First() and Next() methods

The First() and Next() methods are used to iterate between shapes within a vector layer. Both of these methods simply call the VECNextShape() intrinsic appropriately, and store the result in the field shape. In addition, if there are no more shapes, the variable AtEnd is set to "TRUE". The GetVertices() method is used to read the vertex-list of the first shape.

define method First() on VLShape
  if ( this.fd = 0 ) then
    call EASIError( 703, "No Currently opened file" )
  endif
  this.shape = VECNextShape( this.fd, this.layer, -1 )
  if ( this.shape = -1 ) then
    this.AtEnd = "TRUE"
    call this.ClearVertices()
  else
    this.AtEnd = "FALSE"
    call this.GetVertices()
  endif
enddefine

The definition of Next() is very similar.

define method Next() on VLShape
  if ( this.fd = 0 ) then
    call EASIError( 703, "No Currently opened file" )
  endif
  this.shape = VECNextShape( this.fd, this.layer, this.shape )
  if ( this.shape = -1 ) then
    this.AtEnd = "TRUE"
    call this.clearvertices
  else
    this.AtEnd = "FALSE"
    call this.GetVertices()
  endif
enddefine

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.