Login Cart  Cart
logo

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

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline rgolden  
#1 Posted : Thursday, March 24, 2011 7:10:49 AM(UTC)
rgolden
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
Offline Support  
#2 Posted : Thursday, March 24, 2011 10:39:21 AM(UTC)
Support
Rank: Administration

Joined: 2/23/2008(UTC)
Posts: 7,517

Thanks: 334 times
Was thanked: 195 time(s) in 186 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!
Offline rgolden  
#3 Posted : Thursday, March 24, 2011 10:55:20 AM(UTC)
rgolden
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
Offline Support  
#4 Posted : Thursday, March 24, 2011 10:58:00 AM(UTC)
Support
Rank: Administration

Joined: 2/23/2008(UTC)
Posts: 7,517

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

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

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