Lookup with variable contents??
Hello,
I searched some threads releated wiht this but I couldn't see an efficient answer unfortunately, so I had to open a new thread.
What I wonder is it possible to use a variable in lookup?
I need to get variable's content as a string data to send it to display.
What I'm trying to say is that I want to do sompething like this;
for table_index=0 to X
lookup table_index,["Variable Value is:",myVar],store_data
gosub subroutine
next table_index
subroutine:
'send store_data to output
now, if MyVar contains 100, I want to send it to subroutine digit by digit as table_index increases, like; V a r i ..... 1 0 0. Not V a r i ......100
is this possible with lookup? or a backdoor to do this?
Re: Lookup with variable contents??
Just open your manual @ LOOKUP2 ...
Quote:
The Value list can be a mixture of 8-bit and 16-bit (and 32-bit for PBPL) numeric and string constants and variables
also may be using a pointer ...
( noooo ... not on the head !!! )
Alain
Re: Lookup with variable contents??
if you have pbp3
ARRAYWRITE store_data ["Variable Value is:",dec myVar]
Re: Lookup with variable contents??
Hi,
Although I highly recommend getting PBP3 anyway it's not strictly needed for ARRAYREAD/ARRAYWRITE as those commands were added in v2.6.
/Henrik.
Re: Lookup with variable contents??
Many thanks, altough I couldn't use arraywrite, lookup2 and DIG combination solved it :)
Actually I checked lookup2 before but I think I misread it's explanation, I was thinking that lookup2 is for 16bit table. I was totally wrong XD