Problems with macro parameters containing the "/"

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Problems with macro parameters containing the "/"

Post by adroege » Wed Feb 23, 2005 10:17 pm

This sample code illustrates the problem with passing
a variable as a parameter to a macro.

The main macro contains these lines ----------------------
ReadIniFile>c:\myini.ini,settings,window,WinTitle
Macro>%SCRIPT_DIR%\Test1.scp /mywin=%WinTitle%
------------------------------------------------------------------

The macro "Test1.scp" contains ---------
MessageModal>%mywin%
----------------------------------------------

The contents of c:\myini.ini -----
[Settings]
window=hello / there
-------------------------------------

Running this code will produce the error message:
"Error with Let>there, = missing"


I don't have control over the data which is being read in, so
having the "/" characters is always a possibility. The only alternative
I can think of is to try to replace "/" with something else prior to
passing it as a parameter, however there is no "safe" character to
replace it with that might not already exist in the input data.

Any ideas? Or is there a way to make this limitation go away?

Thanks.

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Wed Feb 23, 2005 10:43 pm

Well I think I may have found a solution which I will share to see if anybody can think of a better one....

The main macro is modified as follows: -----------------
ReadIniFile>c:\myini.ini,settings,window,WinTitle
VBStart
VBEnd
VBEval>escape("%WinTitle%"),WinTitle
Macro>%SCRIPT_DIR%\Test1.scp /mywin=%WinTitle%
------------------------------------------------------------------


The test1 macro is modified as follows: --------
VBStart
VBEnd
VBEval>unescape("%mywin%"),mywin
MessageModal>%mywin%
-------------------------------------------------------


Can macro scheduler be modified to do this type of escape/unescape
process behind the scenes when passing parameters so that I am
freed from the extra coding?

Thanks.

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