B4R Question Help with ByteConverter

daveinhull

Active Member
Licensed User
Longtime User
Hello and sorry for all the help requests - must be getting old!

I'm getting an error when trying to use ByteConverter which has never happened before, and I just can't see what I'm doing wrong:
B4X:
    Log (bc.HexFromBytes(1))
gives an eror
Main - 205: Cannot cast type: {Type=Int,Rank=0, RemoteObject=False} to: {Type=Byte,Rank=1, RemoteObject=True}

In fact all conversion types give the same error.

Could somone show me the wood for the trees?
 

Daestrum

Expert
Licensed User
Longtime User
If it works the same way as in B4J then it wants an array passed to it.
B4X:
    Dim bytes() As Byte = Array As Byte(1)
    Log(bc.HexFromBytes(bytes))
 
Upvote 1
Top