I'm attempting to execute some code when a 6302 error is thrown (this happens over ssh in GDC when user presses the blue circle close button on the second form of the GDC). It appears in my CATCH block, I can not execute too much code, in fact it appears to be just one line.
Here is my program: MAIN
CLOSE WINDOW SCREEN
DEFER INTERRUPT
CALL startlog("errlog")
OPEN WINDOW test_wind WITH FORM "testdisconnect"
CALL errorlog("Start of log")
TRY
MENU "MT"
ON ACTION cancel
EXIT MENU
ON ACTION close
EXIT MENU
END MENU
CATCH
CALL errorlog("one")
sleep 1
CALL errorlog("two")
sleep 1
CALL errorlog("three")
EXIT PROGRAM
END TRY
CLOSE WINDOW test_wind
END MAIN
My form:
DATABASE formonly
LAYOUT
GRID
{
[image1 ]
}
END
ATTRIBUTES
IMAGE image1:image1, IMAGE="test", PIXELWIDTH=640, PIXELHEIGHT=480,
STRETCH=BOTH;
When I run the program and press the Close button on the right, and then confirm to stop, it
only shows that one statement was run. I just want to confirm that that is all that is allowed. I wanted
to connect to database and write a record, but was not able to do that even if I called another function.
Date: 02/12/2018 Time: 09:08:55
Start of log
Date: 02/12/2018 Time: 09:09:08
one
Thanks,
Candy
Candy,
I can't help but feel that this issue and your previous issue are a symptom of your SSH configuration, and that you should try and identify why your SSH is different from our other customers and their 15+ usage years of it.
I wonder in your SSH config, do you check the "Start Command in a New Shell Option"?. I say that because there is no numerical limit on lines of code that can be executed in TRY/CATCH, WHENEVER ANY ERROR CALL scenarios although I'd recommend you keep such code concise. My suspicion is that the gdc.exe shuts down after you select Quit, which also shuts down the fgltty terminal session containing the fglrun process, and so you only see 1 line being executed because the fglrun process or what is hosting it has died.
The other thing I'll make sure you are aware of is the OPTIONS ON CLOSE APPLICATION syntax http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_programs_010.html. That is designed to handle case where front-end program is shut down in an orderly fashion
Reuben
Thanks Reuben.
I've implemented the OPTIONS ON CLOSE APPLICATION and I'll have someone test it in our office as well.
I did not have the check the "Start Command in a New Shell" option checked. I checked it and it made no difference.
Just as long as I know that several lines can be executed, I'm good. Thanks again!
Candy