Normal Topic Global Code Programing (Read 837 times)
GW
Junior Member
**
Offline


No personal text

Posts: 83
Joined: Dec 16th, 2003
Global Code Programing
Jul 7th, 2004 at 7:32pm
Print Post Print Post  
Is is possible to  make a statement under global code excute with a on form exit.
I use the global code to close the menu tree on opening of the form but would like to re-open the tree on form exit. Want it to excute from any mode and whether a record was saved or not.

Everything I've tried so far has not worked, believe the form is closing before the statement excutes so am looking a global code or other suggestions.
thanx
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Global Code Programing
Reply #1 - Jul 7th, 2004 at 7:42pm
Print Post Print Post  
Statement, no. Subroutine or Function, yes.

Global Code runs once when the Form is first loaded, however, you can define functions and subroutines in the Global Code area which can be called from other events, like On Form Exit.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
GW
Junior Member
**
Offline


No personal text

Posts: 83
Joined: Dec 16th, 2003
Re: Global Code Programing
Reply #2 - Jul 7th, 2004 at 8:21pm
Print Post Print Post  
Erika, guess I'm a little thick on this one but I not following the part Quote:
which can be called from other events, like On Form Exit.

Can you give a short example please.
this is what I'm trying to execute on form exit but under global code

var state as Int   
   
state = @CloseCommandArea()
if state = 1 then
     CloseCommandArea(0)

thanx becky
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Global Code Programing
Reply #3 - Jul 7th, 2004 at 8:32pm
Print Post Print Post  
Becky,

I'm not in a position to test this for syntax right now, but try something like this:

[b]Global Code[/b]
Subroutine CloseMyTree()
var state as Int   
    
state = @CloseCommandArea() 
If state = 1
{
  CloseCommandArea(0) 
}
End Subroutine

Close MyTree()


[b]Form::OnFormExit[/b]
CloseMyTree()
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
GW
Junior Member
**
Offline


No personal text

Posts: 83
Joined: Dec 16th, 2003
Re: Global Code Programing
Reply #4 - Jul 7th, 2004 at 8:49pm
Print Post Print Post  
thanks Erika
The part I was missing was the
Quote:
Form::0nFormExit
  
Back to top
 
IP Logged