WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated March 25, 2019)

User projects written in or related to FreeBASIC.
Kot
Posts: 335
Joined: Dec 28, 2006 10:34

Re: WinFBE FreeBASIC Editor for Windows

Postby Kot » May 28, 2017 20:47

Two remarks: Multiline comment doesn't mark lines as comment (no color change) and I miss the feature from FBEdit - additional parameter changing keywords case to First Letter (For, Next etc.)
fxm
Posts: 8974
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: WinFBE FreeBASIC Editor for Windows

Postby fxm » Jul 22, 2017 7:56

How to monitor a runtime error, compiling with the option -exx
(I am always using this option during development)

  • Rustic solution :
    Launch your "program.exe" from a (prompt) command window, in order to display the runtime error message.

  • Using FBIde :
    Referring to viewtopic.php?p=121731#p121731, you can edit the run command menu and enter "cmd /c "<$file>" <$param> & pause", in order that IDE opens a command window, runs the program, and then waits for a keypress before closing.

  • Using FreeQ IDE:
    You get automatically a pause (in the command window) after compiling + running with option "-exx", and also you can just select a check-box "Pause after execution" to pause after compile + run (without "-exx")

  • Using Geany :
    Basically, the command "Execute" runs the executable file from a terminal window (shell script calling "cmd.exe" set per default in the menu "Edit/Preferences/Tools).

  • Using FBEdit :
    Only the rustic solution : launching the executable file from a command window opened with menu "Tools/Command prompt".

  • Using WinFBE :
    ???
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: WinFBE FreeBASIC Editor for Windows

Postby sancho2 » Jul 22, 2017 8:24

@FXM
Regarding FBEdit:
You can modify the build option and it seems to work without dropping down to a command prompt.
This image is using the build option Window Console (debug).
Image
fxm
Posts: 8974
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: WinFBE FreeBASIC Editor for Windows

Postby fxm » Jul 22, 2017 9:45

See my similar response at viewtopic.php?f=8&t=23935&p=234345#p234345.
PaulSquires
Posts: 746
Joined: Jul 14, 2005 23:41
Contact:

Re: WinFBE FreeBASIC Editor for Windows

Postby PaulSquires » Jul 22, 2017 13:07

fxm wrote:See my similar response at viewtopic.php?f=8&t=23935&p=234345#p234345.


Hi fxm,

OK, I see what you are looking for. Be able to capture the output of a crashed program due to runtime error. I will try to implement a solution because it seems like a very good feature to have.

I assume you know how to add the -exx for project and non-project files:

Non-project:
View :: Environment Options :: Compiler Setup :: Additional compiler option switches

Projects:
Project :: Project Options :: Error Checking
PaulSquires
Posts: 746
Joined: Jul 14, 2005 23:41
Contact:

Re: WinFBE FreeBASIC Editor for Windows

Postby PaulSquires » Jul 22, 2017 18:39

PaulSquires wrote:
fxm wrote:See my similar response at viewtopic.php?f=8&t=23935&p=234345#p234345.

OK, I see what you are looking for. Be able to capture the output of a crashed program due to runtime error. I will try to implement a solution because it seems like a very good feature to have.


I am now able to capture the STDERR output that -exx throws on runtime errors (used a pipe and createprocess to redirect the output). I just now need to integrate that error message in a meaningful way in order to display the code file and position to the error line just like any other error. Should have that coded soon and then I'll post here with a link to the updated files and source.
PaulSquires
Posts: 746
Joined: Jul 14, 2005 23:41
Contact:

Re: WinFBE FreeBASIC Editor for Windows

Postby PaulSquires » Jul 22, 2017 19:35

PaulSquires wrote:I am now able to capture the STDERR output that -exx throws on runtime errors (used a pipe and createprocess to redirect the output). I just now need to integrate that error message in a meaningful way in order to display the code file and position to the error line just like any other error. Should have that coded soon and then I'll post here with a link to the updated files and source.


Hi fxm,

Try the new runtime error trapping and reporting version 1.3.7
https://github.com/PaulSquires/WinFBE/releases
fxm
Posts: 8974
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: WinFBE FreeBASIC Editor for Windows

Postby fxm » Jul 22, 2017 20:08

- Yes, but there is no detailed display for another crash kind like "segmentation violation" signal:

Code: Select all

Sub s()
  Dim As Integer Ptr p
  Print *(p+1)
End Sub

s()
Aborting due to runtime error 12 ("segmentation violation" signal) in D:\Users\T
0003830\Documents\Mes Outils Personnels\FBIde0.4.6r4_fbc1.06.0\FBIDETEMP.bas::S(
)

- All runtime errors are at /wiki/TblRuntimeErrors

- In addition, after the filename, there is the name of the procedure where the crash occurs ("::S()" for the above case, "::()" if it is in the main code").
This may be interesting when there is no error line number reported as for the above code.
PaulSquires
Posts: 746
Joined: Jul 14, 2005 23:41
Contact:

Re: WinFBE FreeBASIC Editor for Windows

Postby PaulSquires » Jul 22, 2017 20:55

Thanks fxm, I will make the changes and upload again.
PaulSquires
Posts: 746
Joined: Jul 14, 2005 23:41
Contact:

Re: WinFBE FreeBASIC Editor for Windows

Postby PaulSquires » Jul 22, 2017 21:40

Hi fxm,

You can download 1.3.8 and try it to see if the error handling is better for those runtime errors.

https://github.com/PaulSquires/WinFBE/releases

If you need any changes at then please let me know.
fxm
Posts: 8974
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: WinFBE FreeBASIC Editor for Windows

Postby fxm » Jul 23, 2017 6:43

OK.
I tested this improvement for 4 different runtime errors:
- Aborting due to runtime error 6 (out of bounds array access)
- Aborting due to runtime error 7 (null pointer access)
- Aborting due to runtime error 2 (file not found)
- Aborting due to runtime error 12 ("segmentation violation" signal)

Small remark about the column "Description" in case of error 12 ("segmentation violation" signal):
Why the text in "Description" is not truncated as for the other errors (the filename information is already in the column "File" and the procedure name information is in the column "Line")?
Description
Aborting due to runtime error 12 ("segmentation violation" signal)in D:\Users\T0003830\Documents\Mes Outils Personnels\WinFBE-.3.8\FBIDETEMP.bas::S()
Last edited by fxm on Jul 23, 2017 8:35, edited 2 times in total.
fxm
Posts: 8974
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: WinFBE FreeBASIC Editor for Windows

Postby fxm » Jul 23, 2017 6:46

Since these last 2 revisions, code running does not work when executing simple program as:

Code: Select all

Print "OK"
Sleep
(the more recent version that works is WinFBE Version 1.3.6)
Last edited by fxm on Jul 23, 2017 12:54, edited 2 times in total.
fxm
Posts: 8974
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: WinFBE FreeBASIC Editor for Windows

Postby fxm » Jul 23, 2017 7:58

I'm not sure that the capture of the STDERR output is the right solution, because it is necessary that a compiled program (under the IDE with -exx) also works when it is launched directly from a command window, and It continues to be able to display a runtime error message on the command window.

For the 3 working IDEs that I know, they all open a command window, run the program, and then wait for a key press before closing it (an eventual runtime error message is always displayed on the command window itself).
Kuan Hsu
Posts: 415
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: WinFBE FreeBASIC Editor for Windows

Postby Kuan Hsu » Jul 23, 2017 9:08

fxm wrote:I'm not sure that the capture of the STDERR output is the right solution, because it is necessary that a compiled program (under the IDE with -exx) also works when it is launched directly from a command window, and It continues to be able to display a runtime error message on the command window.

For the 3 working IDEs that I know, they all open a command window, run the program, and then wait for a key press before closing it (an eventual runtime error message is always displayed on the command window itself).

We can redirect to get stderr message, but the normal output and input will gone, so I think the solution is as fxm says...
PaulSquires
Posts: 746
Joined: Jul 14, 2005 23:41
Contact:

Re: WinFBE FreeBASIC Editor for Windows

Postby PaulSquires » Jul 23, 2017 21:50

fxm wrote:Since these last 2 revisions, code running does not work when executing simple program as:

Code: Select all

Print "OK"
Sleep
(the more recent version that works is WinFBE Version 1.3.6)


That's strange because it works perfectly for me on both the 32 and 64 bit versions. Are you sure that you have the CONSOLE selected. Just click on the panel in the statusbar to quickly switch between console and gui. When I run the program, the console window appears and "OK' is printed to it.

Image

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 2 guests