| Original Message |
Solitaire (Login Solitaire1) S Posted May 20, 2012 2:19 PM
You have an x variable that isn't being used, but you didn't declare found. Instead of 0 and 1, use found as a counter. That way it will work as an index with the array. It needs to stop when you get to 10 or you will get an out-of-range error.
SUB SEATING
SHARED WLIST() AS STRING
SHARED SEAT() AS STRING
DIM R AS INTEGER
DIM S AS INTEGER
DIM found AS INTEGER
CLS
DO
found = 0
FOR R = 1 TO 10
FOR S = 1 TO 4
IF SEAT(R, S) = "" THEN
SEAT(R, S) = WLIST(found)
found = found + 1
IF found > 10 THEN EXIT DO
END IF
NEXT S
NEXT R
LOOP WHILE found <= 10 |
|
|