Re: Accessing program variables across 4gl files in the same executable
Posted in 1998
Manish Hemrajani wrote: > > > > >JL: No. They're file static variables in terms of C code. > > >>don't confuse these with globals) > > >JL: I'm not confused, but it appears you are; what you want are global > >variables. > > No I'm not confused I want to avoid using globals cause' of the overheads. > Do u understand? > > >>across 2 or more 4gl > >>programs within the same executable (.4ge file). > > > >JL: I4GL GLOBALS are precisely variables which can be accessed across 2 or > >more I4GL source files within the same executable, which is apparently what > >you want. > > >>Say for example I have one 4gl program containing the "main" and "end > >>main" which in turn calls functions which are declared in another 4gl > >>program. Can these 2 programs access a common set of variables (similiar > >>to "extern" variables in "C") > > > >JL: Yes, but only if they are GLOBALS. Why did you think that GLOBALS are > >not what you want? > > I have an application which has 89 executable files If I start declaring > variables which are gonna be used in just a couple of programs in the > globals file how big do u think my globals file (which as u might already > know is declared in every program ) > All I wanted to know was whether one can declare variables accessible to 2 > programs like C. If the answer is NO I'm fine with that > > -Manish If you really want inter-module sharing of variables, GLOBAL is the only way. But lots of GLOBALs will give you a maintenance headache in a big way. How about encapsulating more and using small functions as the interface to the module variables? -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 Mail: Peter.Lancashire.PL1@bayer.co.uk My Internet plumbing does not allow me to mail and post news together. Sorry. All opinions are my own and not those of Bayer plc.