#
CwFindLastObject

### Syntax:

    handle = CwGetLastObject(hSet)

            handle          (handle) The handle to an object.

            hSet            (handle) Handle to a view or group.

### Description:

This function is used to list all of the objects in the given view or group. It returns the last object in the current view or group. The last object is the one furthest forward (i.e. the object that is potentially in front of all other objects.)

A program can cycle through all of the objects in the given view or group by repeatedly calling CwFindNextObject with the handle returned in the previous call as the argument. The sequence of objects visited when calling CwFindNextObject in this manner is the same as the sequence of objects selected when using the page-down key.

The argument "hSet" may be either a view or a group. If it is a group, subsequent calls to CwFindNextObject or CwFindPreviousObject will return only objects in that group. If it is a view, groups will be treated as single objects.

This function behaves identically to CwFindFirstObject except that the object returned is last, not first.

### Example:

    /* This function behaves exactly like CwGetObjectCount except that
       it's slower. */

    objcount:procedure
    count = 0
    o = CwGetLastObject(CwGetCurrentView())
    do while CwIsHandleValid(o)
            count = count + 1
            o = CwGetPreviousObject(o)
            end
    return o

Functions by NAME | Index | Functions by PURPOSE