|
-
Apr 2nd, 2002, 01:19 PM
#1
Thread Starter
Addicted Member
What is wrong with this?
End Type
Dim People(1 to 10) as Aperson,br> For i = 1 to 10
Print People(i).strNAME
Next i
People(1).strNAME = "Mary"
People(1).intAGE = "21"
People(1).intMASS = 80
People(2).strNAME = "John"
People(2).intAGE = "14"
People(3).strNAME = "Albert Einstein"
People(3).intAGE = "43"
People(3).intMASS = 120
The Dim People... keeps saying Invalid Inside Procedure and its in the usual read error text
-
Apr 2nd, 2002, 01:23 PM
#2
PowerPoster
-
Apr 2nd, 2002, 01:25 PM
#3
Thread Starter
Addicted Member
There's something wrong with the Option Explicit thing and the < thing
-
Apr 2nd, 2002, 01:33 PM
#4
PowerPoster
Ok, I think I see what you're doing. You have to add the values to the array in a procedure and declare the array outside the procedure:
VB Code:
' Declarations of form or module
private type Person
ID as long
strName as string
etc as etc
end type
Private People(9) as person
private sub PopulatePeople
with People(0)
.ID=0
.strName="Bob"
.etc(0)=etc.
end with
with People(1)
.ID = 1
.Name = "Otto"
.etc, etc(1)=etc
end with
' and so on and so forth
End Sub
Are you doing the dentist app too????
-
Apr 2nd, 2002, 01:47 PM
#5
Thread Starter
Addicted Member
Nope
Im not doing the dentist app we have to do a student body sorting program with their age mass and name and I try it and see if it works
^Thanx^
-
Apr 2nd, 2002, 01:55 PM
#6
Thread Starter
Addicted Member
Is people a array What is it huh?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|