Introduction | Language Structure | IB Statements | File System | Comet 32 Runtime | Index |
Syntax: | BASE64(string-argument,numeric-error-argument) |
Discussion: |
The BASE64 function performs a standardized encoding of the
string-argument into printable characters, regardless of the
value of the string-argument.
This function allows hex strings to be encoded and used for such purposes as hidden fields in an HTML form, cookies, etc. For more information about Base 64 encoding, please see RFC 1421.
The numeric-error-argument is a numeric variable with a length and precision of at least 1.0. If the BASE64 function successfully encodes the string-argument, the numeric-error-argument is set to 0. If the conversion is unsuccessful (e.g., if the encoding overflows the string accumulator), it is set to 1. To de-encode a Base 64 string, use the BASE256 function. |
History: | This function was added in Build 290. |
Example: |
LENGTH 30 & LOCAL B$ LENGTH 40 & LOCAL A$ LENGTH 1.0 & LOCAL ERR . . . A$ = BASE64(B$,ERR) ! Encode B$ IF ERR = 1 THEN PRINT (0) "ERROR IN BASE64 ENCODING." ENDIF |