Page 1 of 1

Create a "Stop" command...

Posted: Fri May 14, 2010 10:41 pm
by HwyStar
It would be nice to have a very simple "Stop" command built into the language...

Have the stop command basically do: MessageRequester("Stop",Your Dialog Here,#PB_MessageRequester_Abort | #PB_MessageRequester_Ignore)

The variable we pass into Stop would ignore the variable type and always display it in the "your dialog here" section. I use this command in Clarion everyday to quickly inspect the values of numbers or strings. Don't get me wrong - Debug is great but sometimes its nice to have the code stop at a specific spot and display your results without moving forward.

Code: Select all

  Define LongNum
  Define Str.s

  Stop(Str)
  Stop(LongNum)
  Stop("Var: " + LongNum)
If debugging is turned off then bypass the Stop command!

Thanks for listening Dudes!

Re: Create a "Stop" command...

Posted: Fri May 14, 2010 10:48 pm
by STARGĂ…TE
you can use : CallDebugger

Code: Select all

Define LongNum
Define Str.s

Macro Stop(Variable)
 Debug Variable
 CallDebugger
EndMacro

Stop(Str)
Stop(LongNum)
Stop("Var: " + Str(LongNum))

but you can't mix Strings with Integers !
"Var: " + LongNum
never !

Re: Create a "Stop" command...

Posted: Sat May 15, 2010 12:56 am
by Fred
The IDE debugger shows the variable values when you put the mouse cursor on it, and the program is halted (just put a breakpoint).

Re: Create a "Stop" command...

Posted: Sat May 15, 2010 3:06 am
by HwyStar
I will give it a try Fred. I haven't used a debugger in years since Clarion has the Stop statement and it is so easy to use on the fly.

Thanks for the suggestions guys! :D

Re: Create a "Stop" command...

Posted: Sat May 15, 2010 4:55 am
by Mr Coder
The program doesn't even need to be halted; just select the IDE while the program is running and hover the mouse over the variable in question.

You can also use the variable viewer to see their values during runtime, or set a watchlist with your favorite variables, or (with 4.50) set data breakpoints so your app halts when a variable becomes a certain value.