SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
@T macro

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
@T macro
Author Message
Joshua Youngblood



Joined: 14 Apr 2006
Posts: 82
Country: United States

Post @T macro Reply with quote

In our script libraries, we do not have any code but @Script..., which is a reference to the script that we desire to run. Inside of the scripts that we desire to be executed, the @T macros are said to be invalid syntax. When we had the code programmed directly in the script libraries, it worked fine. Do you know what is causing the problem? If you need examples, let me know.

Thu Oct 05, 2006 2:55 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7968

Post Re: @T macro Reply with quote

All macro-parameters are substituted in the job runtime with their value. @SCRIPT is one of them, the contents of the referenced file is inserted into the script. However the substitution is only done on the top level. There is no recursion. That's why external files cannot use macro-parameters.
To take advantage of macro-variables in external files use somethng like the following

//In the calling script define a varible
Dim my_variable, date, "@T"yyyy-mm-dd""
// then reference an external file
@SCRIPT:somefile.jal

In the referenced file just use the variable, for example,
// this is somefile.jal
MessageBox my_variable

: In our script libraries, we do not have any code but @Script..., which is a
: reference to the script that we desire to run. Inside of the scripts that
: we desire to be executed, the @T macros are said to be invalid syntax.
: When we had the code programmed directly in the script libraries, it
: worked fine. Do you know what is causing the problem? If you need
: examples, let me know.

Thu Oct 05, 2006 3:34 pm View user's profile Send private message
Joshua Youngblood



Joined: 14 Apr 2006
Posts: 82
Country: United States

Post Re: @T macro Reply with quote

We are only getting an invalid syntax error for T macro-parameters and not V macro-parameters. Do you know why this may be?

Fri Oct 06, 2006 12:41 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7968

Post Re: @T macro Reply with quote

How do you use it?
Please provide a code snippet demonstrating the usage.

: We are only getting an invalid syntax error for T macro-parameters and not V
: macro-parameters. Do you know why this may be?

Fri Oct 06, 2006 12:45 pm View user's profile Send private message
Joshua Youngblood



Joined: 14 Apr 2006
Posts: 82
Country: United States

Post Re: @T macro Reply with quote

: How do you use it?
: Please provide a code snippet demonstrating the usage.

// This line does not give a syntax error.
logaddmessageDB "ERROR", @V"job_id", "@V"job_name"", Abortit_error_msg

// This line does give a syntax error.
logaddmessageDB "ERROR", @T"yyyy", "@V"job_name"", Abortit_error_msg

Fri Oct 06, 2006 1:54 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7968

Post Re: @T macro Reply with quote

I can reproduce this too. I am really surprised that @V macro-variables work in off-line scripts as nested macros are not supported

Anyway, I can offer you the following solution

Dim d, datetime
Dim yyyy, number

Today d
DateTimePart d, "yy", yyyy
logaddmessageDB "ERROR", yyyy, "@V"job_name"", "test"

This will work in both on-line and off-line scripts.

: // This line does not give a syntax error.
: logaddmessageDB "ERROR", @V"job_id",
: "@V"job_name"", Abortit_error_msg

: // This line does give a syntax error.
: logaddmessageDB "ERROR", @T"yyyy",
: "@V"job_name"", Abortit_error_msg

Fri Oct 06, 2006 2:10 pm View user's profile Send private message
Joshua Youngblood



Joined: 14 Apr 2006
Posts: 82
Country: United States

Post Re: @T macro Reply with quote

Thank you.

Fri Oct 06, 2006 2:39 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.