CharAdd
CharAnd
CharEven
CharHist
CharList
CharMirr
CharMix
CharNoList
CharNot
CharOdd
CharOne
CharOnly
CharOr
CharPix
CharRela
CharRelRep
CharRem
CharRepl
CharRLL
CharRLR
CharSHL
CharSHR
CharSList
CharSort
CharSub
CharSwap
CharWin
CharXOR
Tag Archives: CTOBIT
Conversion Functions
Harbour Conversion Functions
Bin2I | Convert signed short encoded bytes into Harbour numeric |
Bin2L | Convert signed long encoded bytes into Harbour numeric |
Bin2U | Convert unsigned long encoded bytes into Harbour numeric |
Bin2W | Convert unsigned short encoded bytes into Harbour numeric |
BitToC | Converts position-dependent bits into characters |
BinToDec | Converts a Binary Value to Decimal |
CToBit | Converts a character string into a bit pattern |
CToF | Converts a special 8-byte string into a floating point number |
CToN | Converts a numeric string into a different base |
DecToBin | Converts a Decimal Value to Binary |
DecToHexa | Converts a Decimal Value to Hexa |
DecToOctal | Converts a Decimal Value to Octal |
Fahrenheit | Temperature conversion Celsius to Fahrenheit |
FToC | Converts a floating point number into a special 8-byte string |
HexaToDec | Converts a Hexa Value to Decimal |
I2Bin | Convert Harbour numeric into signed short encoded bytes |
L2Bin | Convert Harbour numeric into signed long encoded bytes |
NToC | Converts the numbers in a digit string into a different number base |
OctalToDec | Converts a Octal Value to Decimal |
U2Bin | Convert Harbour numeric into unsigned long encoded bytes |
W2Bin | Convert Harbour numeric into unsigned short encoded bytes |
Word | Converts double to integer values |
XTOC | Convert an expression to character type string |
CT_CTOBIT
CTOBIT() Converts a character string into a bit pattern ------------------------------------------------------------------------------ Syntax CTOBIT(<cCharacterstring>,<cBitpattern>) --> nWORD Arguments <cCharacterstring> Designates a character sequence. When this sequence occurs in the second character string, each corresponding bit is set to 1. <cBitpattern> Designates a sequence, with a maximum of 16 characters, from which the bit position is assigned. Returns CTOBIT() returns a number in the range of 0 to 65535 that corresponds to the created bit pattern. Description The CTOBIT() function delivers a bit pattern that corresponds to a string of individual characters. When used in conjunction with its sister function BITTOC(), it facilitates work with such bit-coded information as file attributes. Note . Characters in <cCharacterstring> that are not found in <cBitpattern> are ignored. Examples . The second bit in the resulting value is set, since the letter "H" appears in the next-to-last position in "ADVSHR": ? CTOBIT("H", "ADVSHR") // Result: 00000010 . Two characters also in ADVSHR, appear at the first and final positions in this 6-character string: ? CTOBIT("RA", "ADVSHR") // Result: 00100001 . <cBitpattern> ignores previously unavailable characters: ? CTOBIT("XRYA", "ADVSHR") // Result: 00100001
See Also: BITTOC() NTOC()
Tools – Numbers/Bit Manipulation
Introduction BITTOC() Converts position-dependent bits into characters CELSIUS() Converts a Fahrenheit temperature value into Celsius CLEARBIT() Clears one or more bits within a number to zero CTOBIT() Converts a character string into a bit pattern CTOF() Converts a special 8-byte string into a floating point number CTON() Converts a numeric string into a different base EXPONENT() Determines the exponent of a floating point number (base 2) FAHRENHEIT() Converts a temperature value from Celsius into Fahrenheit FTOC() Converts a floating point number into a special 8-byte string INFINITY() Creates the largest number possible (21023) INTNEG() Converts an unsigned integer into a signed integer INTPOS() Converts a signed integer into an unsigned integer ISBIT() Tests the bits in a number LTON() Converts a logical value into a numeric value MANTISSA() Determines the mantissa of a floating point number (base2) NTOC() Converts numbers in a digit string into a different number base NUMAND() Performs a 16-bit "AND" of a list of numbers NUMCOUNT() Uses the internal CA-Clipper Tools counter NUMHIGH() Returns the higher value byte in a 16-bit number NUMLOW() Returns the lower value byte in a 16-bit number NUMMIRR() Mirrors 8-bit or 16-bit values NUMNOT() Performs a 16-bit "NOT" of a number NUMOR() Performs a 16-bit "OR" of a list of numbers NUMROL() Performs a 16-bit left rotation of a number NUMXOR() Performs a 16-bit "XOR" of two numbers RAND() Generates random numbers RANDOM() Generates random numbers SETBIT() Sets one or more bits in a number