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
Checked value is stored in DataList_1 as "True"
After reading the file
with the ListATSet.Get (0) command I find the value 0x1 (HEX) - not "True"
Code:
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:
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:
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
B4X:
DataList_1.Clear
DataList_1.Add(Switch1.Checked)
File.WriteList (File.DirDocuments, <file_name>, DataList_1)
After reading the file
B4X:
DataList_1 = File.ReadList (File.DirDocuments, <file_name>)
Code:
B4X:
Switch1.Checked = ListATSet.Get (0)
No error is reported for this record.
The error will appear only when I write directly in the code:
B4X:
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:
B4X:
Variable1 = DataList_1.Get(0)
' false 1(0x1) <----result
Last edited: