1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

@B64ENCODE[s,string]?

Discussion in 'Support' started by vefatica, Nov 15, 2011.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,079
    Likes Received:
    30
    What's the 's' (the help doesn't say)? And how is this form of the function supposed to work? That syntax would seem indistinguishable from @B64ENCODE[inputfile,outputfile].

    And the seemingly likely alternative, @b64endode[string] causes an error.
    Code:
    v:\> echo %@b64encode[string]
    TCC: (Sys) The parameter is incorrect.
     "%@b64encode[string]"
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,040
    Likes Received:
    84
    ?

    function

    @B64ENCODE[s,string] - the "s" means the argument is a string. The help
    file shows the syntax; the bold "s" means that it is a constant, and a
    required argument.
     
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    ---- Original Message ----
    From: vefatica
    To: ESFabian@zenge.org
    Sent: Tuesday, 2011. November 15. 20:16
    Subject: [Support-t-3368] @B64ENCODE[s,string]?

    | What's the 's' (the help doesn't say)? And how is this form of the
    | function supposed to work? That syntax would seem indistinguishable
    | from @B64ENCODE[inputfile,outputfile].
    |
    | And the seemingly likely alternative, @b64endode[string] causes an
    | error.
    |
    | Code:
    | v:\> echo %@b64encode[string]
    | TCC: (Sys) The parameter is incorrect.
    | %@b64encode[string]

    1/ The syntax precludes source file named S (unless it is specified with at least partial path)
    2/ Quoting HELP:
    "@B64ENCODE[s,string] : Encode a base 64 string (MIME encoding format). Returns the encoded string

    @B64ENCODE[inputfile,outputfile] : Encode a base 64 file (MIME encoding format). Returns 0 if the output file was successfully written."

    If the string or file is already base 64, why would I want to have it encoded again? OTOH, what can a source string or file contain for it to be a valid source for B64 encoding?

    --

    Steve
     
  4. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,201
    Likes Received:
    11
    ?

    I got bit by this myself the other day. The 's' means string (as opposed
    to a file). But I imagine if you have a file named 's', there might be
    conflicts.

    echo %@b64encode[s,super secret password]
    c3VwZXIgc2VjcmV0IHBhc3N3b3Jk

    -Scott

    vefatica <> wrote on 11/15/2011 08:16:30 PM:

    error.

     
  5. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,040
    Likes Received:
    84
    ?

    And do you have a file named 's' that you want to encode?

    And if you do, why don't you quote it??
     
  6. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,040
    Likes Received:
    84
    ?

    encoded

    source

    I have no idea what you're asking. If you already have a base64 string, why
    would you even want to try to encode it again?

    Or are you saying that you don't know if your string/file is base64?

    Or are you trying to twist the help syntax to something else?

    @B64ENCODE takes a string / file and encodes it to a base64 string / file.
    That's all.
     
  7. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    ?

    From: rconn
    | Quote:
    || If the string or file is already base 64, why would I want to have it
    |
    | encoded
    |
    |
    | Quote:
    || again? OTOH, what can a source string or file contain for it to be a
    || valid
    |
    | source
    |
    |
    | Quote:
    || for B64 encoding?
    |
    | I have no idea what you're asking. If you already have a base64
    | string, why
    | would you even want to try to encode it again?
    |
    | Or are you saying that you don't know if your string/file is base64?
    |
    | Or are you trying to twist the help syntax to something else?
    |
    | @B64ENCODE takes a string / file and encodes it to a base64 string /
    | file.
    | That's all.

    This is in HELP:
    @B64ENCODE[s,string] : Encode a base 64 string (MIME encoding format). Returns the encoded string
    @B64ENCODE[inputfile,outputfile] : Encode a base 64 file (MIME encoding format). Returns 0 if the output file was successfully written.



    From my limited understanding of English grammar both of the above sentences mean that your SOURCE is "a base 64" string/file. To specify that the source is anything, but the target is base 64, AFAIK sentences should be similar to:

    "@B64ENCODE[s,string] : Encode string into a base 64 (MIME encoding format) string. Returns the encoded string.

    @B64ENCODE[inputfile,outputfile] : Encode inputfile into base 64 (MIME encoding format) and write it to outputfile. Returns 0 if the output file was successfully written."

    --

    Steve
     
  8. Kachupp

    Joined:
    Aug 9, 2009
    Messages:
    133
    Likes Received:
    0
    ?

    The wording of is a little awkward. Either way it's a quick simple edit

    Other than that, I cannot get it to do anything other report an error

    [C:\]echo %@b64encode[s,SimpleText]
    TCC: (Sys) Incorrect function.
    "%@b64encode[s,SimpleText]"

    [C:\]ver

    TCC LE 13.01.31 Windows XP [Version 5.1.2600]

    If it has something to-do with one of zGods disciples I can live with that.

    Psst I wrote the first original b64.btm in 4ntv8 it fails in tcc/le13 I guess in earlier
    versions as well

    Hate 2 strokes. But I'm too poor at the moment for the McCoy overdrive versions.


    : This is in HELP:
    : @B64ENCODE[s,string] : Encode a base 64 string (MIME encoding format). Returns the
    encoded string
    : @B64ENCODE[inputfile,outputfile] : Encode a base 64 file (MIME encoding format).
    Returns 0 if the
    : output file was successfully written.
    :
    :
    :
    : From my limited understanding of English grammar both of the above sentences mean that
    your
    : SOURCE is "a base 64" string/file. To specify that the source is anything, but the
    target is base 64,
    : AFAIK sentences should be similar to:
    :
    : "@B64ENCODE[s,string] : Encode string into a base 64 (MIME encoding format) string.
    Returns the
    : encoded string.
    :
    : @B64ENCODE[inputfile,outputfile] : Encode inputfile into base 64 (MIME encoding format)
    and write it
    : to outputfile. Returns 0 if the output file was successfully written."

    Encode too Base64 ?
    Decode Base64
     
  9. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,040
    Likes Received:
    84
    ?

    @B64ENCODE is not supported in TCC/LE.
     

Share This Page