On 18 Mar 2002 at 18:46, da Silva, Joe wrote:
Interesting. However, I wonder if this truncation is valid. Looking at ISO-10206, it states in section <6.4.6 Assignment-compatibility> :
"At any place where the rule of assignment-compatibility is used ... c) it shall be an error if T1 and T2 are compatible, T1 is a string-type or the char-type, and the length of the value of T2 is greater than the capacity of T1;"
My interpretation of this, is that in this situation, the statement AString:=AString+'ML' should have resulted in an error, since the compiler only allocated a capacity of 1 to AString, yet such a concatenation can never fit within this capacity.
Perhaps in EP mode, it should generate an error. In other modes, it should [a] at least generate a warning, or, [b] (and perhaps more controversially), treat string literals of < 255 chars as strings of 255 capacity. The first seems to be the better of the two, but perhaps generating an error in all modes is the best solution.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~African_Chief email: African_Chief@bigfoot.com