Alright, you would have the array "users$(4,2)" it has a $ on the end because it is a string array. You have to give it dimensions so you do this...
dim users$(4,2)
The different numbers represent 2 dimensions, like a 4x2 grid, so each combination of numbers in the brckets represents a different variable or square in the grid...
users$(1,1)="a"
users$(1,2)="b"
users$(2,1)="c"
users$(2,2)="d"
users$(3,1)="e"
users$(3,2)="f"
users$(4,1)="g"
users$(4,2)="h"
could be represented as...
dimension 2
d _|_1_|_2__
i 1| a | b
m 2| c | d
3| e | f
1 4| g | h
A 4x2 grid with 8 possible values to be stored in it. So by changing the numbers in the brackets, you can store different values with the same variable.
The only reason that we use variables is that we can change their names using other variables, otherwise saying
array(1)=1
array(2)=2
array(3)=3
would be the same as
variable1=1
variable2=2
variable3=3
But with arrays, we can put them inside loops or select the right variable according to a choice from the player, without using if statements. Here is a for next example. With variables, you would have to write 100 commands to store 100 variables...
var1=1
var2=2
var3=3
var4=4
var...
.....
and so on. But with arrays we could compact 100 lines into 3!...
for x=1 to 100
array(x)=x
next x
Ta da!!!
You would probably want to do something like this for your code...
dim users$(3,2)
users$(1,1)="John"
users$(1,2)="yawn"
users$(2,1)="Bob"
users$(2,2)="password"
users$(3,1)="Jill"
users$(3,2)="test"
<<enter name>>
for x=1 to 3
if name$=users$(x,1)
<<say that the account exists>>
endif
next x
<<if none of the names match then create new account>>
this loops through all the stored names and tests to see if the name entered is the same as the names already stored. If it is then say that the account exists and if it isn't the create the account.
Why the hell'd you ask me for crying out loud!?!
Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM