Page 1 of 1

A function or variable to query stepping mode

Posted: 02 May 2023 17:44
by PeterH
Hi! A new wish. Hopefully easy to make?
(Didn't know about or find something for this.)

In stepping for debug there are often several stmts where stepping isn't needed.
Idea:

Code: Select all

   $oldstep = 0;
   if [stepping-mode] {   // <= that's it!
      $oldstep = 1;
      unstep;
   }
   ...many stmts...
   if $oldstep {step;}
Would be very helpful!

Re: A function or variable to query stepping mode

Posted: 07 May 2023 14:38
by klownboy
Hi PeterH, if I got your request right, hopefully Don would be able to accomplish this by having a new SC get(#CommandID) for stepping mode, #750, so we be able to detect whether stepping was on or off by if(get("#750")) {unstep;} or if(!get("#750")) {step;} Seems like a good idea. Of course, we could throw in step and unstep at various places in the script but having this control may be better because it would be independent of whether you've turned stepping on or off via a toolbar button or UDC.

Re: A function or variable to query stepping mode

Posted: 07 May 2023 15:49
by PeterH
Hi klownboy,
Just had a look, and remembered it right: the documentation of the step cmd says:

Remarks
(1) You can manually enable Step Mode using menu Scripting | Step Mode or the Step Mode toolbar
button. When manually enabled, you will be prompted before each command is executed, and
commands step and unstep will be ignored.

I think this can be good or bad, just depends on situation.
But for me it doesn't matter, as in my example I control stepping mode 99% by scripting commands. This way I can start stepping exact where I need it.

But I think: every interest can help for Don's decision to do it :whistle:

Re: A function or variable to query stepping mode

Posted: 07 May 2023 17:31
by klownboy
PeterH wrote: 07 May 2023 15:49 When manually enabled, you will be prompted before each command is executed, and
commands step and unstep will be ignored.
I probably realized that through use, but it's good to keep in mind. I step through a script dialog quite often when working on a new script invoked typically via the toolbar button, but just as often, I step and unstep at specific points in the scripts. I hit the "continue" button to continue stepping through a script line by line. I rarely use the "skip" button in that dialog since it isn't just skipping stepping (that's what continue is for), it's skipping the actual execution of that script line. So unless for troubleshooting purposes, I built in alternate ways of doing accomplishing something, I wouldn't choose to skip executing lines.

Re: A function or variable to query stepping mode

Posted: 07 May 2023 19:21
by PeterH
In short to say: YES :!:

Re: A function or variable to query stepping mode

Posted: 13 May 2023 13:09
by admin
Seems useful. Next beta.

Re: A function or variable to query stepping mode

Posted: 13 May 2023 22:02
by PeterH
Hey - that sounds good!
So fast, and together with VarType() :biggrin:
(In the moment I will not have problems with negative values - all positive :whistle: )

Time is a bit restricted - will go to test and use about beginning of next week.

Thanks for the good service :beer:

Re: A function or variable to query stepping mode

Posted: 15 May 2023 20:58
by PeterH
Hm - didn't test it.

Just used it.

Works fine 8)

Thanks again!