Author |
Topic: Exit or Return codes for LBB console programs? (Read 213 times) |
|
CirothUngol
New Member
member is offline
Odie, Odie, cha cha cha.
Gender:
Posts: 44
|
|
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)?
|
|
Logged
|
LB Booster + LB Workshop + LB Builder = My Programs on Google Drive
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
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: 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.
|
|
Logged
|
|
|
|
CirothUngol
New Member
member is offline
Odie, Odie, cha cha cha.
Gender:
Posts: 44
|
|
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.
|
|
Logged
|
LB Booster + LB Workshop + LB Builder = My Programs on Google Drive
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
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.
|
|
Logged
|
|
|
|
|