I have a script that generates graphs over a particular date duration (e.g. last 30 days) ----- the requirement is to generate multiple graphs over several more date durations (e.g. last 100 days, 365 days, etc.) ---- and these date durations will likely change over time.... So is there a way to pass a 'duration' parameter to the script? ---- or should I set a text file containing the duration value and read from it in the JSL script?
How are you invoking the jsl script?
This is what I do if I need to execute a jsl script from a bat or such and pass the jsl a parameter....
From dos prompt ..... cmd /c start jmp "C:\my_constructed.jsl"
where....
my_constructed.jsl contains (and keep in mind this is the tmp file that gets generated then run)
\\!
include ("C:\the_jsl_code_guts.jsl");
x = my_real_code(10);
then....
C:\the_jsl_code_guts.jsl.... contains....
my_real_code = Function(
// function arg
{duration_function_argument},
// local vars
{},
// your code that really does stuff.....
);
How are you invoking the jsl script?
This is what I do if I need to execute a jsl script from a bat or such and pass the jsl a parameter....
From dos prompt ..... cmd /c start jmp "C:\my_constructed.jsl"
where....
my_constructed.jsl contains (and keep in mind this is the tmp file that gets generated then run)
\\!
include ("C:\the_jsl_code_guts.jsl");
x = my_real_code(10);
then....
C:\the_jsl_code_guts.jsl.... contains....
my_real_code = Function(
// function arg
{duration_function_argument},
// local vars
{},
// your code that really does stuff.....
);
Jane, thank you very much ---- I will give it a try....
I like Jane's idea and it works great --- so I simply concatenate two files...
1. Create a text file with a line of JSL script that includes setting the parameter you want to pass in the Batch file (in DOS.... Echo Parameter1=30;>Parameter1.txt
2. Concatenate using the Copy command to create a temp.jsl script --- Copy /y /b Parameter1.txt+DataScript.jsl temp.jsl
--- so the first line of the temp file contains the 'Parameter1=30; ' jsl command AND all the other jsl scripting that uses the parameter....
3. Now that the temp.jsl has the full Datascript and the one line parameter setting we can run the jump script.....
DOS Batch script.....
Echo Parameter1=30;>Parameter1.txt | |
Copy /y /b Parameter1.txt+DataScript.jsl temp.jsl | |
JMP temp.jsl |