Problem with globals and the definition of structures

Sergio Szychowski <[email protected]> Mon, 25 Mar 2024 11:44:44 -0300
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <CAHrRhujoDwUX8iBTqT1A+ka28eLg6zqegWvxm-cL4x25jT7N_g@mail.gmail.com>
--===============5400847022905434384==
Content-Type: multipart/alternative; boundary="00000000000092b9c106147d37ef"

--00000000000092b9c106147d37ef
Content-Type: text/plain; charset="UTF-8"

Hi,
I have the problem that several modules have globals, and when using the
values of some 'records'
the information seems to be corrupted. Looking at the definition of the
structures in 'C', several records seem to have changed the order of the
fields, even for modules that use the same global file.
Additionally, values are only preserved between modules if the modules use
the same global file. In informix4gl, field values in globals are preserved
for all modules no matter if the module uses a global from a file or if the
global is defined in the module itself.
I use version 1.5.2 with postgresql.

In global.4gl
struct {
   long rowid ;
   char codemp_c [1+1];
   char empresa_c [20+1];
   fgldate fechoy_h ;
   fgldate fecsis_h ;
   fgldecimal tperiodo_d ;
   char tsucurs_c [4+1];
   char rubro_c [1+1];
   char categ_c [1+1];
   fgldecimal nserie ;
   char name_dia [9+1];
   char name_mes [10+1];
   short tdia ;
   short nmes ;
   short tipo_s ;
   char sistema_c [1+1];
   char transac_c [1+1];
   char version_c [2+1];
   char so_c [1+1];
   short graba_s ;
   char prueba_c [1+1];
} p_tpar;

In module.4gl that uses "global.4gl" filename
extern struct {
   long rowid ;
   fgldate fecsis_h ;
   short tipo_s ;
   short graba_s ;
   char rubro_c [1+1];
   char empresa_c [20+1];
   char name_dia [9+1];
   short tperiodo_d ;
   char tsucurs_c [4+1];
   char transac_c [1+1];
   char so_c [1+1];
   long nserie ;
   char codemp_c [1+1];
   char prueba_c [1+1];
   char sistema_c [1+1];
   fgldate fechoy_h ;
   char categ_c [1+1];
   char name_mes [10+1];
   char version_c [2+1];
   short tdia ;
   short nmes ;
} p_tpar;

Thanks in advance.
Best regards

--00000000000092b9c106147d37ef
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-size:large">Hi,=
</div><div class=3D"gmail_default" style=3D"font-size:large">I have the pro=
blem that several modules have globals, and when using the values of some &=
#39;records&#39;<br>the information seems to be corrupted. Looking at the d=
efinition of the structures in &#39;C&#39;, several records seem to have ch=
anged the order of the fields, even for modules that use the same global fi=
le.</div><div class=3D"gmail_default" style=3D"font-size:large">Additionall=
y, values are only preserved between modules if the modules use the same gl=
obal file. In informix4gl, field values in globals are preserved for all mo=
dules no matter if the module uses a global from a file or if the global is=
 defined in the module itself.</div><div class=3D"gmail_default" style=3D"f=
ont-size:large">I use version 1.5.2 with postgresql.</div><div class=3D"gma=
il_default" style=3D"font-size:large"><br></div><div class=3D"gmail_default=
" style=3D"font-size:large">In global.4gl<br></div><div class=3D"gmail_defa=
ult" style=3D"font-size:large">struct {<br>=C2=A0 =C2=A0long rowid ;<br>=C2=
=A0 =C2=A0char codemp_c [1+1];<br>=C2=A0 =C2=A0char empresa_c [20+1];<br>=
=C2=A0 =C2=A0fgldate fechoy_h ;<br>=C2=A0 =C2=A0fgldate fecsis_h ;<br>=C2=
=A0 =C2=A0fgldecimal tperiodo_d ;<br>=C2=A0 =C2=A0char tsucurs_c [4+1];<br>=
=C2=A0 =C2=A0char rubro_c [1+1];<br>=C2=A0 =C2=A0char categ_c [1+1];<br>=C2=
=A0 =C2=A0fgldecimal nserie ;<br>=C2=A0 =C2=A0char name_dia [9+1];<br>=C2=
=A0 =C2=A0char name_mes [10+1];<br>=C2=A0 =C2=A0short tdia ;<br>=C2=A0 =C2=
=A0short nmes ;<br>=C2=A0 =C2=A0short tipo_s ;<br>=C2=A0 =C2=A0char sistema=
_c [1+1];<br>=C2=A0 =C2=A0char transac_c [1+1];<br>=C2=A0 =C2=A0char versio=
n_c [2+1];<br>=C2=A0 =C2=A0char so_c [1+1];<br>=C2=A0 =C2=A0short graba_s ;=
<br>=C2=A0 =C2=A0char prueba_c [1+1];<br>} p_tpar;</div><div class=3D"gmail=
_default" style=3D"font-size:large"><br></div><div class=3D"gmail_default" =
style=3D"font-size:large">In module.4gl that uses &quot;global.4gl&quot; fi=
lename<br>extern struct {<br>=C2=A0 =C2=A0long rowid ;<br>=C2=A0 =C2=A0fgld=
ate fecsis_h ;<br>=C2=A0 =C2=A0short tipo_s ; <br>=C2=A0 =C2=A0short graba_=
s ;<br>=C2=A0 =C2=A0char rubro_c [1+1];<br>=C2=A0 =C2=A0char empresa_c [20+=
1];<br>=C2=A0 =C2=A0char name_dia [9+1];<br>=C2=A0 =C2=A0short tperiodo_d ;=
<br>=C2=A0 =C2=A0char tsucurs_c [4+1];<br>=C2=A0 =C2=A0char transac_c [1+1]=
;<br>=C2=A0 =C2=A0char so_c [1+1];<br>=C2=A0 =C2=A0long nserie ;<br>=C2=A0 =
=C2=A0char codemp_c [1+1];<br>=C2=A0 =C2=A0char prueba_c [1+1];<br>=C2=A0 =
=C2=A0char sistema_c [1+1];<br>=C2=A0 =C2=A0fgldate fechoy_h ;<br>=C2=A0 =
=C2=A0char categ_c [1+1];<br>=C2=A0 =C2=A0char name_mes [10+1];<br>=C2=A0 =
=C2=A0char version_c [2+1];<br>=C2=A0 =C2=A0short tdia ;<br>=C2=A0 =C2=A0sh=
ort nmes ;<br>} p_tpar;</div><div class=3D"gmail_default" style=3D"font-siz=
e:large"><br></div><div class=3D"gmail_default" style=3D"font-size:large">T=
hanks in advance.</div><div class=3D"gmail_default" style=3D"font-size:larg=
e">Best regards<br></div></div>

--00000000000092b9c106147d37ef--


--===============5400847022905434384==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============5400847022905434384==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

--===============5400847022905434384==--