U

<< Click to Display Table of Contents >>

Navigation:  Concordance Programming Language Reference > Functions >

U

The following topic discusses the Concordance Programming Language (CPL) functions that begin with the letter U. For more information on CPL functions, see Functions, About the Advanced Programming Features, and About CPL Functions.

Unload

int unload(int db; char string[]; [int comma, quote, newline; [int row, column, color]]);

Description - Unloads the current query to the file specified by the string file name. The string must be a valid file name. The documents are unloaded in delimited ASCII format as documented in the Concordance Reference Manual.

oThe fields unloaded, and the order in which they are unloaded, is set by assigning a number to the order entry of the field definition. You can assign any number from -128 to 127, but Concordance will only unload fields with consecutive numbers from 1 to the last field number defined in the database. You should always renumber the fields before any unload. Concordance allows the user to change the field order in several full screen modes including Print, Load, and Unload. See the for-loop example below.

oThe optional parameters, comma, quote and newline are used to delimit the fields during the unload process. If they are left off Concordance will use its internal ASCII default values, 20, 254, and 174 respectively. It is recommended that you leave these parameters off if transferring data between Concordance databases, however they are required if row, column, and color are passed.

Return Value - The number of documents unloaded. This should be checked against the number of documents that should have been unloaded. Any inequality will indicate full disk or other disk error condition, or that the user pressed [Esc] to cancel the unload.

See Also - unloadfs(), load(), loadfs()

Example

main()

{

int db, i, count;

/* Permanately sort all records in the */

/* database in ascending order. */

if ((db = opendb("helpdesk")) <> -1)

{

sort(db,"db->DATE");

/* Renumber all fields to unload in */

/* order. This step is necessary */

/* since the order previously set, */

/* or set in Print, is retained */

/* until reset. Never assume the */

/* order includes all fields. */

for(i = 1; i <= db.fields; i = i + 1)

db.order[i] = i;

count = db.documents;

if (unload(db,"helpdesk.dat") <> count)

puts(0,0,"Error unloading database.");

else

{

zap(db);

if (load(db,"helpdesk.dat") <> count)

puts(0,0,"Error reloading data.");

else

{

erase("helpdesk.dat");

index(db);

}

}

closedb(db);

puts(0,1,"Press any key to continue...");

getkey();

}

}

 

UnloadFS

unloadfs(int db);

Description - Invokes Concordance full screen unload mode. The screen is automatically saved before entering this mode and restored after exiting.

Return Value - None.

 

UnlockDB

unlockdb(int db);

Description - The database whose handle is db is unlocked and released from exclusive use.

Return Value - None.

See Also - lockdb()

 

UnlockDoc

unlockdoc(int db);

Description - Will unlock the current document in the network version of Concordance. Unlocking the record will force an immediate write to disk if it has been edited. This has no effect in non-network versions of the program. A locked document cannot be changed and saved to file by other users. Reading another document will automatically unlock a document.

oDocuments are automatically locked by Concordance when read into memory. Your program should unlock them as a courtesy to other network users if you do not intend to edit or modify them.

Return Value - None.

See Also - lockdoc(), locked()

 

UnmapDevice

int unmapDevice(text Device, int force);

Description - Removes the network’s mapping of the disk drive or printer. The unmapping fails if the device has a file or lock open. Set the force parameter to TRUE to force the device to unmap regardless of the open file status. (TRUE is a predefined integer. You do not need to declare it. Do not assign a value to it. Do not pass it in quotes. Simply use it as you would any integer.)

Return Value - Zero indicates success.

See Also - mapDevice()

Example

unmapDevice("F:", FALSE);

Version

Version 7.30 and later

 

Upper

text upper(text string);

Description - Converts the parameter string to all upper case. The parameter can be a text value or a character array.

Return Value - Returns a duplicate of the string in upper case letters, does not modify the original.

See Also - capitalize(), lower()