Hi All,

I have a problem where ord() of a character (single string index) returns the wrong value. the character is a 'o' which is a 111 value but the ord of it returns 121 into an integer. What am I doing wrong?

I can reproduce this error in my main application, but when I try to reproduce it in a smaller test application the error cannot be reproduced. I can find the error with breakpoints.

ch : integer;
Txt : string;
// Txt is passed as a parameter
i is a loop index

    ch := ord(Txt[i]);

    // i=7
    // Txt[i]=111 'o'
    // ch=121


http://pastebin.com/P7Wpkekx

Best Regards,
Peter / pew
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to