Re: NEWERA -- using Globals
Posted in 1997
Mike Ripley wrote: > > I need to syncronise multiple screen within a project so I pass the > common fields across in global variables. This works fine and is simple > to operate but is it the correct way? Should I be using class functions? IMHO Globals in NewEra are as dangerous as ever, and less usefull, since you have class members that can do the job as well (although they too can be dangerous). If you have a main window and the others are modal popups contained by it, you can get to any control or member variable of the parent window: INCLUDE "parentwif.4gh" ... FUNCTION modalClass::thisFunction( ... VARIABLE parWindow ParentWindowClass LET parWindow = self.getWindow() CAST ParentWindowClass ... So you can get the contents of a control: LET chText = parWindow.containedTextBox.getText() or any PUBLIC or PROTECTED variable: IF parWindow.varPublic IS NOT NULL THEN ... etc. //////////////// ======================================================= ////////// // Dennis J. Pimple Informix Software, Inc. ////// / /// Principal Consultant 5299 DTC Blvd Suite 740 ///// // //// dennisp@informix.com Englewood CO 80111 //// // ///// /// // ////// recept: 303-850-0210 // // /////// direct: 303-740-5611 Opinions expressed are mine, / /////////// fax: 303-843-6408 and do not necessarily //////////////// http://www.informix.com reflect those of my employer