Xbasic

*mime_object Function

Syntax

P *MIME_OBJECT(mimeType as c,data as c)

P *MIME_OBJECT(mimeType as c,data as b)

Arguments

mimeType

Mime type object represents (i.e. text/html for example)

data

Data for object (html would be a character, a PNG image would be binary).

Description

Returns a mime object, recognized by layouts to set extended types for variable and calculated fields.

The object contains the fields 'mime_type' and 'content'. If your 'content' is a string (i.e. HTML/SVG vs PNG/BMP) then the ToString() function can be used on the object.

mo = *mime_object("html","hello <b>world</b>")
? mo.mime_type = "html"

? mo.content = hello <b>world</b>

? mo.ToString() = "hello <b>world</b>"

Properties of Object

The object returned by *mime_object has the following properties and methods:

Properties

cache_limitNumeric

The cache limit.

contentBinary

The mime object content.

mime_typeCharacter

The mime type.

Methods

C AlphaType()

Return the alpha field type that best represents the mime type.

P Clone()

Create a copy of an object instance.

C ExpandToData(urlText as c)
urlTextCharacter

The URL to encode.

Gets base64 encoded data version of URL (for embedding).

L Lookup(urlText as c)
urlTextCharacter

Resource to lookup.

Lookup a built-in Alpha Anywhere resource.

P NewInstance()

Create a new object instance of the same type.

C ToExpression()

Return expression (for persisting values).

C ToString()

Return text (if mime type is based on text).