System variables in Includefromvar

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
tbrackett
Newbie
Posts: 11
Joined: Wed Dec 07, 2005 5:00 pm

System variables in Includefromvar

Post by tbrackett » Mon Jun 11, 2018 7:26 pm

Hi all!
Hitting a brick wall when trying to use includefromvar.
Everything works great, except when I have any system variables defined in the script chunk that I am including:
Example script chunk read that is grabbed by include:
---------
mdl>Hello %CRLF% World!
ReadIniFile>c:\source\config.ini,CONFIG,Locations,all_locations
let>tmp1=,
StringReplace>all_locations,%tmp1%,%CRLF%,loc_list
----------
when included, it becomes:
-----------
mdl>Hello
World!
ReadIniFile>c:\source\config.ini,CONFIG,Locations,all_locations
let>tmp1=,
StringReplace>all_locations,%tmp1%,
,loc_list
-----------

Which of course breaks the script....
CRLF is the worst as I use it all the time, but I would assume any system variable will have the same problem...

Any ideas? Thanks!

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

Re: System variables in Includefromvar

Post by JRL » Tue Jun 12, 2018 2:02 am

Code: Select all

LabelToVar>Code,vData

Let>Percent=%

IncludeFromVar>vData

/*
Code:
mdl>Hello %Percent%CRLF%Percent% World!
*/

tbrackett
Newbie
Posts: 11
Joined: Wed Dec 07, 2005 5:00 pm

Re: System variables in Includefromvar

Post by tbrackett » Tue Jun 12, 2018 3:24 pm

Thanks!
Had me pulling my hair out as it worked in your code but not in the includefromvar...
AS IT TURNED OUT! the only thing that screwed it up was putting % around the var for include...
So %CRLF% works fine in includes, just don't be an idiot like me and do this:

IncludefromVar>%vData%

do this:

IncludefromVar>vData
:mrgreen:

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