Hi everyone
In B4i I am using the Switch As B4XView object and I have a problem with its basic property:
- "Value" is in the Visual Designer ("Checked" is missing)
- in the IDE (code) "Checked" is available ("Value" is missing)
When writing to a file
DataList_1.Clear
DataList_1.Add(Switch1.Checked)
File.WriteList (File.DirDocuments, <file_name>, DataList_1)
Checked value is stored in DataList_1 as "True"
After reading the file
DataList_1 = File.ReadList (File.DirDocuments, <file_name>)
with the ListATSet.Get (0) command I find the value 0x1 (HEX) - not "True"
Code:
Switch1.Checked = ListATSet.Get (0)
does not work properly: the "Switch1.Checked" will still be "False" despite typing 0x1
No error is reported for this record.
The error will appear only when I write directly in the code:
Switch1.Checked = 1 ' (or 0x1).
Could the slight difference in the availability of "Value" and "Checked" (in Switch1) have something to do with the fact that I write to the file "true" and read "0x1"?
assignment to a Boolean variable also fails:
Variable1 = DataList_1.Get(0)
' false 1(0x1) <----result