- Jun
- 1
- 0
Hi,
Currently evaluating CMDebug v27.01.24 x64 primarily for - surprise - debugging vanilla .CMD and .BAT scripts. Very powerful IDE but already ran into a few issues. Not sure if there's a setting I'm overlooking.
Found a few close matches here in the forum, but nothing that seemed to cover this exact item.
During debugging, (and only debugging) a proven section of script broke. I tracked it down to CMDebug's expansion of %DATE%. For simplicity this can be observed in the Debug -> Evaluate Command (or -> Evaluate Expression) dialog.
In Windows Command Prompt, I get
In CMDebug, I get
Note CMDebug's output has
- non-zero padded month
- missing day of week
Obviously, there are several alternate methods to get the needed DATE value that would effectively workaround the unanticipated behavior. However using the %DATE% variable is orders of magnitude faster than DATE /T (on the target Intel Core i7 2.5GHz system) which in this case is key as this section of script can fire several times a second. And cleaner than using a FOR /F to parse the elements of the date. More on DATE /T below.
And certainly, while debugging I can swap in alternate code, but that kind of defeats the purpose and introduces maintenance hassles. My interest in CMDebug is toi *not* have debug code sprinkled throughout while debugging.
Using the DATE /T command in Debug -> Evaluate Command, I still have problems
Note /f1 is as unexpected as %DATE% and /f2 now changes to DD/MM/YYYY instead of MM/DD/YYYY
So this really seems like a CMDebug configuration I need to tweak but I'm not finding much that speaks to this. And most of the online discussions about INI settings for TCC don't seem to apply here.
So any tips for the new user?
Thanks!
Greg
Currently evaluating CMDebug v27.01.24 x64 primarily for - surprise - debugging vanilla .CMD and .BAT scripts. Very powerful IDE but already ran into a few issues. Not sure if there's a setting I'm overlooking.
Found a few close matches here in the forum, but nothing that seemed to cover this exact item.
During debugging, (and only debugging) a proven section of script broke. I tracked it down to CMDebug's expansion of %DATE%. For simplicity this can be observed in the Debug -> Evaluate Command (or -> Evaluate Expression) dialog.
In Windows Command Prompt, I get
Code:
C:\> echo %DATE%
Thu 06/17/2021
In CMDebug, I get
Code:
echo %DATE%
6/17/2021
Note CMDebug's output has
- non-zero padded month
- missing day of week
Obviously, there are several alternate methods to get the needed DATE value that would effectively workaround the unanticipated behavior. However using the %DATE% variable is orders of magnitude faster than DATE /T (on the target Intel Core i7 2.5GHz system) which in this case is key as this section of script can fire several times a second. And cleaner than using a FOR /F to parse the elements of the date. More on DATE /T below.
And certainly, while debugging I can swap in alternate code, but that kind of defeats the purpose and introduces maintenance hassles. My interest in CMDebug is toi *not* have debug code sprinkled throughout while debugging.
Using the DATE /T command in Debug -> Evaluate Command, I still have problems
Code:
date /t /f1
6/17/2021
date /t /f2
Thu 17/06/2021
So this really seems like a CMDebug configuration I need to tweak but I'm not finding much that speaks to this. And most of the online discussions about INI settings for TCC don't seem to apply here.
So any tips for the new user?
Thanks!
Greg