put byte value into a string

cotralis

Member
Licensed User
Longtime User
I have made an decrypt routine. if i us a msgbox to display the result then the function works. When i want to put the result in an variable i got an error

how can i solve this problem


data() = Crypto.Decrypt(PassPhrase,secret())
Msgbox(bit.BytesToString(data(),0,ArrayLen(data())))
a=(bit.BytesToString(data(),0,ArrayLen(data())))
 

moster67

Expert
Licensed User
Longtime User
Just out of curiosity - Is this by design (because Basic4PPC is weakly typed)?

Could this be avoided if we had to declare all our variables indicating also the datatype?

Rgds,
moster67


The parser treats expressions wrapped by parentheses as numeric expressions and therefore fails in this situation.
B4X:
a = (b & c) 'ERROR
a = b & c 'OK
a = (5 + 2) 'OK
 
Last edited:
Top