Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8359067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:01:16+00:00 2026-06-09T11:01:16+00:00

just curious why the following code fails to convert uint64 value in string representation

  • 0

just curious why the following code fails to convert uint64 value in string representation ?

var
  num: UInt64;
  s: string;
  err: Integer;

begin
  s := '18446744073709551615';  // High(UInt64)
  Val(s, num, err);
  if err <> 0 then
    raise Exception.Create('Failed to convert UInt64 at ' + IntToStr(err));  // returns 20
end.

Delphi XE2

Am I missing something here ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:01:19+00:00Added an answer on June 9, 2026 at 11:01 am

    According to the documentation,

    S is a string-type expression; it must be a sequence of characters that form a signed real number.

    I agree the documentation is a bit vague; indeed, what exactly does form mean, and exactly what is meant by a signed real number (especially if num is an integer type)?

    Still, I think the part to highlight is signed. In this case, you want an integer, and so S must be a sequence of characters that form a signed integer. But then your maximum is High(Int64) = 9223372036854775807

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just curious how you would comment this line of code: string customerNm = customerNm.EndsWith(s)
Just curious, why does the following code import sys class F(Exception): sys.stderr.write('Inside exception\n') sys.stderr.flush()
I'm just getting curious about the following code : public static class Container<T> {
I was just curious about this: the following code will not compile, because we
Just curious what is the best practice for solving the following issue. I have
Just curious, is there a format string I can use to output something like
I have the following code: private void SetControlNumbers() { string controlString = ; int
I have just encountered this following code: public class TestFinally { public static void
A glance at the source code for string.GetHashCode using Reflector reveals the following (for
The following code gives an unreachable statement compiler error public static void main(String[] args)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.