|
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
JAL parameter characters |
|
According to the manual JAL doesn't need commas or anything to delimit parameters in a statement and can use a space. This is both helpful and annoying....
Is there a way to supply a parameter string to a command, ie runandwait, that combines string literal and one or more variables without collecting and concatenating them first?
ie supplying parameters to an external program from JAL variables
dim GLOBAL.count, 10
dim configini, "xxxx.ini"
RunAndWait "d:\\poc\\action.exe" configini GLOBAL.count, "d:\\poc", 0, process_id
Thanks!
|
|
Wed May 30, 2007 11:41 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7847
|
|
|
|
|
|
RunAndWait "d:\\poc\\action.exe" configini GLOBAL.count, "d:\\poc", 0, process_id |
Here you have 6 parameters specified for RunAndWait. How do you want it to know that first 3 are really 1 parameter?
Why not use a simple
ConcatEx( "d:\\poc\\action.exe ", configini, " ", GLOBAL.count, command )
then call
RunAndWait( command, "", 0, process_id )
By the way, while parenthesis and commas are optional elements, it is highly recommended that you use them. These elements may become required in future versions as the JAL language develops and evolves from a simple batch language to a full fledged scripting language.
|
|
Wed May 30, 2007 11:59 pm |
|
|
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
|
|
Also can you dim or set a global variable creating the name from another variable?
so can I go something like
dim processname, string, "dosomething"
dim GLOBAL.dosomething, number, 1
|
|
Thu May 31, 2007 12:08 am |
|
|
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
|
|
Thanks for the first answer concatex will at least do it in less code than concat.
Cheers
Lee
|
|
Thu May 31, 2007 12:09 am |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7847
|
|
|
|
No. You cannot do it directly. "dosomething" is a value, not a variable. Not sure what you are after. In your example 2 have 2 correct definitions of 2 variables with correct value initialization.
By the way, you can create dynamic off-line file-based scripts from other scripts and then execute them dynamically using @SCRIPT macro, for example, in a job code
|
|
FileSave( "c:\\scripts\\script1.jal", "Dim my_var, number, 55\r\nMessageBox( my_var )" )
JobRun( "dynamic script job" ) |
The code for the dynamic job cane be like
|
|
@SCRIPT:c:\scripts\script1.jal |
In essence the first job creates dynamic script then calls another job that loads that script and executes it.
You can also update on-line job scripts, like in the following example, but this is trickier and could create problems when multiple people work with the scheduler concurrently.
|
|
JobModify( "dynamic script job", "SCRIPT", "Dim my_var, number, 55\r\nMessageBox( my_var )")
JobRun( "dynamic script job" ) |
|
|
Thu May 31, 2007 1:24 am |
|
|
|
|
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
|
|
|