LB Booster
« Exit or Return codes for LBB console programs? »

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



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: Exit or Return codes for LBB console programs?  (Read 213 times)
CirothUngol
New Member
Image


member is offline

Avatar

Odie, Odie, cha cha cha.


PM

Gender: Male
Posts: 44
xx Exit or Return codes for LBB console programs?
« Thread started on: Jul 14th, 2017, 01:04am »

Is it possible to exit a compiled LBB program with a return code (equivalent to %ERRORLEVEL% in WinNT batch script)?
User IP Logged

LB Booster + LB Workshop + LB Builder = My Programs on Google Drive
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Exit or Return codes for LBB console programs?
« Reply #1 on: Jul 14th, 2017, 2:38pm »

on Jul 14th, 2017, 01:04am, CirothUngol wrote:
Is it possible to exit a compiled LBB program with a return code (equivalent to %ERRORLEVEL% in WinNT batch script)?

I believe that currently the only way to do that in LBB is to invoke a BBC BASIC statement:

Code:
    !QUIT returncode 

If you compile this as a console application it sets %ERRORLEVEL% to the entered value:

Code:
    input "Enter required return code: "; returncode
    !QUIT returncode 

Richard.
User IP Logged

CirothUngol
New Member
Image


member is offline

Avatar

Odie, Odie, cha cha cha.


PM

Gender: Male
Posts: 44
xx Re: Exit or Return codes for LBB console programs?
« Reply #2 on: Jul 15th, 2017, 04:00am »

Yes, that is exactly what I was looking for. Without delving into some BBC Basic docs (which I've always meant to do), I will assume that QUIT is equivalent to END? No need to reply, unless I'm wrong. ^_^

Oh, and thanks again.
Console apps, return codes, small executables, expanded arrays, OOP (which I'm still getting my head around)... a whole litany of reasons I enjoy using your little utility.
User IP Logged

LB Booster + LB Workshop + LB Builder = My Programs on Google Drive
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Exit or Return codes for LBB console programs?
« Reply #3 on: Jul 15th, 2017, 08:53am »

on Jul 15th, 2017, 04:00am, CirothUngol wrote:
I will assume that QUIT is equivalent to END?

It's rather more 'final', in that !QUIT immediately and unconditionally terminates the application, whereas the behavior of END depends on whether there is a NOMAINWIN statement and whether your program was compiled or run from the IDE.

Richard.
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