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.


BobJ
  •  BobJ
  • Paid support Topic Starter
2023-02-27T04:14:25Z
If I try to create a user variable with the following formula, it resolves to the correct value before I go to save it, but after I save it and re-open it, it fails with "error in arguement". The process of saving it changes the "<" symbol in the Logic statement to "&lt;".

Our Fiscal year is from July to June. I want to create a directory structure with the months sorted in that order, so I'm trying to preface the folder name with a two digit value. That's what this statement is trying to do. If the modified month of a file is less than 7, I add 6 to the month value, otherwise, subtract 6. The result (when combined with the month) would be 01-July, 02-August, 03-September,....11-May, 12-June).

Is this a bug or am I doing something wrong?

Before Saving:
{LOGIC(If|Integer|{FILE(ModifiedTime|c:\testfile.txt|%M)}|<|7|{MATH(Add|Integer|{FILE(ModifiedTime|c:\testfile.txt|%M)}|6|#00)}|{(MATH(SubtractIInteger|{FILE(ModifiedTime|c:\testfile.txt|%M)}|6|#00)}

opened up after saving:

{LOGIC(If|Integer|{FILE(ModifiedTime|c:\testfile.txt|%M)}|&lt;|7|{MATH(Add|Integer|{FILE(ModifiedTime|c:\testfile.txt|%M)}|6|#00)}|{(MATH(SubtractIInteger|{FILE(ModifiedTime|c:\testfile.txt|%M)}|6|#00)}

Sponsor
Forum information
Pavel
2023-02-27T09:30:26Z
Hi!
Some syntax errors in your formula prevent it from being evaluated and saved correctly (extra and missing brackets).

This is the correct version

Quote:

{LOGIC(If|Integer|{FILE(ModifiedTime|C:\Temp\out.out|%M)}|<|7|{MATH(Add|Integer|{FILE(ModifiedTime|C:\Temp\out.out|%M)}|6|#00)}|{MATH(Subtract|Integer|{FILE(ModifiedTime|C:\Temp\out.out|%M)}|6|#00)})}

BobJ
  •  BobJ
  • Paid support Topic Starter
2023-02-27T13:33:56Z
Yes, it appears I messed up on a couple things (my eyes were going crosseyed from looking at formulas too long), but even after making the changes, it still behaves the same way, changing "<" to "&lt;" after the task is saved. Prior to saving, it resolves to the proper result.

This is with version 9.9.12.

I copied your version of the formula directly over mine, so its exactly the same (I changed my test file name/location to match yours). I also attempted to simplify it, removing the dependence on a file date and just used hard coded values, but the same thing happens when using this:

{LOGIC(If|Integer|2|<|7|{MATH(Add|Integer|2|6|#00)}|{MATH(Subtract|Integer|8|6|#00)})}

Finally, I grabbed the example of LOGIC from variables and pasted it - same issue - won't retain the "<" on save:

{LOGIC(If|Integer|1|<|2|Value 1 is less than value 2|Value 1 is not less than value 2)}
Users browsing this topic
Scroll to Top