ProcOfLine Property

ProcOfLine Property

See Also         Example         Applies To

The ProcOfLine property returns a string containing the name of the procedure that contains a specified line in a standard module or a class module. The body of a procedure begins with the procedure definition, denoted by one of the following:

Setting

object.ProcOfLine(line, pprockind)

The ProcOfLine property uses the following settings.

Setting Description
object A Module object.
line A Long that specifies the number of a line in the module.
pprockind An Long value that indicates the type of procedure containing the line specified by the line argument. When you return the value of the ProcOfLine property, the value of the pprockind argument is set to an intrinsic constant that specifies the type of procedure the line belongs to. The constant may be one of the following values.
  Constant Value Description
  vbext_pk_Get 3 A Property Get procedure.
  vbext_pk_Let 1 A Property Let procedure.
  vbext_pk_Proc 0 A Sub or Function procedure.
  vbext_pk_Set 2 A Property Set procedure.

The ProcOfLine property is available only by using Visual Basic and is read-only.

Remarks

For any given line number, the ProcOfLine property returns the name of the procedure that contains that line. Since comments and compilation constants immediately preceding a procedure definition are considered part of that procedure, the ProcOfLine property may return the name of a procedure for a line that isn't within the body of the procedure. The ProcStartLine property indicates the line on which a procedure begins; the ProcBodyLine property indicates the line on which the procedure definition begins (the body of the procedure).

Note that the pprockind argument indicates whether the line belongs to a Sub or Function procedure, a Property Get procedure, a Property Let procedure, or a Property Set procedure. To determine what type of procedure a line is in, pass a variable of type Long to the ProcOfLine property, then check the value of that variable.

Note   The ProcBodyLine property treats Sub and Function procedures similarly, but distinguishes between each type of Property procedure.