+ Reply to Thread
Results 1 to 5 of 5

Thread: Converting a String to an Integer

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Converting a String to an Integer

    Is it possible a string into an integer via a setup builder function?

    I am looping through a list of files and for each file and setting the size via the "ScriptItem->Get File Information( File Size )" function however return value is actually a String and not an integer. I am using a variable called %TOTAL_FILE_SIZE% intialised to zero to store the cumulative total ... however instead of adding integers it is doing a string concatenation.

    For example:
    Say I am adding the size of 3 files, 1 is 100 bytes, 2 is 300 bytes and 3 is 550 bytes. Instead of giving me a total of 950 bytes it gives me a result "0 + 100 + 300 + 550". Is there any way to convert a string to an integer or to get the variable to treat this calculation as integer addition and not string concatenation?

    Thanks

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Converting a String to an Integer

    Hello,

    Would it be possible for you to send a small demo script to support (at) lindersoft (dot) com?

    Thanks,

  3. #3
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Converting a String to an Integer

    Re-read your message. Do you use the "Evaluate Expression" operation in your Set Variable function?

    Thanks,

  4. #4

    Default Re: Converting a String to an Integer

    Quote Originally Posted by linder
    Re-read your message. Do you use the "Evaluate Expression" operation in your Set Variable function?

    Thanks,
    Thank goodness for you help Friedrich

    Turns out I didn't have the "evaluate expression" option selected. All is well now. Thankyou again!
    Last edited by d2_s; 04-03-2006 at 08:17 PM.

  5. #5

    Default Re: Converting a String to an Integer

    -
    Last edited by d2_s; 04-04-2006 at 12:41 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. String resource problem in 1180 redux: Resource Group destroyed
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 4
    Last Post: 07-07-2005, 04:39 AM
  2. String Functions RSlash call display
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 1
    Last Post: 05-18-2005, 08:23 AM
  3. InStr cannot use a variable search string?
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 1
    Last Post: 04-23-2005, 07:28 AM
  4. Bug: Ready to Install displays "&" in Setup Type string
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 1
    Last Post: 02-03-2005, 02:03 AM
  5. Bug: Ready to Install displays "&" in Setup Type string
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 0
    Last Post: 02-01-2005, 02:41 AM

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •