Login Cart  Cart
logo

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

rgolden Offline
#1 Posted : Thursday, March 24, 2011 7:10:49 AM(UTC)
rgolden
Rank: Newbie

Reputation:

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
Support Offline
#2 Posted : Thursday, March 24, 2011 10:39:21 AM(UTC)
Support
Rank: Administration

Reputation:

Joined: 2/23/2008(UTC)
Posts: 7,280
Man
Location: Sweden

Thanks: 304 times
Was thanked: 179 time(s) in 171 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)}");
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
rgolden Offline
#3 Posted : Thursday, March 24, 2011 10:55:20 AM(UTC)
rgolden
Rank: Newbie

Reputation:

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
Support Offline
#4 Posted : Thursday, March 24, 2011 10:58:00 AM(UTC)
Support
Rank: Administration

Reputation:

Joined: 2/23/2008(UTC)
Posts: 7,280
Man
Location: Sweden

Thanks: 304 times
Was thanked: 179 time(s) in 171 post(s)
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 Offline
#5 Posted : Thursday, March 24, 2011 1:42:46 PM(UTC)
rgolden
Rank: Newbie

Reputation:

Joined: 3/23/2011(UTC)
Posts: 3

Thanks, this has sorted me out.
Users browsing this topic
Guest
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.

footer
Follow VisualCron on Facebook Follow VisualCron on Twitter   Join the VisualCron group on LinkedIn neteject.com anyconnect.net millimetrics.com xendapp.com