LB Booster
Programming >> Compatibility with LB4 >> data/read/restore
http://lbb.conforums.com/index.cgi?board=compatibility&action=display&num=1391704165

data/read/restore
Post by tsh73 on Feb 6th, 2014, 3:29pm

Just found.
This code runs in JB, but fails with out of data after "restore [a]"
LBB version is 2.40

EDIT if I add 2 more data items after (say 11,12), ut will read _them_ instead line "[a] data 7, 8"
A bug, indeed.
Code:
'Demo for jb2c, v.1.9
'(new features compared to 1.8)

print "initial read"
read x,y: print x,y
print "restore / read"
restore
read x,y: print x,y
print "restore numerical label / read"
restore 10
read x,y: print x,y
print "restore symbolic label / read"
restore [a]
read x,y: print x,y
' attempt to restore non-existing label, say
' restore 21
' ends up with C compiler message
' 'restore_lbl_21' undeclared

    data 1, 2
10  data 3, 4
    data 5, 6
[a] data 7, 8
 

Re: data/read/restore
Post by Richard Russell on Feb 6th, 2014, 5:00pm

on Feb 6th, 2014, 3:29pm, tsh73 wrote:
Just found.
This code runs in JB, but fails with out of data after "restore [a]"

LBB requires the label to be on a separate line (or, for example, a comment line) like this:

Code:
    data 1, 2
10  data 3, 4
    data 5, 6
[a]
    data 7, 8 

With that change you should find your program is fully compatible with LB/JB/LBB.

Edit: Now fixed in my development version.

Richard.