Let>text=1998-2004
MessageModal>%text%
will show the value of '-6' because the variable 'text'
automatically evaluates to an integer.
The following workarounds are ok within one script,
but when I pass the variable to another script, it gets
evaluated as an integer again.
// Workaround 1
Let>text=1
// ConCat makes the variable text into a string for this script
ConCat>text,998-2004
MessageModal>%text%
// But this makes it back into an integer
Macro>NextScript /var1=%text%
// Workaround 2
// The hidden character makes this into a string, ok for this script
Let>text=1998-2004%CR%
MessageModal>%text%
// But this makes it back into an integer
Macro>NextScript /var1=%text%
Thanks,
tomasz
How do you declare a string, e.g. '1998-2004' ?
Moderators: Dorian (MJT support), JRL
Hi,
Quicker way to replace the non-numeric-operator character with the hyphon:
VBEval>Replace("%CopyRightDate%","§","-"),CopyRightDate
Just one line needed each way.
Quicker way to replace the non-numeric-operator character with the hyphon:
VBEval>Replace("%CopyRightDate%","§","-"),CopyRightDate
Just one line needed each way.
MJT Net Support
[email protected]
[email protected]
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
I posted this reply on May 19 in the duplicate posting made in Technical/Scripting forum. I have removed that reply to consolidate replies.
I think the only way is to include a non-number character.
Can you use 1998_2004 or 1998~2004 instead?
Then can do a replace after if the "-" is really needed.
If not doing math, can you use the letter "l" vs. the number "1" ?
End up with l998-2004.
I know, these workarounds are only good for some specific conditions,
doesn 't really come up with a real solution.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!