Example
sequence s atom aa = abs(-1) -- = 1 s = abs({-2,-1,{-1,0,1},1,2}) -- = {2,1,{1,0,1},1,2}
See Also: get_bits, hi_word, lo_word, or_all, pack_word, shortInt, signed_word, TextToNumber, unpack_sWord, unpack_word
Typically used to extract which bits have been set on in a flag.
Example:
-- combine flags integer flags sequence codes codes = get_bits( origflag ) if find(WS_EX_CLIENTEDGE, codes) then setText(statusarea, "Client Edge has been specified") end if
See Also: abs, hi_word, lo_word, or_all, pack_word, shortInt, signed_word, TextToNumber, unpack_sWord, unpack_word
Example:
integer y y = hi_word( bigval )
See Also: abs, get_bits, lo_word, or_all, pack_word, shortInt, signed_word, TextToNumber, unpack_sWord, unpack_word
Example:
integer y y = lo_word( bigval )
See Also: abs, get_bits, hi_word, or_all, pack_word, shortInt, signed_word, TextToNumber, unpack_sWord, unpack_word
example:
atom flags flags = or_all({WS_CHILD, WS_VISIBLE, WS_BORDER})
See Also: abs, get_bits, hi_word, lo_word, pack_word, shortInt, signed_word, TextToNumber, unpack_sWord, unpack_word
Typically used to encode a message parameter into a 32 bit word.
Example:
-- pack min and max into parameter integer y lParam = pack_word( min, max )
See Also: abs, get_bits, hi_word, lo_word, or_all, shortInt, signed_word, TextToNumber, unpack_sWord, unpack_word
Typically used to decode Win32 message values
Example:
-- Mouse Position sequence hilo, x, y hilo = upack_word( lParam ) x = shortInt(hilo[2]) y = shortInt(hilo[1])
See Also: abs, get_bits, hi_word, lo_word, or_all, pack_word, signed_word, TextToNumber, unpack_sWord, unpack_word
Typically used to decode Win32 message values when several values are packed into a single number.
Example:
-- extract the low portion from lParam integer x x = signed_word( lParam )
See Also: abs, get_bits, hi_word, lo_word, or_all, pack_word, shortInt, TextToNumber, unpack_sWord, unpack_word
If the text contains invalid characters, zero is returned.
Note 1: You can supply Hexadecimal values if the value is preceded by a '#' character, Octal values if the value is preceded by a '@' character, and Binary values if the value is preceded by a '!' character. With hexadecimal values, the case of the digits 'A' - 'F' is not important. Also, any period character embedded in the number is used with the correct base.
Note 2: Any underscore characters, '_', that are embedded in the text number are ignored. These can be used to help visual clarity for long numbers.
Note 3: You can supply a leading or trailing, minus or plus sign.
Note 4: You can supply trailing percentage sign(s). Each one present causes the resulting value to be divided by 100.
This function can optionally return information about invalid numbers. If text has the form of {sequence, integer} then if the integer is nonzero, a sequence is returned. The first element is the value converted, and the second is the position in the text where conversion stopped. If no errors were found then this is zero.
sequence rc atom val rc = TextToNumber({"12.34a", 1}) -- rc ---> {12.34, 6} -- Error at position 6 rc = TextToNumber({"12.34", 1}) -- rc ---> {12.34, 0} -- No errors.val = TextToNumber("12.34a") -- val ---> 0
val = TextToNumber("#f80c") --> 63500 val = TextToNumber("#f80c.7aa") --> 63500.47900390625 val = TextToNumber("@1703") --> 963 val = TextToNumber("!101101") --> 45 val = TextToNumber("12_583_891") --> 12583891 val = TextToNumber("12_583_891%") --> 125838.91 val = TextToNumber("12_583_891%%") --> 1258.3891
See Also: abs, get_bits, hi_word, lo_word, or_all, pack_word, shortInt, signed_word, unpack_sWord, unpack_word
Typically used to decode Win32 message values when several values are packed into a single number.
Example:
-- extract the signed words from lParam sequence hilo hilo = upack_sWord( lParam )
See Also: abs, get_bits, hi_word, lo_word, or_all, pack_word, shortInt, signed_word, TextToNumber, unpack_word
Typically used to decode Win32 message values when several values are packed into a single number.
Example:
-- extract the short words from lParam sequence hilo hilo = upack_word( lParam )
See Also: abs, get_bits, hi_word, lo_word, or_all, pack_word, shortInt, signed_word, TextToNumber, unpack_sWord