Close dialog box on module close

I know I am missing something here but I have a dialog box that stays open after my module closes. What am I missing? I want the box open while the module window is open but I want it to close when I exit the module. Any suggestions would be welcome. Thanks!
SystemAdmin - Sat Aug 04 19:01:28 EDT 2012

Re: Close dialog box on module close
llandale - Mon Aug 06 08:16:53 EDT 2012

I have a method that has always been annoyingly clumsy and am now (v93) getting exception violations. Maybe you can make the following scribbling work. If so, please post the solution. This should work for a script that has a single globally defined DB. My "clumsy" script tries to handle a variable number of DBs from a single script.

DB   dbGlobal 
// My dialog Trigger trgClose = 

null   bool  trig_CloseDB(Trigger trg) 
{    
// Dynamic pre-close trigger to close my DB 

if (

null trg) 

return(

false)   
// is this possible?     

if (!

null dbGlobal) 
{  hide(dbGlobal) destroy(dbGlobal) 
} 
}   
// end trig_CloseDB()   

void   clbkClose(DB db) 
{   
// close DB for this dialog 

if (!

null trgClose) delete(trgClose)   
// Delete the trigger destroy(dbGlobal) 
}   dbGlobal = bla bla bla close(dbGlobal, true, clbkClose)  
// make sure this gets called trgClose = trigger(module->NameCurrentModuleFull, close, 11, trig_CloseDB) show(dbGlobal)

I'm thinking that a script with a variable number of DBs can use a variable number of global Trigger variables.

-Louie

Re: Close dialog box on module close
llandale - Mon Aug 06 08:19:05 EDT 2012

llandale - Mon Aug 06 08:16:53 EDT 2012
I have a method that has always been annoyingly clumsy and am now (v93) getting exception violations. Maybe you can make the following scribbling work. If so, please post the solution. This should work for a script that has a single globally defined DB. My "clumsy" script tries to handle a variable number of DBs from a single script.


DB   dbGlobal 
// My dialog Trigger trgClose = 

null   bool  trig_CloseDB(Trigger trg) 
{    
// Dynamic pre-close trigger to close my DB 

if (

null trg) 

return(

false)   
// is this possible?     

if (!

null dbGlobal) 
{  hide(dbGlobal) destroy(dbGlobal) 
} 
}   
// end trig_CloseDB()   

void   clbkClose(DB db) 
{   
// close DB for this dialog 

if (!

null trgClose) delete(trgClose)   
// Delete the trigger destroy(dbGlobal) 
}   dbGlobal = bla bla bla close(dbGlobal, true, clbkClose)  
// make sure this gets called trgClose = trigger(module->NameCurrentModuleFull, close, 11, trig_CloseDB) show(dbGlobal)

I'm thinking that a script with a variable number of DBs can use a variable number of global Trigger variables.

-Louie

Oops. Let's let the module close...
  • if (null trg) return( true ) // is this possible?
  • ...
  • return(true)
-Louie