StrToInt documentation misses a functionality (maybe two?)
Guillermo Martínez Jiménez via fpc-pascal <[email protected]> Fri, 13 Feb 2026 19:46:12 +0100
| Newsgroups | gmane.comp.compilers.free-pascal.general |
|---|---|
| Organization | Burdjia |
| Message-ID | <20260213194612.4bafbbba@guillermo-sobremesa-linux> |
Hi again, A few weeks ago I was looking on the Internet if there's a simpler way to convert a binary string (i.e. '00100101') to integer than using a loop and parsing it by hand. On Reddit I found an answer that suggests to use sysutils.StrToInt preceding the string with character '%'. I tested and it works, so I go to the documentation to see if it also converts octal numbers but the documentation only mentions hexagesimal strings preceded by 'x', no mention to binary or octal. I didn't test system.Val though but maybe it also allows binary and octal strings. I know binary and octal strings aren't used often today but I think that the documentation should be updated. Regards, Guillermo Martínez J. _______________________________________________ fpc-pascal maillist - [email protected] https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal