C cotralis Member Licensed User Longtime User Sep 12, 2008 #1 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())))
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())))
agraham Expert Licensed User Longtime User Sep 12, 2008 #2 Try removing the outmost parentheses surrounding the expression - for some reason in some circumstances the B4ppc parser doesn't like them cotralis said: a=bit.BytesToString(data(),0,ArrayLen(data())) Click to expand...
Try removing the outmost parentheses surrounding the expression - for some reason in some circumstances the B4ppc parser doesn't like them cotralis said: a=bit.BytesToString(data(),0,ArrayLen(data())) Click to expand...
C cotralis Member Licensed User Longtime User Sep 12, 2008 #3 thanks that is the solution for my problem thank you for your quick reply
Erel B4X founder Staff member Licensed User Longtime User Sep 12, 2008 #4 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
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
moster67 Expert Licensed User Longtime User Sep 13, 2008 #5 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 Erel said: 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 Click to expand... Last edited: Sep 13, 2008
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 Erel said: 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 Click to expand...
Erel B4X founder Staff member Licensed User Longtime User Sep 13, 2008 #6 This is by design. Yes, if Basic4ppc was strongly typed this assumption would not have been necessary.
This is by design. Yes, if Basic4ppc was strongly typed this assumption would not have been necessary.