script reuse

6 views
Skip to first unread message

Keith

unread,
Mar 25, 2008, 12:06:50 PM3/25/08
to JEQL Users
Hello,

Is it possible to define arguments to a script so that I can call
a .jql script from inside another jql script? This is the same concept
as stored procedures in a database.

Keith

Martin Davis

unread,
Mar 25, 2008, 12:29:21 PM3/25/08
to jeql-...@googlegroups.com
Hi, Keith.

The answer at the moment is "sort of".  You can get the args on the command line for a Jeql script using Script.arg(n). And you can exex another OS-level process by using System.exec(String).  So you can call one Jeql script from another that way.  But you can't get a return value.  So it's a bit primitive.

I have been thinking a bit about how to chain together or call Jeql scripts.  As you say, this would be like having stored procedures.  Obviously it's a nice way to build up modules of re-usable code.

Can you provide some details of your use case, to help me to direct my thinking?

Martin

Keith

unread,
Mar 25, 2008, 12:58:02 PM3/25/08
to JEQL Users
Martin,

Access to the script arguments is all I need now. I want to chain a
few scripts together, so this will work nicely. Is there any way to
detect an error condition inside a script? If there is a way, then I
can write the return value (pass/fail) to a temporary text file, for
the calling script to read. I'll try to report back to you any ideas I
have.

Keith

On Mar 25, 10:29 am, "Martin Davis" <mtncl...@gmail.com> wrote:
> Hi, Keith.
>
> The answer at the moment is "sort of". You can get the args on the command
> line for a Jeql script using Script.arg(n). And you can exex another
> OS-level process by using System.exec(String). So you can call one Jeql
> script from another that way. But you can't get a return value. So it's a
> bit primitive.
>
> I have been thinking a bit about how to chain together or call Jeql
> scripts. As you say, this would be like having stored procedures.
> Obviously it's a nice way to build up modules of re-usable code.
>
> Can you provide some details of your use case, to help me to direct my
> thinking?
>
> Martin
>

Martin Davis

unread,
Mar 25, 2008, 1:00:52 PM3/25/08
to jeql-...@googlegroups.com
No, no way to detect an error condition unfortunately.  Although I guess you could write "success" to a text file as the last line in the script - and it simply wouldn't get executed if the script threw an error.

Interesting requirements!  They all make perfect sense... I just need to think about a good way to design and implement them.

Let me know how it goes.
Reply all
Reply to author
Forward
0 new messages