B4J Question [ABMaterial] error with \

MbedAndroid

Well-Known Member
Licensed User
Longtime User
After a typo in a inputbox a backslash was entered.
Now, when i try to click on the inputbox line, a error comes from the browser.

I can edit the code to remove this '\ and insert code to protect a second typo, but why is this allowed in the library?

upload picture
eRHczc
 

MbedAndroid

Well-Known Member
Licensed User
Longtime User
not easy Alain. To get a working model you need extra hardware.
the 1\ is now coming from memory, which is loaded from external file
i think when you try to display 1\ and edit the column, you will have your debug situation

complete bas file included, might speed up the work


to click to edit the colomn i use:
B4X:
Sub tbl1_Clicked(PassedRowsAndColumns As List)
   ' is the root table
'   Dim Packet As UDPPacket
'   Dim data() As Byte
'   Dim Send868=False As Boolean
   Dim tblCellInfo As ABMTableCell = PassedRowsAndColumns.Get(0)
   Dim tbl As ABMTable = page.Cell(2,1).Component(tblCellInfo.TableName)
   savedlist=PassedRowsAndColumns


   Dim lbl=tbl.GetString(tblCellInfo.row, 0) As String

'   If tblCellInfo.Column<5 Then
'       page.InputBox("INPUTBOX1", "Input","OK", "CANCEL", True, ABM.INPUTBOX_TYPE_QUESTION, ABM.INPUTBOX_QUESTIONTYPE_TEXT,lbl,lbl, "", "",False,"", "")
'       Return
'   End If
   Select  tblCellInfo.Column
       Case 0
           Dim lbl=tbl.GetString(tblCellInfo.row, 0) As String

           page.InputBox("INPUTBOX1", "Input","OK", "CANCEL", True, ABM.INPUTBOX_TYPE_QUESTION, ABM.INPUTBOX_QUESTIONTYPE_TEXT,lbl,lbl, "", "",False,"", "")
           Return


       Case 1
       
           Dim lbl=tbl.GetString(tblCellInfo.row, 1) As String

           page.InputBox("INPUTBOX1", "Input","OK", "CANCEL", True, ABM.INPUTBOX_TYPE_QUESTION, ABM.INPUTBOX_QUESTIONTYPE_TEXT,lbl,lbl, "", "",False,"", "")
           Return

       Case 2
           Dim lbl=tbl.GetString(tblCellInfo.row, 2) As String

           page.InputBox("INPUTBOX1", "Input","OK", "CANCEL", True, ABM.INPUTBOX_TYPE_QUESTION, ABM.INPUTBOX_QUESTIONTYPE_TEXT,lbl,lbl, "", "",False,"", "")
           Return

   End Select
   

End Sub
Sub Page_MsgboxResult(returnName As String, result As String)
   
End Sub

Sub Page_InputboxResult(returnName As String, result As String)
   Select Case returnName
       Case   "INPUTBOX1"
           Select Case result
               Case ""
                   Return
               Case ABM.INPUTBOX_RESULT_CANCEL, ABM.INPUTBOX_RESULT_CLOSE, ABM.INPUTBOX_RESULT_ESC, ABM.INPUTBOX_RESULT_OVERLAY, ABM.INPUTBOX_RESULT_INVALID
                   ' the user did something to close the inputbox without pressing OK.  These are all different cases of 'CANCEL'
               Case Else
                   ' in the result is now the value or selection the user made, the user pressed OK
                   If savedlist<>Null Then
                       Dim tblCellInfo As ABMTableCell = savedlist.Get(0)
                       Dim tbl As ABMTable = page.Cell(2,1).Component(tblCellInfo.TableName)
                       Select Case tblCellInfo.Column
                           Case 0
                               tbl.SetString(tblCellInfo.row, 0,result)
                               tbl.RefreshCell(tblCellInfo.Row, 0)
                               Main.nodevalues(tblCellInfo.row+1).Name=result
                               files.writenodes
                               Return

                           Case 1
                               If js.Len(result)<2  Then result=""

                               Main.nodevalues(tblCellInfo.row+1).mac=result
                               tbl.SetString(tblCellInfo.row, 1,result)
                               tbl.RefreshCell(tblCellInfo.Row, 1)
                               
                               
                               files.writenodes
                               Return
                           Case 2
                               If js.Len(result)<2  Then result=""

                               Main.nodevalues(tblCellInfo.row+1).nodenummer=result
                               tbl.SetString(tblCellInfo.row, 2,result)
                               tbl.RefreshCell(tblCellInfo.Row, 2)
                               
                               
                               files.writenodes
                               Return
                       End Select

                   End If
                   
           End Select

   End Select
End Sub

[\code]
 

Attachments

  • PageNodeData.bas
    14.6 KB · Views: 184
Upvote 0

MbedAndroid

Well-Known Member
Licensed User
Longtime User
no it's text, column 2
B4X:
       'add macadres
       r.Add(Main.nodevalues(i).mac)
       rCellThemes.Add("positive")
[\code]

if you should changed the line into r.add("1\") i think you should have the same result
lines up from 3 are a number, thus numberformat
 
Upvote 0

MbedAndroid

Well-Known Member
Licensed User
Longtime User
inserted r.add("1\") into the code, and cant edit the second column anymore.
The browser is struggling with the \
 
Upvote 0
Top