Tivoli 服务台 6.0 开发工具包脚本语言参考
返回主页
在两个或更多个整型表达式上执行一个按位“与”运算并返回结果。
FUNCTION BitAnd (VAL bits: INTEGER ...): INTEGER;
自变量名称 | 说明 |
bits | 一个整型表达式 |
IF BitAnd(winStyle, $WinTitle) <> 0 THEN -- The window style calls for a title bar. ... END;
返回该自变量的反向二进制位。
FUNCTION BitNot (VAL bits: INTEGER): INTEGER;
自变量名称 | 说明 |
bits | 单个位值的整数 |
BitNot 反向变换其自变量的每一个二进制位:0 变成 1,1 变成 0。
WinCreate($Desktop, myWindow, MyHandler, 10, 10, 80, 25, 'Example', BitAnd($WinDefaultStyle, BitNot ($WinSysMenu))); -- myWindow is created with the all of the default window -- styles except that it has no system menu.
在两个或更多个整型表达式上执行一个按位“或”运算并返回结果。
FUNCTION BitOr (VAL bits: INTEGER ...): INTEGER;
自变量名称 | 说明 |
bits | 一个整型表达式,将使用 OR 运算符来把它的二进制位和其他表达式的二进制位组合在一起。 |
answer := WinMessageBox($Desktop, 'Error', BitOr($MBIconError, $MBAbortRetryIgnore, $MBDefButton2, $MBMoveable), 'Operation Failed');
在输出整型表达式上执行一个按位“异或”Or(XOR)运算并返回结果。如果运算对象不同,互斥性 Or 运算将返回 1。
FUNCTION BitXOr (VAL bits: INTEGER ...): INTEGER;
自变量名称 | 说明 |
bits | 一个整型表达式,将使用 XOR 运算符来把它的二进制位和其他整型表达式的二进制位组合在一起。 |
PROCEDURE EncryptText (REF text: LIST OF STRING, VAL mask: INTEGER) IS (* Encrypt the given text by XORing the mask over each character. While not very secure, it is simple and has the advantage that decryption is accomplished by calling EncryptText again with the same mask.*) VARIABLES i: INTEGER; ACTIONS FOR text DO FOR i := 1 TO StrLength(text[$CURRENT]) DO text[$CURRENT][i] := Char(BitXOr(CharCode(text[$CURRENT][i]), mask)); END; END; END;
Tivoli 服务台 6.0 开发工具包脚本语言参考