Difference between revisions of "ZH/Documentation/BASIC Guide/Operators"
From Apache OpenOffice Wiki
(New page: {{DISPLAYTITLE:运算符}} {{ZH/Documentation/BASICGuideTOC/v2 |ShowPrevNext=block |ShowPrevPage=block |PrevPage=Documentation/BASIC Guide/Constants |NextPage=Documentation/BASIC Guide/Bra...) |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 3: | Line 3: | ||
|ShowPrevNext=block | |ShowPrevNext=block | ||
|ShowPrevPage=block | |ShowPrevPage=block | ||
− | |PrevPage=Documentation/BASIC Guide/Constants | + | |PrevPage=ZH/Documentation/BASIC Guide/Constants |
− | |NextPage=Documentation/BASIC Guide/Branching | + | |NextPage=ZH/Documentation/BASIC Guide/Branching |
|lang=block | |lang=block | ||
}} | }} | ||
Line 66: | Line 66: | ||
|} | |} | ||
− | {{ | + | {{Note|{{OOo}} Basic 不支持 VBA <tt>Like</tt> 比较运算符。}} |
{{PDL1}} | {{PDL1}} | ||
+ | |||
+ | |||
{{InterWiki_Languages_BasicGuide|articletitle=Documentation/BASIC Guide/Operators}} | {{InterWiki_Languages_BasicGuide|articletitle=Documentation/BASIC Guide/Operators}} |
Latest revision as of 14:40, 6 July 2018
Apache OpenOffice Basic 可以识别常见的数学运算符、逻辑运算符和比较运算符。
数学运算符
数学运算符可以应用于所有数字类型;而运算符 + 还可以用于链接字符串。
+ | 数字和日期值的相加以及字符串链接 |
- | 数字和日期值的相减 |
* | 数字相乘 |
/ | 数字相除 |
\ | 数字相除且结果为整数(四舍五入) |
^ | 计算数字的幂 |
MOD | 模运算(计算除法的余数) |
逻辑运算符
逻辑运算符用于按照布尔代数学规则链接元素。如果将这些运算符应用于布尔值,链接将直接提供所需的结果。如果将其与整型值和长整型值一起使用,则会在位级别进行链接。
AND | 与链接 |
OR | 或链接 |
XOR | 异或链接 |
NOT | 非 |
EQV | 相等测试(两个部分 True 或 False) |
IMP | 隐含(如果第一个表达式为 true,则第二个表达式也为 true) |
比较运算符
比较运算符可以应用于所有基本变量类型(数字、日期详细信息、字符串和布尔值)。
= | 数字、日期值和字符串相等 |
<> | 数字、日期值和字符串不相等 |
> | 数字、日期值和字符串的大于检查 |
>= | 数字、日期值和字符串的大于或等于检查 |
< | 数字、日期值和字符串的小于检查 |
<= | 数字、日期值和字符串的小于或等于检查 |
Content on this page is licensed under the Public Documentation License (PDL). |