lang • public

PUBLIC

This keyword is used for declaring the accessibility of a global method , variable or property.

A public variable, method or property can be used outside of the class code.

Examples

Public iCounter As Integer

Public Sub btnTest_Click()

  Dim iLocal As Integer

  iCounter = iCounter + 1
  iLocal = iLocal + 1

  txtField1.Text = CString(iCounter)
  txtField2.Text = CString(iLocal)

  Print "PUBLIC:"; iCounter; "  DIM:"; iLocal

End
PUBLIC:1  DIM:1
PUBLIC:2  DIM:1
PUBLIC:3  DIM:1
PUBLIC:4  DIM:1

See also