saving textfile

volvomann

Active Member
Licensed User
Longtime User
Hallo

I use this code to save and open my file


B4X:
 Map1.Put(("Verdier for veke "&(lagreveke)),"" )
        Map1.Put("Din Bmi ","" &Round(bmi) )
            Map1.Put("Din makspuls ",""& Round(svar1) )
             Map1.Put("Din fitnesindex",""& Round(svar))                 
               Map1.Put("Din fitneskatt.","" & EditText11ukk.Text)
                Map1.Put("Pulssone lett",""& (Round(lett1) & " " & Round(lett2) ))
                Map1.Put("Pulssone AT",""& (Round(at1)& " " &Round(at2)))
            Map1.Put("Pulssone vo2m",""& (Round(vo1)&" " &Round(vo2)))

Thats ok but is there a chanse to get the textfile in same order when it been open in a textreader?
 

volvomann

Active Member
Licensed User
Longtime User
You should then go over the items in the Map and manually write them to a file:
B4X:
   Dim list1 As List
   list1.Initialize
   For i = 0 To map1.Size - 1
      list1.Add(map1.GetKeyAt(i) & "=" & map1.GetValueAt(i))
   Next
   File.WriteList(..., ..., list1)
This will only work if the keys do not contain the '=' character.

Sorry if i Asked stupid questions but do i have to save 2 files one for my app and one for the computer:eek:
 
Upvote 0

volvomann

Active Member
Licensed User
Longtime User
You do not need to make two copied. Save the file in the external storage and then you will be able to send it.

I dont get this ting to work corectly if I use writhemap /Readmap2 the text in the messageox are ok and the textfile in caos, If I use writhelist the textfile is ok and the mesagebox is ok, how can I get both off them to work
corecly Please help me. sorting the textfile is the last thing to do ¨with my APP :D
 
Upvote 0

volvomann

Active Member
Licensed User
Longtime User
Isn't this what you want?[/QUOTE

No It is wrong It shudd ben If I use writhelist the textfile is ok and the mesagebox is not ok and whith map file is not ok and box is ok. I have tried so many things so i dont no what to do. If I sent the textfile that looks ok in the fone, evrything is in one line when i read it in the computer. Can one one give som good adwice.
 
Upvote 0
Top