-->
Page 2 of 2

Re: instr and instrrev bug *solved*

PostPosted: Wed Nov 09, 2016 3:41 pm
by livetv
It's very nice that you've clarified this!

Also there was this:

...it might be easier to use the BASIC "word" function rather than "instr" ...


I completely agree! WORD() is one of the most useful string functions because you can pack data into readable yet still useful form without a lot of code. Here's how I'd extract RGB values from the proposed RGB string:

Code: Select allrgb = "r100 g200 b300"
wprint "<br>R: "
wprint val(word(rgb,2,"r"))
wprint "<br>G: "
wprint val(word(rgb,2,"g"))
wprint "<br>B: "
wprint val(word(rgb,2,"b"))
wprint "<br>"
end