#
CwFindPreviousObject

### Syntax:

    hObj = CwFindPreviousObject(hLastObj)

            hLastObj        (handle) Handle to an object

            hObj            (handle) Handle to an object

### Description:

This function is used to list all of the objects in the current view. It does this by returning the object in line before the one referenced by "hLastObj". This object is (more or less) the object in front of "hLastObj".

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

If "hLastObj" is the null handle, the last object in the sequence is returned and if it is the first (foremost) object (i.e. the last in the sequence), a null-handle is returned.

This function behaves identically to CwFindNextObject except that the order in which objects are cycled through is reversed.

### Example:

    /* Do something to all objects in the current view. */
    o = CwFindLastObject(CwGetCurrentView())
    do while CwIsHandleValid(o)
            call doSomethingTo o
            o = CwFindPreviousObject(o)
            end

### Remarks:

Passing a null handle is equivalent to CwFindLastObject with the currently selected view.

Functions by NAME | Index | Functions by PURPOSE