home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boston 2
/
boston-2.iso
/
DOS
/
PROGRAM
/
CLIPPER
/
NFTROFF
/
13.TR
< prev
next >
Wrap
Text File
|
1993-12-01
|
26KB
|
1,511 lines
.de }n
.bp
.sp .5i
..
.wh -.8i }n
.sp .5i
.po -.4i
.ll 7.5i
.ps 9
.vs 9
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_AT2() Find position of the nth occurrence of a substring
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_AT2()
Find position of the nth occurrence of a substring
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_AT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cSearch>\fR is the character substring to search for\.
.sp
\fB<cTarget>\fR is the character string to search\.
.sp
\fB<nOccurs>\fR is the occurrence of cSearch to look for,
.in 1.28i
defaults to 1\.
.sp
.in 0.4i
\fB<lCaseSens>\fR is a logical value denoting case sensitivity\.
.in 1.28i
If \.F\., then search is NOT sensitive to case,
defaults to \.T\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
The position of the nth occurrence of a substring
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function will find the nth occurrence of a substring
within a string\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
cSearch := "t"
.br
cTarget := "This is the day that the Lord has made\."
.sp
.ta 3.04i
.br
FT_AT2( cSearch, cTarget ) // Returns ( 9 )
.br
.ta
.sp
.ta 3.04i
.br
FT_AT2( cSearch, cTarget, 2 ) // Returns ( 17 )
.br
.ta
.sp
.ta 3.04i
.br
FT_AT2( cSearch, cTarget, 2, \.F\. ) // Returns ( 9 )
.br
.ta
.sp
.in 0.08i
\fBSource:\fR AT2\.PRG
.sp
.ta 1.84i
\fBAuthor:\fR Ralph Oliver, TRANSCOM SYSTEMS
.br
.ta
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_FINDITH()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BITCLR() Clear (reset) selected bit in a byte
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BITCLR()
Clear (reset) selected bit in a byte
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_BITCLR( <cByte>, <nBitPos> ) -> cByte
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cByte>\fR is a character from CHR(0) to CHR(255)\.
.sp
\fB<nBitPos>\fR is a number from 0 to 7 conforming to standard
right-to-left bit numbering convention and representing the
position of the bit within the byte\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
Returns new byte, with designated bit cleared (reset)\.
If parameters are faulty, returns NIL\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
In effect, ANDs argument byte with a byte that has all bits set except
the target bit\. If bit is already clear (0), it remains clear\.
Note: Calls FT_ISBIT() which is also in this Library\.
.sp
This function is presented to illustrate that bit-wise operations
are possible with Clipper code\. For greater speed, write \.C or
\.ASM versions and use the Clipper Extend system\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
This code would clear bit 4 in a byte represented by CHR(115):
.sp
.in 0.56i
.br
cNewByte := FT_BITCLR( CHR(115), 4 )
.ta 2.08i
.br
? ASC( cNewbyte ) // result: 99
.br
.ta
.ta 2.08i
.br
? cNewByte // result: \'c\'
.br
.ta
.sp
.in 0.4i
This code would clear bit 5 in the byte represented by letter \'A\':
.sp
.in 0.56i
.ta 2.08i
FT_BITCLR( \'A\', 5 ) // result: \'A\', since
.br
.ta
.in 2.64i
// bit 5 already clear
.sp
.in 0.4i
For a demonstration of Clipper bit manipulations, compile and
link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
.sp
.in 0.08i
\fBSource:\fR BITCLR\.PRG
.sp
\fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_BITSET()
, FT_ISBIT()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BITSET() Set selected bit in a byte
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BITSET()
Set selected bit in a byte
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_BITSET( <cByte>, <nBitPos> ) -> cByte
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cByte>\fR is a character from CHR(0) to CHR(255)\.
.sp
\fB<nBitPos>\fR is a number from 0 to 7 conforming to standard right-to-left
bit numbering convention and representing the position of the bit
within the byte\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
Returns new byte, with designated bit set\. If parameters are faulty,
returns NIL\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
In effect, ORs argument byte with a byte that has only the target bit
set\. If bit is already set, it remains set\.
Note: Calls FT_ISBIT() which is also in this Library\.
.sp
This function is presented to illustrate that bit-wise operations
are possible with Clipper code\. For greater speed, write \.C or
\.ASM versions and use the Clipper Extend system\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
This code would set bit 4 in a byte represented by CHR(107):
.sp
.in 0.8i
.br
cNewbyte := FT_BITSET( CHR(107), 4 )
.ta 2.4i
.br
? ASC( cNewbyte ) // result: 123
.br
.ta
.ta 2.4i
.br
? cNewbyte // result: \'{\'
.br
.ta
.sp
.sp
.in 0.4i
This code would set bit 5 in the byte represented by the letter \'A\'\.
.sp
.in 0.8i
.ta 2.4i
? FT_BITSET( \'A\', 5 ) // result: \'a\'
.br
.ta
.in 3.2i
// bit 5 set
.sp
.in 0.4i
For a demonstration of Clipper bit manipulations, compile and
link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
.sp
.in 0.08i
\fBSource:\fR BITSET\.PRG
.sp
\fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_BITCLR()
, FT_ISBIT()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BYTEAND() Perform bit-wise AND on two ASCII characters (bytes)
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BYTEAND()
Perform bit-wise AND on two ASCII characters (bytes)
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_BYTEAND( <cByte1>, <cByte2> ) -> cByte
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cByte1>\fR and \fB<cByte2>\fR are characters from CHR(0) TO CHR(255)\.
May be passed in CHR() form, as character literals, or as expressions
evaluating to CHR() values\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
Returns resulting byte, in CHR() form\. If parameters are faulty,
returns NIL\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
Can be used for any bit-wise masking operation\. In effect, this is a
bit-by-bit AND operation\. Equivalent to AND assembler instruction\.
.sp
This function is presented to illustrate that bit-wise operations
are possible with Clipper code\. For greater speed, write \.C or
\.ASM versions and use the Clipper Extend system\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
This code would mask out the high nibble (four most significant bits)
of the byte represented by chr(123) and leave the low nibble bits as in
the parameter byte\.
.sp
.in 0.8i
.br
cNewbyte := FT_BYTEAND( CHR(123), CHR(15) )
.ta 1.36i
.br
? asc(cNewByte) // result: 11
.br
.ta
.ta 1.36i
.br
? cNewByte // result: non-printable character
.br
.ta
.sp
.in 0.4i
For a demonstration of Clipper bit manipulations, compile and
link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
.sp
.in 0.08i
\fBSource:\fR BYTEAND\.PRG
.sp
\fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_BYTEOR()
, FT_BYTEXOR()
, FT_BYTENOT()
, FT_BYTENEG()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BYTENEG() Perform bit-wise negation on an ASCII character
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BYTENEG()
Perform bit-wise negation on an ASCII character
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_BYTENEG( <cByte> ) -> cNewByte
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cByte>\fR is a character from CHR(0) to CHR(255)\.
May be passed in CHR() form, as character literal, or
as expression evaluating to CHR() value\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
Returns resulting byte, in CHR() form\. If parameters are faulty,
returns NIL\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
Can be used for bit-wise byte manipulation\. In effect, this is a
bit-by-bit NEG (two\'s complement) operation\. Equivalent to NEG
assembler instruction\.
.sp
This function is presented to illustrate that bit-wise operations
are possible with Clipper code\. For greater speed, write \.C or
\.ASM versions and use the Clipper Extend system\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
This code performs a bit-wise NEG on byte represented by CHR(32):
.sp
.in 0.8i
.br
cNewByte := FT_BYTENOT(CHR(32))
.ta 2.64i
.br
? asc(cNewByte) // result: 224
.br
.ta
.sp
.in 0.4i
For a demonstration of Clipper bit manipulations, compile and
link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
.sp
.in 0.08i
\fBSource:\fR BYTENEG\.PRG
.sp
\fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_BYTEOR()
, FT_BYTEXOR()
, FT_BYTENOT()
, FT_BYTEAND()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BYTENOT() Perform bit-wise NOT on an ASCII character (byte)
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BYTENOT()
Perform bit-wise NOT on an ASCII character (byte)
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_BYTENOT( <cByte> ) -> cNewByte
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cByte>\fR is a character from CHR(0) to CHR(255)\.
May be passed in CHR() form, as character literal, or
as expression evaluating to CHR() value\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
Returns resulting byte, in CHR() form\. If parameters are faulty,
returns NIL\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
Can be used for bitwise byte manipulation\. In effect, this is a
bit-by-bit NOT (one\'s complement) operation\. Equivalent to the
NOT assembler instruction\.
.sp
This function is presented to illustrate that bit-wise operations
are possible with Clipper code\. For greater speed, write \.C or
\.ASM versions and use the Clipper Extend system\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
This code performs a bitwise NOT on byte represented by CHR(32):
.sp
.in 0.8i
.br
cNewByte := FT_BYTENOT( CHR(32) )
.ta 1.76i
.br
? ASC( cNewByte ) // result: 223
.br
.ta
.sp
.in 0.4i
For a demonstration of Clipper bit manipulations, compile and
link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
.sp
.in 0.08i
\fBSource:\fR BYTENOT\.PRG
.sp
\fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_BYTEOR()
, FT_BYTEXOR()
, FT_BYTENEG()
, FT_BYTEAND()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BYTEOR() Perform bit-wise OR on two ASCII characters (bytes)
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BYTEOR()
Perform bit-wise OR on two ASCII characters (bytes)
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_BYTEOR( <cByte1>, <cByte2> ) -> cNewByte
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cByte1>\fR and \fB<cByte2>\fR are characters from CHR(0) TO CHR(255)\.
May be passed in CHR() form, as character literals, or as
expressions evaluating to CHR() values\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
Returns resulting byte, in CHR() form\. If parameters are faulty,
returns NIL\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
Can be used for bit-wise byte manipulation\. In effect, this is a
bit-by-bit OR operation\. Equivalent to OR assembler instruction\.
.sp
This function is presented to illustrate that bit-wise operations
are possible with Clipper code\. For greater speed, write \.C or
\.ASM versions and use the Clipper Extend system\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.8i
This code performs a bit-wise OR on two bytes represented
by CHR(20) and CHR(10):
.sp
.br
cNewByte := FT_BYTEOR( CHR(20), CHR(10) )
.ta 1.52i
.br
? ASC( cNewByte ) // result: 30
.br
.ta
.ta 1.52i
.br
? cNewByte // result: non-printable character
.br
.ta
.sp
.in 0.4i
For a demonstration of Clipper bit manipulations, compile and
link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
.sp
.in 0.08i
\fBSource:\fR BYTEOR\.PRG
.sp
\fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_BYTEXOR()
, FT_BYTENOT()
, FT_BYTENEG()
, FT_BYTEAND()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BYTEXOR() Perform bit-wise XOR on two ASCII characters (bytes)
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BYTEXOR()
Perform bit-wise XOR on two ASCII characters (bytes)
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_BYTEXOR( <cByte1>, <cByte2> ) -> cNewByte
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cByte1>\fR and \fB<cByte2>\fR are characters from CHR(0) to CHR(255)\.
May be passed in CHR() form, as character literals, or
as expressions evaluating to CHR() values\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
Returns resulting byte, in CHR() form\. If parameters are faulty,
returns NIL\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
Can be used for bit-wise byte manipulation\. In effect, this is a
bit-by-bit XOR operation\. Equivalent to XOR assembler instruction\.
.sp
This function is presented to illustrate that bit-wise operations
are possible with Clipper code\. For greater speed, write \.C or
\.ASM versions and use the Clipper Extend system\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
This code performs a bit-wise XOR on two bytes represented
by CHR(32) and CHR(55):
.sp
.in 0.8i
.br
cNewByte := FT_BYTEXOR( CHR(32), CHR(55) )
.ta 1.76i
.br
? ASC( cNewByte ) // result: 23
.br
.ta
.ta 1.76i
.br
? cNewByte // result: non-printable character
.br
.ta
.sp
.in 0.4i
For a demonstration of Clipper bit manipulations, compile and
link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
.sp
.in 0.08i
\fBSource:\fR BYTEXOR\.PRG
.sp
\fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_BYTEOR()
, FT_BYTENOT()
, FT_BYTENEG()
, FT_BYTEAND()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_FINDITH() Find the "ith" occurrence of a substring within a string
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_FINDITH()
Find the "ith" occurrence of a substring within a string
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_FINDITH( <cCheckFor>, <cCheckIn>, <nWhichOccurrence> ;
.in 1.36i
\fB[, <lIgnoreCase> ] ) -> <nStringPosition>
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cCheckFor>\fR is the string to search for\.
.sp
\fB<cCheckIn>\fR is the string to search\.
.sp
\fB<nWhichOccurrence>\fR is the number of the occurrence to find\.
.sp
\fB<lIgnoreCase>\fR is a logical indicating if the search is to be case
.in 0.64i
sensitive\. The default is no case sensitivity (\.F\.)\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
The position in the string cCheckIn of the ith occurrence of cCheckFor\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function finds the position in a string of the "ith" time another
string appears in it\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
// Find the Position in cMemoString of
.br
// the 10th Occurrence of "the", case
.br
// insensitive
.sp
.br
nNextPosition := FT_FINDITH("the", cMemoString, 10)
.sp
.in 0.08i
\fBSource:\fR FINDITH\.PRG
.sp
\fBAuthor:\fR David Husnian
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_AT2()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_ISBIT() Test the status of an individual bit
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_ISBIT()
Test the status of an individual bit
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_ISBIT( <cByte>, <nBitPos> ) -> lResult
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cByte>\fR is a character from CHR(0) to CHR(255)
.sp
\fB<nBitPos>\fR is a number from 0 to 7 conforming to standard right-to-left
.in 1.2i
bit-numbering convention and representing the position of the
bit within the byte\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
\.T\. if designated bit is set (1), \.F\. if not set (0), NIL if
.in 0.48i
invalid parameters\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
Tests for status of any selected bit in the byte passed as a parameter\.
Byte must be presented in CHR() form, as a literal constant, or as the
one-byte character result of an expression\.
.sp
This function is presented to illustrate that bit-wise operations
are possible with Clipper code\. For greater speed, write \.C or
\.ASM versions and use the Clipper Extend system\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
This code tests whether bit 3 is set in the byte represented by
CHR(107):
.sp
.in 0.48i
.br
lBitflag := FT_ISBIT(CHR(107), 3)
.ta 2.24i
.br
? lBitflag // result: \.T\.
.br
.ta
.sp
This code tests whether bit 5 is set in the byte represented by ASCII
65 (letter \'A\')
.sp
.ta 2.24i
.br
? FT_ISBIT(\'A\', 5) // result: \.F\.
.br
.ta
.sp
.in 0.4i
For a demonstration of Clipper bit manipulations, compile and
link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
.sp
.in 0.08i
\fBSource:\fR ISBIT\.PRG
.sp
\fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_BITSET()
, FT_BITCLR()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_ISBITON() Determine the state of individual bits in a number
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_ISBITON()
Determine the state of individual bits in a number
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_ISBITON( <nNumber>, <nBit> ) -> lResult
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<nNumber>\fR is an integer for which a bit state needs to be checked\.
.sp
\fB<nBit>\fR is a number from 0 to 15 that indicates which bit to test\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
\.T\. if the specified bit was on\., \.F\. if off\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function is useful when dealing with binary integers\. It will
come in very handy if you use the FT_INT86() function, because the
CPU flags are returned as a series of bits\. Using this function, you
can determine the state of each CPU flag\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
if FT_ISBITON( nCPUFlags, 0 )
.in 0.64i
.br
Qout( "The carry flag was set\." )
.in 0.4i
.br
endif
.sp
.br
if FT_ISBITON( nCPUFlags, 7 )
.in 0.64i
.br
Qout( "The sign flag was set\." )
.in 0.4i
.br
endif
.sp
.in 0.08i
\fBSource:\fR ISBITON\.PRG
.sp
\fBAuthor:\fR Ted Means
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_METAPH() Convert a character string to MetaPhone format
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_METAPH()
Convert a character string to MetaPhone format
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_METAPH( <cName> [, <nSize> ] ) -> cMetaPhone
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cName>\fR is the character string to convert
.sp
\fB<nSize>\fR is the length of the character string to be returned\.
.in 1.04i
If not specified the default length is 4 bytes\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
A phonetically spelled character string
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function is a character function use to index and search for
sound-alike or phonetic matches\. It is an alternative to
the SOUNDEX() function, and addresses some basic pronunciation
rules, by looking at surrounding letters to determine how parts of
the string are pronounced\. FT_METAPH() will group sound-alikes
together, and forgive shortcomings in spelling ability\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
USE Persons
.br
INDEX ON FT_METAPH( LastName ) TO LastName
.br
SEEK FT_METAPH( "Philmore" )
.ta 2.56i
.br
? FOUND(), LastName // Result: \.T\. Philmore
.br
.ta
.br
SEEK FT_METAPH( "Fillmore" )
.ta 2.56i
.br
? FOUND(), LastName // Result: \.T\. Philmore
.br
.ta
.sp
.in 0.08i
\fBSource:\fR METAPH\.PRG
.sp
\fBAuthor:\fR Dave Adams
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_NOOCCUR() Find the number of times one string occurs in another
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_NOOCCUR()
Find the number of times one string occurs in another
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_NOOCCUR( <cCheckFor>, <cCheckIn> ;
.in 1.36i
.ta 2.08i
\fB[, <lIgnoreCase> ] ) -> <nOccurrences>
.br
.ta
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cCheckFor>\fR is the string to search for
.sp
\fB<cCheckIn>\fR is the string to search
.sp
\fB<lIgnoreCase>\fR is a boolean variable to force case sensitivity
(optional, defaults to \.F\.)\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
The number of times <cCheckFor> appears in <cCheckIn>
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function finds the number of times a string occurs in a
.in 0.64i
second string\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
// Find the number of times "the" appears in cMemoString, case
.br
// insensitive
.sp
.br
nNoOfOccurrences := FT_NOOCCUR( "the", cMemoString )
.sp
.br
// Find the number of times "the" appears in cMemoString, case
.br
// sensitive
.sp
.br
nNoOfOccurrences := FT_NOOCCUR( "the", cMemoString, TRUE )
.sp
.in 0.08i
\fBSource:\fR NOOCCUR\.PRG
.sp
\fBAuthor:\fR David Husnian
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_PCHR() Convert printer control codes
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_PCHR()
Convert printer control codes
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.48i
.ta 1.76i 2.08i
\fBFT_PCHR( <cString> ) -> <cPrinterFormat>
.br
.ta
.sp
.in 0.08i
\fBArguments
.sp
.in 0.56i
\fB<cString>\fR is the representation of the printer control codes in
text, numeric, hexadecimal, Epson command format, or any combination
separated by commas\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.56i
A character string of printer control codes\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.56i
This function is useful for allowing the user to enter printer
control codes in text (enclosed in double quotes), numeric,
hexadecimal, or Epson commands preceded by a slash and returns
the printer control code equivalent\.
.sp
NOTES"
.sp
.in 0.72i
.br
- Combinations of text, numbers, hex, and commands must be
.in 0.96i
.br
separated by commas ("A",27,&1B,/RESET)\.
.in 0.72i
.br
- Text must be enclosed in double quotes ("x")\.
.br
- Hexadecimal must be preceded by an ampersand (&1B)\.
.br
- Epson commands, listed below, must be preceded by a forward
.in 0.96i
.br
slash (/RESET)\.
.sp
.in 0.72i
Epson commands: (slash commands are specific to the Epson)
.sp
.in 0.88i
Job Control:
.sp
.ta 1.44i
/RESET or /INIT Reset or initialize the printer
.br
.ta
.ta 0.56i 1.44i
/BELL or /BEEP Cause the printer\'s speaker to beep (not HS)
.br
.ta
.ta 1.44i
/CAN Clear print buffers (not MX)
.br
.ta
.ta 1.44i
/SLOW Set low speed mode (not CR, HS, MX)
.br
.ta
.ta 1.44i
/FAST Cancel low speed mode (not CR, HS, MX)
.br
.ta
.ta 1.44i
/ONE Select Unidirectional mode
.br
.ta
.ta 1.44i
/TWO Select Directional mode
.br
.ta
.ta 1.44i
/ON Activate printer
.br
.ta
.ta 1.44i
/OFF Turn off printer
.br
.ta
.sp
.ta 1.44i
/FF or /EJECT Form Feed
.br
.ta
.sp
Page Control:
.sp
.ta 1.44i
/1/6 Set 6 lines per inch
.br
.ta
.ta 1.44i
/1/8 Set 8 lines per inch
.br
.ta
.ta 1.44i
/SKIP Set Skip perforation ON
.br
.ta
.ta 1.44i
/SKIPOFF Set Skip perforation OFF
.br
.ta
.sp
Font Selection and Manipulation:
.sp
.ta 1.44i 3.44i
/ITALIC Select italic char\. set (only FX86, EX, LX,
.br
.ta
.in 4.72i
no LQ-1500, SX)
.in 0.88i
.ta 1.44i
/GRAPHIC Select graphic char\. set (only FX86, EX, LX,
.br
.ta
.in 4.72i
no LQ-1500, SX)
.in 0.88i
.ta 1.44i
/ROMAN Choose Roman font
.br
.ta
.ta 1.44i
/SANS Choose Sans Serif font
.br
.ta
.ta 1.44i
/DRAFT Choose draft
.br
.ta
.ta 1.44i
/NLQ Choose near letter quality
.br
.ta
.ta 1.44i
/PICA Choose 10 chars per inch
.br
.ta
.ta 1.44i
/ELITE Choose 12 chars per inch
.br
.ta
.ta 1.44i
/COND or /SI Choose 15 chars per inch
.br
.ta
.ta 1.44i
/EMPH Turn emphasize on
.br
.ta
.ta 1.44i
/EMPHOFF Turn emphasize off
.br
.ta
.ta 1.44i
/SPANISH Select spanish international char set
.br
.ta
.ta 1.44i
/USA Select USA international char set
.br
.ta
.sp
.sp
.in 0.08i
\fBExamples
.sp
.in 0.56i
.br
cSetUp := \'27,116,1\'
.br
Set Print ON
.ta 2i 2.32i
.br
? FT_PCHR( cSetUp ) -> (CHR(27)+CHR(116)+CHR(1))
.br
.ta
.in 3.52i
.br
<select Epson char\. graphics>
.sp
.in 0.56i
.ta 2i 2.32i
.br
? FT_PCHR( \'27,"x",0\' ) -> (CHR(27)+CHR(120)+CHR(0))
.br
.ta
.in 3.28i
.br
<Epson draft mode>
.sp
.in 0.56i
.ta 1.76i 2i 2.32i 3.92i
.br
? FT_PCHR( \'&1B,"E"\' ) -> (CHR(27)+CHR(69)) <HP reset>
.br
.ta
.sp
.br
? FT_PCHR( \'/ELITE,/NLQ\' ) ->(CHR(27)+CHR(77)+CHR(27)+CHR(120)+CHR(1))
.in 2.56i
.br
<Epson elite & near letter quality>
.sp
.in 0.08i
\fBSource:\fR PCHR\.PRG
.sp
\fBAuthor:\fR Jim Gale
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_PROPER() Convert a string to proper-name case
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_PROPER()
Convert a string to proper-name case
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_PROPER( <cString> ) -> cProperName
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cString>\fR is the string to be converted\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
A string of the same length as <cString>, only converted to
proper name case (upper/lower case)\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
FT_PROPER() uses a brute-force algorithm to convert a string
to propername case\. First, it capitalizes the first letter of
all words starting after a blank, dash, or apostrophe\. This
catches most names, including special cases such as names
beginning with O\' (O\'Malley, O\'Reilly) and hyphenated names
(such as Susan Chia-Mei Lo)\.
.sp
Next, it does a specific adjustment for words beginning in "Mc"
It finds the first \'Mc\' and capitalizes the next character after
it\. It does this for all occurrences of Mc\.
.sp
The original FT_PROPER() was written in Clipper by Glenn Scott
and Mark Zechiel; it was re-written in C (and thus, optimized
and enhanced) by Robert DiFalco\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.56i
.br
FUNCTION main( cStr )
.in 0.72i
.br
OutStd( FT_PROPER( cStr ) + chr(13) + chr(10) )
.in 0.56i
.br
RETURN ( nil )
.sp
.in 0.08i
\fBSource:\fR PROPER\.C
.sp
\fBAuthor:\fR Robert DiFalco and Glenn Scott