Error in FreeBasic program before first line of code

General FreeBASIC programming questions.
wallyg
Posts: 89
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Error in FreeBasic program before first line of code

Postby wallyg » Nov 21, 2010 16:36

This is probably not a FbEdit error but I am looking for something I can do in FbEdit to find the error. Any suggestions on how to proceed further would be appreciated.

I put a breakpoint in FbEdit on the first line of code. I click on Debug/Run. FbEdit displays the first line, it highlights the line and about 5 seconds later the hourglass cursor disappears and I can enter commands.

I then click on Debug/Stop (no execution of my code yet). I immediately get a Vista window indicating the program has stopped working. I do not get FbEdit's window asking if I want to terminate the program.

I got to this point tracking backwards over the last week an intermittent error that causes the program to work properly sometimes and others to terminate suddenly with the Vista error message at different points of execution.

main program starts

Code: Select all

/'
            comments
          '/
          screen 20,32      ' Breakpoint on this line
          .....


Running release version of FreeBasic (Aug 12, 2010)
Running 1.0.7.6c of FbEdit.
Running last updated version of Windows Vista
Running GLADE 3.6.7
Running lastest GTK+tobac 2.22.4


I tried using GBD directly. When I ask it to run executable, it produces several cannot find dll messages (no names just addresses) and goes into limbo and never gives me another prompt. The Screen command as the first line does not ever produce a new window, so I suspect that it does not get executed. I do not know if this is important or just ignorance on my part about using GDB.

Any suggestions from anyone on how to proceed? At this point I would greatly appreciate anything.
Rens
Posts: 256
Joined: Jul 06, 2005 21:09

Postby Rens » Nov 26, 2010 12:48

Are you sure you have compiled your source in fbedit this way:

Choose: Windows Console (debug) in the dropdown menu on the right

Press F5 to compile

Set a breakpoint

Debug the program by clicking on the menuoption:
Debug
Run

Click in your source window (fbedit window). This is essential!!!
Press F7, F7, etc.

I put a breakpoint in FbEdit on the first line of code. I click on Debug/Run. FbEdit displays the first line, it highlights the line and about 5 seconds later the hourglass cursor disappears and I can enter commands.

I can enter commands? This is strange! I can't explain or reproduce this.

Note:
At test versions i always compile them first with Windows console. This way you can always stop the program with the x of the console window.

When you compile with Windows Gui and your program stops at errors or there is an endless loop you can only stop the program with the task manager.

If you use a sleep command in your debug version of your program at the end, rem this line out. In your final version remove the remark.

Hopefully this all makes sense.

And a big thank you for your question! It helped me to understand how to debug a program with screen commands in fbedit. I tried this in the past and get problems too. Now i understand why.

Return to “General”

Who is online

Users browsing this forum: No registered users and 3 guests