[GRASS-dev] Unix-isms in gis_set.tcl

Paul Kelly paul-grass at stjohnspoint.co.uk
Tue Dec 5 21:34:33 EST 2006


On Wed, 6 Dec 2006, Hamish wrote:

> Paul Kelly wrote:
>> Also gis_set.tcl seems to return the same exit status if either Enter
>> GRASS or Exit is clicked - is this true?
>
> both are successful, the program did what you asked it to.
>
>> I was trying to check the %errorlevel% variable in a Windows batch
>> script to avoid starting gis.m if enter was clicked, but it always
>> seems to be 0.
>
> I don't understand what you are trying to do.
> You want: the GUI startup screen -> [Enter GRASS] -> DOS prompt  ???

Sorry, should have read over that before sending, meant to say "if exit 
was clicked"...

I'm calling it from a batch file, snippet:
   =================================
1|"%WINGISBASE%\etc\gis_set.tcl"
2|
3|rem if return ok, gis.m start:
4|if %errorlevel% == 1 exit /b
5|
6|"%WINGISBASE%\etc\gm\gm.tcl"
7|
8|"%WINGISBASE%\etc\clean_temp" > NUL:
   ==================================

so line 4 should detect if Exit was clicked and exit the batch file 
straight away, thus not starting gis.m. I can't see how Init.sh handles 
this. gis_set.tcl has
    puts stdout "exit"
but not sure how to detect that. I guess I'll eventually work it out 
though!

Paul




More information about the grass-dev mailing list