VisualCron
»
Support
»
API
»
API read access to system variables
 Rank: Newbie
Joined: 3/23/2011(UTC) Posts: 3
|
Hi,
I'm trying to access(read) variable values (system variables not user defined variables) through the API, but can't figure out how.
eg. I wish to evaluate the output of a particular task: {TASK(118fb6a7-441b-4b03-b09f-1ee9ac5f61fe,StdOut)}
This is something that can be done using the VisualCron client GUI, but I can't see how to do it using the API.
Regards, Robin
|
|
|
|
|
|
 Rank: Administration
Joined: 2/23/2008(UTC) Posts: 6,115  Location: Sweden Thanks: 197 times Was thanked: 117 time(s) in 112 post(s)
|
We need to expose this better in next version. But here is how you do it: Quote:using VisualCronAPI;
// replace s with your Server object VariableReplacerClass vr = new VariableReplacerClass(s,null,null,string.Empty,null); // SetVar returns the value vr.SetVar("{TASK(118fb6a7-441b-4b03-b09f-1ee9ac5f61fe,StdOut)}"); |
|
|
|
|
|
|
 Rank: Newbie
Joined: 3/23/2011(UTC) Posts: 3
|
Hi,
The VariableReplacerClass.SetVar method takes a second argument: bool bolReplaceEnter. What is the function of this argument, and should it be true or false for my use case?
Thanks, Robin
|
|
|
|
|
|
 Rank: Administration
Joined: 2/23/2008(UTC) Posts: 6,115  Location: Sweden Thanks: 197 times Was thanked: 117 time(s) in 112 post(s)
|
Default is false. The purpose is just to keep or remove new lines. |
|
|
|
|
|
|
 Rank: Newbie
Joined: 3/23/2011(UTC) Posts: 3
|
Thanks, this has sorted me out.
|
|
|
|
|
|
| Users browsing this topic |
|
Guest
|
VisualCron
»
Support
»
API
»
API read access to system variables
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.