Recommended settings for FBIde users

New to FreeBASIC? Post your questions here.
counting_pine
Site Admin
Posts: 6323
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Recommended settings for FBIde users

Post by counting_pine »

[split from http://www.freebasic.net/forum/viewtopic.php?t=13819]

In case anyone ever manages to lose their FBIde settings, this info should help them get it back.

If you go into View->Settings and click on the FreeBASIC tab, then the settings should look something like this:
Image

Compiler command:
"<$fbc>" "<$file>"
Run command:
"<$file>" <$param>
The Compiler path may vary depending on where you installed the FreeBASIC compiler, and you may have changed the Help file line if you downloaded an update to the documentation, but the Compiler command and Run command should look pretty much as above.

The Compiler command may have additional compilation parameters after it (e.g. -lang fblite)


There are a few modifications you may also find useful:

- Compiling with -exx
This enables the largest possible amount of error checking, aborting the program on things like problems opening files, or going out of bounds on an array.

Compiler command:
"<$fbc>" "<$file>" -exx
- Compiling with -s gui
This prevents the program from opening a console window ("DOS Prompt") when it starts. Useful for programs that only use a graphics screen or a GUI. It can be used in conjunction with -exx, but you won't get to see any errors that are printed.

Compiler command:
"<$fbc>" "<$file>" -s gui
- Leaving the command line window open when the program finishes
This basically consists of wrapping the Run command in cmd /c [Run-command & pause], which opens up a command window that does the Run Command, and then runs Pause to wait for a keypress before closing. This is a good alternative to putting Sleep at the end of a console program, and also stops the window closing if the program aborts with an error, allowing you to see the message returned. So it's good to use with '-exx' (not so useful with '-s gui').

Run command:
cmd /c "<$file>" <$param> & pause
This should work on any version of Windows that uses cmd, e.g. Windows 2000/XP/7. (It would be good to hear feedback on how it works on Windows 8.)

UPDATE: fxm suggests wrapping the command(s) in an additional set of quotes:
cmd /c ""<$file>" <$param> & pause"
This should prevent things breaking in case <$file> contains spaces or <$param> contains quotes.
Last edited by counting_pine on Feb 07, 2011 15:03, edited 1 time in total.
TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

Re: FBIde Compile/run settings

Post by TESLACOIL »

you need to leave a blank space between some commands.....its not easy to see / realize this at first glance
fxm
Moderator
Posts: 12396
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Recommended settings for FBIde users

Post by fxm »

WARNING!
FBIde always forces the lower case in the command line to compiler:
Even if we edit for example '-R', '-r' is always sent in the command line to compiler (check with menu View/Show log).

This behavior of FBIde is embarrassing for the following command line compiler options in red:
  • -C : Do not delete the object file(s)
    -c : Compile only, do not link
  • -O < level > : Set the optimization level (-gen gcc)
    -o < name > : Set object file path/name (must be passed after the .bas file)
  • -R : Do not delete the intermediate file(s)
    -r : Write intermediate file(s) only, do not compile or link
  • -RR : Do not delete the asm file(s)
    -rr : Write asm file(s) only, do not compile or link
counting_pine
Site Admin
Posts: 6323
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: Recommended settings for FBIde users

Post by counting_pine »

A workaround for FBIde's case conversion problems might be to specify your options in another file and link to them using e.g. @options.txt
"<$fbc>" @c:\path\to\options.txt "<$file>"
CompilerOptOptfile

For extra hackishness, overwrite ReadMe.txt or QuickKeys.txt to store your options, and then get easy access to them at any time from the help menu :)

I'd like to be able to suggest "<$fbc>" @"<$file>" "<$file>", for an easy way to pass command-line arguments from the top of the program code itself, but unfortunately it's hard to get a file that gives a valid list of options, and compiles as non-trivial code.
integer
Posts: 409
Joined: Feb 01, 2007 16:54
Location: usa

