B4J Question B4j Debug and B4j Build Standalone Package

RauchG

Active Member
Licensed User
Longtime User
Hello, everyone,
in a (B4X) B4j project I want to change the text color of a button when it is opened. It works in debug mode. Not in the Build Standalone Package. The same with Visible.
Has anyone ever had this?

B4X:
Private Sub B4XPage_Appear
    ShowTable
   
    mIntCount = SQL1.ExecQuerySingleResult("SELECT count(*) FROM tblmonatjahr WHERE monat = '" & mMounth & "' AND jahr = '" & mYear & "'")
    If mIntCount = 1 Then
        btnNeuerMonat.TextColor = fx.Colors.RGB(255,0,0)
        btnNeuerMonat.Enabled = False
'        btnNeuerMonat.Visible = False
    Else
        btnNeuerMonat.TextColor = fx.Colors.RGB(0,0,0)
        btnNeuerMonat.Enabled = True
'        btnNeuerMonat.Visible = True
    End If


End Sub
 

Attachments

  • Debug.png
    Debug.png
    75.5 KB · Views: 70
  • Standalone.png
    Standalone.png
    74.7 KB · Views: 64

RauchG

Active Member
Licensed User
Longtime User
I found the mistake.
The query in B4XPage_Appear did not work without the new DateTime calculation (only in Build Standalone Package).

B4X:
Private Sub B4XPage_Appear
    Dim l As Long
    l = DateTime.DateParse(mNewDate)
    mMounth = DateTime.Date(l)
    DateTime.DateFormat="MMM"
    mMounth    = DateTime.Date(l)
    Log(mMounth)

    DateTime.DateFormat="yyyy"
    mYear = DateTime.Date(l)
    Log(mYear)

    SQL1.InitializeSQLite(xui.DefaultFolder, "ausgaben.db3", True)
    
    'Der neue Monat ist schon in der Tabelle
    mIntCount = SQL1.ExecQuerySingleResult("SELECT count(*) FROM tblmonatjahr WHERE monat = '" & mMounth & "' AND jahr = '" & mYear & "'")

'    xui.MsgboxAsync(mIntCount, mIntCount)
    If mIntCount = 1 Then
        MP.btnNeuerMonat.Enabled = False
        MP.btnNeuerMonat.Color = xui.Color_Red
    Else
        MP.btnNeuerMonat.Enabled = True
        MP.btnNeuerMonat.Color = xui.Color_Black
    
    End If

    ShowTable
    
End Sub
 
Upvote 0

RauchG

Active Member
Licensed User
Longtime User
Hello, everyone,
I have a new problem with B4X(B4j). When creating abbreviations for months, in the debug show me the German abbreviations (that's how I need it). Build Standalone Package shows the abbreviations in English.
Can someone please help
Greetings Rauch G
 
Upvote 0
Top