Android Question Missing ) in BytesToString

Discussion in 'Android Questions' started by Eldritch, Mar 30, 2015.

Similar threads

B4A Library B4XEncryption
B4A Tutorial [B4X] AsyncStreams Tutorial
B4A Code Snippet [B4X] Join arrays of bytes
B4A Code Snippet Parsing your apps logs
B4A Tutorial [B4X] Text, Strings and Parsers
B4A Code Snippet [B4X] Bytes To File
  1. Eldritch

    Eldritch Member Licensed User

    Hi All

    I'm going crazy over this. I have modified Erels mailparser and now I get an error where no error should be.

    Error description: ')' expected.
    Occurred on line: 158
    ReturnSubject = BytesToString(bytes, 0, bytes.Length, "utf-8")
    Word: )

    The ')' is there, but still i fails.

    Any Body who can se where I error??

    I'm using V. 3.8 of b4a.

    Attached Files:

  2. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Because you set the Sub name to a value

    Return the value, not ReturnSubject = ...

    Sub ReturnSubject(SubjectLine As StringAs String
    Dim tmpString As String
    If tmpString.Contains("utf-8?b?"Then
    "B?") + 2)

    Dim su As StringUtils
    Dim bytes() As Byte = su.DecodeBase64(tmpString)
    Return BytesToString(bytes, 0, bytes.Length, "utf-8")

    Return SubjectLine.SubString(SubjectLine.IndexOf(":") + 1)
    End If

    End Sub
    Return BytesToString(bytes, 0, bytes.Length, "utf-8") not ReturnSubject = BytesToString(bytes, 0, bytes.Length, "utf-8") when ReturnSubject is also your sub name
    DonManfred likes this.
  3. Eldritch

    Eldritch Member Licensed User

    Duuuh, stupid me. Writing VBS code and not B4A. Thanks for the help:)
  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