Sepehr_b
Member
Hi,
In my code, I came into that it skips (ignores) my IF conditions and executes the next line after that. I tried many parts and finally could make the IF condition visible to the compiler by adding a dummy function before IF conditions. see the code bellow :
and the doNothing is :
if I comment the fn.DoNothing calls, the the following IF condition lines are agnored!
I am using B4A ver 12.80
I wonder why!?!?!
In my code, I came into that it skips (ignores) my IF conditions and executes the next line after that. I tried many parts and finally could make the IF condition visible to the compiler by adding a dummy function before IF conditions. see the code bellow :
ambigious IF blockes:
Private Sub etBarcode_EnterPressed
Try
If etBarcode.Text.Length > 0 Then
Dim OkYet As Boolean = True
' check the format (lenght and starting characters)
Fn.DoNothing
If OkYet = True And (etBarcode.Text.Length <> 13 Or etBarcode.Text.CharAt(0) <> "3") Then
Fn.ErrorTone("شناسه رهگیری باید بک عبارت عددی 13 رقمی باشد و با 3 شروع میشود")
OkYet = False
End If
' check if it is in current list and repeating barcode
Fn.DoNothing
If OkYet = True Then
Dim FDSID As Int = Fn.IfNull(B4XPages.MainPage.db.ExecQuerySingleResult($"Select FDSID FROM FactorDetailSerials WHERE FId = ${FId} And SmtTC = '${etBarcode.Text}'"$),0)
If FDSID > 0 Then
clv_ItemClick (lstFDSID.IndexOf(FDSID) ,FDSID)
clv.ScrollToItem(lstFDSID.IndexOf(FDSID))
Fn.okTone($"شناسه رهگیری ${etBarcode.Text} قبلا در این فاکتور ثبت شده است و تکراری است!"$)
OkYet = False
End If
End If
Fn.DoNothing
If OkYet = True Then ' get the TC info from server or create it and get the created info
Dim NeedUpload As Boolean = False
' first, query the PartSerial info from server
Dim mapPartSerial As Map
mapPartSerial.Initialize
...
...
and the doNothing is :
DoNothing:
Public Sub DoNothing()
' this routine do nothing
' this is used in some if - end ifs
End Sub
if I comment the fn.DoNothing calls, the the following IF condition lines are agnored!
I am using B4A ver 12.80
I wonder why!?!?!