 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
arnaud_dupuis
Joined: 09 Oct 2007 Posts: 2
|
|
How to create a template to check dynamic file name |
|
Hello,
I want to create a template to create jobs which test if a file exists, the filename change each day (file_ddmmyyyy.log).
Most likely I use in the job script :
Dim fex, boolean
FileExists("file@T"ddmmyyyy".log", fex)
But when I try to create a template with the following script :
Dim fex, boolean
FileExists(%FILE%, fex)
and use a EDIT field in the wizzard (and the the problem is the same with a (REMOTE) FILE BROWSE), I got the following generated script :
Dim fex, boolean
FileExists("file@T\"ddmmyyyy\".log", fex)
If I enter "file@T"ddmmyyyy".log" in the wizzard field.
Obviously it's not the behaviour I expected.
Could you please give me some hints ?
Thanks,
Arnaud Dupuis
|
|
Tue Oct 09, 2007 4:06 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
%FILE% placeholder means that you want the template wizard to display a prompt for the file name in this place when you are creating a new job. In your case, you don't need a prompt because the file name is calculated, so in this place you simply need to enter the actual value, which is "file@T"ddmmyyyy".log" In job run-time 24x7 will replace this value with the calculated date.
|
|
Tue Oct 09, 2007 9:01 am |
|
 |
arnaud_dupuis
Joined: 09 Oct 2007 Posts: 2
|
|
|
|
Hmm no,
I want to make a wizzard wich allow people (who knows about the macro-parameters) to create,very quickly, new jobs with different macro-parameters.
for example, I want to be able to create (with my wizzard) the jobs to watch for a file "c:\nt_backup_@T"mmddyy".log" and "d:\sales_@T"mmddyyyy".log".
The problem is that I want mty users to enter themselves (via the wizzard of the template) the file pattern.
And for the moment I got only a stringify path like : "c:\nt_backup_@T\"mmddyy\".log" or "d:\sales_@T\"mmddyyyy\".log"
|
|
Tue Oct 09, 2007 9:47 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
The file browse dialog doesn't prevent people from entering any file name directly into the template field including names having macro-values. The issue here is that if they enter anything that contains special symbols, for example, double quotes, the wizard automatically inserts escape characters into the value to avoid job script syntax errors. To "undo" that you need un-escape them in the job script
Create a custom user-defined statement like ReplaceAll (a complete example is provided in the sample job database file) then in the job script add
ReplaceAll FILE, "\\\"", "\"", FILE
|
|
Tue Oct 09, 2007 2:30 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|