VB Script won't run Changes

Discuss RoboTask here

VB Script won't run Changes

Postby photofrog » Fri Jul 16, 2021 3:59 pm

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
photofrog
 
Posts: 12
Joined: Mon Apr 01, 2013 9:49 pm

Re: VB Script won't run Changes

Postby Oleg » Wed Jul 21, 2021 7:15 am

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
Oleg Yershov
Oleg
Site Admin
 
Posts: 2646
Joined: Thu Jan 01, 1970 1:00 am

Re: VB Script won't run Changes

Postby photofrog » Wed Jul 21, 2021 5:35 pm

Looks like that works. Thank you very much.

David
photofrog
 
Posts: 12
Joined: Mon Apr 01, 2013 9:49 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 10 guests