Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: UnicodeString.ToInt, what formats does it support?


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Jan 31, 2017 1:18 PM Last Post By: Goran Ekstrom Threads: [ Previous | Next ]
Goran Ekstrom

Posts: 149
Registered: 1/10/04
UnicodeString.ToInt, what formats does it support?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2017 7:26 AM
Hi,
the help isn't that informational for UnicodeString.ToInt, what notations does is support?

Regards
Goran
Jan Dijkstra

Posts: 206
Registered: 11/4/99
Re: UnicodeString.ToInt, what formats does it support?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2017 8:01 AM   in response to: Goran Ekstrom in response to: Goran Ekstrom
Goran Ekstrom wrote:
Hi,
the help isn't that informational for UnicodeString.ToInt, what notations does is support?

Regards
Goran

A simple sequence of digits, optionally preceded by a '+' or '-' sign. Leading white space is skipped. Any trailing character, including white space, causes an exception.
Goran Ekstrom

Posts: 149
Registered: 1/10/04
Re: UnicodeString.ToInt, what formats does it support?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2017 8:06 AM   in response to: Jan Dijkstra in response to: Jan Dijkstra
Jan Dijkstra wrote:
Goran Ekstrom wrote:
Hi,
the help isn't that informational for UnicodeString.ToInt, what notations does is support?

Regards
Goran

A simple sequence of digits, optionally preceded by a '+' or '-' sign. Leading white space is skipped. Any trailing character, including white space, causes an exception.

OK but what notations? By experiment I noted it accepts ASCII hex as 0x12345 but I was looking for a more definitive info.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: UnicodeString.ToInt, what formats does it support?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2017 10:08 AM   in response to: Goran Ekstrom in response to: Goran Ekstrom
Goran wrote:

the help isn't that informational for UnicodeString.ToInt,
what notations does is support?

UnicodeString::ToInt() is just a wrapper for System::Sysutils::StrToInt(),
whose documentation lists the supported notations:

http://docwiki.embarcadero.com/Libraries/en/System.SysUtils.StrToInt

'S' must be an integer number, in either decimal or hexadecimal (see below)
notation, with an optional sign ("-" or "+") at the beginning. Decimal or
thousand separators are not supported. If 'S' does not represent a valid
number, 'StrToInt' raises an 'EConvertError' exception.

'StrToInt' supports strings in the following hexadecimal notations:

Delphi: $1234 and 0x1234.

C++: 0x1234.

--
Remy Lebeau (TeamB)
Goran Ekstrom

Posts: 149
Registered: 1/10/04
Re: UnicodeString.ToInt, what formats does it support?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 31, 2017 1:18 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
UnicodeString::ToInt() is just a wrapper for System::Sysutils::StrToInt(),
whose documentation lists the supported notations:

http://docwiki.embarcadero.com/Libraries/en/System.SysUtils.StrToInt

Exactly what I was looking for, thanks!
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02