| |
Previous Section: Glossary | |
|
The files in the tutorials have been included in the tutorials directory. If you are reading this online then click the links to each file to download or you can copy and paste the text from each example directly into Wozterm.
menu.cmd |
|
!File: menu.cmd
!Author: David Cullen (C) April 2003
!Description: Brief OVM script to introduce a user to compiling and running a
! script in Wozterm. Additionally shows new usage of @menu and @form commands.
@check(off)
@integer mnu !Stores result of menu selection
@menu(mnu,0,"AUS$ To","EUR$","US$","YEN")
@string date = "dd/mm/yy"
@boolean reverse = TRUE
@integer amount = 1
@form(1,1,10,date,"Date: ", 1,2,10,amount,"Amount: ", 1,3,2,reverse,"Reverse conversion also: ")
@comment("On ",date)
@if mnu = 1 then
@begin
@comment(amount," Australian dollars converts to 123 Euro Dollars")
@if (reverse) then
@comment(amount," Euro dollars converts to 321 Australian Dollars")
@end
@else if mnu = 2 then
@begin
@comment(amount," Australian dollars converts to 456 US Dollars")
@if (reverse) then
@comment(amount," US dollars converts to 654 Australian Dollars")
@end
@else
@begin
@comment(amount," Australian dollars converts to 789 YEN")
@if (reverse) then
@comment(amount," YEN converts to 987 Australian Dollars")
@end
@pause !Stop program from unloading
|
|
connect.cmd |
|
!File: connect.cmd !Author: Neil Waldron (C) December 2001 !Description: Script to introduce a user to connecting to an AXE NE. ! Additionally, provides for Command History utility usage. ! Provide @MENUARRAY of connection type for users @CONSTANT INTEGER numselections = 4 @CONSTANT INTEGER menutimeout = 0 @STRING menuselections[numselections] @SET menuselections[1] = 'DCAP AXE' @SET menuselections[2] = 'NEAS AXE' @SET menuselections[3] = 'NEM AXE' @SET menuselections[4] = 'NEM AXE MTP' @INTEGER mnu = 0 @MENUARRAY(mnu,menutimeout,'Connection Method',numselections,menuselections) @MODE(menuselections[mnu]) !Change Wozterm automation mode to selection @CONNECT() !Blank connect command calls for user input. @IFERROR THEN PAUSE @LOGON @IFERROR THEN PAUSE !AXE command to print system clock time. !NOTE - Host commands are send as whole lines - ! You should not comment on the same line as an implicit host command. CACLP; !DCAP AXE command to print system alarm list. ALLIP; @PAUSE !Stop program from unloading. |
|
error.cmd
!File: error.cmd !Author: Neil Waldron (C) April 2001 !Description: Script to introduce a user to debugging utilities provided ! in Wozterm. Displays a text file to VT100 Terminal Pane. constant maxFileLines = 200 !Note missing @ - line interpreted as host command @integer lineCount = 0 !Current line being read by filereadln @strng fileName, fileLine !Note typo of @string @string fileLines[maxFileLines] !Will store the file here before printing to screen !Initialise for printing to screen @clrscr !Clear screen for new file display. !Get file to be printed to screen @string fileNamePrompt = strconcat("Enter a fully qualified file name to view (Max ", maxFileLines, " lines will be displayed!):") @input(fileName, fileNamePrompt) @check(on, FILENOTEXIST) @openread(fileName) !Read file into array @check(off) !We want to error check manually to catch EOF. @repeat @begin @set fileLine = filereadln(fileName) @iferror then !We have hit EOF. @begin @fileclose(fileName) !Close the file. @goto DISPLAYFILE !Display the file read in. @end @begin !No EOF encountered, store file line. @set lineCount = lineCount + 1 @set fileLines[lineCount] = fileLine @end @end @until lineCount >= maxFileLines !Print file to screen @label DISPLAYFILE @comment(`Displaying file:\t"`, fileName, "') @if lineCount < 1 then @comment("FILE '", fileName, "' IS EMPTY!") else @begin @integer i @for i = 1 to lineCount @begin @comment(i, `.\t`, fileLines[i]) !Display file line with numbering. @end @end @pause !Stop program from unloading. !Error handling code @trap FILENOTEXIST @begin @comment("The file name that you have entered is invalid, please run script again to retry.") @pause @end
events.cmd
!File: events.cmd !Author: Neil Waldron (C) January 2001 !Description: Script to introduce a user to Text/Time Events. ! Reports method of invocation to user. !=============================================================================== !========= Code to be executed if Script fired nomally from Wozterm ============ !=============================================================================== !Inform user of method of script invocation @clrscr @comment() @comment("This instance of the 'events.cmd' script has been invoked manually by a user of Wozterm.") !Set up new Time Event to fire this script. !NOTE - If a user requires a script to be run from a Time Event ! other than the current script, it needs to be set manually ! using the Wozterm Time Events tab. @integer timeEventSetResult @string eventTime @set eventTime = strconcat("20", advance(getdatetime(), '1M'), strcopy(getdatetime(), 13, 5)) !@advance not yet Y2K date format compliant @set timeEventSetResult = timeevset(TIMEEVENTSTART, eventTime) @comment("A Time Event has been set to trigger at ", eventTime, " (Format: YYYYMMDDhhmmssxxx)") @comment("View the Time Event by clicking on the Time Events tab in the Multi-function pane.") @comment("Please be patient - the Time Event will trigger in under 1 minute...") !End Script Execution @goto SCRIPTEND !=============================================================================== !=========== Code to be executed if Script fired from Time Event =============== !=============================================================================== @label TIMEEVENTSTART !Inform user of method of script invocation @comment() @comment("This instance of the 'events.cmd' script has been invoked by a Time Event.") !Set up new Text Event to fire this script. !NOTE - If a user requires a script to be run from a Text Event ! other than the current script, it needs to be set manually ! using the Wozterm Text Events tab. @integer textEventSetResult @set textEventSetResult = textevset(TEXTEVENTSTART, "GIBBERISH") @comment("A Text Event has now been set to react to the Slogan 'GIBBERISH'.") @comment("Note that Wozterm does not respond to you typing 'GIBBERISH', but instead to the NE response `GIBBERISH not found` or `scommand 'GIBBERISH;'`.") @comment("View the Text Event by clicking on the Text Events tab in the Multi-function pane.") !Now connecting to an NE and sending gibberish to invoke this script again. !Sending 'GIBBERISH;' to the NE should result in the response "GIBBERISH not found" or !"scommand 'GIBBERISH;'", triggering the Text Event set above. Note that @hostcmd or !an implicit host command could not be used, as the script would not terminate until !the prompt was returned, blocking any Text/Time Events from running. @comment("Now connecting to the NE and sending 'GIBBERISH' to trigger NE response...") @sleep(25000) !Time to read comments on screen !Ensure correct NE mode and connect @mode("DCAP AXE") !Change Wozterm automation mode to 'DCAP AXE' @connect() !Blank connect command calls for user input. @iferror then pause @logon @iferror then pause !Send Garbage @send("GIBBERISH;",13,10) !End Script Execution @goto SCRIPTEND !=========================================================================== !========= Code to be executed upon Text Event being captured ============== !=========================================================================== @label TEXTEVENTSTART !Let user know of Script success @comment() @comment("This instance of the 'events.cmd' script has been invoked by a Text Event.") !Delete Text Event to allow for future runs @evdelete(TEXTEVENTSTART) @comment("The Text Event that triggered this script has been deleted to return Wozterm to its starting state.") !Disconnect from NE and pause to stop script unloading @comment("Disconnecting...") @disconnect() @pause !=========================================================================== @label SCRIPTEND
| |
Previous Section: Glossary | |
|
|
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. |