Shop OBEX P1 Docs P2 Docs Learn Events
transferring stamp sx basic to compile sx/b — Parallax Forums

transferring stamp sx basic to compile sx/b

vic fvic f Posts: 2
edited 2006-11-16 06:34 in General Discussion
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

Comments

  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2006-11-15 06:56
    vic f,

    Try using addr = @msg1 and addr = @msg2.

    The @ prefix indicates that the memory address rather than the memory contents should be used.


    - Sparks
  • BeanBean Posts: 8,129
    edited 2006-11-15 11:37
    vic f,
    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
    ·
  • vic fvic f Posts: 2
    edited 2006-11-16 06:34
    thanks ben I will try it out when I get back home
    and will inform you when I'm back in the office
    Vic f
Sign In or Register to comment.