<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Once upon a time, Sven Barth said:<br>
</div>
<blockquote cite="mid:512681B5.2000507@googlemail.com" type="cite">On
21.02.2013 21:01, Ewald wrote:
<br>
<blockquote type="cite">
<br>
Apparently the StrToInt function interprets strings starting
with an `x`
<br>
as hexadecimal numbers? This behaviour seems rather strange to
me
<br>
(strings starting with 0x would be a bit more understandable,
but then
<br>
again, we're programming pascal here, not C) and it is not
mentioned in
<br>
the documentation. What do I do with it?
<br>
</blockquote>
<br>
IntToStr simply calls through to Val and there is documented (more
or less) that it supports binary (%), octal (&) and
hexadecimal ($, 0x) values as well (see here:
<a class="moz-txt-link-freetext" href="http://www.freepascal.org/docs-html/rtl/system/val.html">http://www.freepascal.org/docs-html/rtl/system/val.html</a> ). That it
also supports 'x' and 'X' as a prefix for hexadecimal values is
because of Delphi compatibility.
<br>
<br>
As a sidenote: the prefixes %, & and $ can be used in normal
source code as well.
<br>
</blockquote>
Of course, these I use, but the `xabcd` syntax cannot be used in
source code to represent numbers. Hence my confusion about what to
do with it.<br>
<br>
<blockquote cite="mid:512681B5.2000507@googlemail.com" type="cite">
<br>
<blockquote type="cite">A- File a bug concerning incomplete
documentation?
<br>
B- File a bug concerning incorrect behaviour of StrToInt()?
<br>
C- Do nothing and live with it.
<br>
D- ....?
<br>
</blockquote>
<br>
I'd say A. On the one hand a reference from StrToInt(64),
StrToInt(64)Def and TryStrToInt(64) to Val should be added and on
the other hand Val's documentation should be extended by the fact
that '0x', 'X' and 'x' are valid prefixes for hexadecimal values
as well.
<br>
And while we're at it references from the 32bit StrToInt variants
to the 64bit variants could be added as well (they do exist the
other way round as one can see here:
<a class="moz-txt-link-freetext" href="http://www.freepascal.org/docs-html/rtl/sysutils/strtoint64.html">http://www.freepascal.org/docs-html/rtl/sysutils/strtoint64.html</a>
).
<br>
<br>
So if you would please be so kind to open a bug report :)
<br>
</blockquote>
Here you go:
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a href="http://bugs.freepascal.org/view.php?id=23933">http://bugs.freepascal.org/view.php?id=23933</a>
:-)<br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Ewald
</pre>
</body>
</html>