Italian Conversione da vb6 a basic4android

diresc

Member
Licensed User
Longtime User
Ciao come faccio a convertirlo in basic4A
problemi con= len-mid-val-chr-&h


chiamo funzione
Hex2AsciiSocket (li1.Text)


Function Hex2AsciiSocket(s_input As String) ' Input: "00 01 AA FF
Dim I As Byte
Dim HEX As String
Dim OUT As String
Dim znak As Byte
HEX = s_input
For I = 1 To (Len(s_input) + 1) \ 3
znak = Val("&H" & Mid(HEX, 1, 2))
HEX = Mid(HEX, 4, Len(HEX))
OUT = OUT & Chr(znak)
Next I
'MsgBox OUT
SOCK.SendData (OUT)'winsock
Hex2AsciiSocket = Len(OUT)
End Function

grazie mille per le risposte
 

Enrico Pieraccioni

Member
Licensed User
Longtime User
Ciao come faccio a convertirlo in basic4A
problemi con= len-mid-val-chr-&h


chiamo funzione
Hex2AsciiSocket (li1.Text)


Function Hex2AsciiSocket(s_input As String) ' Input: "00 01 AA FF
Dim I As Byte
Dim HEX As String
Dim OUT As String
Dim znak As Byte
HEX = s_input
For I = 1 To (Len(s_input) + 1) \ 3
znak = Val("&H" & Mid(HEX, 1, 2))
HEX = Mid(HEX, 4, Len(HEX))
OUT = OUT & Chr(znak)
Next I
'MsgBox OUT
SOCK.SendData (OUT)'winsock
Hex2AsciiSocket = Len(OUT)
End Function

grazie mille per le risposte

Per len ho appena risolto anch'io, su di una label, la sintassi è la seguente:
edittext3.Text = Display.Text.Length

edittext3 è una casella di testo dove viene mostrata la lunghezza, la stringa da misurare sta nella label Display.

Io sto cercando come risolvere il left$, Mid$ e Right$

Ciao a tutto il forum
 

roberto64

Active Member
Licensed User
Longtime User
Ciao come faccio a convertirlo in basic4A
problemi con= len-mid-val-chr-&h


chiamo funzione
Hex2AsciiSocket (li1.Text)


Function Hex2AsciiSocket(s_input As String) ' Input: "00 01 AA FF
Dim I As Byte
Dim HEX As String
Dim OUT As String
Dim znak As Byte
HEX = s_input
For I = 1 To (Len(s_input) + 1) \ 3
znak = Val("&H" & Mid(HEX, 1, 2))
HEX = Mid(HEX, 4, Len(HEX))
OUT = OUT & Chr(znak)
Next I
'MsgBox OUT
SOCK.SendData (OUT)'winsock
Hex2AsciiSocket = Len(OUT)
End Function

grazie mille per le risposte
vedi questa
Sub Left(Text AsString, Length AsInt)AsString
If Length>Text.Length Then Length=Text.Length
Return Text.SubString2(0, Length)
End Sub
Sub Right(Text AsString, Length AsInt) AsString
If Length>Text.Length Then Length=Text.Length
Return Text.SubString(Text.Length-Length)
End Sub
Sub Mid(Text AsString, Start AsInt, Length AsInt) AsString
Return Text.SubString2(Start-1,Start+Length-1)
End Sub
Sub Split(Text AsString, Delimiter AsString) AsString()
ReturnRegex.Split(Delimiter,Text)
End Sub
Sub Len(Text AsString) AsInt
Return Text.Length
End Sub
Sub Replace(Text AsString, Str1 AsString, Str2 AsString) AsString
Return Text.Replace(Str1, Str2)
End Sub
Sub Lcase(Text AsString) AsString
Return Text.ToLowerCase
End Sub
Sub Ucase(Text AsString) AsString
Return Text.ToUpperCase
End Sub
Sub Instr(Text AsString, Caracter AsString) AsString
Return Text.IndexOf(Caracter)
End Sub
 
Top