Close all previously opened functions

This forum is for eXpress++ general support.
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Close all previously opened functions

#1 Post by Eugene Lutsenko »

Let functions be called earlier: f1(), f2(),... , fn(). Is it possible to close all of them from somefunction FunAllClose()?

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Close all previously opened functions

#2 Post 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
greetings by OHR
Jimmy

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Close all previously opened functions

#3 Post 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.

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Close all previously opened functions

#4 Post 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. ;)
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Close all previously opened functions

#5 Post by Auge_Ohr »

Eugene Lutsenko wrote:It is possible to select different menu items.
so you can oMenu:disableItem(nIndex).
greetings by OHR
Jimmy

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Close all previously opened functions

#6 Post 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.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Close all previously opened functions

#7 Post 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?

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Close all previously opened functions

#8 Post 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.
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Close all previously opened functions

#9 Post 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.
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Close all previously opened functions

#10 Post 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.

Post Reply