|
|
|
SQL COMMANDS
SQL REFERENCE
TEXT QUERIES
IMPORTING DATA
|
TEXIS WEBSCRIPT
<A>
<BREAK>
<CAPTURE>
<DB>
<EXEC>
<EXPORT>
<IF>, <ELSE>, <ELSEIF>
<LOCAL>
<LOOP>
<PUTMSG>
<READLN>
<RETURN>
<SCHEDULE>
<SQL>
<SQLCACHE>
<STACK>
<SWITCH>, <CASE>
<TIMEOUT>
<TIMPORT>
<TRACESQL>
<TRAP>
<USER>, <PASS>
<USES>
<VERB>
<WHILE>
<WRITE>
<abstract>
<adminsql>
<apicp>
<cal>
<caldate>
<calendar>
<checkbox>
<clist>
<code2geo>
<count>
<createdb>
<decrypt>
<encrypt>
<exit>
<fetch>
<flush>
<fmt>, <strfmt>
<geo2code>
<getpid>
<getvar>
<hash>
<header>
<kill>
<loadavg>
<loguser>
<lower>
<mm>
|
<nsinfo>
<nslookup>
<options>
<pdfxml>
<procexists>
<profiler>
<pwencrypt>
<radiobutton>
<rand>
<randpick>
<read>
<readvars>
<resetstats>
<rex>, <split>
<rmcommon>
<sandr>
<sb>
<send>
<setvar>
<sleep>
<slist>
<sort>
<spew>
<sqlcp>
<srand>
<stat>
<strcmp>, <strcmpi>
<strlen>
<strncmp>, <strnicmp>
<strrev>
<strstr>, <strstri>
<strtonum>
<submit>
<substr>
<sum>
<syscp>
<sysinfo>
<sysutil>
<uniq>
<uniqcount>
<upper>
<urlcp>
<urlinfo>
<urltext>, <urllinks>
<urlutil>
<userstats>
<varinfo>
<vxcp>
<vxinfo>
<wordlist>, <wordcount>
<xtree>
Special variables
Variable assignment
|
|
IMPORTING DATA
Timport is a general purpose import tool which can import
a wide range of text formats, including comma separated,
mail-messages, DBF format from PCs, as well as allowing
custom formats to be specified.
timport -s <schema> <datafiles>
SQL COMMANDS
ALTER USER user-name IDENTIFIED BY password
Changes user-name's password to password. You must be
logged in as that user or _SYSTEM to perform this
operation.
CREATE [UNIQUE] | {[METAMORPH] [INVERTED | COUNTER]} INDEX index-name
ON table-name
(column-name1 [DESC]
[, column-name2 [DESC] ] ...)
| Index Type | Purpose | Updated |
| (unspecified) | A standard BTREE index used for fast lookup and ordering | Automatically as needed |
| UNIQUE | Same as BTREE but prevents replicated keys and records from to being inserted | Automatically as needed |
| INVERTED | Used only for DATE fields, it allows rapid ORDER BY Note: Be sure to create DESC if output is to be inverse chronological order | Automatically as needed |
| METAMORPH | An index for text retrieval speed | On re-issue of CREATE METAMORPH INDEX command |
| METAMORPH INVERTED | A larger METAMORPH index with additional speed for ranking and phrases | On re-issue of CREATE METAMORPH INDEX command |
| METAMORPH COUNTER | A METAMORPH index with additional information for LIKEIN queries | On re-issue of CREATE METAMORPH INDEX command |
See also: Virtual Fields
CREATE TABLE table-name
(column-name1 data-type
[, column-name2 data-type ] ...)
| data-type | description |
BYTE(length) | unsigned 8 bit fixed |
VARBYTE(length) | unsigned 8 bit variable |
CHAR(length) | signed 8 bit fixed |
CHARACTER(length) | same as char |
VARCHAR(length) | signed 8 bit variable |
DATE | 'C' time_t 32bit GMT |
CTIME | same as date |
COUNTER | 64 bit global unique value, may be converted to DATE |
DOUBLE | 'C' double type |
FLOAT | 'C' float type |
INTEGER | 32 bit signed integer |
REAL | same as FLOAT |
SMALLINT | 16 bit signed integer |
INDIRECT | A file treated as a field |
CREATE TABLE table-name AS
SELECT {expression1 [, expression2]...}{...}
FROM table-name1 [alias1] [, table-name2 [alias2] ]...
[WHERE search-condition]
[GROUP BY column-name1 [, column-name2]...
[ORDER BY column-name3 [DESC] [, column-name4 [DESC] ] ...]
CREATE USER user-name IDENTIFIED BY password
Creates a new user with the specified user-name and
password.
DELETE FROM table-name
[WHERE search-condition]
DROP INDEX index-name
See also: SYSINDEX system table
DROP TABLE table-name
See also: SYSTABLES system table
DROP USER user-name
GRANT {ALL}
{privilege1 [,privilege2]...}
ON {table-name}
{view-name}
TO {PUBLIC}
{userid1 [,userid2]...}
| privilege | description |
| ALL | User can do anything (default) |
| DELETE | User can delete records |
| INSERT | User can insert records |
| SELECT | User can read records |
| UPDATE | User can update records |
See also: REVOKE, SYSUSERS system table, CHMOD(1), CHOWN(1)
INSERT INTO table-name[(col-name1 [, col-name2]...)]
VALUES(value1 [, value2]...)
INSERT INTO table-name[(col-name1 [, col-name2]...)]
SELECT-statement
SELECT [DISTINCT] {expression1 [[AS] alias1] [, expression2 [[AS alias2]]...}{...}
FROM table-name1 [alias1] [, table-name2 [alias2] ]...
[WHERE search-condition]
[GROUP BY column-name1 [, column-name2]...
[HAVING search-condition]]
[ORDER BY column-name3 [DESC] [, column-name4 [DESC] ] ...]
| comparison operators |
| =, < ,> , != , >< , >= , <= | standard comparison for all data types |
| [NOT] BETWEEN value1 AND value2 | bracketed range for all data types |
| [NOT] LIKE | Metamorph query for text fields (exact match text retrieval) |
| [NOT] LIKE3 | kewords only match within text field (very fast) |
| LIKER | keyword Relevance ranking within text field (fast, ok precision) |
| LIKEP | relevance ranking within text field (high quality) |
| [NOT] MATCHES | standard SQL MATCH |
| [NOT] IN | Set Membership |
| logic operators |
| AND, OR, NOT | May be used to bind any set of conditions |
| math operators |
| +, -, *, / | may be used on numeric and character data types |
See also: Text Queries
UPDATE table-name
SET column-name1 = expression1
[, column-name2 = expression2]...
[WHERE search-condition]
SQL REFERENCE
The aggregate functions operate on a set of rows, and
return information about the set as a whole. These are
particularly useful in conjunction with a GROUP BY clause.
| Function | Description |
| AVG() | Average of all the values |
| COUNT() | Number of values |
| MAX() | Maximum Value |
| MIN() | Minimum Value |
| SUM() | Total of all the values |
Column aliasing allows one to change the name of an output
column. This is useful and needed in a couple of
situations.
The first is that Texis WebScript will name
the variable the same as the column name. If the default
name of the column would be an illegal name, or would
conflict with an existing variable, renaming the column
lets you change the variable name at the same time.
The second situation is within the query itself. If you
have a GROUP BY clause with either a HAVING clause or an
ORDER BY clause, then any aggregate or calculated fields
must be aliased, and the alias name used in the HAVING or
ORDER BY clause. This is the only time the alias name can
be used in the query.
One of the commonly desired features in a search interface
is to find similar documents once a good match is found.
The way to do this in Texis WebScript is to use the text2mm
function in combination with a LIKEP query. When you are
selecting the text to display you should also select the
query to use, with the text2mm function:
<EXPORT $nquery>
.
.
<SQL "select Body, text2mm(Body) nquery from ...">
$Body
<A HREF=$url/morelike.html>Find Similar</A>
</SQL>
In the morelike function a LIKEP query is used to find
the similar documents.
<A NAME=morelike>
<SQL "select id, Title from ... WHERE Body LIKEP $nquery">
<showrow>
</SQL>
</A>
The order in which tables are specified in the FROM clause
can significantly affect the query speed. Texis will try and arrange the tables in the best order. To disable this if you are sure you know the correct ordering you can use set nooptimize='join';, in which case Texis will
process the tables in the order specified in the FROM
clause. Because of this you should put the tables which
can initially return the smallest number of rows first,
preferably with an index. For example if you have two
tables, one of customers, and the other of orders. You
don't know the customer number of 'John Doe', but you want
to see all his orders the correct way to write the query is
SELECT cust.name, orders.text FROM cust,orders WHERE
cust.name = 'John Doe' and orders.custid = cust.id;
If cust.name is indexed it will find the customer record
with the index, and then use an index on orders.custid to
find the orders. If you switched the FROM clause it would
look at each order, find the corresponding customer, and
see if the name was 'John Doe', which will be slower.
Literals are quantities that are obtained from the SQL
statement rather than from a column. There are three
types of literal available in SQL:
- Integers
- Floating point numbers
- Character Strings
The range available in the numeric literals is machine
dependent. You can typically count on at least the range
in a long or double respectively.
Character strings are delimited by single quotes. To
include a single quote in a string it should be doubled.
For example:
'He''s one of us now.'
Texis includes a number of functions that can be used to
manipulate data at the server. The functions are as follows:
| Function | Description |
| File Functions |
fromfile(filename) fromfiletext(filename) | Returns the contents of a file |
| totext(text or filename) | Converts a PDF or wordprocessor file to text |
| toind(text) | Stores the text into a texis managed indirect and returns the filename |
| String Functions |
| abstract(text[, maxsize[, style[, query]]]) | Abstract a block of text |
| text2mm(text[, words]) | Generate a query from a block of text |
| length(text) | Returns the length of a block of text |
| lower(text) | Returns the lowercase form of a block of text |
| upper(text) | Returns the uppercase form of a block of text |
| initcap(text) | Returns the text with the first letter of every word in uppercase |
| sandr(search, replace, text) | Returns the text with search replaced by replace | | Other Functions |
| exec(cmd[, args]) | Allows execution of external commands |
| mminfo(query, text) | Find out hit offset information |
| convert(data, type) | Converts fields from one type to another |
| seq(increment[, init]) | Returns a number increment than the last, or init |
| random(max[, seed]) | Returns a random number less than max |
| math functions | acos, asin, atan, atan2, ceil, cos, cosh, exp, fabs, floor, fmod, log, log10, pow, sin, sinh, sqrt, tan, tanh |
| date functions | dayname, month, monthname, dayofmonth, dayofweek, dayofyear, quarter, week, year, hour, minute, second |
Table aliasing allows the renaming of table in the query.
This has two uses. The first is simply a typing aid, in
that a long table name can be aliased to a shorter name.
The second, and more interesting use, is that it allows a
table to be joined to itself. One example of this would
be to generate a listing of employees and bosses.
SELECT boss.name Boss, emp.name Employee
FROM employees emp, employees boss
WHERE boss.id = emp.boss_id
Some of the properties of Texis can be modified by issuing
SQL SET statements. The syntax of the SET statement is
SET property = value
The value should be a literal string or number.
In the following table are the most
useful properties, and what they do:
| Property | Value |
| indexspace | A directoy to store indices.
You can put indices in a different directory either for
space reasons, or to improve performance. |
| addexp | An expression to use for creating
metamorph indices. This adds to the expressions. The
default expression is \alnum{2,99} which should catch most
English words. |
The properties only remain in effect for the duration of
a connection to the database. This is typically one
invocation of Texis.
Properties that affect Metamorph indices are kept with
the index and do not need to be respecified. If you want
to change the properties of an index you will need to drop
it and re-create it. If searching must be maintained you
can create a new index first with a different name, and
then drop the old index.
When generating a query with a group by clause it is
necessary to put the proper portions of the query in the
WHERE clause and in the HAVING clause.
The WHERE clause will affect which rows are selected from
the table to be grouped. The HAVING clause will determine
which groups are actually returned.
For example the query:
SELECT DEPT, AVG(SALARY) AVSAL FROM EMPLOYEES
WHERE SALARY > 50000
GROUP BY DEPT
will select for each department the average salary of
those people with a salary over 50,000. The query:
SELECT DEPT, AVG(SALARY) AVSAL FROM EMPLOYEES
GROUP BY DEPT
HAVING AVSAL > 50000
will select only those departments having an average
salary over 50,000.
TEXIS WEBSCRIPT
<A NAME=name [PUBLIC|PRIVATE] [param[=value|$var] ...]>
... statements ...
</A>
Defines a function with given name. Parameters are local variables in the
function, initialized with the named arguments from a call.
| Flag | Action | Default |
PUBLIC |
Function is user-visible: can be entry point to script. |
If no functions are declared PUBLIC or PRIVATE |
PRIVATE |
Function is private: cannot be called outside of script. |
If any function is declared PUBLIC or PRIVATE |
<BREAK>
Ends innermost enclosing <WHILE>,
<SQL>, <LOOP>,
<READLN> or <TIMPORT> statement.
See also <WHILE>, <SQL>, <LOOP>,
<READLN>, <TIMPORT>
<CAPTURE [flags]>
...
</CAPTURE>
Redirects output inside block to $ret at close of block.
| Flag | Action |
BIN | Returned value is binary. |
OUTPUT | Also print output normally. |
Return value in $ret: output of statements within block.
See also <EXEC>, <WRITE>
<DB = path>
As directive (before any functions), sets default script
database for <SQL> statements, state table.
As a statement at run time (inside a function), changes to new database
for <SQL> statements.
| Version | Default Database |
| Webinator | db subdir of script's directory |
| Commercial Windows | c:\morph3\texis\testdb |
| Commercial Unix | /usr/local/morph3/texis/testdb |
<EXEC [flags] program [arg ...]>
... input to program ...
</EXEC>
Program is executed with given arguments; each value
becomes one command-line argument. Enclosed
statements' output is piped to program's input.
Program output returned in $ret, one line
per value.
| Flag | Action |
NOBR | Don't split output into lines. |
BIN | Output is binary. Implies NOBR. |
BKGND | Execute in background; will not wait for program exit.
Output ignored, $ret value is PID of program. |
See also <CAPTURE>, <WRITE>
<EXPORT $var1 [$var2 ...] [flags]>
Marks variables to be saved and restored at next script
invocation.
| Vars saved to | Which vars | When saved |
| State table | Non-LOOP/SQL vars | First time $url printed when vars set |
| URL | LOOP/SQL vars | Every time $url printed inside a loop |
| URL query string | <EXPORT QUERY> vars | Every time $urlq printed |
| Flag | Action |
URL | Always export these variables to URL |
TABLE | Always export these variables to table |
USEROK | User (form) variables may override state values |
QUERY | Export to query string via $urlq |
<IF condition1>
... statements if condition1 true ...
[<ELSEIF condition2>
... statements if condition2 true ...]
[<ELSE>
... statements if both are false ...]
</IF>
Condition may be simple: arg1 op arg2
where op is one of:
eq | Equals |
neq or ne | Does not equal |
gt | Greater than |
gte or ge | Greater than or equal to |
lt | Less than |
lte or le | Less than or equal to |
nmod | Not mod: true if arg1 mod arg2 is 0 |
Or condition may be a SQL where clause.
See also <SWITCH>, <CASE>
<LOCAL var[=value|$var] ...>
...
[</LOCAL>]
Declares variables to be local. Scope ends at </LOCAL> tag, or
end of enclosing block if not given.
See also <A>
<LOOP [SKIP=s] [MAX=m] [REV] $var1 [$var2 ...]>
... statements ...
</LOOP>
Iterates over named variables, one value per loop iteration.
| Attribute | Value |
SKIP | Initial number of values to skip |
MAX | Max number of values to loop |
REV | Whether to loop in reverse order |
| Variable | Value | When Set |
$loop | Loop count (starts at SKIP, default 0) | Start of each iteration |
$next | Next SKIP value | Start of each iteration, and at loop exit |
See also <SQL>, <WHILE>
<PUTMSG call|log|print|all|override on|off>
Directive: sets whether to log, print, and/or call <putmsg> function on errors.
See also <vxcp>
<READLN [options] $file>
...
</READLN>
Reads the given $file one line at a time.
| Option | Action |
REV | Read file in reverse order, and start from end. |
START=$expr | Start returning lines with first one to match REX expresion $expr. |
END=$expr | Stop returning lines when one matches REX expression $expr. |
MAXLINES=$lines | Read at most $lines from the file, regardless of START or END. |
MAX=$n | Return at most $n lines, after START lines. |
ROW | Don't loop $ret: replace previous value each line. |
SKIP=$lines | Skip the first $lines returned lines (after START). |
Return value in $ret: each line from file.
See also <read>, <spew>
<RETURN [$ret]>
Exits current function, optionally setting $ret.
See also <exit>
<SCHEDULE [options] WHEN=schedule [var=val] [...]>
Schedule script for periodic execution according to schedule, which is
a vCalendar schedule or one of the following syntaxes:
minutes
[EVERY] [n] DAY[S]|DAILY timeofday [minutes]
[EVERY] [n] WEEK[S|LY] [ON] weekday timeofday [minutes]
[EVERY] [n] MONTH[S|LY] [ON] [THE] FIRST|SECOND|THIRD|FOURTH|n [TO LAST] weekday|DAY [OF THE MONTH] timeofday [minutes]
where:
minutes = [EVERY] [n] MIN[UTE[S]] [[REPEAT] n [TIME[S]]
timeofday = AT [h]h[:][[m]m] [A|P[M]]
weekday = SUN|MON|TUE|WED|THU|FRI|SAT
| Option | Controls |
START=date | Start schedule on or after Texis-parseable date (default now) |
URLEND=/func.txt | Append /func.txt to URL when running script |
COMMENT=text | Add comment to schedule listing for -LS command-line option |
After all options, a list of variable assignments to pass to the script can be given.
<SQL [flags] "SQL command" [$cmd ...]>
... statements ...
</SQL>
Executes SQL command once, looping for each row returned.
Returned fields become variables, one value added per iteration
as in a <LOOP>.
| Attribute | Value |
SKIP=n | Initial number of rows to skip |
MAX=n | Max number of rows to return |
NOVARS | Flag: don't return variables from SQL statement |
ROW | Flag: return vars in a single row, don't append into list |
DB=db | Override <DB> for this statement |
USER=user | Override <USER> for this statement |
PASS=pass | Override <PASS> for this statement |
NULL=$val | Override $null for this statement |
NONULL | Flag: don't use $null for this statement |
| Variable | Value | When Set |
$loop | Number of rows returned (does not include SKIP) | Start of each iteration |
$next | SKIP value for next <SQL> | Start of each loop iteration and loop exit |
$indexcount | Number of index rows (if index used) | Start of first iteration |
Values of arguments after flags are concatenated to form SQL command.
Embedded variable references in command become parameters.
If $null set, parameters matching it and their clauses are dropped from query.
See also <LOOP>, <TIMPORT>
<SQLCACHE = n>
Directive: number of Texis handles to cache for SQL
statements.
See also <SQL>, <sqlcp>
<STACK=n>
Directive: sets Vortex call stack limit (-1 for no limit). Default is 250.
One stack item used per function, block or loop call.
See also <vxcp>
<SWITCH switchval>
<CASE value1>
... statements if switchval = value1 ...
[<CASE op value2>
... statements if switchval op value2 is true ...
...]
[<DEFAULT>
... statements if no matches above ...
]
</SWITCH>
switchval is a single variable or literal.
First matching (true) <CASE>
is executed. If none match and <DEFAULT>
is present, it is executed.
Same operators as <IF>, <ELSE>, <ELSEIF>
<TIMEOUT = n>
... HTML to print on timeout ...
</TIMEOUT>
Sets overall time limit on each script execution.
Default: 30 seconds.
<TIMPORT [flags] $schema [FROMFILE] $data|$file>
... statements ...
</TIMPORT>
Imports data from each element of buffer
$data (or file $file if
FROMFILE) using TIMPORT schema
$schema. Returned fields become variables;
loop executed once per row ala <SQL>.
| Attribute | Value |
SKIP=n | Initial number of rows to skip |
MAX=n | Max number of rows to return |
NOVARS | Flag: don't return any variables |
ROW | Flag: return vars in a single row, don't append into list |
FROMFILE | $file is filename list, not text buffer |
| Variable | Value | When Set |
$loop | Number of rows returned (does not include SKIP) | Start of each iteration |
$next | SKIP value for next <TIMPORT> (given same data) | Start of each iteration and loop exit |
See also <SQL>
<TRACESQL on|off|N>
Directive: turns SQL statement tracing on or off.
See also <sqlcp>
<TRAP [CONNRESET=on|off|N] [[SIGNALS=]on|off]>
Directive: turns signal and connection-reset trapping on or off.
For diagnostive purposes; not for general use.
See also <vxcp>
<USER = user>
<PASS = pass>
Sets user and password to access SQL database with.
Must be called before <SQL> statements.
See also <DB>
<USES [DATE=date] module[=file] [module[=file] ...]>
List of modules to link in from library.
<VERB [NOESC]>
... raw text ...
</VERB>
Enclosed text is output as-is (no Vortex statements),
but HTML-escaped. If NOESC, text is
verbatim (no HTML escapement).
See also <send>
<WHILE condition>
... statements ...
</WHILE>
Loops over statements while condition is true.
Condition has same syntax as <IF>.
$loop set every iteration, starting with 0
before first iteration. <BREAK> will also exit the loop.
See also <IF>, <ELSE>, <ELSEIF>, <BREAK>
<WRITE [APPEND] $file>
...
</WRITE>
Redirects output inside block to $file. Appends instead of truncates
if APPEND given. If $file is "-" (single
dash), output goes to stdout (ie. no-op). If $file is "--"
(two dashes), output goes to top-level stdout (ie. "break through" outer
<CAPTURE> etc. blocks).
Return value in $ret: nothing (no effect on $ret).
See also <CAPTURE>, <EXEC>
<abstract $text [$maxsz [$style [$query]]]>
Generate an abstract of the supplied $text
value(s), of up to $maxsz (default 230)
characters. $style is either smart
(look for meaningful text) or dumb (just
first part of text). If $query is given, query is searched
for in text and abstract is centered on the best hit.
<adminsql [arg ...]>
Execute an arbitrary SQL statement, the concatenation
of args. Prints result rows in an HTML table.
Return value in $ret: None
See also <createdb>
<apicp $name $value>
Modify Metamorph control parameters. Boolean settings take on,
true, yes or a nonzero value to turn on; opposite to turn off.
Query protection settings:
| Name | Setting | Default |
alpostproc | Allow post-processing | off |
allinear | Allow linear searches | off |
alequivs | Allow equivalences | off |
alintersects | Allow @ intersections | off |
alnot | Allow "NOT" logic (- operator) | on |
alwithin | Allow /w within operator | off |
alwild | Allow wildcards | on |
qminprelen | Minimum character length of wildcard prefix | 2 |
qminwordlen | Minimum character length of term | 2 |
qmaxsets | Maximum allowed number of sets | 100 |
qmaxsetwords | Maximum allowed number of words per set | 100 |
qmaxwords | Maximum allowed number of words in overall query | 100 |
denymode | Action to take on disallowed query | warning |
texisdefaults | Set Texis defaults (allow linear, post-processing, etc.) | -- |
defaults | Restore Vortex defaults | -- |
Query processing settings:
| Name | Setting | Default |
exactphrase | Exact phrase processing | off |
prefixproc | Prefix processing | off |
suffixproc | Suffix processing | on |
rebuild | Word rebuilding | on |
incsd | Include start delimiter in hits | off |
inced | Include end delimiter in hits | on |
withinproc | Within (/w) processing | on |
minwordlen | Minimum word length for prefix/suffix processing | 255 |
intersects | Default number of intersections | 255 |
see | Look up "see also" references during equivalence lookup | off |
keepeqvs | Use equivalences for words/phrases | off |
keepnoise | Keep noise words in query | off |
sdexp | Default start delimiter expression | None |
edexp | Default end delimiter expression | None |
eqprefix | Equivalence file name | builtin |
ueqprefix | User equivalence file name | /usr/local/morph3/eqvsusr; or USROBJECTS.tbl file in database for Webinator |
suffix | Suffix list used during search | see manual |
suffixeq | Suffix list used during equivalence lookup | see manual |
prefix | Prefix list used during search | see manual |
noise | Noise words | see manual |
Return value in $ret: None
<cal [options] [$dates [$events [$var ...]]]>
[</cal>]
Prints a calendar of events with links. $dates are the dates,
$events are the corresponding text to print. In the looping syntax,
the programmer must print each day's <TD>, text and </TD>.
| Option | What it does | Default |
TYPE=type | Sets type: week, month,
quarter or year | Determined from
$dates range |
DATEVAR=date | Name of variable to set to each day's date |
date |
DAYFUNC=/day.html | URL function/MIME extension for day-number links |
/day.html |
EVENTFUNC=/event.html | URL function/MIME extension for event links |
/event.html |
MAXEVENTS=5 | Max events to print per day. |
5 |
BORDER=1 | BORDER value for table |
1 |
WIDTH=100% | WIDTH value for table |
100% |
HEIGHT=50% | HEIGHT value for table |
50% (except for week format) |
CELLPADDING=1 | CELLPADDING value for table |
1 |
CELLSPACING=0 | CELLSPACING value for table |
0 |
WEEKLEN=1 | Length of weekday name strings to print |
1 for quarter and year, else full length |
MONTHFMT="%B %Y" | Date format to print month header |
%B for year, else %B %Y |
DAYFMT="%e" | Date format for non-event days' numbers |
%e |
NEWDAYFMT="%b %e" | Date format for week type days that start a new month |
%b %e |
EVENTFMT="<B>%e</B> | Date format for event days' numbers |
<B>%e</B> |
MONTHCLASS=class | Style CLASS for month header |
none |
WEEKCLASS=class | Style CLASS for weekday names |
MONTHCLASS if given, else none |
DAYCLASS=class | Style CLASS for non-event days |
none |
EVENTCLASS=class | Style CLASS for event days |
DAYCLASS if given, else none |
START=date | Start date for calendar |
Earliest $dates value |
END=date | End date for calendar |
Latest $dates value |
NOHREF | Flag: don't link any days or events |
Off |
<caldate $varprefix>
Returns a list of dates from the variables submitted
from a <calendar> form, using the variable
prefix $varprefix
See also <calendar>, <cal>
<calendar $year $month $day $hour $min ["am"|pm" [$prefix [flags ...]]]>
or
<calendar $date [$prefix [flags ...]]>
Note: This function is obsolescent. Use <cal> instead.
Prints a calendar HTML form. Submitted date(s)
can be read with <caldate>.
| Argument | Value |
$year | Year (4-digit) |
$month | Month number (January = 1) |
$day | Day of month |
$hour | Hour (24-hour unless am/pm flag) |
$minute | Minute (00-59) |
| am/pm | AM/PM (and $hour is 12-hour) |
$prefix | Form variable name prefix (default cal) |
$date | Texis-parseable date |
| Flag | Value |
| radio | Radio buttons for days (default) |
| checkbox | Checkboxes for days |
| julian | Julian days (days into year) |
Return value in $ret: None
See also <caldate>, <cal>
<checkbox $name $values $selected $output>
| Argument | Value |
$name | Name of checkboxes |
$values | Option values |
$selected | Which $values should be SELECTED |
$output | User-visible values |
Return value in $ret: None
See also <radiobutton>, <options>
<clist $values>
Return value in $ret: $values in one parenthetical, comma-separated string
See also <slist>
<code2geo $num>
Decodes number from <geo2code> back into latitude/longitude
(returned as space-separated numbers in string).
See also <geo2code>
<count $var>
Return value in $ret: Number of values of $var
<createdb $db $syspass $publicpass>
Creates the database $db with given
_SYSTEM and PUBLIC passwords.
Return value in $ret: success or fail message
See also <adminsql>
<decrypt $data $key>
Decrypts $data with $key.
See also <encrypt>
<encrypt $data $key>
Encrypts $data with $key.
See also <decrypt>
<exit [$code]>
Exits script, with optional exit code (default 0).
<fetch $theURL [$rawdoc]>
or (parallel version)
<fetch PARALLEL[=n] [URLS=]$urls [$loopvar ...]>
...
</fetch>
Return value in $ret: Raw (unformatted) document at URL $theURL,
or contents of $rawdoc as if it were.
Parallel version: Up to n (default all) $urls are retrieved
simultaneously. Completed URLS returned, fastest first, one per loop iteration.
Use <urlinfo> for information about current URL in loop. $loop and
$next incremented each iteration.
See also <submit>, <urltext>, <urllinks>,
<urlcp>, <urlinfo>
<flush>
Flushes any pending output. Returns nothing.
<fmt format [arg ...]>
<strfmt format [arg ...]>
Standard printf formats |
| Format code | Prints argument as |
%d, %i | Decimal integer |
%u | Unsigned decimal integer |
%x, %X | Hexadecimal integer |
%o | Octal integer |
%e, %E | Floating-point exponential |
%f | Floating-point (no exponent) |
%g, %G | Floating-point (%e or %f) |
%c | Single character |
%s | String |
%% | % sign |
|
| Flag | What | Applies to formats |
- | Left adjustment | All |
+ | Sign positive numbers | All numeric |
(space) | Leading space for positive numbers | All numeric |
0 | Pad with 0's instead of spaces | All numeric |
# | Alternate format | %o, %x, %X, %e, %E |
m.n | Width, precision | All except %ms, %mU, %mH |
h | Arg is short int | Integer numeric |
l | Arg is long int | Integer numeric |
|
| Additional formats/flags |
| Format code | Prints argument as |
%t | Date/time (Texis date or counter field) |
%T | UTC (Universal time) date/time |
%U | URL encode string |
%H | HTML encode string |
%V | UTF-8 encode an ISO-8859 (ASCII) string |
%v | UTF-16 encode a UTF-8 string |
%B | base64 encode string; field width is chars per line to print |
%b | Binary integer |
%r, %R | Roman numeral |
%F | Fractional output of float |
|
| Flag | Subflag | What | Applies to |
m | | Metamorph query and markup; next arg is query | %s, %U, %H |
| | b | Bold hit highlighting |
| | | h | HTML hit highlighting (default) |
| | | n | No backoff of hits inside <> |
| | | p | Paragraph formatting: double newlines replaced with <P> |
| | | P | Paragraph formatting: next arg (REX expression) replaced with <P> |
| | | c | Continue subhit count into next query |
a | | Next arg is strftime() format | %t, %T |
k | | Put a "," every 3 places to left of decimal | %d, %i, %u, %f, %g |
K | | Put next arg (string) every 3 places to left of decimal |
& | | Pad with instead of space | %s, %d, %i, %u, %f, %g |
_ (underscore) | | Pad with ASCII 160 byte ( code) instead of space | %s, %d, %i, %u, %f, %g |
_ (underscore) | | Skip (don't print) leading BOM in UTF-16 output (%v); save (don't delete) leading BOM in UTF-16 input (%!v) | %v, %!v |
< (less-than) | | Force UTF-16LE (little-endian) input/output | %v, %!v |
> (greater-than) | | Force UTF-16BE (big-endian) input/output | %v, %!v |
! | | Decode instead of encode | %H, %U, %V, %v, %B, %c |
h | | HTML-escape out-of-range (>255 for %!V, >0x10FFFF for %v) characters instead of printing as ? | %!V, %v |
h | | HTML-unescape sequences in source data | %V, %!v |
hh | | Also HTML-escape low (7-bit) characters | %V, %!V, %v, %!v |
l (el) | | Only encode low (7-bit) characters, or decode to 7-bit (multi-char) strings | %H |
q | | Full encoding: encode forward-slash and at-sign too | %U |
p | | Paragraph markup for %s and %H codes; path escapement (%20 instead of +) for %U code | %s and %H; %U |
w | | Pass argument as "whopping" integer size (max available, usually 64-bit). Automatically set. | %d, %i, %u, %x, %o |
|
Escape sequences in format string:
| Escape | Meaning |
\n | Newline (ASCII 10) |
\r | Carriage return (ASCII 13) |
\t | Tab (ASCII 9) |
\a | Bell (ASCII 7) |
\b | Backspace (ASCII 8) |
\e | Escape (ASCII 27) |
\f | Form feed (ASCII 12) |
\v | Vertical tab (ASCII 11) |
\\ | Backslash |
\xhhh | Hexadecimal escape; hhh is 1 to 3 hex digits. |
\0ooo | Octal escape; ooo is 0 to 3 octal digits. |
Return value in $ret: None for <fmt>,
printed string for <strfmt>
<geo2code $lat $lon [$radius]>
Encodes latitude/longitude values into hash for BETWEEN (xxx, yyy) search.
Returns one integer, or (xxx, yyy) string for box if $radius
given.
See also <code2geo>
<getpid>
Returns process id (integer) of current Vortex process.
See also <procexists>
<getvar $var>
Returns the values of the variable named by $var.
See also <readvars>, <setvar>
<hash $buf>
Returns a counter type hash value for
text buffer $buf. Different buffers
almost certainly produce different hash values.
<header NAME=$name [VALUE=$value]>
<header COOKIE=$cookie [VALUE=$value] [cookie-options]>
Prints HTTP header, if called before any output is generated. Prints generic header
$name with $value, or Set-Cookie header
if COOKIE used. More useful alternative to .bin URL syntax.
COOKIE Attribute | Value |
MAX-AGE=seconds | Maximum age of cookie, in seconds |
EXPIRES=date | Expiration time of cookie (alternate to MAX-AGE) |
PATH=path | Root URL path cookie will be returned for |
DOMAIN=.domain | Domain cookie will be returned for |
<kill $pid [$sig]>
Sends signal $sig (default SIGTERM) to each process $pid.
Signals may be names or numbers. Not supported under Windows.
See also <getpid>, <procexists>
<loadavg>
Returns the system load averages in 3 values of $ret.
<loguser $REMOTE_ADDR [$limit]>
Return value in $ret: success or fail message (fail if over $limit (5) unique users in the past minute)
See also <userstats>, <resetstats>
<lower $str>
Returns each value of $str in all lowercase.
See also <upper>
<mm> ... $variables ... </mm>
Enables automatic hit-markup of variables printed within the block.
See also <sb>, <fmtcp>
<nsinfo $name [$which]>
Returns information about most recently completed <nslookup>
query.
| Name | Value Returned |
addrs | IP address(es) in the reply |
name | Canonical hostname |
aliases | Alias hostnames |
errnum | Internal error number (0 is Ok) |
errmsg | Internal error message |
rawreply | Raw reply packet data |
See also <nslookup>
<nslookup [options] $host|$ip>
or
<nslookup PARALLEL[=n] [options] [HOSTS|ADDRS=]$hosts|$ips [$loopvar ...]>
...
</nslookup>
Looks up $host or IP address $ip and returns
IP address or host name.
Parallel version: n at a time (default all) of $hosts
or $ips list are looked up. $loop, $next
set each loop iteration, results returned fastest first.
| Option | Action |
BYADDR | Force lookup by address (IP to host) |
BYNAME | Force lookup by name (host to IP) |
MTERR | Return empty string on lookup failure |
See also <nsinfo>, <urlcp>, <fetch>
<options $values $selected $output>
Prints an HTML form <OPTION> list
with the given $values.
| Argument | Value |
$values | Option values |
$selected | Which $values should be SELECTED |
$output | User-visible values |
Return value in $ret: None
See also <radiobutton>, <checkbox>
<pdfxml $query $Body [$color]>
Returns Metamorph hit information on PDF document
$Body for a PDF browser plugin.
<procexists $pid>
Returns 1 for each process $pid that exists, 0 if not.
See also <getpid>, <kill>
<profiler INIT $table [$profile [$field]]>
<profiler GET $msg [$profile]>
Help manage a table of fixed message queries.
<pwencrypt $password $salt>
Unix style password encryption. If $salt is empty it will generate a random salt.
<radiobutton $name $values $selected $output>
Prints HTML form radio buttons for given $values.
| Argument | Value |
$name | Name of buttons |
$values | Option values |
$selected | Which $values should be SELECTED |
$output | User-visible values |
Return value in $ret: None
See also <checkbox>, <options>
<rand $min $max>
Return value in $ret: Random integer N, $min <= N < $max
See also <randpick>
<randpick $var>
Return value in $ret: One randomly chosen value of $var
See also <rand>
<read $files [$offsets [$lengths]]>
Return value in $ret: Contents of each file in $files
(1 file per value). Reading starts at $offset into file, default 0,
negative offsets are from end of file. Length read is $length,
default rest of file, negative length is rest of file.
See also <spew>, <READLN>
<readvars $varnames $urldata>
Reads variables from URL-encoded strings in $urldata.
Only vars named in $varnames (if non-empty)
are assigned.
See also <fmt>, <strfmt>'s %U format
<resetstats $REMOTE_ADDR>
Return value in $ret: None
See also <loguser>, <userstats>
<rex $expr $data> <split $expr $data>
or or
<rex [options] $expr $data> <split [options] $expr $data>
... ...
</rex> </split>
Return value in $ret: Data from $data matching REX
expressions in $expr for <rex>; non-match data
for <split>. Non-looping version by default. If any options
given, looping syntax instead, and $loop/$next/$ret.off set.
| Option | What it does |
ROW | Do not accumulate hits in $ret |
SKIP=$n | Skip the first $n hits |
MAX=$n | Return at most $n hits |
SPLIT | Return non-match data instead (<split> behavior) |
NONEMPTY | Return only non-empty hits |
See also <sandr>, Regular expressions
<rmcommon $data $template [$maxrm]>
Removes the prefix and suffix text, on a word boundary, from each $data
value, that is shared with the corresponding $template value. Up
to $maxrm characters are removed (default: maximum amount of common
text).
<sandr $expr $replace $data>
Return value in $ret: Values of $data with each matching $expr REX expression replaced with corresponding $replace value
See also <rex>, <split>
<sb> ... $variables ... </sb>
Enables automatic search and replace ("sandblast") of variables within block.
See also <mm>, <fmtcp>
<send $values>
Prints $values as-is.
Return value in $ret: None
See also <VERB>
<setvar [APPEND] $var $values>
Sets (appends if APPEND given) variable
named $var to given $values.
See also <getvar>
<sleep $seconds [wake]>
If wake given, return value in $ret:
Number of seconds remaining (eg. could be non-zero if signal received)
<slist $intersect $values>
Return value in $ret: $values as Metamorph set query for $intersect intersections
See also <clist>
<sort $var [ICASE|NUM] [DESC|ASC] [$var2 ...]>
Sort variables.
| Flag | Action |
ICASE | Ignore case, and sort alphabetically |
NUM | Sort numerically |
DESC | Sort descending |
ASC | Sort ascending |
Flags apply per-variable.
Return value in $ret if 1 variable,
otherwise variables sorted in place.
See also <uniq>
<spew $files [$offsets [$lengths]]>
Prints contents of each of the $files as-is, starting from
$offsets into files (default start of file, negative offset
is from end of file), for $lengths bytes (default rest of
file, negative length is rest of file). Return value in $ret: None
See also <read>
<sqlcp $name $value>
| Setting | Controls | Default |
cache | Texis handle cache: close closes it, stats to print statistics, resetstats to reset | -- |
singleuser | Texis single-user mode Use with caution! | off |
tracesql | SQL statement tracing; see also <TRACESQL> | off |
traceidx | Metamorph index tracing (diagnostic use) | off |
kdbfiostats | KDBF I/O stats: 0, 1, 2, summary or a file name | 0 |
autocreatedb | Whether to automatically create a database when needed for math | on |
lookahead | Whether to do one-row look-ahead in <SQL> statements for $rows.min | on |
rmlocks [force] [verbose] $db | Removal of stale locks (or entire lock structure if force) for database $db | |
addtable $file [$tbname [$db [$comment [$user [$pass [$nbits]]]]]] | Add .tbl $file as table in database (eg. manually copied from elsewhere) | |
See also <apicp>
<srand $seed>
Seeds the pseudo-random number generator.
See also <rand>
<stat [options] $path> [</stat>]
| Option | Controls |
ROW | Do not accumulate return variables in arrays |
SKIP=n | Skip first n results |
MAX=n | Return at most n results after initial SKIP |
MAXDEPTH=n | Recursively traverse subdirectories too, to a maximum depth of n. Default is 0; -1 is no limit. |
NAME=wildcard | Only return results whose file name matches shell-style wildcard expression |
ALL | Return . and .. directory entries too |
SAMEDEV | Do not cross filesystems from original $path when traversing directories |
DEPTHFIRST | Returns directories' entries before the directory itself when traversing directories |
SYMLINK | Return information about symlinks, not the files they point to (Unix) |
FOLLOWSYM | Also traverse symlinks that point to directories |
GLOB | Expand shell-style wildcards in initial $path first |
SORT=method | Sort each directory's contents by method, which can be none, name (default), size, atime, mtime or ctime |
ASC | Sort each directory's contents in ascending order (default) |
DESC | Sort each directory's contents in descending order |
| Return Var | Type | Value |
$ret | varchar | File path |
$ret.err | varchar | Error from stat() or empty on success |
$ret.depth | long | Number of dirs traversed from top-level $path |
$ret.symlink | varchar | Raw target of symlink (if Unix and path is a symlink) |
$ret.sympath | varchar | Corrected path of symlink |
$ret.size | long or double | Size of file |
$ret.owner | varchar | Owner of file |
$ret.group | varchar | Group of file |
$ret.isrd | long | 1 if file is readable, 0 if not |
$ret.iswr | long | 1 if file is writable, 0 if not |
$ret.isex | long | 1 if file is executable, 0 if not |
$ret.mode | varchar | 10-character ls style permissions/mode string |
$ret.atime | date | Last access time of file |
$ret.mtime | date | Last modify time of file |
$ret.ctime | date | Last status change time of file |
$ret.nlinks | long | Number of hard links to file, if filesystem supports it |
$ret.devtype | long | Device type file is on (if filesystem supports it) |
$ret.dev | long | Device major/minor number (Unix) or 0 for A:, 1 for B: etc. under Windows |
$ret.ino | long | Inode of the file (if supported) |
$ret.blks | long | Number of blocks consumed by file (if supported) |
$ret.blksize | long | Preffered block size for file transfers (if supported) |
See also <sysutil>, <read>, <WRITE>
<strcmp $a $b>
<strcmpi $a $b>
Return value in $ret: an integer for each
comparison of each value of $a (as a string)
against each value of $b:
- < 0 if
$a < $b
- 0 if
$a = $b
- > 0 if
$a > $b
strcmp is case-sensitive;
strcmpi is not.
See also <strncmp>, <strnicmp>
<strlen $str>
Returns length of each given string value.
See also <substr>
<strncmp $a $b $len>
<strnicmp $a $b $len>
Like <strcmp>, <strcmpi> except $len
gives the max length of the corresponding $b
string to use in comparison. Return value is:
- < 0 if
$a < $b
- 0 if
$a = $b
- > 0 if
$a > $b
strncmp is case-sensitive;
strnicmp is not.
See also <strcmp>, <strcmpi>
<strrev $str>
Returns each value of $str, reversed.
<strstr $needle $haystack>
<strstri $needle $haystack>
Return value in $ret: Indices into each
$haystack value of each $needle
value. Indices start at 0 for first character; if not found
value is -1.
<strstr> is case-sensitive,
<strstri> is not.
See also <substr>
<strtonum $text>
Returns: each $text string converted to a number.
<submit [options] URL=$theURL [var=$value ...]>
Fetches $theURL using the HTTP POST method, with given
form variables.
| Option | Value |
URL=$theURL | URL of form. FTP URLs supported (for GET, PUT, and DELETE methods). |
FROMFILE=$file | File to send content from; ``-'' for stdin. |
TOFILE=$file | File to write received content to; ``-'' for stdout. Content-derived fields in <urlinfo> etc. will be unavailable. |
METHOD=$method | HTTP method (OPTIONS, GET, HEAD, POST, PUT, DELETE or TRACE) |
DATA=$data | Raw data to send instead of variables. |
CONTENT-TYPE=$type | Content-type of raw data to send. |
var=$value | Variable to send with form |
Return value in $ret: Result document from form submission
See also <fetch>, <urltext>, <urllinks>, <urlinfo>, <urlcp>
<substr $str $offset $len>
Returns substring starting at offset (0 is first char, < 0 is from string end)
of length $len (< 0 is rest of string) for each corresponding
string $str.
See also <strstr>, <strstri>
<sum $fmt $var [$var2 ...]>
Values of $var | Return value in $ret |
| All numeric (integers or simple floats) | Sum of values, then formatted and cast with $fmt code |
| One or more non-numeric | Each value formatted with $fmt, then string-concatenated |
See also <fmt>, <strfmt>
<syscp $what [$arg ...]>
Controls various system or OS-level parameters.
| Command | Action |
chdir | Change the current working directory to the argument |
See also <sysinfo>, <sysutil>
<sysinfo $what [$arg]>
Gets system/OS information.
| What | Returns |
| time | Wall-clock time; same as date, but sub-second precision (double) |
| proctime | User, system, and real time used by process, in seconds (double). If given, $arg is subtracted |
| procmem | Virtual size and resident set size of process, in bytes. |
| physmem | Physical memory (RAM) of machine, in bytes. |
| getpid | Process id |
| getppid | Parent process id |
| procexists | 1 if process id $arg exists, 0 if not |
| loadavg | 3-value system load average (double) |
| cwd or pwd or getcwd | Current working directory |
| platform | Hardware-vendor-OS-filebits-ptrbits platform description string |
| regquery or regqueryvalue | (Windows only) Registry value, given key subkey name [default] |
| maxdescriptors | Max allowed open file descriptors (-1 if unknown) |
| opendescriptors | Number of currently open file descriptors (-1 if unknown) |
See also <syscp>, <sysutil>
<sysutil $action [options ...] $arg [...]>
| Action and Args | What It Does |
mkdir or md $dir [...] | Creates directories |
chown or lchown $owner $file [...] | Changes ownership of files (or symlinks if lchown). $owner is [owner][.][group]. Unimplemented under Windows. |
chgrp or lchgrp $group $file [...] | Changes the group of files. Unimplemented under Windows. |
chmod $mode $file [...] | Changes file permissions to symbolic or numeric $mode. |
rm or del or delete $file [...] | Removes files. |
rmdir or rd $dir [...] | Removes directories. |
mv or rename $src [...] $dest | Moves each $src file to $dest. |
cp or copy $src [...] $dest | Copies each $src file to $dest. |
link or symlink $target [...] $name | Creates a hard or soft link $name to the given $target. Unimplemented under Windows. |
| Option | What It Does |
msg | Turns on putmsg for this call |
nomsg | Turns off putmsg for this call |
glob | Wildcard-expand source file argument(s) |
recurse | Recursively descend source directories |
force | Force action, even if no file write permission |
preserve | Preserve file attributes for cp |
asis | Copy non-directories as-is instead of as files for cp |
parents | Create needed parent directories too for mkdir |
nnn or [ugoa]=[rwx] | Directory permissions for mkdir |
-- | End of options: following arguments are files |
Returns empty string on success, otherwise a string describing the first error.
See also <stat>, <sysinfo>,
<syscp>
<uniq [SORTED] $var [ICASE|NUM] [DESC|ASC] [$var2 ...]>
Returns unique, sorted list of the given variables.
| Flag | Action |
SORTED | Assume vars are already sorted as per given flags |
ICASE | Ignore case, and sort alphabetically |
NUM | Sort numerically |
DESC | Sort descending |
ASC | Sort ascending |
SORTED flag applies globally.
Return value in $ret if single variable,
otherwise variables modified in place.
See also <sort>
<uniqcount>
Returns an integer list of the counts of each unique value,
after <uniq> is called.
See also <uniq>
<upper $str>
Returns each value of $str in all uppercase.
See also <lower>
<urlcp $param [$value1 [$value2]]>
Controls various page-fetching parameters ($param)
There are several parameter value ($value1) types:
| Setting Type | Value Arguments |
| Boolean (true/false) | 1 value: 1/0, "yes"/"no" |
| Integer | 1 integer value, with optional suffix KB/MB/GB |
| String | 1 string value |
Possible $param settings:
| Name | Type | Controls | Default |
| timeout | integer |
Timeout, in seconds, for <fetch>, <submit>, <nslookup> | 30 |
| maxhdrsize | integer |
Maximum header size, in bytes | 128KB |
| maxpgsize | integer |
Maximum raw page size, in bytes | 512KB |
| maxredirs | integer |
Maximum number of redirects | 5 |
| getframes | boolean |
Whether to fetch frames | no |
| getiframes | boolean |
Whether to fetch iframes | no |
| maxframes | integer |
Maximum number of frames fetched per document |
5 |
| offsiteok | boolean |
Whether to fetch off-site redirects and frames |
yes |
| user | string |
User name for password-protected pages
(Basic authentication) |
none |
| pass | string |
Password for password-protected pages |
none |
| proxyuser | string |
User name for password-protected proxy
(Proxy-Authorization header) |
none |
| proxypass | string |
Password for password-protected proxy |
none |
| redirmsgs | boolean |
Whether to show redirect informational messages |
no |
| useragent | string |
User agent header |
Mozilla-compatible |
| 8bithtml | boolean |
Whether to leave 8-bit (foreign) HTML characters as-is |
yes |
| alttxt | boolean |
Whether to include ALT text from image tags |
yes |
| strike | boolean |
Whether to include <STRIKE> text in formatted output
(from <urltext>) |
yes |
| del | boolean |
Whether to include <DEL> blocktext in formatted output
(from <urltext>) |
yes |
| select | boolean |
Whether to include <SELECT> block text in formatted output
(from <urltext>) |
yes |
| input | boolean |
Whether to include <INPUT TYPE=text> values in formatted output
(from <urltext>) |
yes |
| textarea | boolean |
Whether to include <TEXTAREA> block text in formatted output
(from <urltext>) |
yes |
| formtxt or formtext | boolean |
Alias for select, input and textarea
together |
yes |
| minclrdiff | integer |
Minimum foreground/background color difference for formatted text to appear |
0 |
| eatlinkspace | boolean |
Whether to trim leading/trailing whitespace from links before processing. |
true |
| urlnonprint | string |
How to treat non-printable (outside ASCII range 32-126) characters in URL links:
asis, strip or encode |
asis |
| urlcanonslash | Boolean |
Whether to canonicalize backslashes in URLs to forward slashes |
True |
| proxy | string |
The URL to use as a proxy server |
none |
| reparentmode | string |
URL reparenting mode: abs, reroot, mirror or off |
None |
| reparent | string |
Re-parent links in HTML of fetched documents.
If absolute URL, sets reparentmode abs and links made absolute,
as if page were that URL. If full path, sets reparentmode reroot,
links made relative (if possible) as if that were document root. |
Empty |
| reparentimg | Boolean |
Re-parent image links also (if reparent
set). |
False |
| ifmodsince | string |
The HTTP If-Modified-Since conditional-get header |
Unset |
| accept | 2 string lists |
The HTTP Accept header list |
Everything (*/*) |
| header | list, 2 arguments |
Set the HTTP headers given in first arg to second arg values. |
None |
| clearheaders | no args |
Clears any headers set with header. |
-- |
| dnsmode | sys or int |
Host name lookup routines to use |
int |
| nameservers | list |
Nameservers used for host name lookup |
System dependent |
| dnsretrans | integer |
Initial host name lookup retry interval |
System dependent |
| dnsretry | integer |
Max number of retries for host name lookups |
System dependent |
| dnsservices | List of host or bind |
Services to use and in what order, for host name lookup |
System dependent |
| dnsdomains | List of domains |
Domains to search when resolving hostnames without embedded dots |
Host dependent (from /etc/resolv.conf) |
| dnsignoretrunc or dnsigntc | Boolean |
Whether to ignore truncated-message flag in DNS replies |
True |
| fileexclude | List of file prefixes |
File prefixes to exclude when fetching local file:// URLs |
None on Windows; /dev/, /proc/ and /debug/ on Unix |
| fileinclude | List of file prefixes |
File prefixes to include (require) when fetching local file:// URLs |
None |
| filenonlocal off|unc|ftp | String |
How to treat non-localhost file:// URLs |
off |
| fileroot | File prefix |
File root for local file:// URLs |
None |
| filetypes [add|del|set] [file|dir|device|symlink|other ...] | List |
File types to allow for local file:// URLs |
None |
| scriptvaryevents | Boolean |
Whether to vary form elements' values to generate more JavaScript events |
True |
| scripturldecode | Boolean |
Whether to URL-decode javascript: links |
True |
| protocols [add|del|set] [$protocols ...] | list |
List of allowed protocols to fetch |
http, https, ftp, gopher, javascript |
| linkprotocols [add|del|set] [$protocols|allowed|unknown ...] | list |
List of protocols to allow in returned links from a page |
unknown, http, https, ftp, gopher, javascript, file |
| pagecachesz | integer |
Size of page cache for frames/iframes/scripts |
5MB |
| getscripts | Boolean |
Whether to fetch <SCRIPT SRC=...> scripts |
True |
| javascript | Boolean |
Whether to execute inline JavaScript <SCRIPT>...</SCRIPT> blocks and enable other JavaScript features |
False |
| scriptevents [add|del|set] [$events ...] | list |
List of JavaScript events to trigger after page fetch |
all |
| scriptlinks | Boolean |
Whether to run javascript: links on a page before returning from fetch |
True |
| scriptmaxtimer | integer |
Max time in seconds to run JavaScript timers |
3 |
| scriptrealtimers | Boolean |
Whether to run JavaScript timers in real time |
False |
| scriptmem | integer |
Max memory to allow JavaScript engine to allocate |
20MB |
| scriptmsgs | Boolean |
Whether to print JavaScript errors |
False |
| scripttimeout | integer |
Max total time to allow JavaScript to run on a page |
5 |
| cookies | Boolean or integer |
Sets acceptcookies and sendcookies together |
3 |
| acceptcookies | Boolean |
Whether to acceptcookies |
True |
| sendcookies | Boolean |
Whether to send cookies |
True |
| cookiejar $text [append] | string |
Sets the cookie jar |
As received from fetches |
| cookiemsgs | Boolean |
Whether to print errors for invalid cookies |
False |
| embedsecurity off|nodecrease|noincrease|sameprotocol | string |
Whether to fetch embedded objects on a page based on main/embedded protocol security |
off |
| addentropy $entropy [$fraction] | string |
Seed SSL plugin with random data $entropy of fractional randomness $fraction |
Check entropy daemon if needed |
| entropypipe $file | string |
Path to entropy daemon pipe for SSL plugin init |
Check texis.cnf, or etc/egd-pool in install dir |
| verbose | integer |
Sets debugging verbosity level: 1 for commands received, 2 for
commands sent too. |
0 |
| tracedns | integer |
Host name lookup tracing (debug) |
0 (off) |
| traceskt | integer |
Socket level tracing (debug) |
0 (off) |
| defaults | No arguments |
Resets all settings |
|
Returns 1 on success.
See also <fetch>, <submit>,
<urlinfo>, <nslookup>
<urlinfo $name [$which]>
| Name | Type | What |
| actualurl | string |
The last URL retrieved. It may differ from the argument to <fetch> or <submit> if redirects were followed. |
| contenttype | string |
The MIME content type of the page. This may be derived from the Content-Type header, a <META HTTP-EQUIV> tag, or the URL extension, depending on what is available. |
| contenttypeparams | list |
The names of parameters in the MIME content type, if any. |
| contenttypeparam | list |
The value(s) of the content type parameter(s) named $which. Multiple values may be given in $which. |
| frames | list |
The list of frame URLs in the document. If the <urlcp> setting getiframes is true, the list is empty since the iframes have been fetched and inserted into the document. |
| iframes | list |
The list of iframe URLs in the document. If the
| | headers | list |
The names of HTTP headers received with the document. |
| header | list |
The value(s) of the HTTP header(s) listed in $which. |
| errnum | integer |
The last error code (not HTTP response code). |
| errmsg | string |
The last error message (not HTTP message). |
| httpcode | integer |
The value of the HTTP response code. |
| httpmsg | string |
The HTTP response message. |
| images | list |
The list of image URLs in the document, eg. <IMG> tags, background images, etc. |
| links | list |
The list of non-image link URLs in the document, eg. <A HREF> tags, <FORM> tags, etc. Same as the return value of the <urllinks> function. |
| metaheaders | list |
The names of <META HTTP-EQUIV> tags in the document. |
| metaheader | list |
The value(s) of the <META HTTP-EQUIV> tag(s) listed in $which. |
| metanames | list |
The names of <META NAME> tags in the document. |
| metaname | list |
The value(s) of the <META NAME> tag(s) listed in $which. |
| rawdoc | string |
The raw document source. Same as the return value of the original <fetch> or <submit>. |
| redirs | integer |
The number of redirects encountered. |
| text | string |
The formatted text of the document. Same as the return value of the <urltext> function. |
| title | string |
The title of the document. |
| time | double |
The total time taken to fetch the document. |
| dnstime | double |
The time taken to resolve the hostname(s) while fetching the document. |
| transfertime | double |
The time taken to transfer the data for the document. |
| cookiejar [all] | string |
The contents of the cookie jar in Netscape cookie-file format. |
| prngdpid [$path] | integer |
The process ID of the prngd daemon running at Unix pipe $path. |
See also <urltext>, <urllinks>, <urlcp>
<urltext>
<urllinks>
<urltext> returns the formatted text
from the last <fetch> or <submit>. It is
equivalent to <urlinfo text>.
<urllinks> returns the list of the document's links. It
is equivalent to <urlinfo links>.
See also <urlinfo>, <urlcp>
<urlutil $action [$arg1 [$arg2]]>
URL parsing utility.
| Action | What it does |
split | Splits URL $arg1 into parts $arg2
(protocol, host, port, path,
type, anchor or query) |
abs | Absolutes (fully-qualifies) relative links $arg2
as if they were on absolute URL $arg1 |
See also <fetch>
<userstats $REMOTE_ADDR [license|user]>
Return value in $ret: Number of accesses by given user in past minute,
either <loguser> stats (default or if user given),
or license stats (license). Empty $REMOTE_ADDR
gives current number of users; high gives highest ever seen.
See also <loguser>, <resetstats>
<varinfo $action [$arg]>
Get variable information.
| Action | What it returns |
list |
Names of all variables in current scope. Optional $arg
can be URL, ENV, CONTENT, CGI
or COOKIE for specific source. |
size |
Size in bytes of each value of variable named in $arg.
|
type |
SQL type of variable named by $arg. |
filename |
Filename for variable named by $arg, from
Content-Disposition header, if multi-part file upload. |
contenttype |
The Content-Type for the variable named by
$arg, if multi-part file upload. |
See also <getvar>
<vxcp setting [args ...]>
| Setting | Controls | Arguments |
| putmsg | Error message disposition |
2 args: call, log, print
or all, and a boolean value |
| stack | Maximum Vortex stack depth |
Integer |
| timeout | Vortex script timeout |
Integer or Texis date |
| trap | Trap signals or not (debug) |
Boolean value |
| connreset | Trap connection-reset or not |
Boolean value |
| filemsg | putmsg for <sysutil> actions or not |
Boolean value |
| htmlmode | Whether to HTML-encode variables on output |
Boolean value |
| libpath | The path to search for loadable modules |
String value |
See also <sqlcp>, <PUTMSG>,
<TIMEOUT>, <STACK>, <TRAP>,
<sysutil>
<vxinfo $what [$arg] ...>
Gets miscellaneous Vortex information.
| What | Returns |
| outputsz | Number of bytes printed by the script so far |
| db | The current database |
| globaldb | The global database for the script |
| release | Release date of this Vortex executable |
| version | Vortex version string |
| installdir | Directory Texis was installed in |
| htmlmode | 1 if variables are being HTML-escaped, 0 if not |
| license | License value $arg, which is one of violationmsg, violationtime, gentime, expiretime, verifytime, verifytrytime, serial, curhits, curhitstime, maxhits, curtblrows, maxtblrows, curtblsz, maxtblsz, curdbrows, maxdbrows, curdbsz, maxdbsz, curtotrows, maxtotrows, curtotsz, maxtotsz, texismonitorpid, equivpath, uequivpath, vortexlog, defaultdb, defaultscript, vortexflags |
See also <vxcp>
<wordlist $table [$field [$prefix]]>
<wordcount>
Returns a list of words in $table, as
found in a Metamorph index. Uses index for $field
if given. $prefix can be a single word,
or prefix followed by * to limit words.
<xtree $command [$values] [$treename]>
or
<xtree [options] $command [$values] [$treename]>
...
</xtree>
Manages an in-memory list of string values. Non-looping syntax by default.
If looping option(s) given, loop syntax expected and $ret.count,
$ret.seq, $loop and $next set as well.
| Loop option | What it does |
ROW | Do not accumulate values in $ret |
SKIP=$n | Skip the first $n return values |
MAX=$n | Return at most $n values |
| Command | Action |
| CLEAR | Clear tree (reset counts to 0) |
| DUMP | Dump tree to $ret |
| COUNT | Dump corresponding value counts to $ret (non-loop only; loop sets $ret.count during search/dump) |
| SEQ | Dump corresponding sequence numbers to $ret (non-loop only; loop sets $ret.seq) |
| INSERT | Insert $values into tree; returns $values and counts/sequences |
| DELETE | Delete $values from tree |
| SEARCH | Return list of matching $values in tree |
| SET | Set options given in $values (see below) |
| FLUSH | Remove tree and free its memory |
| Option | Action |
| NOADD | Don't add new values to tree during INSERT |
| CLEAR | Also clear tree during DUMP |
See also <sort>, <uniq>, <uniqcount>
| Variable | Value | Set by |
$cmd | Start function (if /func.ext not in URL) | User |
$cmdlnargs | Command-line arguments. | Vortex at script startup |
$errnum, $errscript,
$errline, $errmsg,
$errfunc, $errvfunc
| Error message | Vortex before <putmsg> |
$indexcount | Estimate of query hits for <SQL>, if index used | <SQL> |
$loop | Loop count (starts at SKIP for <LOOP>, 0 for others) | <LOOP>, <SQL>, <WHILE>, <TIMPORT>, <READLN>, parallel <fetch> |
$next | Next SKIP value for <LOOP>, <SQL>, <TIMPORT> | <LOOP>, <SQL>, <TIMPORT>, parallel <fetch> |
$null | Argument values to drop for <SQL> (cleared at script start) | User |
$pathroot | $PATH_INFO without state, function/mime ext | Vortex at script start |
$ret | Return value from functions | Builtin/user functions |
$sourcepath | File path to Vortex script source | Vortex at startup |
$url | URL to re-invoke script, with state | Vortex |
$urlq | Query-string part of URL, with <EXPORT QUERY> state | Vortex |
$urlroot | URL to re-invoke script, no state | Vortex |
$userpath | User-defined absolute path at end of URL | Vortex at script start |
$ret.owner, $ret.group, $ret.size,
$ret.isrd, $ret.iswr, $ret.isex,
$ret.mode, $ret.atime, $ret.mtime,
$ret.ctime, $ret.depth, $ret.symlink,
$ret.sympath, $ret.nlinks, $ret.devtype,
$ret.dev, $ret.ino, $ret.blks,
$ret.blksize | Return variables from <stat> | <stat> |
<$var = [value1 ...]>
for list of values (variables or literals).
Left-side variable type will be overall type of
right-side values (string if types mixed). For math:
<$var = (expression)>
Expression is a Texis math expression. Only first value
of variables in expression used.
If assigned-to (left) variable is in a <LOOP>,
<SQL> or <TIMPORT>, only the current value
of the variable is modified.
TEXT QUERIES
The LIKE clause in Texis uses the Metamorph search engine
to evaluate the results. It is also able to use a
metamorph index to improve the search speed. When
generating queries it is useful to keep the following points
in mind.
- Make the query as precise as possible. The fewer the
rows to be returned, the faster the response will be.
- The index is most useful for finding keywords and
concepts, so try to include at least one such term in
the query.
The approximate pattern matcher is used to locate words
that have been misspelled, incorrectly typed, or otherwise
changed. This pattern matcher is invoked by preceding
the expression with the '%' character. This is optionally
followed by a two digit number specifying the degree of
match required (default is 80), and then a string.
... LIKE 'iraq gulf %qadhafi'
By default Texis will only search for the word in the
query. If you want to search for a concept you should
precede the term with a tilde (~). For example:
... LIKE '~cat'
will also return documents containing kitten or
tiger.
If you want to supply the search terms which comprise the
query term yourself you can do so as follows:
... LIKE '(cat,tiger,kitten)'
The most basic type of search is a keyword search. This
allows you to find documents containing a particular
word. The query for this is simply the word you are
looking for. For example
... WHERE text LIKE 'dog';
If you want to find multiple keywords you can simply add
them to the query, for example:
... WHERE text LIKE 'dog cat';
Which will find documents having a sentence which contains
the word cat and the word dog. Look at the
proximity operators for searching within different blocks
than a sentence.
By default in Texis WebScript the linguistic settings are
set such that it will only find the word as entered. To
enable linguistic processing you can use the apicp function
to set the minwordlen to 5.
The Metamorph engine has the ability to find quantities in
almost any form they might occur, whether spelt out as
English words, or written with arabic numerals.
The query term is introduced with a '#' character. This
can be followed either by a number to find exactly that
number or '<' number and/or '>' number to find
ranges of numbers.
To find cancer statistics you could use the query:
... LIKE 'cancer #>0<1'
which would match:
- ... 20 percent of cancer victims ...
- ... two-thirds of those suffering from lung cancer ...
There are two ways that you can search for phrases,
depending on your priorities. Doing a LIKEP search will
rank those documents containing the words in the order
specified, and as close together as possible the highest.
It will also find documents containing matches that are
similar to the phrase, but possibly with extra words
interspersed. Enclosing the phrase in double quotes will
find that phrase exactly when doing a LIKE query.
For example if you were searching for a persons name, and
are unsure if the middle initial is included you could use
LIKEP:
... LIKEP 'john smith'
which would find, among others
John Smith
John D. Smith
Smith, John
If you only wanted to find John Smith, and none of
the other variations you would use the query:
... LIKE '"John Smith"'
When there are multiple terms in the query Texis will try
to find them within particular delimiters. Texis knows a
number of predefined delimiters, and also allows you to
specify your own delimiter with REX syntax. You can have
different start and send delimiters. The proximity range
specifier is started with w/. The delimiter
follows. If only one delimiter is specified it is used as
both start and end delimiter. If two are specified then
the first is the start delimiter and the second is the
end delimiter. The known delimiters are:
| Expression | Meaning |
|---|
| line | within a line |
| sent | within a sentence |
| para | within a paragraph |
| page | within a page |
| all | within the field |
| NUMBER | within NUMBER characters |
| REX Expression | use expression as delimiter |
Examples:
Find cat and dog withing a paragraph
...LIKE 'cat dog w/para'
Find President and congress within a section,
which has uppercase SECTION headings.
...LIKE 'president congress w/\RSECTION'
The default logic for a LIKE query is AND, so that all
terms must appear. It is possible to require some number
of the terms, or to exclude individual terms. The @N
operator (N is a number) specifies the number of
intersections of the sets. This is one less than the
number of sets you want to find. If there were three
Smith brothers, David, Michael and John, you could search
for places where two of them were talked about with the
following query:
'john david michael +smith @1'
The + means that smith must occur. The @1 means that
there should be at least one intersection (two sets)
between the remaining sets (john, david and michael).
The symbols available are:
- +
- Required set. Not counted in permutation.
- -
- Excluded set. Do not include hits which
match this term.
- @N
- Permutations. Requires N intersections of
remaining sets. (N + 1 of the sets must match) Default is
all of them.
The permutation operators can be used with any of the
pattern matchers.
In the ranking queries (LIKER, LIKEP), the intersects
operator is ignored, and the + and - take on a different
meaning. Normally the weight of a word is determined by
its frequency. A + will give that word the maximum
possible weight. A - will take the weight of the term,
and negate it, so a document containing the weight will
have its rank reduced.
Texis includes a regular expression matcher as part of the
Metamorph query engine. This can be used to match patterns
in the text. No linguistic processing is done on the term.
The expression is indicated by a leading / on the term. If
you are looking for documents containing part numbers for
screwdrivers, and you know that part numbers consist of
3 letters followed by 4 numbers you could use the query
... LIKE 'screwdriver /\alpha{3}\digit{4} w/line'
Within Rex the meaning of various characters is as
follows:
| Flags | Meaning |
| \R | Respect Case |
| \I | Ignore Case (default) |
| \L | Toggle Literal mode. Removes special
meaning from characters |
\F \P | Followed/Preceded By. Allows the
finding of an expression following or in front of another.
The preceding or following expression is not counted as
part of the hit. |
| ! | NOT the following expression |
| >> | Use the following expression as the root,
which means it will be found first. |
| Character Class | Meaning |
| \alpha \upper \lower \digit \xdigit \alnum
\space \punct \print \graph \cntrl \ascii |
Match the same characters that are would be matched by
the respective is...() function, e.g. isalpha() |
| [] | Matches any single character from those
contained between the brackets. Ranges can be given with
a '-' (e.g. a-z0-9). A '^' as the first character inverts
the set. Case is respected. |
| Single Characters | Value |
| \xNN | NN is the hexadecimal code of the
character |
| $ | End of line. (Appropriate for operating
system) |
| . | Any Single Character |
| Other | Matches itself |
| \\ | Matches a backslash |
| Repetition Operators | Meaning |
| {x} | expression repeated x times |
| {x,y} | repeated between x and y times |
| * | zero or more occurences |
| + | one or more occurences |
Note that the repetition operators apply to entire preceding
expression, not just the last character. So
\digit{1}abc{2,3}
Will match 1abcABC, but not 1abcC
|