Purpose |
|||||||||||||||||||||||||||||||||||||
Syntax |
bytevar? = CVBYT(variable [, offset]) curvar@ = CVCUR(variable [, offset]) cuxvar@@ = CVCUX(variable [, offset]) doublevar# = CVD (variable [, offset]) doublewordvar??? = CVDWD(variable [, offset]) extendedvar## = CVE (variable [, offset]) integervar% = CVI (variable [, offset]) longintvar& = CVL (variable [, offset]) quadintvar&& = CVQ (variable [, offset]) singlevar! = CVS (variable [, offset]) wordvar?? = CVWRD(variable [, offset]) | ||||||||||||||||||||||||||||||||||||
Remarks |
The CVx functions return a number corresponding to a binary pattern stored in a string value. The MKx functions are complementary to the CVx functions. Do not confuse these functions with the VAL function, which converts a number stored as a printable text string (such as "123.45") into a numeric expression. The CVx functions allow retrieving values beyond the first byte of the input string variable, where offset indicates at what position in the string the function should retrieve value. variable may be either a User-Defined Type or a string. For example: "Value& = CVL(x$, 3)" would extract the 3rd through 6th bytes of x$ and convert these 4 bytes to the corresponding Long-integer value. In this example, x$ must be at least 6 bytes long.
Expressions involving Numeric Equates and conditional compilation (#IF) may also include the CVQ function. This allows you to easily assign numeric values to an equate, based upon a meaningful mnemonic. In this context, the CVQ expression is limited to a length of eight bytes. For example: %Mode = CVQ("DEBUG") %Style = CVQ("Cool") | ||||||||||||||||||||||||||||||||||||
See also |