Re: avoiding huge globals files
Posted in 1996
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Casper Boden-Cummins wrote: > > Suppose I had a bunch of modules to be included in various programs. > Rather than create one huge globals file "hugeglob.4gl" and insert a > > globals "hugeglob.4gl" > > in each module, I could create a seperate globals file for each module. > This works even when globals with the same name exist in more than one > globals file. I can even define explicit duplicate globals in modules. > > Is this technique is safe? Is it the answer to huge globals files? You can create separate globals files for each module, or you can include the globals definition at the top of each module. Remember that the alternative syntax for the globals section is: GLOBALS DEFINE variable TYPE : END GLOBALS We use this method for our library functions which return values via globals. If a module is to call a library function, then it declares the appropriate globals at the top of the module. Obviously the data types must be the same. You can also direct globals at any module that contains a globals section. Hope that helps, -- Mark. +-------------------------------------------------------------------------+ |Mark D. Stock - The West Solutions Group http://www.west.co.za | | The Informix FAQ is at http://www.iiug.org | |mailto:marks@west.co.za +------------------------------------------------+ |Tel: +27 11 803 2151 |If it doesn't work... force it! | |Fax: +27 11 803 2189 |If it breaks... it needed replacing anyway! | |Cell: +27 83 250 2325 |Well, that's how I code anyway! | +------------------------+------------------------------------------------+