| THE META-HTML LANGUAGE REFERENCE MANUAL

| [TOC] |

## Manual Page Viewer

Name: COERCE-VAR

Section: Variables

Synopsis:

`<coerce-var VARNAME [TYPE=(STRING|BINARY)]>`

Description:

Coerces VARNAME's data to have the type specified by the argument to TYPE. You can convert a binary object to a string object, and vice-versa.

A binary variable might be created as the result of a call to `stream-get-contents`, for example. Once the data is read, you might wish to perform some substitutions on it, or otherwise get its value. To do so, you call `coerce-var` on the value:

       <with-open-stream s /tmp/file mode=read>
         <stream-get-contents s foo>
       </with-open-stream><p>
       <coerce-var foo type=string>
       <subst-in-string <get-var foo> "Hello" "Goodbye">
       <get-var foo>

Edit Pointer
Function Index
Variable Index
Variable Editor

The META-HTML Reference Manual V1.4 Copyright © 1995, 1996, Brian J. Fox, 1996, 1997 Universal Access Inc.
Found a bug? Send mail to bug-manual@metahtml.com