Quantcast
Channel: Indigo Rose Software Forums - Forums
Viewing all articles
Browse latest Browse all 2105

Get integers via for Loop or Array Need Help

$
0
0
I have paragraph's that contains a number, i want to get and add those numbers, here is my implementation i will just use 3 paragraph for example.

par1 = String.ToNumber(Paragraph.GetText("Paragraph1"))
par2 = String.ToNumber(Paragraph.GetText("Paragraph2"))
par3 = String.ToNumber(Paragraph.GetText("Paragraph3"))

Total = par1+par2+par3

so that total will be the sum of 3 paragraph.
But how to achieve it using for loop for array? i am now practising Loop or array is there way to get those value in Array or for Loop ways?

i try this in array:
Total = { "Paragraph1", "Paragraph2", "Paragraph3"}

newTotal = String.ToNumber(Total)
Paragraph.SetText("Total", newTotal);

not work


also this

for count =1, 3 do
newTotal = String.ToNumber(Paragraph.GetText("Paragraph"..cou nt))
end

Paragraph.SetText("Total", newTotal);

not work


Thanks

Viewing all articles
Browse latest Browse all 2105

Trending Articles