Re: Aubit 4gl, too many spaces in front of interval field
Mike Aubury <[email protected]>
| Newsgroups | gmane.comp.lang.4gl.aubit.general |
|---|---|
| Message-ID | <CAGAq4WGZNrTkpObH6w=6sugHLCM9Hi2TYZ3fED-RFGmQymzXJQ@mail.gmail.com> |
Indeed - hence the "HORRIBLE HACKY THING", but at least it proves that that is the issue :) I'll look into why its not decoding properly soon. On 3 June 2016 at 12:28, Gjerstad, Øyvind <[email protected]> wrote: > Thanks. It didn't quite work, the length seems to be 1094, so if I hardcode that instead then this specific testcase works, but I guess it will hurt all others uses of interval with different qualifiers, so it's not really a solution. > > -----Original Message----- > From: Mike Aubury <[email protected]<mailto:Mike%20Aubury%20%[email protected]%3e>> > To: "Gjerstad, Øyvind" <[email protected]<mailto:%22Gjerstad,%22%20%3d%3fISO-8859-1%3fQ%3f%3dD8yvind%3f%3d%20%[email protected]%3e>> > Cc: [email protected] <[email protected]<mailto:%[email protected]%22%20%[email protected]%3e>> > Subject: Re: [Aubit4gl-discuss] Aubit 4gl, too many spaces in front of interval field > Date: Fri, 3 Jun 2016 11:23:46 +0100 > > > The problem is in the detection from the database- its coming back as > an INTERVAL DAY TO MINUTE and ignoring the qualifier. > > The rules for decoding an interval from the informix syscolumns > basically look slightly wrong - you could do a quick hack for specific > cases by editing the lib/libsql/esqlc/esql.ec > > if (dtype == DTYPE_INTERVAL) > { > n1 = Infx_dt_to_A4gl_dt (TU_START (length)); > n2 = Infx_dt_to_A4gl_dt (TU_END (length)); > n3 = length>>8; > > return (n3<<8)+(n1 * 16) + n2; > } > > > you could just do : > > > if (dtype == DTYPE_INTERVAL) > { > > if (length==1608) { // <<<<< HORRIBLE HACKY THING > return 0x235; > } > > n1 = Infx_dt_to_A4gl_dt (TU_START (length)); > n2 = Infx_dt_to_A4gl_dt (TU_END (length)); > n3 = length>>8; > > return (n3<<8)+(n1 * 16) + n2; > } > > > > Until I can figure out how to easily derive that (size) value... > > > On 3 June 2016 at 09:31, Gjerstad, Øyvind <[email protected]<mailto:[email protected]>> wrote: > > > Hi! > > We have discovered another small quirk regarding interval fields in forms and 4gl-programs. > > We have many fields that are defined as interval day(2) to minute in the (Informix) database. > If we define a variable in aubit 4gl that is defined as "like table.field" and this field is defined as interval day(2) to minute, it gets extra spaces in front of it when it is displayed to a form field, and when the field had just enough space to display this interval in Informix 4gl, the value will not fit in the field when compiled with aubit. This field should require 9 character posistions (one for sign + two for days + one space + two for hours + one colon + two for minutes). > > If, however, the field is defined as 'interval day(2) to minute' in the 4gl program, it works as expected. In general we like to have the fields in the programs to be defined like the database fields. > I have attached a small test program that demonstrates this. > -- > > > Øyvind Gjerstad > Systemkonsulent > > > M +47 909 41 485 > [email protected]<mailto:[email protected]><mailto:[email protected]> > > ___________________ > > > PostNord Logistics AS > T +47 09300 > IT og Forretningsutvikling > Øran Vest > Postboks 100 > 6301 Åndalsnes > www.postnordlogistics.no<http://www.postnordlogistics.no><http://www.postnordlogistics.no> > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e > _______________________________________________ > Aubit4gl-discuss mailing list > [email protected]<mailto:[email protected]> > https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss > > > > -- > > > Øyvind Gjerstad > Systemkonsulent > > > M +47 909 41 485 > [email protected]<mailto:[email protected]> > > ___________________ > > > PostNord Logistics AS > T +47 09300 > IT og Forretningsutvikling > Øran Vest > Postboks 100 > 6301 Åndalsnes > www.postnordlogistics.no<http://www.postnordlogistics.no> > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e > _______________________________________________ > Aubit4gl-discuss mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ Aubit4gl-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss