| |
OVM supports the usual operators found in most 3GL languages. The OVM operators in precendence order are (highest first, left to right equal).
(,) Open bracket and close bracket [,] Array open bracket and close bracket {,} Variable substitution open bracket and close bracket -, ~ , NOT Integer unary minus, Bitwise not, Boolean not *, /, %, MOD Multiply, Divide, Modulus (%,'MOD') +, - Add, Subract <, >, <=, >=, =, <> Less than, Greater than, Less than or equal, Greater than or equal, Equal to, Not equal to & Bitwise and ^ Bitwise exclusive or | Bitwise or AND Boolean and XOR Boolean exclusive or OR Boolean or The operator precedence determines the order in which OVM evaluates subexpressions.
The addition operator + can also be used to concatenate strings together.
Unlike DOS Ozterm, OVM observes the correct precendence of operators. This can lead to subtle errors if a DOS Ozterm script is used unmodified in the OVM environment. Eg. In DOS Ozterm 1 + 2 * 3 = 9, In OVM 1 + 2 * 3 = 7. When in doubt use the () operators to ensure the expression is evaluated in the required order. Eg. (1 + 2) * 3 = 9.
The symbol for the equality operator = also doubles as the symbol for the assignment operator =. This is unlike C, and Pascal which have different symbols to distinguish between the assignment operator, and the equality operator.
| |
| This publication has been prepared and written by Telstra Corporation Limited (ACN 051 775 556), and is copyright. Other than for the purposes of and subject to the conditions prescribed under the Copyright Act, no part of it may in any form or by any means (electronic, mechanical, microcopying, photocopying, recording or otherwise) be reproduced, stored in a retrieval system or transmitted without prior written permission from the document controller. Product or company names are trademarks or registered trademarks of their respective holders. Note for non-Telstra readers: The contents of this publication are subject to change without notice. All efforts have been made to ensure the accuracy of this publication. Notwithstanding, Telstra Corporation Limited does not assume responsibility for any errors nor for any consequences arising from any errors in this publication. |