Italian [risolto] B4J - esiste debug mode

ivanomonti

Expert
Licensed User
Longtime User
ciao Ragazzi, lo so che sono un rompipalle, ma ho bisogno di sapere una cosa, Debug mode esiste via codice?

esempio
B4X:
if debugmode= true then
var1 = "xxx"
var2 = "aaa2
else
var1=null
var2=null
end if
 

ivanomonti

Expert
Licensed User
Longtime User
B4X:
#IF DEBUG
    Public Const debugMode As Boolean = True
#End If

#IF RELEASE
 Public Const debugMode As Boolean = False
#End If
 

udg

Expert
Licensed User
Longtime User
Se vuoi puoi includere direttamente il codice delle varianti di var1/var2 nei simboli condizionali #IF DEBUG/#IF RELEASE evitando di utilizzare debugMode
 

LucaMs

Expert
Licensed User
Longtime User
Si può anche usare:
B4X:
' Questo, ovviamente, nel caso avessi altre "variabili" da confrontare.
#IF DEBUG
    Public Const debugMode As Boolean = True
#ELSE IF RELEASE
    Public Const debugMode As Boolean = False
#End If

oppure

B4X:
#IF DEBUG
    Public Const debugMode As Boolean = True
#ELSE
    Public Const debugMode As Boolean = False
#End If
 

ivanomonti

Expert
Licensed User
Longtime User
wow grazie avevo risolto ma sempre utile per tutti
 
Top