New to xojo and programming. Am practicing using listbox. In the lists box, there are four columns. I use the following code to sum the content of each column i.e. 0,0 to 30,0; 0,1 to 30,1; 0,2 to 30,2; 0,3 to 30,3. The contents of each columns are summed perfectly. However, the challenge is when I was trying to sum the results of the 4 columns the result appears to be in string form. E.g, 1000+1000, the result will appear 10001000 instead of 2000. I went through the forum and haven’t found something to get me through. Kindly help me out.
Dim total1, total2, total3, total4, total5 As Double
Dim i as integer
For i = 0 to ListBox1.ListCount-1
//column1
total1 = total1 + Val(ListBox1.Cell(i,0))
Label1.value = Format(total1, “$###,###0.00)
//column2
total2 = total2 + Val(ListBox1.Cell(i,1))
Label2.value = Format(total2, “$###,###0.00)
//column3
total3 = total3 + Val(ListBox1.Cell(i,2))
Label3.value = Format(total3, “$###,###0.00))
//column 4
total4= total4+ Val(ListBox1.Cell(i,3))
Label4.value = Format(total4, “$###,###0.00))
Label5.value= Label1.value + Label.value + Label3.value + Label4.value