FBEdit internal Debugger with Command line program

New to FreeBASIC? Post your questions here.
Post Reply
Tonigau
Posts: 36
Joined: Feb 25, 2021 20:19

FBEdit internal Debugger with Command line program

Post by Tonigau »

FBEdit- with the inbuilt debugger...
1. The program I am compiling is run from CMD line to load & process a data file, 'eg: CC112.exe Datafile.dat'
How can I include the file to load(or any other cmd line -switches) in the menu Debug, Run Shift+F7 ?
Run just runs the exe but I need tyo i9nclude the dat file in the run command.


Thanks
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBEdit internal Debugger with Command line program

Post by VANYA »

Tonigau wrote:FBEdit- with the inbuilt debugger...
1. The program I am compiling is run from CMD line to load & process a data file, 'eg: CC112.exe Datafile.dat'
How can I include the file to load(or any other cmd line -switches) in the menu Debug, Run Shift+F7 ?
Run just runs the exe but I need tyo i9nclude the dat file in the run command.


Thanks
The built-in debugger cannot load EXE with command line parameters. Try using FbDebugger (he can), it is more practical.
Tonigau
Posts: 36
Joined: Feb 25, 2021 20:19

Re: FBEdit internal Debugger with Command line program

Post by Tonigau »

ar-bugger, I was hoping I just missed something. (I like how vars are display with mouseover )
I could not find anywhere inside FBdebugger settings to include my dat file as cmd parameter, then my brain sparked...
Just so anyone needs else to know, you have to run FBdebugger from cmd line with parameters

eg:

Code: Select all

 'FBdebugger_32_108.exe YourProg.exe Datafile.dat' 
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBEdit internal Debugger with Command line program

Post by VANYA »

Image
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FBEdit internal Debugger with Command line program

Post by SARG »

@VANYA thank you for helping Tonigau.
I have to complete the manual as it's not indicated how to set command line parameters in the "How to use Fbdebugger" page.
Tonigau
Posts: 36
Joined: Feb 25, 2021 20:19

Re: FBEdit internal Debugger with Command line program

Post by Tonigau »

Vanya,
I found that setting page, I Tried putting parameters to load dat file in the DBG line & it didn't work.
I was tired with droopy eyes then so I probably typo'd. I will try again when I get back home.

thanks

FBedit is a great IDE, coming from VB6 it is comfortable & ergonomic to use.
A good IDE improves creativity (Yes I like to think my code is art sometimes)
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBEdit internal Debugger with Command line program

Post by VANYA »

Tonigau wrote:Vanya,
I found that setting page, I Tried putting parameters to load dat file in the DBG line & it didn't work.
Why didn't it work? What does a function that takes command line parameters return in your program? Are you using the COMMAND function in the program? See what she returns. Perhaps you need to pass the full path to the Datafile.dat file.
Tonigau
Posts: 36
Joined: Feb 25, 2021 20:19

Re: FBEdit internal Debugger with Command line program

Post by Tonigau »

VANYA
Why didn't it work? What does a function that takes command line parameters return in your program? Are you using the COMMAND function in the program? See what she returns. Perhaps you need to pass the full path to the Datafile.dat file
Dunno.(yet)
When I put the command line parameter (FileName) in the DBG field program behaved same as no parameter supplied.
-> I will try your suggestion adding the path to the dat file (it is in the same folder as prog being debugged)
At the time of posting I did not even know what reads the command line in a FB program, I have since learned.
For work-around now I just hard code the "File Input" variable in source code for debugging in FBEdit.

The FB program I am debugging is not written by me, it has about 35,000 lines of code & some of the flow is not easy to understand, debugging sheds a lot of light, now I can get out of first gear in adding my new feature.
After too many hours I am getting a better understanding.

Thanks
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FBEdit internal Debugger with Command line program

Post by SARG »

I just tested. In settings DBG box : param11 param22

Using this code from documentation :

Code: Select all

print "program launched via: " & Command(0)
Dim As Integer i = 1
Do
    Dim As String arg = Command(i)
    If Len(arg) = 0 Then
        Exit Do
    End If
    Print "command line argument " & i & " = """ & arg & """"
    i += 1
Loop
If i = 1 Then
    Print "(no command line arguments)"
End If
sleep
I got :

Code: Select all

program launched via: test_cmd.exe
command line argument 1 = "param11"
command line argument 2 = "param22"
So it works fine. Try with the test code and your parameter to see.
Post Reply