Re: Rare problem with global variable value

Sergio Szychowski <[email protected]> Fri, 10 Jul 2020 18:44:35 -0300
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <CAHrRhuhz3nvEVhU+3D9HmqKVLEcfNwodhgK0b3Nuj-prh0w8WQ@mail.gmail.com>
Hello Mike,
it worked perfect.
I understand, about the global type modules. But we have everything, some
very clear and orderly programs and others not so much.
thank you!
Best regards.

El vie., 10 de jul. de 2020 a la(s) 15:23, Mike Aubury ([email protected])
escribió:

> The chances are they you've got the global variable defined in two files.
>
> Normally - you should have *one *definition within a GLOBALS .. END
> GLOBALS
> and then you reference that definition from a GLOBALS "filename.4gl"
>
> In Aubit4gl - we try to initialise globals (in informix4GL - c-compiler
> version - they are not initialised) - but if its defined in two files - it
> will get initialised in both (when any function in that module is called).
>
> If you've got it in two files, and you can't "fix" it - try compiling with
>
> export NOGLOBALINIT=Y
>
> and recompile your 4gls, see if that fixes it.
>
>
>
>
> On Fri, 10 Jul 2020 at 18:21, Sergio Szychowski <[email protected]>
> wrote:
>
>> Hello,
>>
>> I have a global variable type int in a module xxx.4gl, which takes value
>> inside this module, but when I invoke a function
>> Inside the yyy.4gl module, which uses the value of this variable, it
>> appears with a value of 0.
>> the variable is defined in both modules as int and global.
>>
>> Something I observed is that in the xxx.c and yyy.c a block 'c' appears
>> at the beginning where it initializes the
>> variables that are global. This should happen only once, and immediately
>> after the entry point to 4ae. Or maybe it shouldn't happen automatically.
>>
>> Thanks in advance
>>
>> Best regards
>>
>>
>> _______________________________________________
>> Aubit4gl-discuss mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>>
>

_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss