d2_s
04-03-2006, 01:10 AM
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
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