Re: 4gl RDS 7,2 on hp-ux 10.20 -- string handling errors
Posted in 1998
Well, its a shot in the dark, but... Example 1 if a_string = 200 characters and b_string = 200 characters the following LET statements may produce problems LET a_string = 'Some data to be displayed somewhere' LET b_string = 200 SPACES LET a_string = b_string[1,22], a_string because you are effectively saying LET (200 chrs) = 'Some data to be displayed somewhere' LET (200 chrs ) = 200 spaces LET (200 chrs ) = 22 chrs + 200 chrs - 222 chrs assigned to a space 200 chrs big !! Thus, breaking the boundaries of the original string length causing all sorts of problems in the stack or heap where the variables have been declared. add the CLIPPED clause to the last statement to give:- LET a_string = b_string[1,22], a_string CLIPPED Example 2 Was this bit of code anywhere near the code in the first example or is it in a separate function ?? Possible initialisation problems. Set each element in the array to "" (NULL) before processing ?? I don't know, just a guess - I tried it on our machine ( running 4.2 ) and, like you, it worked fine !! richard@dcs.co.uk wrote in message <3677d05b.4710953@news.powernet.co.uk>... >A warning to others and a plea for ideas or help. > >Just upgrading to 4gl RDS 7,2 UD4 running on hp-ux 10.20 and I'm >having problems with simple string handling causing errors. Is anybody >else having similar problems and have they managed to determine what >is happening ? > >Example 1 > >LET a_string = 'Some data to be displayed somewhere' >LET b_string = 200 SPACES >LET a_string = b_string[1,22], a_string > >caused a core dump - replace '22' by '21','23','24' - core dump. >Replace by 20, 25, 26 - no core dump. Move code to a small test >program - no core dump > >Example 2 > >A LET command of the form > >LET m_str = m_array[1].str > >was causing the string m_str to be truncated to 10 characters (even >though both sides were defined as CHAR 80 .) > >Changing the code to > >LET m_str[1,80] = m_array [1].str > >fixed the problem > >This problem also disappeared when the data was moved to a small >program. > >Naturally this code works fine running under RDS 4.14 > >Informix can't help because I can't reproduce the problem in small >programs. They have 'no known problems' of this nature. > >Anyone else experienced anything like this ?