disable variable replacment

Discuss RoboTask here
Post Reply
4444124
Posts: 5
Joined: Thu Mar 29, 2012 11:42 pm
Location: United States

disable variable replacment

Post by 4444124 »

Hello,
I am merging few text files into one, and some texts
include {sometext} strings in it (the texts are scripts
for IDE software.

Most strings aren't recognized by Robotask and therefore
not being replace, but some do.

How can I avoid that please?
is there an option to set Robotask not replacing it?

Thx
Jay
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

disable variable replacment

Post by Oleg »

RoboTask always tries to expand {sometext} constructions
Therefore in order to preserve such strings you should replace this to another string (for example to {#sometext#}) before processing of the text.
You can do this by using BASIC scripts, because high-level actions of RoboTask will expand text in any case.

See this task please. Save the task into file and use menu Task | Import in order to import into RoboTask

It searches necessary files in folder, opens and replaces braces (small Basis script), processes body, and save result with restoration original constructions (another small script).

Of course you need Basic plugin in order to get this task work. You can download it here.
4444124
Posts: 5
Joined: Thu Mar 29, 2012 11:42 pm
Location: United States

disable variable replacment

Post by 4444124 »

thx
this is solving it.
is it possible to use variables in the Basic script, like:

buf = Replace(buf,"sometext","{SOMEVAR}")

so it will replace every "sometext" with the content of
varaible {SOMEVAR} ?

this will make my script much simpler.

thx
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

disable variable replacment

Post by Oleg »

Yes, of course.
function replace is BASIC function and it don't use RoboTask engine.
If you want to expand variables in text you should use
RoboTaskApp.ExpandText( SomeTextVar )
or
RoboTaskApp.ExpandText( "Some text with {MyVariable}" )
4444124
Posts: 5
Joined: Thu Mar 29, 2012 11:42 pm
Location: United States

disable variable replacment

Post by 4444124 »

thank you, that worked
Post Reply