transferring stamp sx basic to compile sx/b
vic f
Posts: 2
I been transferring some program from parallax stamp basic to sx/b compile basic,
and the following basic statement below cannot be be compile but works in stamp basic;
i var byte
addr var byte
chr var byte
start:
addr = msg1
gosub display_line
addr = msg2
gosub display_line
end
display_line:
i = 0
do
read addr + i,chr
if chr = 0 then exit
serout rb.1,T9600,chr
inc i
loop
return
msg1:
data "sample line 1",0
msg2:
data "sample line 2",0
what I get when compiling this program an "error 8, invalid parameter" for line 5
what is the equivalent command for assignning a pointer to a variable in sx/b??
thank you
and the following basic statement below cannot be be compile but works in stamp basic;
i var byte
addr var byte
chr var byte
start:
addr = msg1
gosub display_line
addr = msg2
gosub display_line
end
display_line:
i = 0
do
read addr + i,chr
if chr = 0 then exit
serout rb.1,T9600,chr
inc i
loop
return
msg1:
data "sample line 1",0
msg2:
data "sample line 2",0
what I get when compiling this program an "error 8, invalid parameter" for line 5
what is the equivalent command for assignning a pointer to a variable in sx/b??
thank you
Comments
Try using addr = @msg1 and addr = @msg2.
The @ prefix indicates that the memory address rather than the memory contents should be used.
- Sparks
Addr needs to be a WORD variable.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
"People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
·
and will inform you when I'm back in the office
Vic f