LB Booster
Programming >> Liberty BASIC language >> Speeding up graphics plotting
http://lbb.conforums.com/index.cgi?board=lblang&action=display&num=1388062774

Speeding up graphics plotting
Post by Richard Russell on Dec 26th, 2013, 11:59am

You may occasionally find that plotting graphics in LBB is a little slower than in LB 4.04; this results from the overhead of the emulator. This can often be resolved by sending fewer, longer, graphics commands. For example this code runs noticeably more slowly in LBB:

Code:
    #gr "place ";x;" ";y
    for i = 1 to len(rest$) step 2
        x1=asc(mid$(rest$,i,  1))-34-45
        y1=asc(mid$(rest$,i+1,1))-34-45
        x=x+x1
        y=y+y1
        #gr "goto ";x;" ";y
    next 

But this simple modification makes it run more quickly in LBB than in LB4.04:

Code:
    gr$ = "place ";x;" ";y;";"
    for i = 1 to len(rest$) step 2
        x1=asc(mid$(rest$,i,  1))-34-45
        y1=asc(mid$(rest$,i+1,1))-34-45
        x=x+x1
        y=y+y1
        gr$ = gr$;"goto ";x;" ";y;";"
    next
    #gr gr$ 

Richard.