String to integer conversion

Posted on 2005-05-11
Last Modified: 2010-04-05
We are using and need to convert a string value to an integer. Any ideas on how please as strtoint etc. does not seem to work

Best regards
Question by:Paul-Brooks
    LVL 15

    Expert Comment

    Well I have noticed now that most of the .net functions happen at the end of string objects such as

    sString := Trim(sString)
    is now
    sString := sString.Trim();

    so maybe it is something like
    iInt := sString.StrToInt()

    Have a look at the methods that get exposed when you do sString.
    LVL 6

    Accepted Solution

    Are you sure you have SysUtils in your Uses Clause ?
    LVL 15

    Expert Comment

    How about
    iInt := CInt(sString)

    Author Comment

    That is exactly the problem. Cant see the wood from the tree's im afraid :)
    LVL 6

    Expert Comment

    Sometimes the biggest problems have the simplest answers, don't they ? ;-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
    Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now