Welcome to iraf.net Saturday, May 11 2024 @ 09:32 AM GMT
Gaba_p |
03/11/2009 05:27PM (Read 2026 times)
|
|
|
Status: offline
Registered: 10/10/2008
Posts: 104
|
Hi,
I'm writing a procedure script that looks like this:procedure test1 (query parameters)#declaration of parameters
real fwhm {prompt = "Ingrese el valor de FWHM"}begin #declaration of variables
string variable1#if structure
if (xxxxx) {
xxxx
xxx
}
else {
xxx
}etc... (more script commands)end
The thing is that when I run this script, it FIRST runs the 'if structure' and THEN it asks for the 'query parameters' (defined before 'begin').
Am I doing something wrong? Is this the way it should work?
In any case I want it to do this (I'm happy with the way the script runs), I just don't know if this is a sign that something is not working properly (in that case I'd rather fix it now that the script is small) or just normal behaviour.Thanks!
|
|
|
|
fitz |
03/11/2009 05:27PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
The query is made when the parameter is first accessed in the script, if this is after your 'if' statement then that would explain it. A common practice is to first get all the parameters at the top of your script and save them to local variables, this will avoid the query each time the parameter is accessed (i.e. a query parameter in a loop may prompt each time).-Mike
|
|
|
|
Gaba_p |
03/11/2009 05:27PM
|
|
|
Status: offline
Registered: 10/10/2008
Posts: 104
|
Thanks Mike, now I get why it's doing this.Since the 'if structure' is a control (a "check point"), I want it to appear before the query parameters (if this check is 'no', the script must exit).
|
|
|
|
| |
|
Content generated in: 0.09 seconds |
|