Have the following code, which shows the state of all databases in the app.
As this is displayed in a SQL edittext I don't want it to be formatted as SQL as that will make no sense.
This is done with the line:
cMP.cSQLEdit.bNoEDTFormatting = True
In Debug mode this won't work, so the text is formatted as SQL. In Release mode it all works fine, so no SQL formatting takes place.
I just wonder why this is and if there is something I could do to make it work OK in Debug mode.
RBS
As this is displayed in a SQL edittext I don't want it to be formatted as SQL as that will make no sense.
This is done with the line:
cMP.cSQLEdit.bNoEDTFormatting = True
B4X:
Sub ShowDatabasesStates
Dim i As Int
Dim strText As String
Dim iDBCount As Int
Dim bExtraDB As Boolean
'this doesn't prevent SQL formatting when in debug mode, fine when in release mode
cMP.cSQLEdit.bNoEDTFormatting = True
bExtraDB = cMP.cConn.strExtraDB.Length > 0
If bExtraDB Then
iDBCount = 5
Else
iDBCount = 4
End If
Dim arrDBState(iDBCount) As Int
For i = 0 To iDBCount - 1
arrDBState(i) = 1
Next
Select Case miDataBase
Case eDataBase.Main
arrDBState(0) = 0
Case eDataBase.NON_CLINICAL
arrDBState(1) = 0
Case eDataBase.KVS
arrDBState(2) = 0
Case eDataBase.MapnikOSM2
arrDBState(3) = 0
Case eDataBase.NewDB
arrDBState(4) = 0
End Select
Select Case miAttachedDataBase
Case eDataBase.Main
arrDBState(0) = 2
Case eDataBase.NON_CLINICAL
arrDBState(1) = 2
Case eDataBase.KVS
arrDBState(2) = 2
Case eDataBase.MapnikOSM2
arrDBState(3) = 2
Case eDataBase.NewDB
arrDBState(4) = 2
End Select
If iDBCount = 5 Then
strText = "seq name file" & CRLF & _
"----------------------------------------------------------" & CRLF & _
arrDBState(0) & " Main " & "/PhonePatsE.db" & CRLF & _
arrDBState(1) & " non-clinical " & "/NON_CLINICAL.db" & CRLF & _
arrDBState(2) & " kvs " & "/DataStorage" & CRLF & _
arrDBState(3) & " tiles " & "/tiles.db3" & CRLF & _
arrDBState(4) & " Extra " & "/" & cMP.cConn.strExtraDB & CRLF & CRLF & _
"0 means main DB, 1 means DB not in use, 2 means attached DB." & CRLF & _
"All databases will be in File.DirInternal, which is:" & CRLF & _
File.DirInternal
Else
strText = "seq name file" & CRLF & _
"----------------------------------------------------------" & CRLF & _
arrDBState(0) & " Main " & "/PhonePatsE.db" & CRLF & _
arrDBState(1) & " non-clinical " & "/NON_CLINICAL.db" & CRLF & _
arrDBState(2) & " kvs " & "/DataStorage" & CRLF & _
arrDBState(3) & " tiles " & "/tiles.db3" & CRLF & CRLF & _
"0 means main DB, 1 means DB not in use, 2 means attached DB." & CRLF & _
"All databases will be in File.DirInternal, which is:" & CRLF & _
File.DirInternal
End If
cMP.cSQLEdit.edtSQL.Text = strText
cMP.cSQLEdit.btnLargeEdit_Click
cMP.cSQLEdit.bNoEDTFormatting = False
End Sub
In Debug mode this won't work, so the text is formatted as SQL. In Release mode it all works fine, so no SQL formatting takes place.
I just wonder why this is and if there is something I could do to make it work OK in Debug mode.
RBS