Re: Odd GLOBALS behaviour?
Malcolm Perrior <[email protected]>
| Newsgroups | gmane.comp.lang.4gl.aubit.general |
|---|---|
| Message-ID | <A338ECC4DD46BC4B8B313F6AACEEC1E302095414@ukhqexchange2.Foresters.co.uk> |
Mike, sorry for the long delay – there’s been other things going on here and so on – but yes, this works fine. Our system is a pain because we have several hundred executables all in their own subdirectory and all with their own globals file; and all of these reference all our 15 or so shared libraries which all have their own globals file as well…whoever wrote this (and I could name names – they were pretty big in the bespoke insurance tools world), burning in hell’s too good for them! From: [email protected] [mailto:[email protected]] On Behalf Of Mike Aubury Sent: 25 March 2015 18:03 To: Malcolm Perrior Cc: [email protected] Subject: Re: [Aubit4gl-discuss] Odd GLOBALS behaviour? The chances are that its referring to a different globals somewhere somehow. I think i've mentioned before that we try to auto initialize global variables to NULL but - this isn't 100% accurate when you define the same variable in multiple places. Try setting : export NOGLOBALINIT=Y and then **recompile** all your programs/libraries The comment for that variable is : "if GLOBALS are specified in more than one file - they can overwrite each other when being initialized. This shouldn't happen if you specify the second (or subsequent) globals via the GLOBALS "filename" - just if they are repeated in "GLOBALS .. END GLOBALS" in two separate files" Note - this is a compile time setting - it changes whats actually put in the generated .c files On 25 March 2015 at 16:59, Malcolm Perrior <[email protected]<mailto:[email protected]>> wrote: Or have I not set some variable? I recall something about global persistence across links but can’t remember the context. NB this is under Ubuntu using an informix db and standard 4GL What we have is: A “.a” library built from several 4GLs in path “<path1>/<path2>/<path3>/base_lib/”. All the 4GLs in here refer to ../../globals.4gl. The makefile also refers to that globals.4gl A program built from a single 4GL in “<path1>/<path4>/<path5>/program.4gl”. The 4GL points to the same globals as the library, using “../../<path2>/globals.4gl” (as does its makefile). The globals file defines a global variable “prog_name”. When the program runs, it calls a get_general_variables() function in one of the library 4GLs which uses arg_val(0) to get the program name and populate the global. (Set font to COURIER to see the below diagram properly) <path1> | |------/<path2>/ | | |--globals.4gl | | | |-------/<path3>/ | | | /<base_lib>/ | |--lib_file_1.4gl | |--lib_file_2.4gl | |------<path4> | | | |------/<path5>/ | |--program_source.4gl The program 4GL also contains a “WHENEVER ERROR CALL get_error_action”; this refers to a function in a second library 4gl (in the same library path), which is called if anything untoward happens (NB it refers to the same ../../globals.4gl) This works on our current HP-UX host running informix 4gl. Under the linux proof-of-concept I’m running, the prog_name variable appears to be unset in the case of an error. I’ve proved this by inserting “DISPLAY prog_name” statements in each of the modules at appropriate times; it’s there in the library 4GL that sets it when the get_general_variable() function is called, it’s there in the program 4GL after that call, but if I force an error it is NULL in the error handler code. Do I dimly recall that there’s something I have to do to make global variables persistent in a4gl? Malcolm Perrior Database Administrator T 020 8628 3618 Foresters Foresters House, 2 Cromwell Avenue Bromley BR2 9BF foresters.com<http://foresters.com> ********************************************************************** The information contained in this email is intended only for the individual or entity to whom it is addressed. It may contain privileged and confidential information and if you are not an intended recipient you must not copy, distribute or take any action in reliance on it. If you have received this email in error, please notify us immediately by telephone on (020) 8628 3456. Please also destroy and delete the message from your computer. Any opinions expressed in this message are those of the sender only and do not necessarily represent the views of Foresters. The sender may not be authorised to give financial advice and nothing in this message should be construed as offering such advice or entering into any contract on behalf of any Foresters Company. Forester Life Limited is authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and Prudential Regulation Authority. Forester Fund Management Limited is authorised and regulated by the Financial Conduct Authority. The Children’s Mutual is a trading name of Forester Fund Management Ltd. Companies within the Foresters UK Group are registered in England as follows: Forester Life Limited 2997655, Forester Fund Management Limited 4315370 and Forester Holdings (Europe) Limited 3013082. Registered Offices for all companies within the Foresters UK Group: Foresters House, 2 Cromwell Avenue, Bromley, BR2 9BF. T 020 8628 3400. F 020 8628 3500. E [email protected]<mailto:[email protected]> foresters.com<http://foresters.com> ********************************************************************** ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Aubit4gl-discuss mailing list [email protected]<mailto:[email protected]> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss ________________________________________________________________________ This e-mail has been scanned for all viruses by Claranet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.claranet.co.uk ________________________________________________________________________ ********************************************************************** The information contained in this email is intended only for the individual or entity to whom it is addressed. It may contain privileged and confidential information and if you are not an intended recipient you must not copy, distribute or take any action in reliance on it. If you have received this email in error, please notify us immediately by telephone on (020) 8628 3456. Please also destroy and delete the message from your computer. Any opinions expressed in this message are those of the sender only and do not necessarily represent the views of Foresters. The sender may not be authorised to give financial advice and nothing in this message should be construed as offering such advice or entering into any contract on behalf of any Foresters Company. Forester Life Limited is authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and Prudential Regulation Authority. Forester Fund Management Limited is authorised and regulated by the Financial Conduct Authority. The Children’s Mutual is a trading name of Forester Fund Management Ltd. Companies within the Foresters UK Group are registered in England as follows: Forester Life Limited 2997655, Forester Fund Management Limited 4315370 and Forester Holdings (Europe) Limited 3013082. Registered Offices for all companies within the Foresters UK Group: Foresters House, 2 Cromwell Avenue, Bromley, BR2 9BF. T 020 8628 3400. F 020 8628 3500. E [email protected] foresters.com ********************************************************************** ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ Aubit4gl-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss