Show/Hide Toolbars

Inventu Viewer+ Simulated Host

The Script tag is used as a container for all logic and flow control in your Simulated Host script.

 

A key attribute in the Script tag is the event attribute, which defines when the Script will execute.

 

There are currently two events defined:

 

onLoad Event

 

The onLoad event is executed each time the screen is activated either by being the first screen in the script or by being activated with the ScreenSwitch action tag.  Typical activities in the onLoad event would be selecting a map and possibly altering the contents of the screen, setting a different cursor location, sending the screen and receiving the input.  An example is at the bottom of this section.

 

Attribute

Default / Required

Description

context

optional, required in generated scripts however.

Sets the context(s) in which this screen is presented from the recordings.  The more times a screen appears in recordings, the more context entries there will be.  Syntax: R[id]:[index] where id=Recording ID and index=screen index inside the recording

 

In generated scripts, multiple onLoad events will be included, depending on context.  For each unique instance of a screen, the context(s) for that instance will be listed, and the onLoad event will include the LoadMap tag followed by necessary PutScreen tags to set the unique data for this instance of the screen.

 

Note that if you omit the onLoad event, the default behavior is to:

 

1.Load the default map for this screen (the one named "default")
2.Set the cursor to the map's defined cursor location
3.Send the screen
4.Read the input (response).

 

onInput Event

 

The onInput event provides far more opportunity for implementing unique logic.  Using the available logic and action tags, the onInput event can display an error message (using PutScreen), or navigate to another screen (using ScreenSwitch).

 

Note that if you omit the onInput event, the default behavior is to perform a ScreenSwitch to the next screen defined in the script.

 

In Inventu Viewer+ Studio generated scripts, the IfState tag is the principal means of managing the actions inside the onInput event.

 

Script Tag Attribute

 

The Script tag's attribute is the single event attribute

 

Attribute

Default / Required

Description

event

required

Allowed: onInput or onLoad

 

See above for descriptions of each event type

 

Child Tags Allowed:

 

IfAid Tag

IfScreen Tag

IfState Tag

CloseClient Tag

LoadMap Tag

PutScreen Tag

ReceiveInput Tag

RestoreScreen Tag

SaveScreen Tag

ScreenSwitch Tag

SetCursor Tag

 


onLoad Example:

 

<Script event="onload">

 <LoadMap name="default"/>

 <SetCursor row="12" column="21"/>

 <SendScreen clear="yes" unlock="yes"/>

 <ReceiveInput/>

</Script>

 

onInput Example:

 

<Script event="oninput">

 <IfAid key="clear">

   <LoadMap name="default"/>

 </IfAid>

 

 <IfAid key="pf3">

   <ScreenSwitch screen="Welcome"/>

 </IfAid>

 

 <IfAid key="enter">

   <IfScreen row="7" column="24" text="Demo">

     <ScreenSwitch screen="SignonComplete"/>

   <Else/>

     <PutScreen row="12" column="12"

         text="}Password invalid]"/>

     <SetCursor row="7" column="24"/>

   </IfScreen>

 <Else/>

   <PutScreen row="14" column="20"

         text="}Only ENTER, CLEAR or PF3 supported]"/>

   <SetCursor row="6" column="24"/>

 </IfAid>

</Script>