a4gl string comparison broken?

Malcolm Perrior <[email protected]>
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <A338ECC4DD46BC4B8B313F6AACEEC1E3EB3A5680@ukhqexchange1.Foresters.co.uk>
Hi
I'm debugging one of our old (very old) production Informix 4gls that's worked tolerably well since 1998 on our HP-UX machine under i4GL V7.20/IDSV9.30; we've migrated all the code with a very high degree of success to a Ubuntu machine running Aubit against an Informix 12.10 database with minimal code changes.
One bit of code though has been causing screen display issues - it's basically a horrible bit of 4GL that takes strings and displays them in a screen window and there's a bit of string-slicing going on to strip unprintables and carriage returns etc. Under the Linux/a4gl environment it gets the test for CR wrong (it's looking for CTRL-M) in that it seems to see whitespace as a CR and thus messes up our display. The following code snippet demonstrates it. When run in HPUX it's fine and prints 1,2,3,4,5 as expected; but under Linux/a4gl it prints 1 2 3 YES 4 5.

NB the "^M" is entered in vi using "CTRL-V CTRL-M", and we get the same result whether we precede it with a backslash or without.
NB(2) we're compiling using '4glpc snippet.4gl -o snippet.4ge'. 4glpc -v shows: version 1.2, build level 38

Looks like an a4gl bug?


MAIN
DEFINE lc_char CHAR(5)
DEFINE ls_pos SMALLINT

LET lc_char = "AB DE "

FOR ls_pos = 1 to 5
    DISPLAY ls_pos
    IF lc_char[ls_pos] = "^M" THEN
        DISPLAY "YES"
    END IF
END FOR

END MAIN

Thanks!

Malcolm Perrior
foresters.com

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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