- Jan
- 179
- 2
Last time when I trial CMDebug there were issues regarding CMD if's vs TCC. If I rewrite these if's to work with the debugger will they work outside the debugger? Also will it fix the quirky step through in the debugger?
By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!Hard to know each debugger has it's own language it debugs.Is CMDebug identical to bdebugger, only sold as a separate item?
Is CMDebug identical to bdebugger, only sold as a separate item?
Let's start here. I wasn't wanting to redo to go to TCC I was just thinking some of the issues in CMDebug were inconsistancies between the two. I cannot get a simple string compare to work.
Batch Parameters
2=Start (shows just like this in the Batch Parameters with no extra spaces on either end)
CMDebug
If %2 == [Start] (
Goto Parm1OK)
(blank line #1)
(blank line #2)
Next statement
It's that simple but I've tried it using spaces around the == I've tried it using the mnemonics I've tried it without the parens I've tried it wiht brackets on both sides and without brackets I've tried negating it and using else...this shouldn't be this hard. It worked under CMD in fact I never had an issue with it but now I cannot get it to goto.
The original script before I started with CMDebug was this which I think having the : on the goto line is technically wrong.
If [%1]==[Start] goto :Parm1OK
Using the same "if" the debuger highlights the first line, the 2nd will never highlight for the reasons I listed above and then the current line becomes the line after the if...the whitespace line inbetween this statement and the next which I actually have 2 lines so it hghtlights each one in succession.
Here's another that just won't work...
Batch Parameters
2=0
CMDebug
Iff @NUMERIC[%2] Then (
Set LPassed=0
) Else (
Set LPassed=1
Endiff )
The highlighting on this one goes immediately to the last line the Endiff ) then when I think it will hit the next statement out of the blue it returns to the calling script. I must have changed something because it was highligting the first line then going to the else logic. In the help file the table in there shows that there's supposed to be a % in front of the @. I tired it with and without, neither worked. Again I tried all types of changes and got no where. With the parens without them without the then and even a regular if contruct. At some point I got the idea that there was no "if" in TCC that instead it was using Iff to replace the CMD if structure.
Is there a way to stop having to change the Read-only setting everytime I guess you reload or restart every script? Is there a way to change the default setting?
One more. Is there a way to identify the executing script line number?
I'm not getting email notifications for some reason.
goto Foo
echo blah blah
:Foo
echo We won't have seen blah blah
Iff @NUMERIC[%2] Then (
Set LPassed=0
) Else (
Set LPassed=1
Endiff )
Iff %@NUMERIC[%2] Then
Set LPassed=0
Else
Set LPassed=1
Endiff
| TEE [/= /A /Dn .E"regex" /F"format" /R /T /Unicode=[UTF-16LE | UTF-8 | ASCII[,UTF-16LE | UTF-8 | ASCII]]] file... |
What's wrong with my /F" "?
Echo "Create new log file." | Tee /F"%F, %T" /D /T "P:\Backup\BackupLogs\%2Drive%3BackupT.log"
Echo "Create new log file." | Tee /F"%%F, %%T" /D /T "P:\Backup\BackupLogs\%2Drive%3BackupT.log"
What is the /Dn The /D option is to display the date in yyyy-mm-dd format what is the "n" following it? Typo? Th eonly thing I get is the comman between the %F, %T followed by my "Create New Log File".
After I fixed that I notice that the script loading in the debugger does not match the script I keyed.
View attachment 5830
What do you make of that? And it also does it on the next if statement and then reports it as an unknown command and shows a ascii heart and the If. It's also adding a tab before the goto rather than my single space.
Should the debugger actually goto labels because it seems to skip over them.
Often with if's I see two behaviors in the debugger. One where it goes to the last ) if there is one and another where it steps through each line of the if so that you have no idea what logic it's following. It seems to be OK on linear if's not that there's really anything to get wonrg. Does it make any difference if you have enabled delayed expansion as to how it steps through them?
So debug doesn't handle single-conmand command groups or is that TCC? As far as I know that is legitimate in CMD.
Sometimes when I move execution to a prior line I feel like it's ignoring the change I made or the rexecution. I"m not sure at this point from what you're saying it should ignore the changes or that it's a bad idea? Most debuggers I've used in the past have allowed you to make changes to values and code on the fly. I assumed that's why when I would attempt to exit it was asking me to save it because I had changed it. Regardless even to change a variable value I have to go to edit and down to the bottom and turn off read-only every time a script loads regardless if it's a script that had been loaded before or not. You can imagine on a subscript that's gettting called multiple times that can be a real pita. There is a shortcut but I"m not a fan of shortcuts having to grab the keyboard unless I'm typing code is something I prefer not to do. There are 4 I use cut, copy an paste and rarely undo.
I was not able to identify a variable that contains the source line number.
I didn't think to hex view and no backup exists so I cannot answer. If I look up a heart it's like 2665. I could have copy and pasted code from a website and picked up something unexpected I think is the most likely way I got it.I try to avoid such editor issues with using the same codepage "overall".
However: I also use Notepad++ ... so that's interesting for me too. WHAT exactly is your editor issue? I could try then too maybe.
As I saw there is one problem at least at the beginning of your line "37", right?