Is this an undocumented feature?????
SamMishal
Posts: 468
· I just learned something new today THANKS to Mike Green.
I did not realize that if you have a variable, say Long F, that you can access individual bytes or words of the variable by using
F.Byte[noparse][[/noparse]i] or F.Word[noparse][[/noparse]i].
Thanks Mike for that information.....
HOWEVER.......where is this in the manual.........I actually had occasion to use this previously and remember looking
all over the manual to see if this can be done and eventually had to resort to using·Byte[noparse][[/noparse]@F][noparse][[/noparse]i] instead
I am glad to see that F.Byte[noparse][[/noparse]i] can be used ...BUT....I still don't see where in the manual does it say so.....
is it something new that has been added recently???
Samuel
·
I did not realize that if you have a variable, say Long F, that you can access individual bytes or words of the variable by using
F.Byte[noparse][[/noparse]i] or F.Word[noparse][[/noparse]i].
Thanks Mike for that information.....
HOWEVER.......where is this in the manual.........I actually had occasion to use this previously and remember looking
all over the manual to see if this can be done and eventually had to resort to using·Byte[noparse][[/noparse]@F][noparse][[/noparse]i] instead
I am glad to see that F.Byte[noparse][[/noparse]i] can be used ...BUT....I still don't see where in the manual does it say so.....
is it something new that has been added recently???
Samuel
·
Comments
with me but I have been in denial....well I am now entering the anger stage.....
Thanks Tim for the pointer.......
Sam
·
Post Edited (localroger) : 8/6/2009 6:19:06 PM GMT
Thanks for making an old guy feel like he is not alone.
I love reading stuff like this, because then I can look it up and maybe (notice I said maybe - the memory goes after the eyes) remember it when I am looking for the info!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Whit+
"We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
Post Edited (Whit) : 8/6/2009 7:05:29 PM GMT
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
···································Fix it, if ain't broke!
D Rat
Dave Ratcliff N6YEE
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
···································Fix it, if ain't broke!
D Rat
Dave Ratcliff N6YEE
Also, it's a puzzle that F[noparse]/noparse]j].byte[noparse][[/noparse]k][/b] isn't supported, particularly given that [b]byte[noparse][[/noparse]@F[noparse][[/noparse]j[noparse][[/noparse]k] is. The former shouldn't be any harder to parse than the latter and is certainly more readable.
-Phil
it helps us get out of the anger stage.....since if we keep remembering our
youthful days and compare how we used to be to the way we are we would never
get out of the anger stage....
Also the eyesight loss is not so bad....otherwise I would be·horrified every time I
look to my left upon waking up·in the morning.....
Sam
homespun -d file.spin
bstc -ls file.spin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
The zip file does not incorporate the .BAS files.....it would be nice to see those too!!!
Is it ok if you show us that program too???
Thanks for your support for RobotBASIC
Regards
Samuel Mishal
·
SetCommPort 5,br19200
loop:
Joystick 1,x,y,z,b
x = tobyte(round(x*255))
y = tobyte(round(y*255))
z = tobyte(round(z*255))
b = tobyte(b)
serout "!","~","#","}",x,y,z,b
goto loop
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
···································Fix it, if ain't broke!
D Rat
Dave Ratcliff N6YEE
Post Edited (ratronic) : 8/7/2009 12:25:16 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
Really?· That's very odd.· I noticed recently that var~ and var~~ generated exactly the same code as var := FALSE and var := TRUE which I find much more readable, which kind of makes sense since it's getting translated into a FORTH-like RPN bytecode.· The different methods of sub-byteing a long should all end up with a byte address getting calculated and a RDBYTE executed.
I don't know where you got that impression from..
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
What's odd is that they do not generate the same code! Or shouldn't, anyway. What makes you think they did?
I would still use var := true because it's much more readable.
on edit...
OK I now see what the difference is.· They do the same thing standalone, but if you use them to return a value, e.g. var2 := var~~ var2 gets the value before the post operation, but if you were to do var2 := (var := true) var2 would get the value after the assignment.· Don't write code like that, it makes my eyes bleed kthx.
Post Edited (localroger) : 8/7/2009 12:49:21 PM GMT