Re: Problem with globals and the definition of structures
Mike Aubury <[email protected]> Mon, 25 Mar 2024 14:47:07 +0000
| Newsgroups | gmane.comp.lang.4gl.aubit.general |
|---|---|
| Message-ID | <CAGAq4WEu7Ef5+MaevDrqG1Oiy+62az=uPgS+XMnZ91QKRBrjOw@mail.gmail.com> |
--===============7818725614971002556== Content-Type: multipart/alternative; boundary="0000000000000ea79e06147d406b" --0000000000000ea79e06147d406b Content-Type: text/plain; charset="UTF-8" I'd need a small example to try here. On Mon, 25 Mar 2024 at 14:45, Sergio Szychowski <[email protected]> wrote: > 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 > _______________________________________________ > Aubit4gl-discuss mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss > --0000000000000ea79e06147d406b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">I'd need a small example to try here.</div><br><div cl= ass=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, 25 Mar 20= 24 at 14:45, Sergio Szychowski <<a href=3D"mailto:[email protected]">s= [email protected]</a>> wrote:<br></div><blockquote class=3D"gmail_quote= " style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);= padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fo= nt-size:large">Hi,</div><div class=3D"gmail_default" style=3D"font-size:lar= ge">I have the problem that several modules have globals, and when using th= e values of some 'records'<br>the information seems to be corrupted= . Looking at the definition of the structures in 'C', several recor= ds seem to have changed the order of the fields, even for modules that use = the same global file.</div><div class=3D"gmail_default" style=3D"font-size:= large">Additionally, values are only preserved between modules if the modul= es use the same global file. In informix4gl, field values in globals are pr= eserved for all modules no matter if the module uses a global from a file o= r if the global is defined in the module itself.</div><div class=3D"gmail_d= efault" style=3D"font-size:large">I use version 1.5.2 with postgresql.</div= ><div class=3D"gmail_default" style=3D"font-size:large"><br></div><div clas= s=3D"gmail_default" style=3D"font-size:large">In global.4gl<br></div><div c= lass=3D"gmail_default" style=3D"font-size:large">struct {<br>=C2=A0 =C2=A0l= ong rowid ;<br>=C2=A0 =C2=A0char codemp_c [1+1];<br>=C2=A0 =C2=A0char empre= sa_c [20+1];<br>=C2=A0 =C2=A0fgldate fechoy_h ;<br>=C2=A0 =C2=A0fgldate fec= sis_h ;<br>=C2=A0 =C2=A0fgldecimal tperiodo_d ;<br>=C2=A0 =C2=A0char tsucur= s_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=A0c= har sistema_c [1+1];<br>=C2=A0 =C2=A0char transac_c [1+1];<br>=C2=A0 =C2=A0= char version_c [2+1];<br>=C2=A0 =C2=A0char so_c [1+1];<br>=C2=A0 =C2=A0shor= t graba_s ;<br>=C2=A0 =C2=A0char prueba_c [1+1];<br>} p_tpar;</div><div cla= ss=3D"gmail_default" style=3D"font-size:large"><br></div><div class=3D"gmai= l_default" style=3D"font-size:large">In module.4gl that uses "global.4= gl" filename<br>extern struct {<br>=C2=A0 =C2=A0long rowid ;<br>=C2=A0= =C2=A0fgldate fecsis_h ;<br>=C2=A0 =C2=A0short tipo_s ; <br>=C2=A0 =C2=A0s= hort graba_s ;<br>=C2=A0 =C2=A0char rubro_c [1+1];<br>=C2=A0 =C2=A0char emp= resa_c [20+1];<br>=C2=A0 =C2=A0char name_dia [9+1];<br>=C2=A0 =C2=A0short t= periodo_d ;<br>=C2=A0 =C2=A0char tsucurs_c [4+1];<br>=C2=A0 =C2=A0char tran= sac_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=A0short nmes ;<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">Thanks in advance.</div><div class=3D"gmail_default" style=3D"font-s= ize:large">Best regards<br></div></div> _______________________________________________<br> Aubit4gl-discuss mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank"= >[email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss" r= el=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/lis= tinfo/aubit4gl-discuss</a><br> </blockquote></div> --0000000000000ea79e06147d406b-- --===============7818725614971002556== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============7818725614971002556== 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 --===============7818725614971002556==--