Example for OHIO in Html

Top  Previous  Next

<html>

 

<head>

<title>z/Scope Web-to-Host</title>

<script>

var OhioManager = new ActiveXObject("zOHIO.OHIOManager");

var OhioSession;

function Connect()

{

 OhioSession = OhioManager.OpenSession("","*");

 if (OhioSession==null) {

         alert("no session");

 };

 Refresh();

}

function SendKeys(keys)

{

 if (OhioSession==null) {

         alert("no session");

 };

 if (keys==null) {

         keys = document.all("keys").value;

 } else {

         keys = document.all("keys").value+keys;

 };

 OhioSession.Screen.SendKeys(keys,OhioSession.Screen.Cursor);

 OhioSession.Screen.WaitForUnlock();

 Refresh();

}

 

function Refresh()

{

 if (OhioSession==null) {

         alert("no session");

 };

 document.all("screen").innerHTML = '';

 for (var i=1;i<OhioSession.Screen.Rows;i++) {

         var line = OhioSession.Screen.GetData((i-1)*OhioSession.Screen.Columns+1,i*OhioSession.Screen.Columns,1);

         document.all("screen").innerHTML = document.all("screen").innerHTML + "<pre>"+line+"</pre>";

 }

}

</script>

</head>

 

<body bgcolor="#ffffff" text="#000000" style="MARGIN: 0px" scroll="no" onLoad="Connect()">

<pre id="screen"></pre>

<form>

<input type="TEXT" name="keys" id="keys" style="WIDTH: 299px; HEIGHT: 22px" size="38">

<input type="button" onClick="Refresh()" value="Refresh">

<input type="button" onClick="SendKeys()" value="SendKeys">

<input type="button" onClick="SendKeys('@E')" value="ENTER">

</form>

</body>

</html>