LB Booster
« tokenized LBB files »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:55am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: tokenized LBB files  (Read 308 times)
Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx tokenized LBB files
« Thread started 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.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: tokenized LBB files
« Reply #1 on: Sep 24th, 2016, 06:35am »

on Sep 23rd, 2016, 8:40pm, Alincon wrote:
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.

Richard.
« Last Edit: Sep 24th, 2016, 06:37am by Richard Russell » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls