| |
By default script file execution starts at the top of the file and then continues line by line until the end of the file has been reached. Although this is fine for some scripts in many cases you will need to control the flow of a script's execution. The OVM keywords that are used to control the flow of the script can be loosely divided into the categories unconditional, conditional, loop, and runtime error handling. Brief keyword descriptions are each given below. Follow the links for the full description of each keyword.
call Explicitly call a function discarding its returned value. eosub / !$$$$! Return to the script that called us with @include. gosub Call an @subroutine. goto Jump to an @label. include Call another script but current script remains loaded. pause Script immediately halts but remains loaded and can be recontinued. quit Script immediately halts and Wozterm / Wozix exit also. return Returns from the current @subroutine, @trap, @procedure, or @function. run Call another script and current script is unloaded. stop Script immediately halts and Wozix exits but Wozterm continues running.
if If a condition is true run the code that follows. prompt Asks the user if to continue script execution.
endloop Script immediately exits the innermost loop. for Script executes a counting loop. nextloop Script immediately continues to the next innermost loop iteration. repeat Continue executing the code that follows until a condition is met. while While a condition is met continue executing the code that follows.
check Turn runtime error checking on or off and optionally set an error trap. geterrorflag Return the runtime error flag and the last runtime error number. iferror Test (and reset) the runtime error flag and execute code that follows if it was set. seterrorflag Set the runtime error flag and runtime error number. trap Define a runtime error trapping subroutine for use with @check.
| |
| 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. |