KMatle Expert Licensed User Longtime User Jan 26, 2017 #1 I've never asked for the reason As known File.WriteList will convert the values to strings. To me this makes no sense as a List can hold any data type. Is there a reason for that behaviour? (Maybe because the written file is a textfile?)
I've never asked for the reason As known File.WriteList will convert the values to strings. To me this makes no sense as a List can hold any data type. Is there a reason for that behaviour? (Maybe because the written file is a textfile?)
DonManfred Expert Licensed User Longtime User Jan 26, 2017 #2 You should use Randomaccessfile and here Writeb4xobject to write a List (with it´s items). Upvote 0
KMatle Expert Licensed User Longtime User Jan 26, 2017 #3 DonManfred said: You should use Randomaccessfile and here Writeb4xobject Click to expand... I wasn't precise enough The question is: Why is there a method (File.WriteList) when this method (does not work properly). Properly = Writing a List as it is. Upvote 0
DonManfred said: You should use Randomaccessfile and here Writeb4xobject Click to expand... I wasn't precise enough The question is: Why is there a method (File.WriteList) when this method (does not work properly). Properly = Writing a List as it is.
DonManfred Expert Licensed User Longtime User Jan 26, 2017 #4 KMatle said: Writing a List as it is. Click to expand... I guess in B4A 1 a list just could contains Strings. I dont know. I cant answer this WHY If you think this is an error than you can create a thread in the bug and wishlist forum. Upvote 0
KMatle said: Writing a List as it is. Click to expand... I guess in B4A 1 a list just could contains Strings. I dont know. I cant answer this WHY If you think this is an error than you can create a thread in the bug and wishlist forum.
Erel B4X founder Staff member Licensed User Longtime User Jan 27, 2017 #5 File.ReadList reads a text file and returns a list with its lines. File.WriteList writes a list to a text file where each item is written to a separate line. The answer to your question is that this is how these methods were designed (and documented). This behavior will never change. If you want to serialize a list then use B4XSerializator or RAF.WriteB4XObject. The result will be different. You will get a binary file. Upvote 0
File.ReadList reads a text file and returns a list with its lines. File.WriteList writes a list to a text file where each item is written to a separate line. The answer to your question is that this is how these methods were designed (and documented). This behavior will never change. If you want to serialize a list then use B4XSerializator or RAF.WriteB4XObject. The result will be different. You will get a binary file.