@B64ENCODE[s,string]?

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
#1
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]"
 

rconn

Administrator
Staff member
May 14, 2008
10,205
86
#2
?

> 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].
@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
---- 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
 

samintz

Scott Mintz
May 20, 2008
1,229
11
Solon, OH, USA
#4
?

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:

>
> 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]"
>
>
 

rconn

Administrator
Staff member
May 14, 2008
10,205
86
#6
?

> 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?
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
?

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
 
Aug 9, 2009
133
0
#8
?

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