API read access to system variables - VisualCron - Forum

Community forum

rgolden
2011-03-24T06:10:49Z
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
Support
2011-03-24T09:39:21Z
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)}");


Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
rgolden
2011-03-24T09:55:20Z
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
Support
2011-03-24T09:58:00Z
Default is false. The purpose is just to keep or remove new lines.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
rgolden
2011-03-24T12:42:46Z
Thanks, this has sorted me out.
Scroll to Top