BIN2I() | Преобразует 16-битовое целое со знаком в числовое значение. |
BIN2L() | Преобразует 32-битовое целое со знаком в числовое значение. |
BIN2W() | Преобразует 16-битовое целое без знака в числовое значение. |
DSTRTON() | Преобразует строку c "double"-представлнием в xClipper-число. |
FSTRTON() | Преобразует строку c "float"-представлнием в xClipper-число. |
FT_BYT2BIT() | Convert byte to string of 1's and 0's |
FT_BYT2HEX() | Convert byte to hexadecimal version of its binary value |
FT_D2E() | Convert decimal to scientific notation |
FT_DEC2BIN() | Convert decimal to binary |
FT_E2D() | Convert scientific notation string to a decimal |
FT_ESCCODE() | Convert Lotus style escape codes |
FT_HEX2DEC() | Convert a hex number to decimal |
FT_INVCLR() | Get the inverse of a color |
FT_NTOW() | Translate numeric value to words |
FT_SQZN() | Compress a numeric value into a character string |
FT_UNSQZN() | Uncompress a numeric compressed by FT_SQZN() |
FT_XTOY() | Convert from any data type to any other data type |
HASHNAME() | Возвращает строку, из которой был получен хэш-код. |
HASHSTR() | Возвращает хэш-код строки. |
I2BIN() | Преобразует числовую величину в двухбайтное двоичное целое. |
L2BIN() | Преобразует числовую величину в 32-битовое двоичное целое. |
STR2VAR() | Конвертировать uucode строку в исходные данные. |
VAR2STR() | Конвертировать данные в uucode строку. |
FT_BYT2BIT( <cByte> ) -> cBitPattern
9-character string, consisting of 1's and 0's, representing bits 0 through 7 of parameter byte, with space between bits 3 and 4. Returns NIL if parameters are faulty.
Can be used to show results of bit manipulation, both before and after. Binary representation follows right-to-left convention of bit position numbering, 0 through 7. Space between high and low nibbles for clarity and easy comparison to hexadecimal notation.
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.
These three code lines perform a bitwise AND on bytes with values of CHR(20) and CHR(36), and deliver the result as a string in binary (bit) format. ? FT_BYT2BIT(CHR(20)) // byte1: '0001 0100' ? FT_BYT2BIT(CHR(36)) // byte2: '0010 0100' ? FT_BYT2BIT(FT_BYTEAND(CHR(20), CHR(36))) // result: '0000 0100' For a demonstration of Clipper bit manipulations, compile and link the program BITTEST.PRG in the Nanforum Toolkit source code.
FT_BYT2HEX( cByte ) -> cHexValue
Three-character string, consisting of two digits of hexadecimal notation and letter 'h' to signify hex. Returns NIL if parameters are faulty.
Can be used to show results of bit manipulation, both before and after.
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.
These three code lines perform a bitwise AND on bytes with values of CHR(20) and CHR(36), and deliver the result as a string in hexadecimal format, using 'h' to signify hexadecimal. ? FT_BYT2HEX(CHR(20)) // byte1: '14h' ? FT_BYT2HEX(CHR(36)) // byte2: '24h' ? FT_BYT2HEX(FT_BYTEAND(CHR(20), CHR(36))) // result: '04h' For a demonstration of Clipper bit manipulations, compile and link the program BITTEST.PRG in the Nanforum Toolkit source code.
FT_D2E( <nDec>, <nPrecision> ) -> <cNumE>
<cNumE> A string representing a number in scientific notation
Given a decimal number and the desired precision, a string representing the equivalent in scientific notation is returned.
? FT_D2E( 12.345, 2 ) -> 1.23E1 ? FT_D2E( -12.345, 3 ) -> -1.235E1 ? FT_D2E( 0.00000543, 2 ) -> 5.43E-6
FT_DEC2BIN( <nNum> ) -> cBinaryNumber
A character string representing <nNum> in binary format.
This function can be used in conjunction with any bit-wise operations.
QOut( FT_DEC2BIN(255) ) // "11111111" QOut( FT_DEC2BIN(2) ) // "00000010"
FT_E2D( <cNumE> ) -> <nDec>
<nDec> Decimal number
Given a string in the format x.yEz, the decimal equivalent is returned.
? FT_E2D( "1.23E1" ) -> 12.3 ? FT_E2D( "-1.235E1" ) -> -12.35 ? ft_d2e( "5.43E-6" ) -> 0.0000543
FT_ESCCODE( <cASCII> ) -> <cPrinterFormat>
The binary version of an ASCII coded printer setup string.
This function is useful for allowing the user to enter printer control codes in Lotus-style ASCII format, and then having this function convert that code to the format that the printer needs to receive.
cSetup = "\015" // default = Epson compressed print UserInput( @cSetup ) // Let user modify setup code SET DEVICE TO PRINT // get ready to print ?? FT_ESCCODE( cSetup ) // Output the converted code
FT_HEX2DEC( <cHexNum> ) -> nDecNum
A decimal number.
Converts a hexadecimal number to a BASE 10 decimal number. Useful for using FT_INT86().
FT_INT86( HEX2DEC( "21" ), aRegs ) Converts 21h, the Dos Interrupt, to its decimal equivalent, 33, for use by FT_INT86().
FT_INVCLR( [ <cDsrdColor> ] ) -> cColor
The inverse of the passed color.
This function inverts a passed color (in the Clipper format: ??/??), e.g., "W/N" is converted to "N/W".
cInverse := FT_INVCLR() // Get Inverse of Current Color cInvErr := FT_INVCLR( cErrColor ) // Get Inverse of cErrorColor
FT_NTOW( <nNumber> ) -> cWords
A text string representing <nNumber>
Translates numeric input to a text string.
FT_NTOW is intended to be used with integers only. Since I don't know what your application will be, I can't assume the type of fraction you want returned (ninety nine cents, 99/100, .99, etc). If you want the fraction in words, just pass it as an integer.
Do not pass a negative number! Handle negative numbers any way you need to in your code. (ie: CR, DB, Negative, Minus, etc.)
Also, numeric 0 is returned as a null string. You will need to make a decision how to output it (zero dollars, no dollars, etc).
? FT_NTOW( 999 ) -> Nine Hundred Ninety Nine ? FT_NTOW( 1000 ) -> One Thousand ? FT_NTOW( 23 ) + " Dollars and " + FT_NTOW( 99 ) + " Cents" -> Twenty Three Dollars and Ninety Nine Cents ? FT_NTOW( 23 ) + " Dollars and " + "99/100" -> Twenty Three Dollars and 99/100 x := -23.99 cents := str( (x - int( x )) * 100, 2, 0 ) + "/100" x := int( x ) string := iif( x < 0, "Credit of ", "Debit of " ) ? string + FT_NTOW( abs(x) ) + " Dollars and " + "99/100" -> Credit of Twenty Three Dollars and 99/100
FT_SQZN( <nValue> [, <nSize> [, <nDecimals> ] ] ) -> cCompressed
No arguments
cCompressed - Compressed string, 50% the size of nSize
The FT_SQZN function allows a numeric value to be compressed when stored in the database. The compression is 50% the storage space of the original number. The companion function, FT_UNSQZN returns the original number from the compressed string.
replace TRANS->cust_id with FT_SQZN(mcust_id,8),; TRANS->amount with FT_SQZN(mamount,12,2)
FT_UNSQZN( <cCompressed>, <nSize> [, <nDecimals> ] ) -> nValue
nValue - Uncompressed numeric value
The FT_UNSQZN function returns the numeric value from the compressed string. The compression is 50% the storage space of the original number. The original number must have been compressed using the FT_SQZN() function.
This function, along with FT_SQZN() can be used to reduce disk storage requirements for numeric fields in a database file.
mcust_id := FT_UNSQZN(TRANS->cust_id,8),; mamount := FT_UNSQZN(TRANS->amount,12,2)
FT_XTOY( <xValueToConvert>, <cTypeToConvertTo> ; [, <lWantYesNo> ] ) -> xResult
The original value converted to the new type.
This function converts a value of character, date, numeric, logical, array or code block type to any of the other type. While it is guaranteed to return a value of the correct type, that value may not be meaningful (i.e., converting from a code block returns an EMPTY() value of the desired type).
nNumericValue := FT_XTOY(cInputValue, "N") IF (FT_XTOY(nInputValue, "L"))
Пред. | Начало | След. |
CGI/FCGI | Уровень выше | DATABASE |