[SOLVED] Bug in Debugger or what?

Just starting out? Need help? Post your questions and find answers here.
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

[SOLVED] Bug in Debugger or what?

Post 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?)
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Fred
Administrator
Administrator
Posts: 18199
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [SOLVED] Bug in Debugger or what?

Post by Fred »

You should really use EnableExplicit even if you don't like it. It will help you.
Axolotl
Addict
Addict
Posts: 832
Joined: Wed Dec 31, 2008 3:36 pm

Re: [SOLVED] Bug in Debugger or what?

Post by Axolotl »

Second Hint:
Typo on

Code: Select all

paaram$ vs. param$
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Quin
Addict
Addict
Posts: 1132
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: [SOLVED] Bug in Debugger or what?

Post 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.
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: [SOLVED] Bug in Debugger or what?

Post 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:
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Post Reply