Qbasicnews.com

Full Version: FB's command-line format
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Added a real command-line parser today (was using batch files before :P), format is now:

Code:
Usage: fbc [options] inputlist

inputlist:    xxx.a = library, xxx.o = object, xxx.bas = source

options:
-a <name>     add an object file to linker's list
-b <name>     add a source file to compilation
-c            compile only, do not assemble or link
-d <name=val> define a preprocessor's constant
-e            add error checking
-g            add debug info (testing)
-l <name>     add a library file to linker's list
-m <name>     main file w/o .ext (entry point)
-o <name>     output name (in the same number as source files)
-s <name>     subsystem (gui, console)
-v            verbose
-x <name>     executable name

To create foo.exe it's simple as: fbc foo.bas

I wish BC was that easy when i started, heh..
Good job.

That will be useful while the IDE is being made ready.

Will there be messages and stuff (ie syntax errors, parsing errors etc) shown in that same command-prompt or something?
How about -r

-r <name> Error/Information return destination, if nothing then screen

Good for the IDE...



(-r is just an example, can be anything really... doesent even have to be one letter does it?)
Sure it does, m$/VC's error format, any Win IDE supports that, ie:

hello.bas(29,14) : error 1: Argument count mismatch, found: 3
Well, it's very easy to steal the output of a commandprompt program in VB...you can take the output and stick it in a textbox or something...thats how Dev-C++ does it, I think. MingW is a commandline compiler. That way, you can just send the error messages to the screen, and then you will be able to steal them and put them in the IDE.
couldn't you just have the compiler creat a log then have the IDE read the log file.

ripping the output seems abit hackish but what ever works
"Stealing" the output of a console is actually the "correct" way of doing it. It's just a couple of API calls anyways.
what about this

fbc somefile > error.txt

should work just fine right? without hacks right?
Its not the proper way to do it. Stealing output is the way the big boys do it.

It's also not a hack. It's the best and most efficient way for a windows program to interface with commandline. It's also very simple. Takes a few API calls. You also have to do nothing to the actual compiler. You can change everything in the compiler, or nothing, and this will still work. Shout if you need help on this.
yep its standard output redirection.
Pages: 1 2