LB Booster
General >> General Board >> Amount of data the LBB can manage (capacity)
http://lbb.conforums.com/index.cgi?board=general&action=display&num=1441819313

Amount of data the LBB can manage (capacity)
Post by michael on Sep 9th, 2015, 5:21pm

I managed to create a program generator that converts a bmp image to compacted code to allow for making small reusable designs that you can transfer easily.
Here is the link
http://libertybasic.conforums.com/index.cgi?board=game&action=display&num=1440989107

My question is : How much program data can the BBC editor hold and can the size of the program cause any issues?
Here is a sample of what this generator can create using only code: (the data statements hold the bmp image data)
Code:
nomainwin
open "Compressed BMP Data to Image project " for graphics_nsb as #1
u=0
#1 "trapclose [quit]"
ost$=""
read x,y
#1 "down;fill black"
while nst$<>"100000"
 read nst$,t
if nst$="0" then r=0:g=0:b=0  'black              0   0   0
if nst$="1" then r=192:g=128:b=64  ' brown      192 128  64
 if nst$="2" then r=64:g=64:b=192 'dark blue     64  64 192
if nst$="3" then r=128:g=128:b=128' dark grey 128 128 128
if nst$="4" then r=128:g=0:b=0'dark red       128   0   0
if nst$="5" then r=224:g=192:b=0 'dark yellow  224   192   0
if nst$="6" then r=128:g=160:b=192'flat blue  128 160 192
 if nst$="7" then r=32:g=192:b=64 'green        32 192  64
 if nst$="8" then r=166:g=202:b=240'light blue 166 202 240
 if nst$="9" then r=192:g=192:b=192 'light gray 192 192 192
 if nst$="a" then r=192:g=224:b=0  'light green  192 224   0
 if nst$="b" then r=224:g=32:b=64'light red    224  32  64
 if nst$="c" then r=0:g=160:b=192 'medblue        0 160 192
 if nst$="d" then r=224:g=128:b=64  'orange       224 128 64
 if nst$="e" then r=224:g=160:b=192'pink       224 160 192
 if nst$="f" then r=160:g=64:b=192'purple      160 64 192
if nst$="g" then r=192:g=220:b=192'tan        192 220 192
if nst$="h" then r=255:g=255:b=255'white      255 255 255
 if nst$="i" then r=255:g=255:b=0'yellow       255 255 0
#1 "color ";r;" ";g;" ";b
for u=0 to t
a=a+1: print #1, "set ";c;" ";a+y :if a>x  then c=c+1:a=0
next u
wend
wait
[quit]
close #1
end
data 56,56
data 3,170,9,227,h,170,4,284,1,113,b,170,e,170,d,113,5,170,i,170,g,170,7,170,a,170,c,170,8,113,2,170,6,170,f,170,100000,0

 

Re: Amount of data the LBB can manage (capacity)
Post by Richard Russell on Sep 9th, 2015, 5:43pm

on Sep 9th, 2015, 5:21pm, michael wrote:
My question is : How much program data can the BBC editor hold and can the size of the program cause any issues?

There are some limits. One is that the total number of lines should not normally exceed 65,535 because LBB stores the line number in two bytes (16 bits). There are also some individual limits, for example a maximum of 5000 globals and 5000 arrays - but if any of those limits are an issue for you I can quite easily increase them (and I have in the past).

One thing to watch is that the length of DATA statements is limited (to around 250 characters I think) so it's better to use a larger number of short DATA lines than a few much longer lines.

Richard.

Re: Amount of data the LBB can manage (capacity)
Post by michael on Sep 9th, 2015, 5:53pm

Thanks. My program automatically makes the data lines short when it converts the image to data and generates the program (ready to run)
I will keep a note of this. Some of the huge complex images I have made into code are so large that they cant be copied with a clipboard.
The whole reason to making the utility was because I wanted reusable compact image tools in code and the ability to share it in one program without sending bmp files.

Re: Amount of data the LBB can manage (capacity)
Post by Richard Russell on Sep 9th, 2015, 6:24pm

on Sep 9th, 2015, 5:53pm, michael wrote:
I wanted reusable compact image tools in code and the ability to share it in one program without sending bmp files.

When LBB embeds BMP (and other) files in an EXE it compresses them quite efficiently, almost as good as a ZIP. So if your concern is to minimize the size of the final executable you will probably be better to let LBB do the compression.

Richard.