|
So I'm thinking a loop will work for this issue, but I do not have ANY experience creating loops.
Here's the situation:
I have a string field that is an array of numbers separated by a comma. For instance: "250.00, 150.00, 50.00"
How could I create a loop to calculate the sum of the numbers in the array, 450.00?
If you have any other solution besides a loop, please post. I'm not committed to the loop, but I saw it as the most effective way.
Thanks.
|
|
Okay, so scratch the initial question. I have a formula to add the array. Now I need to know if there is a way to create an array out of a comma delimited string variable?
Here is the Loop to add the array:
whileprintingrecords; Global stringVar Array x := ["250.00" , "150.00", "50.00"]; global numbervar Total := 0;
numbervar h;
FOR h := 1 to UBound(x) do ( Total := Total + ToNumber(x[h]); );
Total;
The problem remains that i do not know the values the array will be
consisted of, so I cannot plug into the formula as above. I am creating a
string variable of the numbers and need to create an array out fo the
string variable and use it in the above formula.
Thanks.
Edited by FrnhtGLI - 19 Sep 2011 at 10:15am
|