I'm not sure if comments are supposed to work when in the middle of a line. I usually write comments as a separate line, starting with the double-slash.
What do you get when you write this like
if [$MyVar = 1
// flag set
GoTo Layout xxx
If they are short, I place them at the end of a line as Markus did. Yes, I believe they should work "in-line".
Markus, I'm sure TS will ask for platform, version and FM version (and any other variables, such as plug-ins).
thank You Beverly! A phone call came across and I forget about mentioning the spec's )-:
added spec's to the original post
Thank you for your posts.
The in-line comment should work. Using your example, I did not receive an error under Windows 7, Windows 8.1, Windows 10, Mac OS X 10.10.5 and Mac OS X 10.11.3. I even removed the space after the "1" in case the first slash was being recognized as a division operator.
If I put a space between the two slashes, then I do get an error that a text, number, constant, etc. is missing.
Has this worked with other If statements? If you create a new script with the same If statement, does it work? If you changed the words after the slashes, does it work?
thank You for replying!
I did not get an error - it's just annoying when one types in a comment and the system wants to interpret the typed-in chars all the time - in a comment..
will check out for the errors tomorrow, when I'm on that system again
thank You Russell!
voted - and this is exactly what I meant (@TSGal)
You are using the wrong comment marker the double // is for only the end of a line.
You need to use /* comment here */ to put it in the middle of a line. at least in FM 13.
if [$MyVar = 1 /* flag set*/]
GoTo Layout xxx
The // is correct at end-of-line as well, great!
I believe the "issue" is that the type-ahead is trying to "guess" what you want to type, even after the start of an in-line comment. If I start to type something that matches a function or matches a field name or ??? then SW tries to give me values to select.
I don't know that this is bug (or error) and the Idea would likely mean that if I type "//" (or "/*") that everything to follow is NOT to be using the type-ahead.
Am I correct in the assessment, Markus and Mrwatson?
greatgrey, please see the link to the IDEA that Mr. W posted.
What I see in the example is that the closing "]" is in the comment.
I typed in the text manually, could be a typing mistake, it's the scripteditor-display. But: Just try it out, check out the link provided by MrWatson...
Yes I see that it can be a problem.