<< Click to Display Table of Contents >> Navigation: Concordance Programming Language Reference > Functions > T |
The following topic discusses the Concordance Programming Language (CPL) functions that begin with the letter T. For more information on CPL functions, see Functions, About the Advanced Programming Features, and About CPL Functions.
table(int db); |
•Description - Invokes Concordance full screen Table View mode.
•Return value - None.
•See Also - browse()
•Version - Version 5.32 and later
int tag(int db, ON|OFF|CLEAR [, text tagString]); |
•Description - Tags a document in the database whose handle is db according to the value of the second parameter:
▪ON 1 Document is tagged.
▪OFF 0 Document is untagged.
▪CLEAR -1 All documents in the database are untagged.
oRemember to clear all tagged queries before beginning a tagging cycle. Otherwise, documents previously tagged will be included in the current tagging operation. Document tags are stored in a file called database.trk, they are retained with the database and do not disappear if the database is closed and reopened.
oIf the optional tagString parameter is passed, the supplied tag is applied to the document. Otherwise the default tag, "", is applied.
•Return Value - Returns a zero if no error occurred. Returns a nonzero value if an error occurred while tagging the document.
•See Also - istagged(), tagquery()
tagquery(int db[, text tagString]); |
•Description - Collects all tagged documents in the database whose handle is db into a single query. If the optional tagString is supplied, only documents tagged to the tagString are selected. The set of tagged documents becomes the current active query.
•Return Value - None. Check the database information variable db.query to see if a tagged query was actually created. The function will create a tagged query with zero documents if no tagged documents were found.
•See Also - tag(), istagged()
time(int hours, minutes, seconds); |
•Description - Returns the current time in the passed parameters. The hours are in military format, 1 - 24 hours. Minutes and seconds are optional parameters.
•Return Value - Returns the total seconds elapsed since midnight, (hours * 3600) + (minutes * 60) + seconds. The passed parameters are set to the current time when the function returns.
Example
ShowTime() { int hours, minutes, seconds; text AMorPM; char string[10]; /* Display time on the screen. */ /* Get the time in a string. */ time(hours, minutes, seconds); AMorPM = " p.m."; if (hours < 12) AMorPM = " a.m."; if (hours > 12) hours = hours - 12; string = str(hours,2,0,'Z')+":"+str(minutes,2,0,'Z')+":"+str(seconds,2,0,'Z')); puts(0,0,string+AMorPM); } |
int today(); |
•Description - Gets today's date in internal numeric format.
•Return Value - Integer representing today's date.
•See Also - dtoc(), ctod(), clock(), time()
Example
WhatDayIsIt() { puts(0,0,"Today is "+dtoc(today())); } |
text trim(text string); |
•Description - Removes all trailing and leading blanks from the text variable, character array, or field.
•Return Value - Returns a duplicate of the string, does not modify the original.
Example
main() { text line; line = " This is a fine mess "; puts(0, 0, "|"+trim(line)+"|"); puts(1, 0, "|"+line+"|"); } Output: |This is a fine mess| | This is a fine mess | |