Please help!

DarkKnight

New Member
:sign0085:
I want to do a save and load button that would save numbers and button colors (I made that buttons that are pressed change their color ). So you could save and close the program and then load the save
Is that possible? :confused:
 

Johnmcenroy

Active Member
Licensed User
Longtime User
There are a lot of ways to do this: SQL , Map , List.

For example you can create map similar to this:

B4X:
Button.Tag = Certain_Color
Label.Tag = Certain_Color

and save it to memory, then load when activity starts. The easiest solution. The more advanced is with SQL.

Useful Class for saves using maps:
http://www.b4x.com/forum/basic4andr...fficient-key-value-data-store.html#post152277

Edit: If you will save color as 255,255,255,255 you can then read saved map with this value and split into numbers with regex.split
B4X:
Dim s() As String
       s = Regex.Split (",","255,255,255,255)
       Colors.ARGB (s(0),s(1),s(2),s(3))

Best regards
 
Last edited:
Upvote 0

DarkKnight

New Member
Thanks

There are a lot of ways to do this: SQL , Map , List.

For example you can create map similar to this:

B4X:
Button.Tag = Certain_Color
Label.Tag = Certain_Color

and save it to memory, then load when activity starts. The easiest solution. The more advanced is with SQL.

Useful Class for saves using maps:

Edit: If you will save color as 255,255,255,255 you can then read saved map with this value and split into numbers with regex.split
B4X:
Dim s() As String
       s = Regex.Split (",","255,255,255,255)
       Colors.ARGB (s(0),s(1),s(2),s(3)

Best regards

Thanks! And I saw you're apps, they're great! And if you could, could you explain more or put a link on a video tutorial or make a video explaining or shoeing hours to do it your self,
Thanks for helping!
 
Upvote 0
Top