# Test reply modes with real ReadModified responses.
rows 43
columns 80

# Ask for TN3270E.
telnet.do tn3270e
flush

# Ask for the device type.
telnet.sb tn3270e
 tn3270e.send device-type
 telnet.se
flush

# Tell them what the device type is.
telnet.sb tn3270e
 tn3270e.device-type is IBM-3278-4-E
 tn3270e.connect TEST
 telnet.se
flush

# Tell them what TN3270E we will support (no BIND-IMAGE)
telnet.sb tn3270e
 tn3270e.functions is responses,sysreq
 telnet.se
flush

# Draw the screen.
tn3270e 3270-data
 cmd.ewa reset,alarm,restore
  ord.sba 1 1
  ord.sfe 3270 protect,high fg default
  text "APL characters"
  # Define an ordinary field with APL extended attributes, interrupted by a stretch of non-APL.
  # The APL regions should be reported with GEs by the RM below.
  ord.sba 2 1
  ord.sf protect
  text "Using SA "
  ord.sf protect,modify
  ord.sa charset apl
  raw 4041424344
  ord.sa charset default
  raw 454647
  ord.sa charset apl
  raw 48494a4b4c4d4e4f
  ord.sa charset default
  ord.sf protect
  # Define an extended field with the APL charset, with redundant APL extended attributes in the middle.
  # The APL EA region should be reported with GEs by the RM below.
  ord.sba 3 1
  ord.sf protect
  text "Using SFE"
  ord.sfe 3270 protect,modify charset apl
  raw 5051525354
  ord.sa charset apl
  raw 555657
  ord.sa charset default
  raw 58595a5b5c5d5e5f
  ord.sf protect
  # Then the usual input field.
  ord.sba 14 1
  ord.sf modify
  ord.ic
  ord.sba 15 1
  ord.sf protect
 telnet.eor
flush

# Read it back in Field mode.
tn3270e 3270-data
 cmd.rb
 telnet.eor
flush

# Switch to Extended Field mode and read it back.
tn3270e 3270-data
# wsf len=5 set-reply-mode partition 00 extended-field-mode
 raw 110005090001
 telnet.eor
flush
tn3270e 3270-data
 cmd.rb
 telnet.eor
flush

# Switch to Character mode and read it back.
tn3270e 3270-data
# wsf len=7 set-reply-mode partition 00 character-mode foreground charset
 raw 1100070900024243
 telnet.eor
flush
tn3270e 3270-data
 cmd.rb
 telnet.eor
flush
