Hi,
I have a function or a sub in VB.NET but can not convert in B4A.
Can anyboady help
VB.NET
B4A
This I have try it:
get compiler error regarding Substring2
I have a function or a sub in VB.NET but can not convert in B4A.
Can anyboady help
VB.NET
B4X:
Private Function Send(ByRef Klartext As String) As Boolean
Dim idx As Byte
Dim tmpByte As Byte
Dim tmpChar As String
Dim Textsammeln As String = ""
For idx = 1 To CByte(Len(Klartext.Trim))
tmpChar = Mid(Klartext.Trim, idx, 1)
tmpByte = CByte(Asc(tmpChar) + 3)
tmpChar = Chr(tmpByte)
Mid(Klartext, idx, 1) = tmpChar
Textsammeln = Trim(Klartext)
Next idx
Return Senden(Textsammeln)
End Function
B4A
This I have try it:
B4X:
For idx = 1 To Klartext.Trim.Length
tmpChar = Klartext.SubString2(idx, 1).Trim
tmpByte = Asc(tmpChar) + 3
tmpChar = Chr(tmpByte)
Klartext.SubString2(idx, 1) = tmpChar
Textsammeln = Textsammeln & tmpChar.Trim
Next
Return Send(Textsammeln)
End Sub
get compiler error regarding Substring2