Call a codeblock when exiting a Popup ?

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

Call a codeblock when exiting a Popup ?

#1 Post by GeneB »

I'm looking for a way to call a code block upon exiting a popup. I would like to refresh items on the screen based on the item chosen in a popup. The only way I can see to do this is to refresh with a codeblock called by Valid, but this requires exiting the Get. Perhaps a new "POPEXIT" ?

If there is a way to do this now, I would appreciate being pointed in the right direction.
Thanks in advance.
GeneB

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

Re: Call a codeblock when exiting a Popup ?

#2 Post by rdonnay »

You can do what you want inside the current code block.
Just make sure that the last value returned by the code block is the value you want put into the get.

Code: Select all

@ .. DCGET cVar POPUP {|c|PickVar(c),RefreshItems(c,GetList),c}


FUNCTION PickVar( c )

.. pick something

RETURN c

FUNCTION RefreshItems( c, GetList )

IF c == 'TEST'
  DC_GetRefresh(GetList,'TEST')
ENDIF

RETURN nil
The eXpress train is coming - and it has more cars.

User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

Re: Call a codeblock when exiting a Popup ?

#3 Post by GeneB »

Works perfectly. Thanks for the tip.
Roger, you just turned a light bulb on in my head. I'm converting a huge program I wrote from Clipper to Express. I'm making headway, and it's a chore, but this one seemingly insignificant tip just made me see the power in manipulating Express's own code blocks. I'm finally starting to think in Express and not in Clipper.
Thanks again, GeneB

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

Re: Call a codeblock when exiting a Popup ?

#4 Post by rdonnay »

Excellent way to start the New Year. :dance:
The eXpress train is coming - and it has more cars.

Post Reply