MMC Internet ServicesAbout MMCCorporate MeetingsMMCISmultimedia


WebKit API Reference

The WebKit API is a series of uniVerse BASIC routines that can be used to process HTML forms or to dynamically generate HTML documents from data stored in a uniVerse database file. This is only a sample of the routines that are included in WebKit. The first set of functions are used to get and parse the information passed to a uniVerse program called by httpd, or to generate error output. The Tag functions generate HTML tag sequences.
Utility Functions
HTML Tag Generation
Back to Index

HTMLGetPostArgs

Retrieve arguments from the command line. The WKAPI assumes that any post arguments in standard in are extracted and put on the command line. Most commonly used for retrieving arguments from an HTML form. HTMLCGIParse is called from HTMLGetPostArgs.

HTMLGetPostArgs first looks for input in standard in, where it would be put by httpd in response to a form submitted with POST method. It then looks for input on the command line. This feature can be used to debug routines designed for POST forms without having to run a browser.

Syntax

variable=HTMLGetPostArgs(dummy)
dummy
HTMLGetPostArgs needs an argument passed to it but it does not matter what is contained in that variable
HTMLGetPostArgs looks in the VOC for a record named HTML.TRACE.IP. If the record exists, and the IP address in that record matches the IP address of the client invoking this routine, HTMLGetPostArgs saves the current command line in a VOC entry named HTML.LAST.CMD. This is useful for debugging routines without having to involve a browser and the httpd. To use RAID to debug the routine, edit HTML.LAST.CMD and insert -DEBUG as the first parameter, and HTMLGetPostArgs will enter the debugger just before returning to the calling routine.
Back to Index

HTMLGetArg

Retrieve specific arguments from the string generated by HTMLGetPostArgs. Arguments can be retrieved by name or by position in the argument string.

Syntax

variable=HTMLGetArg(name,argstring)

or

variable=HTMLGetArg(n,argstring)
argstring
argstring is the string of arguments passed by httpd from a POST method form. It contains arguments of one of two forms: gname or name=value separated by "&" characters.
name
name is the name from the name option of the HTML form tag. If the argument is passed as just a name (e.g., a checkbox tag), then HTMLGetArg returns the argument name. If the argument is a name=value pair, HTMLGetArg returns the value. If the specified argument is a muliple selection list, then HTMLGetArg returns all values separated by "&" characters.
n
the integer position of the argument to be returned. HTMLGetArg returns either the name or name=value.
Back to Index

HTMLCGIParse

CGIParse replaces CGI escape sequences with the original characters.

Syntax

variable=HTMLCGIParse(string)
string
The text from an HTML form to be parsed.
Back to Index

HTMLCGIEncode

CGIEncode substitutes the appropriate escape strings for HTML metacharacters.

Syntax

variable=HTMLCGIEncode(string)
string
The text to be parsed for display in an HTML document.
Back to Index

HTMLError

Returns an Error message that has the name of the program originally called followed by the specified text.

Syntax

variable=HTMLError(Text)
Text
The text to be displayed in the Error message.
Back to Index

HTMLTagBody

Generate a tag specifing the beginning of the body of an HTML document

Syntax

variable=HTMLTagBody(StartorEnd)
StartorEnd
If StartorEnd="START" then an open tag <BODY> is produced
any other value will produce a close tag </BODY>
Back to Index

HTMLTagCheckBox

Generate a CheckBox control in a form

Syntax

variable=HTMLTagCheckBox(name,value,checked)
name
the name to given to the checkbox tag. name is required
value
value to passed back as value of this control if the checkbox is checked. If value is specified as the null string, the value passed back by the browser is "CHECKED"
checked
if checked is not the empty string then the CHECKED option is set.
Back to Index

HTMLTagFormPost

Generate a form tag using post as the method

Syntax

variable=HTMLTagFormPost(action)
action
the action to be carried out when the form has been submitted. action is require.
Back to Index

HTMLTagHeader

Generate text to be displayed as a header.

Syntax

variable=HTMLTagHeader(text,value)
text
the text to be displayed as a header. text is required
value
the degree of prominence of the header (1 being the greatest, 6 being the smallest). If no value is given for value, (1) is the default.
Back to Index

HTMLTagImage

Places an image in the document.

Syntax


variable=HTMLTagImage(imagefilename,align)
imagefilename
the name of the file that contains the image to be displayed. imagefilename is required.
align
the alignment of the image (left, center, or right are the values). If no value is given for align, then (left) is the default.
Back to Index

HTMLTagLabel

Generate a label anchor.

Syntax

variable=HTMLTagLabel(label)
label
label is the text used as a the label for a link to reference. label is required
Back to Index

HTMLTagLi

Generate a tag for building a list item for a ordered, unordered, menu, or directory list.

