Saving contents of 2 edit text boxes to one file name.

bodycode

Member
Licensed User
Longtime User
Hi. I'm trying to develop an app that needs to load and save the contents of two edit text boxes to one file name. Is that possible?
 

netchicken

Active Member
Licensed User
Longtime User
This is a great bit of code!
The potential for it to save editing or as a backup while data entering is great.
Something like this should work for you. Be sure to change all the EditText names to whatever you like.

B4X:
Sub Globals
      Dim sets As Map
      sets.Initialize
End Sub

Sub savebtns
      sets.Clear
      sets.Put("EditText1", EditText1.Text)
      sets.Put("EditText2", EditText2.Text)
      File.WriteMap(File.DirInternal, "btnset.set", sets)
End Sub

Sub loadbtns
      sets = File.ReadMap(File.DirInternal, "btnset.set")
      EditText1.Text = sets.Get("EditText1")
      EditText2.Text = sets.Get("EditText2")
End Sub
 
Upvote 0
Top