Something like this:

by Solitaire (Login Solitaire1)
S

 

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

Posted on May 20, 2012, 2:19 PM

Respond to this message   

Return to Index

Response TitleAuthor and Date
AWESOME!MATT on May 20
 oopsMatt on May 20
  Default tab settingsSolitaire on May 20
   RE:default tabMATT on May 20
    Your arrays and the IF block need fixing.Solitaire on May 20
     re:your arrays are..Matt on May 22
      Re: CorrectionMATT on May 22
      Sub can call other subs.Solitaire on May 22
       re: Sub can call..Matt on May 28
     I'm surprised you didn't mention LBOUND and UBOUND.a on May 22

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement