Question about table control

EzCoder

Member
Licensed User
Longtime User
First of all, let me say **Thank You!** for such a fantastic product!
The more I use it, the better I like it. :)
:sign0098:

On with the question...
I've been doing some testing of the table control, converting data from one delimited format to another (piped to tabbed, comma to piped, etc...) and ran across an oddity that I need some help with. As the example I've attached shows, I can easily sort the table on a given column and it works flawlessly. However, once the table is sorted, saving the results (Table1.SaveCSV) does not save the data as sorted in the table.

Here's my code with some sample data tagged onto the end:
B4X:
Sub Globals
   'Declare the global variables here.

End Sub

Sub App_Start
   Form1.Show
   Table1.Height = 200
   Table1.Width = 240
   Table1.Visible = true
   Table1.Enabled = true
   Table1.Color = 255,255,255
   Table1.HeaderColor = 100,200,222
   Table1.LinesColor = cGold
   Table1.LoadCSV ("data1.csv", "|", True, True)

   AddButton (Form1, "Button1", 20, 220, 100, 30, "Click Me!")
   Button1.color= Form1.Color
   AddEvent ("Button1", Click, "ButtonsClick")
   
   
End Sub

Sub ButtonsClick
'I = Asc ("9")
Table1.TableSort ("PartNumber ASC")
Table1.SaveCSV ("exporteddata.csv", Chr(9),False)'tabbed format
End Sub

'Sample Data Used For Testing:
'
'Whse|PartNumber|OnHand|
'2|100602-0025|1|
'2|10A902-1618|1|
'4|10A982-1650|18|
'2|10A982-1650|2|
'2|118432-0035|1|
'4|118432-0035|3|
'4|118432-0036|1|
'2|118432-0060|1|
'4|118432-0140|28|
'4|121312-0060|11|
'1|121312-0060|36|
'4|124335-8104|6|
'2|124335-8101|1|
'2|124335-8104|9|
'2|125K02-0005|3|
'2|125K02-0015|2|
'2|125K07-0060|1|
'4|125K07-0060|1|
'2|126302-0279|1|
'4|126312-0023|12|
'2|126312-0023|1|
'2|126312-0023|1|

It seems that once the table has been sorted, it would save the same way...
Am I just missing something again?

Ez
 
Top