FB Setup for FBEdit editor

New to FreeBASIC? Post your questions here.
Post Reply
Dik
Posts: 6
Joined: Aug 20, 2017 16:23

FB Setup for FBEdit editor

Post by Dik »

I'm new to FreeBASIC and am having great difficulty using the program editor. Starting with the simple 'Hello' program in the New User Manual, It's a very simple one line Print "Hello World". I can enter the source, and compile it without any errors and it creates a Hello.exe file in the sub-directory that the main file is in. It creates a BackUp sub-directory. There is nothing on the screen that indicates anything has run, and if I click on the *.exe file nothing happens even if loaded from the DOS command prompt. It doesn't even show up on the command line.

Are there switches that have to be set with the fbc.exe program (there is a listing of about 20 switches) or are there internal program switches or some directives that have to be included in the compiler set up?

Is it the same for creating a program on the Windows IDE?

Thanks in advance... Dik
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: FB Setup for FBEdit editor

Post by sancho2 »

It might be that it is flashing by super fast when you run it.
The code print "hello world" will print to the screen but it will also end immediately.
Add a sleep command after that which will force the user to press a key to continue.
In FBEdit you use the green arrow on the tool bar to compile and run the program.
There is an output window on the bottom left that will tell you the status of the compile similar to this:

Code: Select all

C:\Program Files (x86)\FreeBASIC1.05\fbc -s console "..\..\Users\Arcade\FB1076\FbTemp.bas"

Make done
If there are errors it will print them in that window.
There is also a 'quick run' option that looks like 3 colored dots on the tool bar. This runs the code in the active editor window.
For your tests you can use either.
If you don't see make done then likely your build path settings need to be set.
FranKTic has created a website that could be of great assistance to you. Here is the thread with the link to it.

This is what hello world code should look like:

Code: Select all

Print "hello world"
Sleep
When run, this code will present a console window with the text printed on it.
Version 2:

Code: Select all

ScreenRes 800, 600
Print "hello world"
Sleep
With the add screenres code, a graphics window is created that is 800x600. The text is printed to that window.
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: FB Setup for FBEdit editor

Post by Tourist Trap »

You can also use BEEP, to get aknowledged that something was run. The documentation says however that some systems won't beep:
(doc)
Beep tells the system to sound a beep noise. Note that this might not work on some platforms. Since this command is not reliable and there is no way to specify the frequency and duration, you might want to avoid it in favor of other / better solutions, for example: http://www.freebasic.net/forum/viewtopi ... 0441#20441 by yetifoot.

Code: Select all

Print "hello noise"
Beep()
Dik
Posts: 6
Joined: Aug 20, 2017 16:23

Re: FB Setup for FBEdit editor

Post by Dik »

Thanks... I've used FBIde for an environment and can get the screen to see the output of the code... I was hoping for FBEdit to allow the use of Windows objects for data entry, menu, etc. but so far it aludes me... haven't programmed for a decade or more and am slowly trying to move back in... largely because of trying to load an early Finite Element Program into a TI Nspire calculator... Using the FB IDE program, I can, at least, view the data output... Will take a gander at the suggestions... desktop is a pretty fast machine...

Dik
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: FB Setup for FBEdit editor

Post by sancho2 »

If by "windows objects" you mean listbox, textbox etc., then I would recommend the WinFBE editor by PaulSquires (here is the thread).
This editor is currently being developed by Paul.
At this point you can use templates developed by Jose Roca to create windows and controls. I tried it out and it worked quite well.
There is no GUI Designer yet but Paul is working on it.

FBEdit has a GUI Editor and it does work. The IDE is no longer being developed and the original developer is not active in the community. Getting help for it might be a challenge.
That said I have used it a few times and might be able to help.

If you are coming from the VB6 era, programming windows in FB is much lower level.
FB is not an event driven language.
Here you intercept windows messages and respond to them. It is essentialyl the windows api wrapped in Basic coding language.
Dik
Posts: 6
Joined: Aug 20, 2017 16:23

Re: FB Setup for FBEdit editor

Post by Dik »

Thanks...

Dik
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: FB Setup for FBEdit editor

Post by Tourist Trap »

sancho2 wrote:If by "windows objects" you mean listbox, textbox etc., then I would recommend the WinFBE editor by PaulSquires (here is the thread).
Unless you are on XP. Unfortunately PaulSquires said that no compatibility with XP will be provided.
Post Reply