Page 1 of 3

Close all previously opened functions

Posted: Fri Feb 23, 2018 1:20 pm
by Eugene Lutsenko
Let functions be called earlier: f1(), f2(),... , fn(). Is it possible to close all of them from somefunction FunAllClose()?

Re: Close all previously opened functions

Posted: Fri Feb 23, 2018 3:05 pm
by Auge_Ohr
hi,

i do not understand why you want a Function FunAllClose() :?:

the normal Way is to restore it :!: just after use.

Code: Select all

      bBlock := SetKey( K_INS, {|| ChangeCursor() } ) 
 
      CLS 
      @ 10,10 SAY "Wert1:" GET cVar1 
      READ 
 
      SetKey( K_INS, bBlock )      // restore old Value

Re: Close all previously opened functions

Posted: Sat Feb 24, 2018 4:06 am
by Eugene Lutsenko
It is possible to select different menu items. Each menu item has a function. Sometimes when you call the next function the previous one should be closed. This can be done in the usual way. But they don't always do it. Therefore, I would like to do it forcibly programmatically.

Re: Close all previously opened functions

Posted: Sat Feb 24, 2018 4:16 am
by Tom
I guess, "close" is the wrong word. You mean something like "terminate". In Clipper, there was/is a function to do that. If you want to terminate running functions from Xbase++, you have to set a value or function return code which is recognized inside the functions. Or: Kill your app and restart it. ;)

Re: Close all previously opened functions

Posted: Sat Feb 24, 2018 4:38 am
by Auge_Ohr
Eugene Lutsenko wrote:It is possible to select different menu items.
so you can oMenu:disableItem(nIndex).

Re: Close all previously opened functions

Posted: Sat Feb 24, 2018 5:12 am
by Eugene Lutsenko
Tom wrote:I guess, "close" is the wrong word. You mean something like "terminate". In Clipper, there was/is a function to do that. If you want to terminate running functions from Xbase++, you have to set a value or function return code which is recognized inside the functions. Or: Kill your app and restart it. ;)
Yes, when I wrote also thought that "close" is not quite the right word. Of course it means "stop function". And previously called for the execution of the function. And stop the work of the previously called function is not this function, which should be closed, and the other. Tom, you're right. Just sometimes because of this you have to restart the whole system. It's ugly.

Re: Close all previously opened functions

Posted: Sat Feb 24, 2018 5:15 am
by Eugene Lutsenko
Auge_Ohr wrote:
Eugene Lutsenko wrote:It is possible to select different menu items.
so you can oMenu:disableItem(nIndex).
How to do it?

Re: Close all previously opened functions

Posted: Sat Feb 24, 2018 5:43 am
by Auge_Ohr
Eugene Lutsenko wrote:How to do it?
i'm not a Express++ User but i saw this

Code: Select all

DCMENUITEM 'Test' PARENT oMenu WHEN {|| Not_Allow_When_Working() }
so it seem me the WHEN Option.

Re: Close all previously opened functions

Posted: Sat Feb 24, 2018 10:31 am
by rdonnay
Sometimes when you call the next function the previous one should be closed. This can be done in the usual way. But they don't always do it. Therefore, I would like to do it forcibly programmatically.
The only way to close a function is to return from the function.
This can only be done within the function, however your function can always monitor a public variable within it's loop structure.
That public variable can be used to set a value to inform the function to terminate.
This can be complicated unless you are running your functions in different threads other than the main menu thread.

Re: Close all previously opened functions

Posted: Sun Feb 25, 2018 1:09 am
by Eugene Lutsenko
Hey, Roger!
Good to hear from you!

I mean only functions called by the user from the main menu. The rest of the features I looks as expected of them.