 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
JALScript.exe |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
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 |
|
 |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
|
|
I tried something similar to what you sent me, but I must be doing something wrong. Here's my .bat code:
 |
 |
Set param1 = "Hello"
Set param2 = 2
JALScript /V JoshJalTest.jal
|
Here is my JAL 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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
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 |
|
 |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
|
|
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:
 |
 |
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
This sounds to me like a bug. I will log a case for this.
|
|
Thu Dec 11, 2008 4:46 pm |
|
 |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
|
|
Thanks.
|
|
Thu Dec 11, 2008 4:48 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
|
|
|