[Solved] Write a task output to a int32 variable - VisualCron - Forum

Community forum

PedroFFPereira
2013-02-18T19:41:47Z
Hi,

I'm need to usa an output from a sql task. the sql is something like select count(*) from...

I'm tring to put in a int32 var for "colect" the output from the sql task.

When i examime the variable value it is always "Error displaying Variable: There is an error in XML document (1, 2)."

When I try to atrib the value of the sql task the VS put a <string> tag, like this:

<string>{TASK(0bb77e98-1a18-4594-a1f4-95d072bbfd5a,StdOut)}</string>

how to write a task output to a int32 variable?
Support
2013-02-18T19:45:10Z
Attribute values does not work. XML should not care if int32 as everything is string. You should just use the {TASK(0bb77e98-1a18-4594-a1f4-95d072bbfd5a,StdOut)}.

If, for any reason XML expects an "attribute" you just need to add what XML is asking for.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
PedroFFPereira
2013-02-18T19:51:30Z
Originally Posted by: Support 

Attribute values does not work. XML should not care if int32 as everything is string. You should just use the {TASK(0bb77e98-1a18-4594-a1f4-95d072bbfd5a,StdOut)}.

If, for any reason XML expects an "attribute" you just need to add what XML is asking for.





Thanks, but when I try to use just {TASK(0bb77e98-1a18-4594-a1f4-95d072bbfd5a,StdOut)} the VS responds "Error converting value to chosen datatype".

If i check out the "validate value when saving" then i don't get any error but when i reopen the task VC put the <string>...</string>
Support
2013-02-18T19:52:58Z
What do you mean with VS in this case? Could you add some screenshots?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
PedroFFPereira
2013-02-18T19:57:13Z
Originally Posted by: Support 

What do you mean with VS in this case? Could you add some screenshots?



sorry VC is Visual Cron...

screenshoot
PedroFFPereira attached the following image(s):
Support
2013-02-18T19:58:44Z
I see. You should either save it as string or the Variable directly in XML instead of temporary store it in global variable.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
PedroFFPereira
2013-02-18T20:08:07Z
i don't want to use XML. i whant to use a global var.

The question is that it seens that when i wright {TASK(0bb77e98-1a18-4594-a1f4-95d072bbfd5a,StdOut)} the VC don't evaluate the {TASK...} but "thinks" that as a string.😢

If this is Visual Basic i should use something like val({TASK...})...
Support
2013-02-18T20:09:03Z
But where do you want to use the Variable?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
PedroFFPereira
2013-02-18T20:16:23Z
in a condition. i need control the execution of several tasks based in the value of that variable.

Basicaly when the variable is 0 then several tasks aren't executed.
Support
2013-02-18T20:17:12Z
You can use string all the way but in the condition you can use int and it will try to convert both values (variable and entered value).
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
PedroFFPereira
2013-02-18T20:21:36Z
but when i use string the VC responds:

Variable 'CTT-EXP Nº linhas na Query' was updated to: {TASK(0bb77e98-1a18-4594-a1f4-95d072bbfd5a,StdOut)} 😢

File Attachment(s):
Untitled.png (338kb) downloaded 47 time(s).
Support
2013-02-18T20:23:21Z
Yes, this is a feature. If you don't want the reference to the Variable you just check "Translate to constant" in the Set Variable Task.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
PedroFFPereira
2013-02-18T20:30:20Z
Originally Posted by: Support 

Yes, this is a feature. If you don't want the reference to the Variable you just check "Translate to constant" in the Set Variable Task.



it solved!!😁

but i would never think that "Translate to constant" would have this behavior.

thanks!!
Scroll to Top