I have a Sub to create a Button. In Sub, create a Button according to a condition. If the condition is not met, returns a NULL. The code just like this:
----------------------------
Sub MyCreateButton(condition As String) As Button
Dim btn As Button
btn.Initialize("btn")
Select condition
Case "1"
btn.Text = "Some text 1"
btn.Color = Colors.Red
Case "2"
btn.Text = "Some text 2"
btn.Color = Colors.Yellow
Case Else
'Other value is not expected, so we return a NULL
btn = Null
End Select
Return btn
End Sub
----------------------------
Now I call this Sub like this:
----------------------------
Dim btn As Button
btn = MyCreateButton(EditText1.Text)
If btn = Null then
Msgbox("Bad value, Input again!", "")
Else
....... some code for using btn, omitted.
End If
----------------------------
The problem is that "If btn = Null" will be always False whether I input any value.