FieldAttribute Method Example

This example checks the field attribute value for a particular screen position, and reports various characteristics found. Use with 3270 mainframe sessions only.


Sub Main

Dim Sess as Object, Sys as Object

Set Sys = CreateObject("Extra.System")

'assumes an open 3270 session...

Set Sess = Sys.ActiveSession

'check attribute value for an arbitrary location

attr% = Sess.Screen.FieldAttribute(21, 17)

If attr% = 0 Then

Msgbox "Screen is not field-formatted, or invalid row/column."

Exit Sub

End If

'This works for 3270 field attribute values...

'5250 field attributes are formatted differently (see help).

Dim Modified$, Numeric$, Protected$, Display$

If attr% And 1 Then

Modified$ = "modified"


Modified$ = "unmodified"

End If

If attr% And 16 Then

Numeric$ = "numeric"


Numeric$ = "alpha-numeric"

End If

If attr% And 32 Then

Protected$ = "protected"


Protected$ = "unprotected"

End If

If (attr% And 4) Then

If (attr% And 8) Then

Display$ = "password field"


Display$ = "not a password field"

End If


Display$ = "not a password field"

End If

Msgbox "Field for requested position is" & _

chr(13) & Modified$ & _

chr(13) & Numeric$ & _

chr(13) & Protected$ & _

chr(13) & Display$

End Sub