Author |
Topic: Calling the Compiler from the Command Line (Read 2092 times) |
|
mohsen
New Member
member is offline


Gender: 
Posts: 39
|
 |
Calling the Compiler from the Command Line
« Thread started on: Nov 9th, 2008, 7:28pm » |
|
Well, the first thread in this section 
Is there a way to call BB4W Compiler from the command line to take a BASIC file compile it and save it without opening the IDE window?
i.e. something like:
BBCWIN.exe "in_filename" /c ["out_filename"]
There is no need to pass Compiler parameters (options) as these can be embedded as REMarks in the program file itself.
The out_filename can also be embedded as a REMark statement.
Thanks
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Calling the Compiler from the Command Line
« Reply #1 on: Nov 9th, 2008, 9:43pm » |
|
Quote:Is there a way to call BB4W Compiler from the command line |
|
It's something I have considered (no. 207 in my list of nice-to-have features: "command-line compilation utility"), but have never gone so far as to implement it.
There would be issues like how to indicate the location of a compile error, since at present it relies on being able to highlight the problem statement in the editor.
It's certainly not a trivial task, especially if you wanted a genuine console program (for example all the existing 'compilation' code assumes it's OK to display a MessageBox if it's necessary to alert the user).
Richard.
|
|
Logged
|
|
|
|
mohsen
New Member
member is offline


Gender: 
Posts: 39
|
 |
Re: Calling the Compiler from the Command Line
« Reply #2 on: Nov 10th, 2008, 09:50am » |
|
on Nov 9th, 2008, 9:43pm, Richard Russell wrote:It's something I have considered (no. 207 in my list of nice-to-have features: "command-line compilation utility"), but have never gone so far as to implement it.
There would be issues like how to indicate the location of a compile error, since at present it relies on being able to highlight the problem statement in the editor.
It's certainly not a trivial task, especially if you wanted a genuine console program (for example all the existing 'compilation' code assumes it's OK to display a MessageBox if it's necessary to alert the user).
Richard. |
|
Thanks Richard.
I hope that you re-consider this utility/feature.
An error may be generated by throwing it out to the console mode and existing the Compiler.
Surely a flag (indicating in IDE or in Console Mode) could be setup to indicate to the Compiler if to display an error box or not.
In console mode, Complier should exit/terminate immediately when encountering the first error. It is not necessary to parse the entire BASIC file for Compile errors.
The user calling the Compiler this way can easily check if the Compile function failed or succeeded by examining the presence of the "out_file". If no "out_file" generated by complier then Compile has failed.
It is also possible, in the case of a Compile error, to generate the "out_file" as a ".txt" file instead of an ".exe" file with the first line reading (for example):
BB4W Compile Error: <Error Message>
Just some simple ideas .
Thanks again.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Calling the Compiler from the Command Line
« Reply #3 on: Nov 10th, 2008, 10:54am » |
|
Quote: I don't have the time, resources or motivation that would be required to implement such ideas and test them thoroughly.
I had hoped that you would agree that displaying a MessageBox from a console program was acceptable (even CMD.EXE itself does it: try copying a file to a write-protected floppy!); that might allow a 'quick and dirty' command-line compilation utility to be created. If not I'm afraid it's out of the question.
Richard.
|
|
Logged
|
|
|
|
mohsen
New Member
member is offline


Gender: 
Posts: 39
|
 |
Re: Calling the Compiler from the Command Line
« Reply #4 on: Nov 10th, 2008, 12:59pm » |
|
on Nov 10th, 2008, 10:54am, Richard Russell wrote:I don't have the time, resources or motivation that would be required to implement such ideas and test them thoroughly.
I had hoped that you would agree that displaying a MessageBox from a console program was acceptable (even CMD.EXE itself does it: try copying a file to a write-protected floppy!); that might allow a 'quick and dirty' command-line compilation utility to be created. If not I'm afraid it's out of the question.
Richard. |
|
I didn't get it ?
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Calling the Compiler from the Command Line
« Reply #5 on: Nov 10th, 2008, 2:05pm » |
|
Quote: Console-mode programs can display Message Boxes, Dialogue Boxes, indeed any of the usual Windows GUI controls, it's just that they don't normally do so.
It would be a lot easier (and safer) for me to create a command-line compiler utility if I could leave the warnings and error messages just as they are now - i.e. by means of a MessageBox. Despite being a console program that is perfectly possible.
Indeed, I'd probably have to display a dialogue box too, because all the compiler settings are read from the 'Compile' dialogue box.
My reference to CMD.EXE (and COMMAND.COM) - the programs that display a command prompt in a DOS-like console window - was that they too display warnings in a MessageBox in some circumstances, such as when attempting to copy a file to a write-protected floppy.
My suggestion is that if Microsoft consider that acceptable for CMD.EXE and COMMAND.COM, it ought to be acceptable (if somewhat non-standard) for a BBC BASIC compile utility too!
|
|
Logged
|
|
|
|
JGHarston
Junior Member
member is offline


Gender: 
Posts: 52
|
 |
Re: Calling the Compiler from the Command Line
« Reply #6 on: Aug 6th, 2010, 3:26pm » |
|
I compile BBFW programs with my Make utility, which could be thought of as command-line compilation.
|
|
Logged
|
|
|
|
|