Page 1 of 1

[SOLVED] Bug in Debugger or what?

Posted: Tue Jun 10, 2025 1:54 am
by Randy Walker
Nothing happens (no output) when I run this code AND
Nothing Happens when I click [Stop] button in the debugger -- Why?

Code: Select all

cmd$ = "powershell.exe"
paaram$ = "(curl https://www.purebasic.com/documentation/reference/ide_commandline.html).Content"
exe = RunProgram(cmd$,param$,"", 2 | 4 | 8) ;
Output$ = "" 
If exe
  Debug "Something"
  While ProgramRunning(exe)
    Output$ + ReadProgramString(exe) + Chr(13)
    er$ = ReadProgramError(exe)
    Debug er$
  Wend
Debug Output$
;  Output$ + Chr(13) + Chr(13)
 ; Output$ = "Exitcode: " + Str(ProgramExitCode(exe))     
 ;Debug "-------------------------"
EndIf
Debug Output$
Shouldn't the debugger stop if I click the [Stop] button?

Found the problem I think. Stupid me again. I had "paarm$ = ..." instead of "param$ = ..."
Fixed that typo and program finishes execution almopst immediately... DUH!!
(how do you all put up with me?)

Re: [SOLVED] Bug in Debugger or what?

Posted: Tue Jun 10, 2025 6:28 am
by Fred
You should really use EnableExplicit even if you don't like it. It will help you.

Re: [SOLVED] Bug in Debugger or what?

Posted: Tue Jun 10, 2025 2:02 pm
by Axolotl
Second Hint:
Typo on

Code: Select all

paaram$ vs. param$

Re: [SOLVED] Bug in Debugger or what?

Posted: Tue Jun 10, 2025 2:27 pm
by Quin
If it wouldn't break literally decades of code, including the PB IDE For some baffling reason, I'd suggest making explicit the default. Typoing a variable name in a MessageRequester or a debug line alone and spending hours trying to find it is nooot fun.

Re: [SOLVED] Bug in Debugger or what?

Posted: Tue Jun 10, 2025 6:59 pm
by Randy Walker
Axolotl wrote: Tue Jun 10, 2025 2:02 pm Second Hint:
Typo on

Code: Select all

paaram$ vs. param$
Yeah, spotted that one myself. Duh. :oops: