VA FileMan V. 22.0 Programmer Manual Banner


 

Main Chapter Getting Started Manual Advanced User Manual

Database Server (DBS) API


$$HTML^DILF( ): HTML Encoder/Decoder

This function has two capabilities:

  1. It encodes a string that may contain embedded "^" characters according to the rules of HTML so that the "^" characters are replaced with the string "^". As a side effect, "&" characters are encoded as the string "&". Other encodings typical of HTML are not performed by this function, since its focus is on encoding the "^" character used as the delimiter in FileMan databases.

  2. This function also decodes an encoded string, restoring its "^" and "&" characters.
Format
$$HTML^DILF(STRING,ACTION)

Input Parameters
STRING

(Required) The string to be either encoded or decoded. Encoding a string that contains no "^" or "&" characters has no effect on the string. Nor does decoding one that lacks "^" and "&" substrings.

ACTION

(Optional) Set this parameter to 1 to encode the string, or -1 to decode it. Defaults to 1.

Output

The function evaluates to the encoded or decoded string. If encoding the string makes it overflow the string length limit, it returns error 207. Decoding will never make it overflow.

Error Codes Returned
207 The value is too long to encode into HTML.

 


Reviewed/Updated: March 10, 2007