SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
JALScript.exe

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
JALScript.exe
Author Message
Joshua Youngblood



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

Post JALScript.exe Reply with quote
This is a neat feature. Thanks for adding it. Is there a way to pass parameters to JAL files that are being executed?
Could I do something like: "JALScript.exe MyJalScript.jal 1, 2, 3, "Hello"

If so, how would I capture the values in the JAL file?
Thu Nov 20, 2008 12:23 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
At this time additional command line parameters are not supported, but you can still pass values using other methods. For example, in a batch file

SET MY_VAR1=Hello
SET MY_VAR2=555
JALScript MyJalScript.jal



In the called JAL script

MessageBox( "We got @V"env:MY_VAR1" and @V"env:MY_VAR2" from the calling process." )
or
ConsoleWrite( "We got @V"env:MY_VAR1" and @V"env:MY_VAR2" from the calling process." )
Thu Nov 20, 2008 12:45 pm View user's profile Send private message
Joshua Youngblood



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

Post Reply with quote
I tried something similar to what you sent me, but I must be doing something wrong. Here's my .bat code:
Code:

Set param1 = "Hello"
Set param2 = 2
JALScript /V JoshJalTest.jal


Here is my JAL code
Code:

dim myParam1, string
set myParam1, @V"env:param1"

dim myParam2, number
set myParam2, @V"env:param2"

dim sum, number

add 3, myParam2, sum

MessageBox sum
MessageBox myParam1


I get this error: "ERROR: Line 2: Syntax error.JAL Script finished"
Thu Nov 20, 2008 1:16 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
I haven't tried this yet, but I see at least one problematic place

set myParam1, @V"env:param1"

Here, the value is a string and it is missing double quotes. The @V macro simply "injects" the value, it is not a variable in the full sense.

dim myParam1, string
set myParam1, "@V"env:param1""


or alternatively in one step

Dim myParam1, string, "@V"env:param1""
Thu Nov 20, 2008 1:29 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
Build 3.5.2 will be available today for download. Starting with this build JALScript will support optional command line parameters and also streamline access to local environment variables. In addition, it will support mail configuration functions (new MailConfig statement) for using JAL on systems where full 24x7 is not installed and 24x7 system preferences aren't available, basically for sending emails from batch files.
Mon Nov 24, 2008 10:37 am View user's profile Send private message
Joshua Youngblood



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

Post Reply with quote
Great! Thanks. I did notice something about the parameter passing. Whenever I pass a string, it converts it to all-caps. Is there a setting for preventing this?

Here's an example:
Code:

dim parameter1, string, "@V"param:1""
dim parameter2, string, "@V"param:2""
dim myString, string

concatex "Parameter 1 = ", parameter1, myString
messagebox myString

concatex "Parameter 2 = ", parameter2, myString
messagebox myString


I run it using: jalscript JoshTest.jal "Brandon" "Joshua"

My first message box says: "Parameter 1 = BRANDON"
My second message box says: "Parameter 2 = JOSHUA"
Thu Dec 11, 2008 4:20 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
This sounds to me like a bug. I will log a case for this.
Thu Dec 11, 2008 4:46 pm View user's profile Send private message
Joshua Youngblood



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

Post Reply with quote
Thanks.
Thu Dec 11, 2008 4:48 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.