Re: Default justification of integer values in Aubit 4gl vs Informix 4gl

Mike Aubury <[email protected]> Thu, 25 Feb 2021 13:40:31 +0000
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <CAGAq4WG3z9_=pOkkmb+gMzBHBiZd6qwYNs_h_QFwNq1bFEn6Dw@mail.gmail.com>
Looking at the code

int
A4GL_digittoc (int *a, char *z, char *fmt, int dtype, int size)
{
  static char buff[100];

#ifdef DEBUG
  A4GL_debug ("digittoc %d", *a);
#endif
  SPRINTF1 (buff, fmt, *a);
#ifdef DEBUG
  A4GL_debug ("digittoc: %s", buff);
#endif

#define DIGIT_ALIGN_LEFT

#ifdef DIGIT_ALIGN_LEFT
  SPRINTF2 (buff, "%%-%d%s", size, fmt);
#else
  SPRINTF2 (buff, "%%%d%s", size, fmt);
#endif

#ifdef DEBUG
  A4GL_debug ("digittoc: buff set to %s", buff);
#endif
  strcpy (fmt, buff);
#ifdef DEBUG
  A4GL_debug ("digittoc: returns");
#endif
  return 1;
}


Its specifically set to  DIGIT_ALIGN_LEFT

You could try commenting that #define out and seeing what else breaks ?

On Thu, 25 Feb 2021 at 12:14, Gjerstad, Øyvind <[email protected]>
wrote:

> Just noticed that the default formatting (left/right justification) of
> integer values differ between Informix 4gl and Aubit 4gl. While I would
> normally prefer the Aubit way, it is not compatible with how it works in
> Informix 4gl, and it breaks a number of our flat file integrations.
>
> Consider this program:
>
> main
>
>   define i1 int, s1 char(15)
>
>
>   let i1 = 1
>
>   let s1 = "[", i1, "]"
>
>   display "012345678901234567890"
>
>   display s1
>
> end main
>
>
> Output with Aubit 4gl:
>
> 012345678901234567890
>
> [1          ]
>
>
> Output with Informix 4gl:
>
> 012345678901234567890
>
> [          1]
>
>
>
> We can probably fix this with the USING operator, but I would like to know
> if there is an environment variable or runtime flag that can be used
> instead.
> Thanks in advance,
> --
> Øyvind Gjerstad
> _______________________________________________
> Aubit4gl-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>

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