Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


MikeyP
2017-05-18T13:16:02Z
So I am using the list folder task as a way of counting the files in a the folder, using the task variable result "Number of files listed". I then want to perform a calculation on that but it appears that the variable type is string. Why? Can it be converted?
Sponsor
Forum information
Gary_W
2017-05-18T20:18:00Z
Sounds like you're finding out like I did that you can't just do a calculation like {JOB(Active,Variable,Days)}+2 as the variable Days in my example is a string (with a value of 3 say) and you will end up with a string with a value of "3+2".

You need to use a math function like this:
{MATH(Add|Integer|{JOB(Active,Variable,Days)}|2|#0)}
which will result in a result of 5 as expected. The math function appears to do the conversion for you. So, have a look at the "Math" section in the Variables dialog.
Scroll to Top