Re: Aubit 4gl, too many spaces in front of interval field

Mike Aubury <[email protected]>
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <CAGAq4WGSV7K=nKA0+E6AbQ=bBNeLK3cG_BYiFA8adeTM0GFpvQ@mail.gmail.com>
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]> 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]>
>
> ___________________
>
>
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.