Page 1 of 1

VB Script won't run Changes

Posted: Fri Jul 16, 2021 3:59 pm
by photofrog
Hi,

Have this VB script task that sets alot of variables. It seems, perhaps after upgrading to the latest version, that when I add a line to set a new variable, it does not recognize it nor set the variable. It still does set all the other variables that have been in the file for a long time.

RoboTaskApp.AddUserVariable "G_IP_MICAPI", "999.999.999.999"
RoboTaskApp.AddUserVariable "G_IP_MICAPIAA", "999.999.999.999"
RoboTaskApp.AddUserVariable "G_HOST_MICAPI", "http://secure.ihammsonline.com/micapi"

First line (MICAPI) has been in there for a long time. The second and third were just added. But running the script, these variables are not set.

Ideas? Thanks.

David

Re: VB Script won't run Changes

Posted: Wed Jul 21, 2021 7:15 am
by Oleg
Maybe you have global variable G_IP_MICAPI
If global variable is already exist then RoboTask assigns new value to it. Otherwise RoboTask sets local variable by default

If you want to set global variables use such expressions:

RoboTaskApp.AddUserVariable "global@G_IP_MICAPI", "999.999.999.999"
RoboTaskApp.AddUserVariable "global@G_IP_MICAPIAA", "999.999.999.999"
RoboTaskApp.AddUserVariable "global@G_HOST_MICAPI", "http://secure.ihammsonline.com/micapi"

read about variable prefixes here: https://robotask.com/help/index.php?pre ... iables.htm
Also read about some rules of usage: https://robotask.com/help/index.php?rul ... iables.htm

Re: VB Script won't run Changes

Posted: Wed Jul 21, 2021 5:35 pm
by photofrog
Looks like that works. Thank you very much.

David