<< Click to Display Table of Contents >> Navigation: Concordance Programming Language Reference > Functions > I |
The following topic discusses the Concordance Programming Language (CPL) functions that begin with the letter I. For more information on CPL functions, see Functions, About the Advanced Programming Features, and About CPL Functions.
int import( text db->field; char filename[]; char delimiter[]; int anchored; int keepfile; int blanks; int wrap; [int maxBytes]); |
•Description - Loads the text file, whose name is passed in filename[], into the selected field and appends the new documents to the end of the database. If the file contains data for several documents, they are separated from each other by a line with the delimiter string on it. Concordance will assume the delimiter string is flush left if the anchored parameter is an 'A'.
oThe text file is a plain text file, i.e., ASCII format. Import will break the file into several documents if it is larger than 65,000 characters or maxBytes, and it cannot flow the text into following paragraphs.
oIf the keepfile parameter is 'K', Concordance will store the file's name in parentheses on the first line of each document created. The file name will appear on the line by itself.
oConcordance will keep blank lines if the blanks parameter is 'B'. This parameter should be set to zero to remove blank lines. Concordance will automatically trim any trailing spaces from each line it loads.
oThe wrap parameter should be set to a 'W' if your text has indented paragraphs, or paragraphs separated by blank lines. This will cause Concordance to treat all carriage returns as soft returns, word wrapping all text until it finds an indented or empty line.
oConcordance loads up to 60,000 characters per field unless the optional maxBytes parameter specifies another maximum.
•Return Value - A zero if no error occurred. A nonzero value would indicate that the user aborted the import by pressing the [Esc] key, a disk or database full condition, or an error reading or locating the import file.
•See Also - load()
Example
LoadDeposition(int db) { int CR; char string[60]; CR = 13; if ( getfile("Deposition","*.*",string) == CR) import(db->depo,string,"",0,'K',0,0); return; } |
importfs(int db); |
•Description - Full screen import menu as described in the Concordance Reference Manual.
•Return Value - None.
•See Also - loadfs()
int index(int db); |
•Description - Database is indexed from scratch. The dictionary file and inverted text files are erased before this command begins. The user is not prompted before the files are erased.
oThe db parameter must be a value returned by a call to opendb(). The screen is automatically saved before entering this mode and restored after exiting.
•Return Value - Zero if successful.
•See Also - reindex(), opendb()
insertText(db->FIELD; text szText; int offset); |
•Description - The first parameter identifies a field in the database. The insertText() function inserts a block of text, the szText parameter, into the field. This function preserves annotations and rich text formatting. Simply assigning text to a field does not preserve annotations or rich text, i.e., db->FIELD = db->FIELD + szText may cause all annotations to be misplaced and rich text formatting to disappear.
•Return Value - The number of bytes inserted.
•See Also - deleteText()
•Version - Concordance version 7 and later.
int isalnum(char ch); |
•Description - Tests the character value to determine if it is in the set a to z, or A to Z, or 0 to 9. ch can be any numeric value, char, int, float, or short.
•Return Value - Returns a nonzero value if the character is in the alphanumeric set of characters. Returns a zero if it is not.
•See Also - isalpha(), isdigit()
int isalpha(char ch); |
•Description - Tests the character value to determine if it is in the set a to z, or A to Z.
•Return Value - Returns a nonzero value if the character is alphabetic, or a zero if it is not alphabetic.
•See Also - isalnum(), isdigit()
int isdeleted(int db); |
•Description - Checks if the document is marked for deletion.
•Return Value - Nonzero if the document is marked for deletion, zero if it is not marked for deletion.
•See Also - delete(), recall(), pack()
Example
/* Count the documents marked for deletion. */ DelCount(int db) { int count; cycle(db) if (isdeleted(db)) count = count + 1; return(count); } |
int deleteText(db->FIELD; int offset; int length) |
•Description - The first parameter identifies a field in the database. The deleteText() function deletes a block of text at offset for length number of bytes. This function preserves rich text formatting and properly processes annotations. Any annotations contained by the block of deleted text are also deleted.
•Return Value - The number of bytes deleted.
•See Also - insertText()
•Version - Concordance version 7 and later.
int isedited(int db); |
•Description - Determines if the full-text indexable fields in the current document have been edited or appended to the database since the last time the database was reindexed. Documents located in a full text search that have been edited may not actually match the search conditions. Attempting to highlight the keywords on the screen, or to underline them on a printer may result in the wrong words being highlighted.
•Return Value - A nonzero value if the document has been edited or modified since the last reindex.
int isfield(int db; text fieldName); |
•Description - Determines if the named field exists in the database. Useful with concatenated databases and the report writer.
•Return Value - Returns the nonzero field number if the field exists in the current database, otherwise zero.
Example
printSomeData(int db, fh) { int i; text someData; cycle(db) { someData = ((i=isfield(db,"SUMMARY")) ? db->i : ""); writeln(fh, someData); } } |
int islower(char ch); |
•Description - Tests the character to see if it is a lower case letter, in the set a to z.
•Return Value - Returns a nonzero value if the character is lower case, and a zero if it is not a lower case letter.
•See Also - isupper(), lower(), upper()
int isnexthit(int db); |
•Description - Determines if there is another hit in the current document. A hit is a word located in a search.
•Return Value - Returns a nonzero value if there is a hit.
Example
/* Count the hits in this record */ for (i = 1; isnexthit(db); i = i + 1) nexthit(db); |
•See Also - nexthit()
•Version - Version 5.33 and later
int isspace(char ch); |
•Description - Tests the character to see if it is a white space character. White space characters include the space, horizontal tab, line feed, vertical tab, form feed, and carriage return; ASCII codes 32, 9, 10, 11, 12, and 13, respectively.
•Return Value - A nonzero value is returned if the character is a space, and a zero is returned if it is not a space character.
int istagged(int db[, text tagName]); |
•Description - Checks if the document is currently tagged. The parameter db is a handle an open database. If the optional tagString is passed, the return value only applies to that tag. Calling istagged() without a tagString determines if the default tag, "", has been applied to the document. To determine if ANY tag has been applied use the following code:
text NULL; if (tagged(db,NULL)) |
•Return Value - Returns a zero if the document is not tagged, nonzero if it is tagged.
•See Also - gettags(), tag(), tagquery()
•Version - The tagName parameter is only valid in version 5.31 and later.
int isupper(char ch); |
•Description - Tests the character to determine if it is an upper case letter, in the set A to Z.
•Return Value - Returns a nonzero value if the character is upper case, and a zero if the character is not an upper case letter.
•See Also - islower(), lower(), upper()
int itoa(int value; int radix); |
•Description - Converts an integer to a plain text, ASCII, value in base radix notation. If the value of radix is 10, and the number is negative, then itoa() will prepend a minus sign to the result.
•Return Value - The number as a string in the requested base.
Example
The following program displays the values 25, 19, and 11001, which is the decimal 25 in base 10, 16 and base 2.
main() { puts( 10, 10, itoa( 25, 10 )); puts( 11, 10, itoa( 25, 16 )); puts( 12, 10, itoa( 25, 2 )); getkey(); } |