Android Question Undisplayed error in B4A V9.80 (bug?)

strupp01

Active Member
Licensed User
Longtime User
I have dimensioned a program.
B4X:
    Dim Dargestellter_Monat_rechte_Seite_Ticks As Long

After changes, I thought that dimensioning was no longer required and commented it out.
B4X:
'    Dim Dargestellter_Monat_rechte_Seite_Ticks As Long

No error is displayed, although this parameter still exists in the program.
1589705223165.png


No error is displayed when compiling, the program is compiled and is executable. The parameter is not taken into account in the running program and therefore leads to incorrect results.

Is that normal ?

Greetings strupp01
 

strupp01

Active Member
Licensed User
Longtime User
Thanks @Erel for your answer. I will consider more. However, there are also messages that are incorrect.

B4X:
            'Feiertage überprüfen
            Dim TempDayStart As Long
            Dim Treffer As Boolean = True
            Do While Treffer = True
                Treffer = False
                DateTime.DateFormat = "dd.MM.yyyy c"
                MONATSANFANG = DateTime.Date(FirstDayOfMonth)
                MONATSENDE = DateTime.Date(LastDayOfMonth)
                        TempDay = FirstDayOfMonth
                
                If MONATSANFANG.SubString(11) = "Sa" Then
                    FirstDayOfMonth = DateTime.Add(TempDay,0,0,2)
                    MONATSANFANG = DateTime.Date(FirstDayOfMonth)
                    Treffer = True
                Else
                    If MONATSANFANG.SubString(11) = "So" Then
                        FirstDayOfMonth = DateTime.Add(TempDay,0,0,1)
                        MONATSANFANG = DateTime.Date(FirstDayOfMonth)
                        Treffer = True
                    End If
                End If
                

                Dim Erstes_Datum, Datums_Veraenderung As String
                Dim Jahreszahl As Int
                Jahreszahl = MONATSANFANG.SubString2(6, 10)
                Erstes_Datum = MONATSANFANG.SubString2(0,10)
                Datums_Veraenderung = "voraus"
                
                FeiertageBerechnen(Jahreszahl, Erstes_Datum, Datums_Veraenderung)

                If Ausgabe_Zahl <> 0 Then
                    FirstDayOfMonth = Ausgabe_Zahl
                    Datum_zum_sortieren_next_Transaktion = Ausgabe_Zahl
                    Label_Datum_next_Transaktion = Ausgabe_Zeile
                    Treffer = True
                End If
                TempDayStart = Datum_zum_sortieren_next_Transaktion
            Loop

In the example, the variable 'TempDayStart' is declared in line 97 and is used in line 133. However, the protocol says

1589712960950.png
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
The warning #9 means that the variable has not been used.
There are three steps:
1. Declere the variable: Dim TempDayStart As Long
2. Assign a value to the variable: TempDayStart = Datum_zum_sortieren_next_Transaktion
3. Using the variable, for example: NewDayStart = TempDayStart

In your code point 3 is missing, therefore warning #9.
 
Upvote 0
Top