Re: Recommended settings for FBIde users

Post by integer »

counting_pine wrote:...
I'd like to be able to suggest "<$fbc>" @"<$file>" "<$file>", for an easy way to pass command-line arguments from the top of the program code itself, but unfortunately it's hard to get a file that gives a valid list of options, and compiles as non-trivial code.
Most likely you've ruled out #pragma, but could you elaborate the difficulties involved with using pragma to give the compiler those command line options for the compilation of the file in which it appears as the first or second statement?
fxm
Moderator
Posts: 12396
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Recommended settings for FBIde users

Post by fxm »

In order to be compatible with passing parameters containing double quotes, modify the Run Command as follows:
cmd /c ""<$file>" <$param>" & pause
counting_pine
Site Admin
Posts: 6323
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: Recommended settings for FBIde users

Post by counting_pine »

I see - having tried a quick experiment with quoted parameters (Run->Parameters), I see the whole thing breaks if the compiled path contains spaces and the parameters contain quotes.

cmd /c's quote-parsing seems a little bit magical to me - it seems difficult to define in some cases.

Do you think cmd /c ""<$file>" <$param> & pause" would also work? It has the slight added bonus of making it clearer what's going on - i.e. what is supposed to be part of the /c parameter.
fxm
Moderator
Posts: 12396
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Recommended settings for FBIde users

Post by fxm »

Yes, that works also and it's more clear like you said:
cmd /c ""<$file>" <$param> & pause"
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: Recommended settings for FBIde users

Post by Tourist Trap »

Hi,

Has it been mentioned that a restart would be needed at each setting change to get it work?
fxm
Moderator
Posts: 12396
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Recommended settings for FBIde users

Post by fxm »

Tourist Trap wrote:Has it been mentioned that a restart would be needed at each setting change to get it work?
I think that is true only for few settings as the help file name setting (perhaps even the only case).
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: Recommended settings for FBIde users

Post by Tourist Trap »

Since 1.04 version of fbc (compiler), we have the boolean new type keyword.
FBIDE will ignore this until some settings are updated.

FBIDE ---> menu/VIEW ---> submenu/SETTINGS ---> tab/KEYWORDS ----> list/GROUP2

There sit the various type names.
Enter somewhere in the textbox the name of 'boolean'.

Close the working tab (if possible - becareful FBIDE has a bug: it may crash sometimes at tab closing!).

Open your files again, the boolean are now highlightened like the other types.

Same to do with 'cBool', and also 'this' which is not highlighted by default..etc.
kcvinu
Posts: 240
Joined: Oct 07, 2015 16:44
Location: Keralam, India

Re: Recommended settings for FBIde users

Post by kcvinu »

Somebody please tell me, Is there any intelliscense in FBide ?
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: Recommended settings for FBIde users

Post by sancho2 »

kcvinu wrote:Somebody please tell me, Is there any intelliscense in FBide ?
I don't use FBIde for just that reason. I couldn't find any code completion or intelliscense.
Note that the intelliscense in FBEdit is broken and unreliable.
Sorry.
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: Recommended settings for FBIde users

Post by Tourist Trap »

sancho2 wrote:Note that the intelliscense in FBEdit is broken and unreliable.
Nope, as you know, it's just that you need keyboard to navigate through the various syntaxes proposed.

Ok, this said, I just wanted to share 2 or 3 tips I find most useful in FBIDE:
  • The CTRL + MouseWheel that allows one to zoom/unzoom the code.
  • The CTRL + D that makes a duplicate of a line.
  • The TAB + selected text, that allows one to indent multiple lines at once.
  • The Shift + TAB + selected text, that indent in right to left until it reaches left border, also useful.
Maybe there is also something to comment/uncomment, but I don't use this feature.
fxm
Moderator
Posts: 12396
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Recommended settings for FBIde users

Post by fxm »

To display all keyboard shortcuts, FBIde menu: Help / QuickKeys.txt
Post Reply