N

<< Click to Display Table of Contents >>

Navigation:  Concordance Programming Language Reference > Functions >

N

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

NetUser

text netuser();

Description - Determines the user ID, or workstation ID, for the network.

Return Value - Text string containing the user's sign-on ID.

 

Newline

text newline();

Description - Returns a hard carriage return. Primarily used in the report writer.

Return Value - A carriage return/line feed combination.

 

Next

int next(int db, document, field, index);

Description - Concordance advances to the next document in the current query. The hit list is positioned on the first hit for the document. Additional calls to nexthit() will retrieve information about the other items in the hit list.

Return Value - Returns the physical document number of the next document retrieved in the query. Returns a value less than or equal to zero if the current document is the last in the query, or if an error was encountered reading the document.

oSee last() for more information about returned values.

See Also - last(), first(), nexthit(), prev(), prevhit(), count(), docno(), hits()

Example

/* Cycle through every document in the data

** base, starting with the current document,

** converting the STATE field to upper case.

*/

StateToUpper(db)

{

int i;

for(i = docno(db); i > 0; i = next(db))

db->state = upper(db->state);

}

 

NextHit

int nexthit(int db, document, field, index);

Description - Moves to the next hit in the current query. If this moves to the next document, then that document is read. Information about the hit list item is returned.

odb is a valid database handle returned by a call to opendb(). The document, field, and offset parameters are optional.

Return Value - Information about the hit word is returned only if one or more of the document, field, and offset parameters are passed.

oReturns a value less than or equal to zero if the document could not be read.

See Also - goto(), first(), isnexthit(), last(), prev(), next(), prevhit(), count(), hits()

 

Not

int not(int number);

Description - Logically inverts the number, converts the number to its one's compliment. The binary representation of 2 is 0000000000000010, not(2) returns the value 1111111111111101. The number is converted to int type before the inversion.

Return Value - The number's one's compliment.

See Also - Operators and Operands | and &.

 

Num

float num(char string[]);

Description - Converts a character string to a number. The number is converted to a float type, but the result of num() can be assigned to any numeric type.

oBlank spaces are ignored in the conversion. The conversion begins with the first numeric character, and it ends when the first nonnumeric character is encountered.

Return Value - Numeric representation of character string.

See Also - itoa(), str()

Example

main()

{

text something;

int i;

something = " 1982 was a good year.";

i = num(something) + 1;

/* i now equals 1983. */

}