The simple TEaaS API provides transparent embedded emulation in
Windows applications or services. By using embedded emulation,
a Windows application can interrogate and/or update data that
resides on a Unisys mainframe to provide seamless integration
between PC and mainframe applications and data.
The C# code below steps through a TIP Session Control login and
then runs the CUST3 transaction to display the CUST4 screen shown in
the web example.
static void Main (string[] args)
{
EmulationAccess esa = new EmulationAccess();
FieldInfo fi;
if (!esa.Connect("FCIMCB","UTS","sta001"))
{ Console.WriteLine(esa.LastErrorMessage);
Console.WriteLine(esa.LastException);
return;
}
if (!esa.WaitForHostText(23,2,"Enter your ",6000,1000))
{
Console.WriteLine("did not find 'Enter your '");
}
esa.SetText("userid/password");
esa.XmitFromCursor();
esa.WaitForHostText(22,2,"1. ",3000,0); // ignore this
result;
if (!esa.WaitForHostText(23,2,"Choose
your",2000,500))
{
Console.WriteLine("did not find 'Choose your'")
Console.WriteLine(esa.GetLine(23))
goto function_exit;
}
esa.SetText(EmulationAccess.UseCurrent,EmulationAccess.UseCurrent,"1");
esa.XmitFromCursor();
if (! esa.WaitForHostText(23,2,"Previous session",2000,1000))
{
Console.WriteLine("did not find 'Previous session'");
Console.WriteLine(esa.GetLine(23));
goto function_exit;
}
esa.SetText(1, 1, "cust3");
esa.XmitFromCursor();
// … process the screen
}