LB Booster
Programming >> Compatibility with LB4 >> tokenized LBB files http://lbb.conforums.com/index.cgi?board=compatibility&action=display&num=1474663227 tokenized LBB files
Post by Alincon on Sep 23rd, 2016, 8:40pm
I am trying to run an LB program in LBB. The LB program calls a subprogram with a RUN statement. I used the LBB menu option to create an LBB subprogram from the same code I used to create the LB tokenized sub-program.
run x.LBB does not work 'include x.LBB does not work. 'include x.BAS does work, but when I close the sub-program the main program closes, too.
What should I have done?
r.m.
Re: tokenized LBB files
Post by Richard Russell on Sep 24th, 2016, 06:35am
I am trying to run an LB program in LBB. The LB program calls a subprogram with a RUN statement.
There's no direct equivalent in LBB, but you have a number of options. One is to compile the subprogram to an EXE and then to run that using the RUN command with the LBB-specific WAIT option:
Code:
RUN "subprogram.exe", WAIT
Another is to create a tokenized (.LBB) version of the subprogram ('Run... Make *.LBB file' menu option) and to run that using the optional run-time engine:
Code:
RUN "LBBRUN subprogram.lbb", WAIT
The main shortcoming of those methods is that you cannot combine multiple options so by requiring the WAIT qualifier (which presumably you need to force LBB to wait until the subprogram has completed) you can't also specify HIDE or any of the other window states.
You could also consider rejigging your subprogram as a conventional SUB which you incorporate in your program using the 'include directive. Then you would run it with CALL in the usual way:
Code:
CALL subprogram
A possible disadvantage is that the subprogram will then share GLOBALs (including handles, arrays and structs) with the main program, which may not be what you want.
Hopefully one or other of those alternatives will meet your needs.