Re: Globals in 4gl - feature or bug?
Posted in 1996
: marcog@ctonline.it (marco greco) writes: : Quoted from the 4gl reference manual, volume 2: : : 1. You may have at most one GLOBALS statement where global variables are defined. : This statement may be in a separate file or in the file containing the main : program block. : : For years I'va had this strange belief that in a multiple file application you could : only have one place where globals were defined, all other files having to refer to : that. : ... snip ... : I don't want to start a thread on the evil and good of global variables, : I only want to know: : : 1) Is this a feature? - I suppose it is. It's a feature. : 2) if it is, is it generally known? (in other words, am I the only ignorant?) We have used it for years. : 3) The reason of the single globals limitation. Bad compiler writers?? There aren't even include files so... The manual only states that you can have only one globals in one source module. Nowhere is it stated as far as I can remember, that these can't be different in different source modules even if they are compiled into one program. Your quote sertainly doesn't say this is illegal. In our programs the source module with the main function doesn't even have any globals. Nils.Myklebust@ccmail.telemax.no NM-data, Aasesvei 71, 1300 Sandvika, Norway My opinions are those of my company