problem with SRT start and end mismatch

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
bbrink
Pro Scripter
Posts: 70
Joined: Thu Dec 31, 2009 2:36 am
Location: Minnesota
Contact:

problem with SRT start and end mismatch

Post by bbrink » Wed Sep 02, 2020 11:11 pm

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

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1390
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: problem with SRT start and end mismatch

Post by Dorian (MJT support) » Thu Sep 03, 2020 9:51 am

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.

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

bbrink
Pro Scripter
Posts: 70
Joined: Thu Dec 31, 2009 2:36 am
Location: Minnesota
Contact:

Re: problem with SRT start and end mismatch

Post by bbrink » Thu Sep 03, 2020 11:50 am

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

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: problem with SRT start and end mismatch

Post by JRL » Thu Sep 03, 2020 2:01 pm

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

bbrink
Pro Scripter
Posts: 70
Joined: Thu Dec 31, 2009 2:36 am
Location: Minnesota
Contact:

Re: problem with SRT start and end mismatch

Post by bbrink » Thu Sep 03, 2020 2:08 pm

so a commonality is //*

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1390
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: problem with SRT start and end mismatch

Post by Dorian (MJT support) » Thu Sep 03, 2020 2:49 pm

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

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: problem with SRT start and end mismatch

Post by JRL » Thu Sep 03, 2020 4:12 pm

Maybe the same issue.

I boiled it down to a remarked block inside a subroutine and also having //* in the script

Code: Select all

//*
SRT>Test
/*
*/
END>Test
But it also saves with the error if you remove the /*

Code: Select all

//*
SRT>Test
*/
END>Test

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts