View previous topic :: View next topic |
Author |
Message |
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Thu Sep 22, 2016 3:24 pm Post subject: Problem with %cc + %ew |
|
|
Using both lines
Code: | MA = WINIO@ ('%cc&', CB_EXIT)
MA = WINIO@ ('%ew&', CB_EXIT)
|
my program provides after closing an error window with
" Attempt to call winio at program exit "
If I use only one of these lines - regardless which one - to program closes correct. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu Sep 22, 2016 5:36 pm Post subject: |
|
|
Erwin,
You must retain the return path, otherwise MA (which I suspect is a local variable) may have disappeared.
The way to do this is to SAVE MA, or put it in a COMMON block. Global SAVEs work too ...
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Mon Sep 26, 2016 9:32 am Post subject: |
|
|
Erwin
Has this issue been resolved?
Here is my test program that runs within failure.
Code: | integer ma,winio@
integer,external::cb_exit
ma = winio@('%bt[OK]&')
ma = winio@('%cc&',cb_exit)
ma = winio@('%ew',cb_exit)
end
integer function cb_exit()
cb_exit = 0
end |
|
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Mon Sep 26, 2016 9:55 am Post subject: |
|
|
Paul,
'within' failure? What does that mean?
Putting it in a main program means that the return path to MA isn't lost. If you spread your Clearwin+ WINIO@s across several routines, then you get the error.
Now how did I discover that? (Memory cogs whirr) Aha! You told me!
This is a clear example where the simplified test program works but the big program is liable to fail.
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Mon Sep 26, 2016 10:12 am Post subject: |
|
|
Eddie
'within' is just Monday morning typing for 'without'!
Do you have a short program that fails? |
|
Back to top |
|
|
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Mon Sep 26, 2016 11:15 am Post subject: |
|
|
Paul,
I made a small example, but it works fine.
If there is no %ew, the user has to close the program before shutting down.
That's my solution now.
For the know-all: MA is in a module. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Mon Sep 26, 2016 11:49 am Post subject: |
|
|
Paul,
I can't get a short program to fail, nor can I find the original forum post where you provided the helpful advice.
My program first affected works with global SAVE, and not without, later programs reflect the knowledge gained and only save the WINIO@ return variable (and they work too). I haven't tried it with a module.
As for Erwin's solution, you can always make things work by taking out the bits that cause you bother, but it doesn't help when the user shuts down windows at the end of a long day before saving their data, I know that much
Eddie. |
|
Back to top |
|
|
|