iOS Question Adding a row to csv (table) fails

John Woodsmall

Active Member
Licensed User
Longtime User
I have a csv table (history.csv) that I want to keep as a record on the phone.
After I have the data in the phone I want to add a row to the table. then at
a later date I want to view and retrieve the data. The file is empty but for the column headers.
(First_name,Last_name,birth_date,birth_time,birth_state,birth_st_abv,birth_city)
This:"AddTofile_click" fails when it is run:


Table4.SetColumnsWidths(Array As Int(25%x, 15%x, 9%x, 14%x, 9%x, 14%x, 14%x))
Table4.Initialize(Me, "Table4", 1)
Table4.AddToParent(Page4.RootPanel, 0, 0dip, 100%x, 75%y)
Table4.LoadTableFromCSV(File.DirAssets, "History.csv", False)


Sub AddTofile_click
' First_name,Last_name,birth_date,birth_time,birth_state,birth_st_abv,birth_city
Table4.AddRow(Array As String("John","Woodsmall","08/12/1942","16:25:00","Texas","TX","Houston"))
'Table4.AddRow(Array As String("John,Woodsmall,08/12/1942,16:25:00,Texas,TX,Houston"))
Table4.SaveTableToCSV(File.DirAssets, "History.csv")
End Sub

Sub Show_file_click
'Table4.SetColumnsWidths(Array As Int(100dip, 30dip, 130dip, 100%x - 260dip))
'Table4.Initialize(Me, "Table4", 1)
'Table4.AddToParent(Page4.RootPanel, 0, 0dip, 100%x, 75%y)
'Table4.LoadTableFromCSV(File.DirAssets, "History.csv", False)
'Table4.Initialize(Me, "Table4", 1)
'Table4.AddToParent(Page4.RootPanel, 0, 0dip, 100%x, 75%y)
Table4.LoadTableFromCSV(File.DirAssets, "History.csv", False)
NavControl.ShowPage(Page4)
Sub End
 

John Woodsmall

Active Member
Licensed User
Longtime User
ok

But where can i write to a file on the phone?
thanks

I have a csv table (history.csv) that I want to keep as a record on the phone.
After I have the data in the phone I want to add a row to the table. then at
a later date I want to view and retrieve the data. The file is empty but for the column headers.
(First_name,Last_name,birth_date,birth_time,birth_state,birth_st_abv,birth_city)
This:"AddTofile_click" fails when it is run:

B4X:
Table4.SetColumnsWidths(Array As Int(25%x, 15%x, 9%x, 14%x, 9%x, 14%x, 14%x))
Table4.Initialize(Me, "Table4", 1)
Table4.AddToParent(Page4.RootPanel, 0, 0dip, 100%x, 75%y)
Table4.LoadTableFromCSV(File.DirAssets, "History.csv", False)


Sub AddTofile_click
' First_name,Last_name,birth_date,birth_time,birth_state,birth_st_abv,birth_city
Table4.AddRow(Array As String("John","Woodsmall","08/12/1942","16:25:00","Texas","TX","Houston"))
'Table4.AddRow(Array As String("John,Woodsmall,08/12/1942,16:25:00,Texas,TX,Houston"))
Table4.SaveTableToCSV(File.DirAssets, "History.csv")
End Sub

Sub Show_file_click
'Table4.SetColumnsWidths(Array As Int(100dip, 30dip, 130dip, 100%x - 260dip))
'Table4.Initialize(Me, "Table4", 1)
'Table4.AddToParent(Page4.RootPanel, 0, 0dip, 100%x, 75%y)
'Table4.LoadTableFromCSV(File.DirAssets, "History.csv", False)
'Table4.Initialize(Me, "Table4", 1)
'Table4.AddToParent(Page4.RootPanel, 0, 0dip, 100%x, 75%y)
Table4.LoadTableFromCSV(File.DirAssets, "History.csv", False)
NavControl.ShowPage(Page4)
Sub End
 
Upvote 0
Top