Syntax

variable=HTMLTagLi(text)
text
text is the text used in the list.
Back to Index

HTMLTagLink

Generate a link anchor that references a label or a URL.

Syntax

variable=HTMLTagTagLink(text,reference)
text
the text to be used as the link(or anchor). text is required
reference
the URL orlabel that is to be referenced when the anchor is activated. reference is required.
Any HTML entities in the text are converted to the HTML escape sequences.
Back to Index

HTMLTagPassword

Generate a password input box control in a form.

Syntax

variable=HTMLTagPassword(name,value,size)
name
the name given to the password input. name is required
value
the default value for the password input box.
size
the size(width) of the password input box. If no value is given, (15) is the default
Back to Index

HTMLTagRadio

Generate a Radio button control in a form.

Syntax

variable=HTMLTagRadio(name,value,checked)
name
the name given to the radio button tag. name is required
value
the value passed back as the value of this control is the button is activated. If value is specified as the null string, the value passed back by the browser is "CHECKED"
checked
if checked is not the empty string then the CHECKED option is set.
Back to Index

HTMLTagReset

Generate a Reset button in a form.

Syntax

variable=HTMLTagReset(value)
value
the text to be displayed on the face of the button (e.g., Reset, Clear). If no value is given,("Reset") is the default.
Back to Index

HTMLTagSelect

Generate a select list box for a document.

Syntax

variable=HTMLTagSelect(name,items,size,multi,selected)
name
the name given to that control
items
items is a dynamic array containing the list box values separated by @FM
size
size is an interger value representing the number of items (or options) that will be displayed at one time. If no value is given for size, then (3) is the default.
multi
If multi is 1, then HTMLTagSelect produces a list box that can have multiple selections. You can use the EQUATED value of MULTIPLE.SELECT
selected
To have HTMLTagSelect generate some of the options as selected by default, place the items to be selected into selected. If this is a multiple selection list, and you want to select more than one item, selected should contain the items separated by field marks. If there is more than one selected item, multi must be set to MULTIPLE.SELECT.
Back to Index

HTMLTagSubmit

Generate a Submit button in a form.

Syntax

variable=HTMLTagSubmit(value)
value
the value is what is displayed on the face of the button (e.g.,: OK, Submit). If no value is given,("Submit") is the default.
Back to Index

HTMLTagStrong

HTMLTagStrong generated the tags for text to be displayed as strong (bold).

Syntax

variable=HTMLTagStrong(text)
text
the text to be displayed with as bold. text is required.
Back to Index

HTMLTagTable

HTMLTagTable generates an HTML Table from the data passed to it.

Syntax

variable=HTMLTagTable(Options,Caption,TableData)
Options
table attribute values delimited by @FM, empty values are defaulted
BORDER @FM CELLSPACING @FM CELLPADDING
BORDER default is 1, CELLSPACING default is 2, CELLPADDING default is 1
Caption
The caption text and alignment attributes separated by @FM.
caption text@FMalignment
where alignment is the string TOP or BOTTOM
TableData
A dynamic array specifying the cell data and attributes. Rows are separated by @FM, values within the row are separated by @VM.
Each cell data value has the format:
[H(eading) @TM ALIGN @TM NOWRAP @TM COLSPAN @TM ROWSPAN @SVM] cell value
where H specifies that this cell is a heading cell and the remaining attribute values are the values for the specified options to the TH or TD tag. If there is no @SVM in the cell data value, the entire value is taken as the table cell string. Trailing attribute values can be omitted. See
TableEx.html for an example of code using HTMLTagTable.
Back to Index

HTMLTagTextArea

Generate a text area.

Syntax

variable=HTMLTagTextArea(name,text,rows,cols)
name
the name given to the text area. name is required
text
the text to be displayed inside the text area.
rows
the height of the text area. If no value is given, (3) is the default.
cols
the number of columns (or the length) of the text area. If no value is given , (50) is the default.
Back to Index

HTMLTagTextInput

Generate a text input box in a form.

Syntax

variable=HTMLTagTextInput(name,value,size)
name
the name given to the control. name is required
value
the default value of the text input box that will be displayed. If no value is given, (15) is the default.size
size is the width of the textinput box. If no value is given for size, (15) is used as the default.
Back to Index

HTMLTagUl

Generate a tag for an unodered list.

Syntax

variable=HTMLTagUl(StartorEnd)
StartorEnd
if StartorEnd has a value of TAG.START then the a tag for opening an unordered list is produced, any other value produces a tag for closing an unordered list.


HomeContact InfoMBI demoMMC Gallery

Written by Matt Cornell (mcornell@mmcis.com), 9/6/94, maintained by Charles Cornell (cac@mmcis.com)