Hi, Is this a known issue? === program z;
{$longstrings on} {$zerobasedstrings on} var S, T: string; begin S := 'ABC'; write('S[0] = "',S[0],'"'); if (S[0] <> 'A') then writeln(', FAIL: expected: A') else writeln(' [Ok]'); write('S[1] = "',S[1],'"'); if (S[1] <> 'B') then writeln(', FAIL: expected: A') else writeln(' [Ok]'); write('S[2] = "',S[2],'"'); if (S[2] <> 'C') then writeln(', FAIL: expected: A') else writeln(' [Ok]'); T := Copy(S,0,1); write('Copy(S,0,1) = "',T,'"'); if (T <> 'A') then writeln(', FAIL: expected: A') else writeln(' [Ok]'); T := Copy(S,1,1); write('Copy(S,1,1) = "',T,'"'); if (T <> 'B') then writeln(', FAIL: expected: B') else writeln(' [Ok]'); end. === Outputs: S[0] = "A" [Ok] S[1] = "B" [Ok] S[2] = "C" [Ok] Copy(S,0,1) = "A" [Ok] Copy(S,1,1) = "A", FAIL: expected: B (I played a little with this because Copy() accepts Index < 1 for "normal" AnsiStrings, and in Lazarus Utf8Copy() does not, so I wanted to see how his behaved with zerobasedstrings on. B.t.w. Is there an associate short option for this, as currently you cannot check {$IFOPT zerobasedstrings+} nor any other longoptions IIRC.) -- Bart _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel