BBC BASIC for Windows
« Calling the Compiler from the Command Line »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:59pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Calling the Compiler from the Command Line  (Read 2092 times)
mohsen
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 39
xx Calling the Compiler from the Command Line
« Thread started on: Nov 9th, 2008, 7:28pm »

Well, the first thread in this section smiley

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

User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx 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.
User IP Logged

mohsen
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 39
lamp 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 wink.

Thanks again.

User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Calling the Compiler from the Command Line
« Reply #3 on: Nov 10th, 2008, 10:54am »

Quote:
Just some simple ideas

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.
User IP Logged

mohsen
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 39
xx 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 ?

User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Calling the Compiler from the Command Line
« Reply #5 on: Nov 10th, 2008, 2:05pm »

Quote:
I didn't get it ?

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!
User IP Logged

JGHarston
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 52
xx 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.
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