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

Gjerstad, Øyvind <[email protected]>
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <[email protected]>
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
foo.4gl (text/plain, 555 B)
database test
main
define p_tst like testtable.interval_field, # interval day(2) to minute,
       p_dummy char(1),
       p_minutes interval minute(5) to minute

  whenever any error stop

  open form f_test from "foo"
  display form f_test
  let p_tst = "0 08:30"

  while true
    input p_tst without defaults
      from formonly.tst
    let p_minutes = p_tst
    display p_tst to formonly.tst
    display p_minutes to formonly.resultat

    input p_dummy from formonly.dummy
    if p_dummy = "q" then
      exit while
    end if
  end while

end main
foo.per (text/plain, 466 B)
database test
screen
{
----------------------------- test av interval input --------------------------



                     Oppgi et intervall: [f000     ]


                     Du har oppgitt:       [f001          ] minutter



                     [c]
}
END


TABLES 
testtable

ATTRIBUTES
f000=formonly.tst type like testtable.interval_field, required;
f001=formonly.resultat type char, noentry;
c=formonly.dummy type char;

INSTRUCTIONS
DELIMITERS "[]"

END
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.