Random & Read [ was bs2p40 DIRS ]
Archiver
Posts: 46,084
Oh good, Chuck jumped in and you already resolved the reset problem.
random seed ' keep the seed as a word-don't try to truncate it
seedvalue=seed//25
lookup seedvalue,[noparse][[/noparse]text0,text1,.....,text24],pointer '<--this is
what you need
' DATA labels can be used like constants in your program
gosub sayit ' transmit data from pointer up to terminator
-- Tracy
>Ahhh... yes.
>
>That's clearly it. Sheesh, and to think I had actually already
>determined this to be a potential issue, programmed to prevent it from
>arising, and forgot all about it during a basic test.
>
>Now that I've got that understood...
>
>I've got sufficiently varying-in-length sets of data to be able to
>randomize a seeded value regularly. Thing is, I'm not sure how
>exactly to use the value to randomly access sets of data.
>
>Say I have 25 DATA chunks, all varying length strings of text ( not
>what I'm doing but for simplicity's sake I'll pick this example )
>
>text1 DATA "Hello there", 255
>text2 DATA "I would like to order the Ham n Eggs Combo"
>text3 ... ...
>
>Random SeededValue ' randomize it
>SeededValue // 24 ' cut that # down to size
>
>I realize this code isn't in any particularly correct order or flow,
>I'm just curious how to use this value to access the different memory
>addresses. Any help appreciated!
>
>manny
>
random seed ' keep the seed as a word-don't try to truncate it
seedvalue=seed//25
lookup seedvalue,[noparse][[/noparse]text0,text1,.....,text24],pointer '<--this is
what you need
' DATA labels can be used like constants in your program
gosub sayit ' transmit data from pointer up to terminator
-- Tracy
>Ahhh... yes.
>
>That's clearly it. Sheesh, and to think I had actually already
>determined this to be a potential issue, programmed to prevent it from
>arising, and forgot all about it during a basic test.
>
>Now that I've got that understood...
>
>I've got sufficiently varying-in-length sets of data to be able to
>randomize a seeded value regularly. Thing is, I'm not sure how
>exactly to use the value to randomly access sets of data.
>
>Say I have 25 DATA chunks, all varying length strings of text ( not
>what I'm doing but for simplicity's sake I'll pick this example )
>
>text1 DATA "Hello there", 255
>text2 DATA "I would like to order the Ham n Eggs Combo"
>text3 ... ...
>
>Random SeededValue ' randomize it
>SeededValue // 24 ' cut that # down to size
>
>I realize this code isn't in any particularly correct order or flow,
>I'm just curious how to use this value to access the different memory
>addresses. Any help appreciated!
>
>manny
>