V2.70 Warning issues

Scantech

Well-Known Member
Licensed User
Longtime User
I did lot of clean up with the warning system, however some of them do not make sense to me.

Unused variable for startX, startY and lastX??? It is in the Panels_Touch event

B4X:
Sub Globals
     Dim startX, startY, lastX As Float

B4X:
Sub Panels_Touch (Action As Int, X As Float, Y As Float)

   Select Action
      Case Activity.ACTION_DOWN
         startX = X
         lastX = Round(X)
         startY = Y

Can we have a feature to dismiss some of the unnecessary warning such as files attached. I have over 30 fonts and the whole log screen is filled up with this warning message "File is not used". But it is used but not shown in the coding.


Here is another one

B4X:
ab.SubTitle = "Profile: " & tmpName

Subtitle is CharSequence, but you can pass string to it, also?

I will see if I can spot anymore. Good job, Erel.
 
Last edited:

corwin42

Expert
Licensed User
Longtime User
ab is AHActionBar i think. Title and Subtitle properties are declared as CharSequence. If you assign a String to these properties you get a warning in 2.70
 

Scantech

Well-Known Member
Licensed User
Longtime User
Yes, ab is AHActionBar.

I think it is ok with this. I should post the whole code next time :). I need to remove 2 of the variable. Warning is for startX and lastX only.

B4X:
Sub Panels_Touch (Action As Int, X As Float, Y As Float)

   Select Action
      Case Activity.ACTION_DOWN
         startX = X
         lastX = Round(X)
         startY = Y
         'ACTION BAR
         tmrABHide.Enabled = False
         tmrABHide.Enabled = True
         If ab.Visible = False Then 
            ab.Visible = True
         End If
         
         
      Case Activity.ACTION_UP         
         If pnlGaugeControl.Visible = True Then 
            'Anim_ControlPanel_Hide
            pnlGaugeControl.Visible = False
         End If
         
         If isPortraitLayout = True Then
            'PORTRAIT
            If (Y - startY) > 30%y Then
               'SLIDE DOWN
               mnuOBDMenu_Click
            Else If (startY - Y) > 30%y Then         
               'SLIDE UP
               PanelControlShow
            End If
         Else
            'LANDSCAPE
            If (Y - startY) > 40%y Then
               'SLIDE DOWN
               mnuOBDMenu_Click
            Else If (startY - Y) > 40%y Then         
               'SLIDE UP
               PanelControlShow
            End If         
         End If

   End Select
End Sub


Here is another one.

Warning #17. File "None" is missing from file tab?? Maybe you fixed this one already.
B4X:
Description = J1979Definition.GetSAECodeDescription(DTCValue, File.DirAssets, "None")

B4X:
Sub GetSAECodeDescription(Code As String, FilePath As String, FileName As String) As String
   If FileName = "None" Then
      FileName = "SAE OBD II CODES.dat"
   End If
   
   Dim Description As String
   Description = ReadIni(Code, FilePath, FileName, "No Description Available")
   Return Description
End Sub
 
Last edited:
Top