EDIT: Hi can a MOD rename this to Array Test
Hi there. Im not near a PC with DBPro on so this is just from memory:
Here is a simple program with arrays and I would just like to know if it was the right concept? Is it right, wrong and why? Anyhows here it is:
Rem Project: TestArray
Rem Created: 05/04/2009 22:20:01
Rem ***** Main Source File *****
Rem Characteristics Test
Dim People(1) as String
People(0) = "Bob"
People(1) = "Pat"
Dim Bob(3) as String
Bob(0) = "No Hair"
Bob(1) = "Blue Eyes"
Bob(2) = "37"
Bob(3) = "Boy"
Dim Pat(3) as String
Pat(0) = "Blond Hair"
Pat(1) = "Green Eyes"
Pat(2) = "24"
Pat(3) = "Girl"
Start:
Print "Hello type in a Characteristic of Bob or Pat and I will identify them"
wait 1000
gosub Pick
Pick:
CLS
Input "type it in -> ";Char$
Gosub Identify
Identify:
If Char$ = Bob(0) then
Gosub Bob
If Char$ = Bob(1) then
Gosub Bob
If Char$ = Bob(2) then
Gosub Bob
If Char$ = Bob(3) then
Gosub Bob
If Char$ = Pat(0) then
Gosub Pat
If Char$ = Pat(1) then
Gosub Pat
If Char$ = Pat(2) then
Gosub Pat
If Char$ = Pat(3) then
Gosub Pat
Return
Bob:
Print "This Characteristic belongs to ";People(0)
Wait 1500
Gosub Start
Pat:
Print "This Characteristic belongs to ";People(1)
Wait 1500
Gosub Start
Well thats it, Like I said im not a machine with DBPro on so it's probably all wrong. Anyway this is just off the top of my head so...What do you think?
Jack
TheCleverGuyz