Quote:
Originally Posted by Stellaferox
I fear I keep bugging you all with questions.......
|
If you declare the columns as cNumber first, the loaded data is treated as numbers and not as a string, even it is bigger than an int.
I tested this
Code:
Sub App_Start
Table1.AddCol(cNumber, "Col1", 100)
Table1.AddCol(cNumber, "Col2", 100)
Table2.AddCol(cNumber, "Column1", 0)
Table2.AddCol(cNumber, "Column", 0)
Table1.LoadCSV("test1.txt", "," ,False, False)
Table1.TableSort("Col1 ASC")
Form1.Show
For i = 0 To Table1.RowCount - 1
Table2.AddRow(Table1.Cell("Col1",i),Table1.Cell("Col2",i))
Next
Table2.SaveCSV("test2.txt", "," ,False)
End Sub
with this data
Code:
201315439073333,201315439073333
10131543907,10131543907
999999999999999,999999999999999
555555555555555,555555555555555
12131543907,12131543907
5,5
999912131543907,999912131543907
4,4
20131543907,20131543907
12131543907,12131543907
202315439073333,202315439073333
121,121
This works fine as long as the table does not use exponentials to store its numbers, e.g due to a row of 9999999999999999,9999999999999999.
In this case the sorting is still ok but the exponential view is written bach to the new file.
specci48