Hi,
Just a heads up in case anyone else runs into this...
I frequently use breakpoints to debug scripts and recently ran into a problem with SRT start and end mismatch in a 2000 line script. MS pops up this "mismatch" message during SAVE of the script. I spent hours looking for the problem, because there was no real mismatch. the real cause was lines where I had used double slashes to comment out breakpoints. Don't do this, it MIGHT hurt!
//**BREAKPOINT**
I say "might" because I have done it for YEARS, in dozens of places and never had an issue. For some reason though, I just encountered in two scripts in the 4 months. It should be pointed out, I am still using MS 14.5.6, I just have not had time to upgrade to 15.
I hope this helps others,
Bob
problem with SRT start and end mismatch
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1390
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: problem with SRT start and end mismatch
Hi Bob,
Are you able to share a snippet that replicates this? I can't seem to force it to happen in v15. Could it be the positioning of the //**BREAKPOINT** ?
It reminds me of something I discovered in March last year, where an errant */ breaks Repeat/Until in a similar way - but only if it's inside the Repeat/Until loop. It took forever to figure out.
Are you able to share a snippet that replicates this? I can't seem to force it to happen in v15. Could it be the positioning of the //**BREAKPOINT** ?
It reminds me of something I discovered in March last year, where an errant */ breaks Repeat/Until in a similar way - but only if it's inside the Repeat/Until loop. It took forever to figure out.
Code: Select all
//Warning to new users - this snippet contains a deliberate error
let>loop=1
repeat>loop
let>loop=loop+1
message>%loop%
*/
Until>loop,10
Yes, we have a Custom Scripting Service. Message me or go here
Re: problem with SRT start and end mismatch
Hi,
I could not replicate my the issue in MS 14.
During initial research on the first script I took single sections of code out of the script and hit save until the issue went away. I thought I found the the offending section until I dropped it into a new script and it saved without error.
I looked for mismatches of If / Endif, SRT / End, block comments, Pycode. I checked for my commented breakpoints and they all were typed the same.
My error went away when I removed the offending commented breakpoint, but I did not determine what made that one offend, whereas the 18 others did not. Nothing jumped out that made it special. I am 90% certain it was not in a loop.
You probably know this, but for others... The error in the sample script above that Marcus posted does not pop upon save, like mine does, it pops upon run. the error in his simple example is easy to spot if you put the entire script into a comment block. The error directly precedes the only non-commented text. This works great in a tiny example script, not so well in more complex scripts, but it could be a good diagnostic method for chunks of code.
The second script that had this issue was only about 225 lines of code. I could dig up a backup and send send it to you if you want. Perhaps you could pull out the commented breakpoints one at a time or use a text editor to look for hidden characters, two obvious things I did not do. I am certain you know many other ways to test I would never imagine.
Bob
I could not replicate my the issue in MS 14.
During initial research on the first script I took single sections of code out of the script and hit save until the issue went away. I thought I found the the offending section until I dropped it into a new script and it saved without error.
I looked for mismatches of If / Endif, SRT / End, block comments, Pycode. I checked for my commented breakpoints and they all were typed the same.
My error went away when I removed the offending commented breakpoint, but I did not determine what made that one offend, whereas the 18 others did not. Nothing jumped out that made it special. I am 90% certain it was not in a loop.
You probably know this, but for others... The error in the sample script above that Marcus posted does not pop upon save, like mine does, it pops upon run. the error in his simple example is easy to spot if you put the entire script into a comment block. The error directly precedes the only non-commented text. This works great in a tiny example script, not so well in more complex scripts, but it could be a good diagnostic method for chunks of code.
The second script that had this issue was only about 225 lines of code. I could dig up a backup and send send it to you if you want. Perhaps you could pull out the commented breakpoints one at a time or use a text editor to look for hidden characters, two obvious things I did not do. I am certain you know many other ways to test I would never imagine.
Bob
Re: problem with SRT start and end mismatch
I've seen this for years. Never figured that is was related to remarked breakpoints. I just know the message is wrong and ignore it. Good catch Bob!
Just tested a long script I knew had the issue and after removing all breakpoints and remarked breakpoints it still had the issue. Then I found a remarked note. I often add asterisks to make short remarks more visible.
//***********Note************
Also causes the issue.
As does a simple:
//*
But its related to something more. Placing //* in any script with subroutines doesn't spawn the error message on save. Out of over 5000 scripts I've written most of which have subroutines and remarked breakpoints, I've seen this in only a few.
Still does this in v15
Just tested a long script I knew had the issue and after removing all breakpoints and remarked breakpoints it still had the issue. Then I found a remarked note. I often add asterisks to make short remarks more visible.
//***********Note************
Also causes the issue.
As does a simple:
//*
But its related to something more. Placing //* in any script with subroutines doesn't spawn the error message on save. Out of over 5000 scripts I've written most of which have subroutines and remarked breakpoints, I've seen this in only a few.
Still does this in v15
Re: problem with SRT start and end mismatch
so a commonality is //*
- Dorian (MJT support)
- Automation Wizard
- Posts: 1390
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: problem with SRT start and end mismatch
I've never managed to get to the bottom of it. I've experienced it too.
Yes, we have a Custom Scripting Service. Message me or go here
Re: problem with SRT start and end mismatch
Maybe the same issue.
I boiled it down to a remarked block inside a subroutine and also having //* in the script
But it also saves with the error if you remove the /*
I boiled it down to a remarked block inside a subroutine and also having //* in the script
Code: Select all
//*
SRT>Test
/*
*/
END>Test
Code: Select all
//*
SRT>Test
*/
END>Test