iOS Question Handling INI Files in IOS

pbsys

Member
Licensed User
Hello guys, hope all of you are doing great!!

I am a new user of B4i and I have a question regarding how to use INI files (if there's any chance) in IOS...I have a code that I am using in b4a but I cannot find a way to do the same in b4i, I really appreciate your help or guidance with this issue...
Thanks in advance,

code:
Sub WriteIni(mykey As String,myvalue As String,fPath As String,filename As String)
Dim Map1 As Map
Map1.Initialize
If File.Exists(fPath,filename) Then
Else
File.WriteMap(fPath, filename, Map1) 'to create it if not exist
End If
Map1 = File.ReadMap(fPath,filename)
Map1.Put(mykey, myvalue)
File.WriteMap(fPath, filename, Map1)
End Sub
'--------------------------------------------------------------------
Sub ReadIni(key As String,fPath As String,filename As String)
Dim Map1 As Map
Map1 = File.ReadMap(fPath,filename)
For i = 0 To Map1.Size - 1
If Map1.GetKeyAt(i) = key Then
Return Map1.GetValueAt(i)
End If
Next
End Sub
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

pbsys

Member
Licensed User
Hello Erel,

Thank you very much for your fastest response. I will take note about next time when posting code to put it in the correct tags.

Regarding to my problems, it was solve thanks to your advice.

Once again, thank you for the help and fast response.
Take Care,
 
Upvote 0
Top