EPIScreenRecord screen = new EPIScreenRecordImpl();you instantiate an EPIScreenRecordImpl.
EPIInteractionSpec epiSpec = new EPIInteractionSpec(); epiSpec.setFunctionName(“CESN”); epiSpec.setAID(AIDKey.enter); epiSpec.setInteractionVerb(EPIInteractionSpec.SYNC_SEND_RECEIVE); // epiInter is an interaction created elsewhere epiInter.execute(epiSpec, null, screen);Note the use of null as the input record.
The screen information is in the screen object. Other screen information, such as cursor position, is returned to your defined EPIInteractionSpec object. You can then request a specific field by index number, which is a number in the range from 1 to the total number of fields on the screen, or you can use an iterator to request all the fields. The fields are indexed in order starting from the top left of the screen proceeding from left to right to the bottom right of the screen. The iterator returns each field in ascending index order.
EPIFieldRecord field = screen.getField(7);
java.util.Iterator it = screen.getFields(); while (it.hasNext()) { EPIFieldRecord field = (EPIFieldRecord)it.next(); .... .... }
public void printScreen(EPIScreenRecord inscr) { int col = 1; int row = 1; System.out.println(“——————————————————————————————————————”); for (int i = 1; i <= inscr.getFieldCount(); i++) { try { EPIFieldRecord f = inscr.getField(i); while (f.getTextRow() > row) { System.out.print(“\n”); row++; col = 1; } while (f.getTextCol() > col) { System.out.print(“ ”); col++; } if (f.isDisplay()) { System.out.print(f.getText()); col += f.getText().length(); } } catch (ScreenException se) { } } System.out.print(“\n”); System.out.println(“——————————————————————————————————————”); }
epiSpec.setAID(AIDKey.enter); epiInter.execute(epiSpec, screen, screen);