put byte value into a string

Discussion in 'Questions (Windows Mobile)' started by cotralis, Sep 12, 2008.

  1. cotralis

    cotralis Member Licensed 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())))
     
  2. agraham

    agraham Expert Licensed User

    Try removing the outmost parentheses surrounding the expression - for some reason in some circumstances the B4ppc parser doesn't like them :(
     
  3. cotralis

    cotralis Member Licensed User

    thanks

    that is the solution for my problem

    thank you for your quick reply
     
  4. Erel

    Erel Administrator Staff Member Licensed User

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

    moster67 Expert Licensed 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


     
    Last edited: Sep 13, 2008
  6. Erel

    Erel Administrator Staff Member Licensed User

    This is by design. Yes, if Basic4ppc was strongly typed this assumption would not have been necessary.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice