lists


Closed Thread
Results 1 to 3 of 3

Thread: lists

  1. #1
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52

    Default lists

    Hi,

    I'm trying to figure a way to simulate a large list, that I can sequentially pick the "next" number from and use it as a variable.
    List example:
    2
    354
    9826
    55
    122
    97

    So the program would use "2" on the first gosub, "354" the next time and so on. I'm sure somebody has done something like this in PBP and maybe would share?
    Cheers
    Gary

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Use LOOKUP2.
    Code:
    INDEX VAR BYTE
    MYVAR VAR WORD
    
    
    MAIN:
        FOR INDEX = 0 TO 5   ' lookup 6 values 0 to 5
          LOOKUP2 INDEX,[2,354,9826,55,122,97],MYVAR
          GOSUB DOIT
        NEXT INDEX
    MAIN2:
        GOTO MAIN2
        
    DOIT:
       ' Do something here
       HSEROUT [DEC MYVAR,13,10]
       RETURN
       
       END
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default lists

    Bruce,

    Outstanding.
    Thank you.

Similar Threads

  1. Pic Lists
    By TonyA in forum General
    Replies: 5
    Last Post: - 15th April 2006, 08:21

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts