B4A Code Snippet External Storage Extras - max123    Apr 14, 2023   (4 reactions) This format makes it easy to edit it manually. ' One common usage of File.WriteMap is to save a map of "settings" to a file. 'Reads the file and returns its content as a string. 'Example:<code> 'Dim text As String = Storage.ReadString(Storage.Root, "myfile.txt")</code> Public Sub R B4A Question How can I Manage the Itemclick of the Customlistview created by map? - Mahares (first post)    Feb 27, 2022   (3 reactions) You cannot use File.ReadMap and File.WriteMap because your values are lists not strings. You have to use Serializator (need RandomAccessFile lib) to save the file and retrieve it.. See below code:
' Write map to file
Dim ser As B4XSerializator 'you need RandomAccessFile lbrary checked
Dim ty B4A Question Troubles with custom type and File.ReadMap, File.WriteMap - DonManfred (first post)    Jun 17, 2018   (1 reaction) https://www.b4x..png File. WriteMap (Dir As String, FileName As String, Map As Map)
Creates a new file and writes the given map. Each key value pair is written as a single line.
All values are converted to strings. B4J Question This logical conversion won't work. Why? - Erel (first post)    Nov 01, 2016   (1 reaction) File.WriteMap creates a text file. It will not work with raw bytes. You should use BytesToFile isntead: https://www.b4x./#content B4A Question Save Map with custom Type to file - DonManfred (first post)    Sep 29, 2022   (1 reaction) It will be ALL STRINGS after you save it this way.
https://www.b4x..png File. WriteMap (Dir As String, FileName As String, Map As Map)
Creates a new file and writes the given map. Each key value pair is written as a single line.
All values are converted to strings. <--- !!!
Use B4XSerializator to B4A Question Retrieving Type Data From File.ReadMap Gives Imcompatible Types Error - Erel (first post)    Mar 17, 2020 That's expected. As I wrote:
File.WriteMap / ReadMap is only good for simple values as it creates a text file. B4A Question XML -> MAP issue - William Lancee (first post)    Dec 17, 2023   (3 reactions) File.WriteMap converts all values to a string and saves one key: string-Value as a pair on each record/line in the file.
The List is converted to a string. When read it is still a string. When you log the list and string they look the same.
You need to use the B4XSerializator from the internal Ra B4A Question Using correctly File.WriteList - GiovanniPolese    Jun 02, 2024 Hi. My problem is to write on disk various Lists, in sequence, on same file. The saving sequence is: File.Delete(InternalWorkDir,FileUndo) File.WriteList(InternalWorkDir,FileUndo,Layers) File.WriteMap(InternalWorkDir,FileUndo,colorMap) b=rvs.ConvertObjectToBytes(layerMap.Size) ' jus B4A Question "compiletime.jar" does not store the correct time. - rosippc64a (first post)    Jul 10, 2021   (2 reactions) The comment line is from file.writemap(). It is autmatically saved. B4J Tutorial Working with files - Erel    Dec 10, 2015   (6 reactions) The File methods in B4J are identical to B4A File methods. Text file methods File.WriteString - Writes the given text to a new file. File.ReadString - Reads a file and returns it content as a string. File.WriteList - Writes all values stored in a list to a file. All values are converted to string Page: 1   2   3   4   5   6   7   Powered by ColBERT |