HTML/OS Tag Reference c Appendix This appendix summarizes the HTML/OS tags used in this book. Each tag includes a brief description and its parameters. For information on other tags and a more complete description of each tag, please refer to the Official HTML/OS Tag Reference included with purchase of HTML/OS Professional. HTML/OS Tags with No Parameters CR Returns carriage-return character (ASCII 13). HTMLOS.POPUP Returns TRUE if page was launched from HTML/OS Desktop. HTMLOS.ICONPAGE Returns HTML/OS Desktop page. HTMLOS.CLICKED Returns name of submit button last clicked. ISGOODKEY Returns TRUE if a valid product has been registered. Otherwise returns FALSE. LF Returns line-feed newline character (ASCII 10). PAGE Returns current page. SYSSERVICE Returns current Web service; HTTP or HTTPS. SYSSTARTLINK Returns URL path to Start-link. Append with entry page name to build full Start-link. TAGRESULTS Set by some HTML/OS tags. Returns last value placed in it. TODAY Returns current date. HTML/OS Tags with Parameters ADDDAYS(date,days) Returns the date offset from the specified input date by a number of days. Params: date Any valid date after 1970. days Number of days to add. Negative numbers allowed. 153
154 Advanced Web Software Made Easy APPEND variable TO destination /APPEND Appends a variable to a destination variable, document, or delimited file. Params: variable The source variable. destination The destination variable, document or delimited file where the document is specified as FILE=filename and delimited file is specified as FILE=filename TS=delimiter. ASCII(number) Returns character from ASCII value. GETASCII returns ASCII value of character. Params: number ASCII value. BINTOTEXT(filename) Reads binary file and loads, as text, into variable. (Maps null character to ^n and ^ character to ^d. The tag TEXTTOBIN variable back into binary file. See Aestiva Print Reference.) Params: filename Filename. COLTOLIST(variable,col,delimiter) Converts a column in variable to a delimited list. Same as SPLIT tag. Params: variable Input table. col Column number in variable to convert. delimiter Character separator. COOKIEREAD(cookie_var) Reads cookie variable from an HTML cookie. Params: cookie_var Name of cookie variable. COOKIEWRITE(cookie_var,cookie_value,expires) Writes to HTML cookie variable. Params: cookie_var Name of cookie variable. cookie_value Value to write to cookie_var. expires Expiration date of cookie. COPY source TO destination /COPY Copies a source variable, document, or delimited file to a destination variable, document, or delimited file. Params: source The source variable, document, or delimited file where document is specified as FILE=filename and delimited file is specified as FILE=filename TS=delimiter. destination The destination variable, document, or delimited file where the document is specified as FILE=filename and the delimited file is specified as FILE=filename TS=delimiter.
Appendix C 155 CUT(variable,pattern) Removes first match of pattern from string. Use CUTALL to remove all matches. Usage: CUT(variable,pattern). Params: variable Input text. pattern Pattern pattern being cut. DBADD(dbname) and DBADD(dbname,fieldlist) Adds a new record to a database using current variables. Returns a status result. fieldlist Specific fields to place in record. If fieldlist is specified, then only those fields in the list are placed in the record. DBBATCHADD(dbname,variable,fieldlist,flag) Import multiple records into database from array. Same as DBLOAD tag. variable Source variable. fieldlist Specific fields to change in record. If fieldlist is specified, only those fields in the list are updated. flag Set to Y or N to enable or disable import of overflow data. DBBATCHEDIT(dbname,variable,fieldlist) Edit multiple fields in database. variable Source variable. fieldlist Comma-separated list of fields to change in record. fieldlist must contain physical record, *RECORD. See DBFIND. Only those fields in the list are updated. DBBATCHDELETE(dbname,variable,recordcol) Delete multiple records in database. variable Source variable. recordcol Column position of physical record, *RECORD, in variable. See DBFIND. DBDELETE(dbname,record) Deletes a record from database. Returns a status result. Usage: DBDELETE(dbname,record). record Record number of record to remove.
156 Advanced Web Software Made Easy DBEDIT(dbname,record) and DBEDIT(dbname,record,fieldlist) record Record number of record to remove. fieldlist Specific fields to change in record. If fieldlist is specified, then only those fields in the list are updated. DBFIND(dbname,query,from,to,fieldlist) Retrieves records from a database. Returns the result in table. Places the status result in TAGRESULTS. query Boolean search expression. from Number of first result to return. to Number of last result to return. fieldlist Specific fields to return from database. Each record returned is placed in a different row. Each field is placed in a column based on its order in the fieldlist. Specify RECORD for logical record and *RECORD for physical record. Status: TAGRESULTS[1,1] TRUE or FALSE TAGRESULTS[2,1] Number of records returned. TAGRESULTS[3,1] First match number returned. TAGRESULTS[4,1] Llast match number returned. TAGRESULTS[5,1] Total matches in database. TAGRESULTS[1,2] OK or error message. DBFINDJ(dbname,query,from,to,fieldlist,results,field) Retrieves records from a database, joining with prior search result. Returns result in table. Places a status result in TAGRESULTS. Params: dbname Database database name. query Boolean search expression. from Number of first result to return. to Number of last result to return. fieldlist Specific fields to return from database. Each record returned is placed in a different row. Each field is placed in a column based on its order in the fieldlist. Specify RECORD for logical record and *RECORD for physical record. results Search result table. col Join column in results table. field Join field in database. Status: TAGRESULTS[1,1] TRUE or FALSE TAGRESULTS[2,1] Number of records returned. TAGRESULTS[3,1] First match number returned. TAGRESULTS[4,1] Last match number returned.
Appendix C 157 TAGRESULTS[5,1] Total matches in database. TAGRESULTS[1,2] OK or error message. DBFINDSORT(dbname,query,from,to,sfield,order,fieldlist) Retrieves records from a database sorted by field. Returns the result in table. Places the status result placed in TAGRESULTS. query Boolean search expression. from Number of first result to return. to Number of last result to return. fieldlist Specific fields to return from database. Each record returned is placed in a different row. Each field is placed in a column based on its order in the fieldlist. sfield Sort field. order Sort order, Y or N. Status: TAGRESULTS[1,1] TRUE or FALSE. TAGRESULTS[2,1] Number of records returned. TAGRESULTS[3,1] First match number returned. TAGRESULTS[4,1] Last match number returned. TAGRESULTS[5,1] Total matches in database. TAGRESULTS[1,2] OK or error message. DBGET(dbname,query,num) Updates current variables from a queried record in a database. Returns status result. query Boolean search expression. num Result number to return. Status: [1,1] TRUE or FALSE. [2,1] Number of records returned. [3,1] First match number returned. [4,1] Last match number returned. [5,1] Total matches in database. [1,2] OK or error message. DBGETREC(dbname,record) Updates current variables from a record in a database. Returns a status result. record Database record to remove. Status: [1,1] TRUE or FALSE. [1,2] OK or error message. Example: stat=dbgetrec( /apps/work/db/mydb,43)
158 Advanced Web Software Made Easy DBREMOVE(dbname,query) Deletes queried records from a database. Returns a status result. query Boolean search expression. Status: [1,1] TRUE or FALSE [2,1] Total number of records deleted. [1,2] OK or error message. DISPLAY source /DISPLAY Inserts text into an HTML document from source variable, file, or variable array. If FILE= is specified, content is loaded from a file. If NAME= is specified, data is loaded from an array and variable is repeatedly displayed, once for each row of the array. Params: source Variable, FILE=filename, or NAME=array expressions, such as: DISPLAY x /DISPLAY, or DISPLAY FILE= abc.txt /DISPLAY, or DISPLAY NAME=x [1] [2] [3]<br> /DISPLAY. EXPAND FILE=file /EXPAND Expands HTML/OS code into an Overlay from file. Params: file Filename. Contents of the file are inserted into the current Overlay from file and executed. FILESCRAMBLEKEY(domain,productcode) and FILESCRAMBLEKEY(domain,productcode,versioncode) Get registration key from target domain name, product code, and version code. Params: domain Target domain name. productcode Product code specified in Bundle Bee. versioncode Five digit code. Default is 00000. FOR NAME=name VALUE=value1 TO value2 DO instructions /FOR and FOR NAME=variable ROWNAME=rowvar DO instructions /FOR Repeats instructions as integer increments from one value to another, or repeats instructions as row increments from top row of table to bottom row of table. Params: integer Variable being changed. value1 First value of integer. value2 Last value of integer. rowvar Name of table containing one row from variable. instructions HTML/OS instructions repeated. FUNCTION otag(param,...) DO instructions RETURN var /RETURN /FUNCTION Defines a function (Overlay Tag).
Appendix C 159 Params: otag Name of Overlay tag (function) being defined. param Temporary name of function parameter(s). instrucs Instructions to be executed when function is run. var Value returned by function. GETCOLEQ(variable,col,pattern) Extracts from multirow variable those rows with a column entry that equals a pattern. Returns table with matching rows. Params: variable Input table. col Column to match. pattern String to match to entry in column. GETCOLNOTEQ(variable,col,pattern) Extracts from multirow variable those rows with a column entry that does not equal a pattern. Returns table with nonmatching matching rows. Params: variable Input table. col Column to search. pattern String to match to entry in column.. GOTO destination Continues the execution of code at top of specified file if the destination is a filename. Redirects the user to Web location if destination is a URL. Params: destination URL or file name. IF test -THEN instruc ELIF instruc ELSE instruc /IF Executes instructions between THEN and /IF, ELSE or ELIF, respectively if test is TRUE, otherwise skips instructions and executes instructions between ELSE and /IF (if ELSE is specified) or performs next test (if ELIF is specified). Params: test Boolean test. For example, a= TRUE. instruc HTML/OS instructions being conditionally executed. ISDATE(variable) Returns TRUE if the string is a proper HTML/OS date. Otherwise, returns FALSE. Params: variable Input variable. ISFILE(filename) Returns TRUE if a file exists. Otherwise returns FALSE. Params: file Name of file. ISINTEGER(variable) Returns TRUE if input is a valid integer. Otherwise returns FALSE. Params: variable Input variable.
160 Advanced Web Software Made Easy ISSTARTLINK(file) Returns TRUE if page is enabled Start-link FALSE if not. Params: file Filename LEFT(variable,number) Returns the specified leftmost number of characters of a string. number Number of leftmost characters to return. LENGTH(variable) Returns length of a character string. LISTTOCOL(variable,delimiter) Converts list to a one-column variable. Params: variable Input list. delimiter Character separator between items in list. LOCATE(variable,pattern) Returns the position of a pattern in string. Returns #0 if not found. pattern Pattern being searched. MAIL variable TO ADDRESS=address SUBJECT=subject /MAIL E-mails message to an e-mail address. Params: variable Input message. address E-mail address. subject E-mail message subject line. MIDDLE(variable,number1,number2) Returns substring of character string. number1 Position in variable of left-most character to return. number2 Position in variable of right-most character to return. PASTETABLE(variable1,col,row,variable2) Pastes table over another. Top table s upperleft corner positioned at specified cell in first table. Params: variable1 First table. variable2 Top table. col Column position in first table for upper-left corner of top table. row Row position in first table for upper-left corner of top table.
Appendix C 161 REPLACE(variable,pattern1,pattern2) Returns a string with first pattern in an input string substituted for another. Use REPLACEALL to replace all patterns in input string. pattern1 Pattern being replaced (replacement done on first match only). pattern2 Pattern being substituted. RIGHT(variable,number) Returns the specified rightmost number of characters of a string. number Number of rightmost characters to return. ROW(variable,variable,variable,..) Returns one-row table with specified columns. Params: variable Column entry. ROWS(variable) Returns number of rows of specified variable. The tag COLS returns number of columns. Params: variable Specified variable. SPLIT(variable,delimiter) See LISTTOCOL. SQRT(number) Returns square root of specified number. Params: number Specified number. SYSACCESS(filename,variablelist,flag) Enables or disables direct access to document using Start-link. Params: filename Document name. variablelist Comma-separated list of Start-link variables. flag Set to ALLOW or DENY to ENABLECOOKIE enable or disable access. TIMEFROM(variable,units) Returns the number of minutes or hours since a specified time. Returns 0 if in the future. Params: variable Input date. units Output units (MINUTES, HOURS, DAYS).
162 Advanced Web Software Made Easy TIMETILL(variable,units) Returns the number of minutes or hours to a specified time. Returns 0 if in the past. Params: variable Input date. units Output units (MINUTES, HOURS, DAYS). UPPER(variable) Returns upper-case value of input variable. Params: variable Input string. WHILE test DO instructions /WHILE Repeats instructions as long as test returns TRUE. Params: test Boolean test. For example, a= TRUE. instructions HTML/OS instructions repeated.