Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Flipper 6.0 Help File - <b>layer_cnt()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
LAYER_CNT()
   Returns the number of objects on the specified layer.

   Syntax
         nCount = LAYER_CNT([nLayerNumber])

   Arguments
         OPTIONAL PARAMETERS
         nLayerNumber Sets the number of the layer to count. If not passed,
                      the current layer is used.

   Returns
         nCount       Returns the number of objects on the specified layer.
                      Returns -1 if the parameter is an invalid layer number
                      or if the layer has not been opened.

   Description
         LAYER_CNT() returns the number of objects on the specified layer.
         This is helpful in determining the last object added to the layer,
         because the last object will have the highest number and all objects
         are sequential. The current layer is used if no layer is specified. A
         -1 is returned if the layer is invalid.

   Examples
         The following code would move all marked objects in the
         current layer to layer 3:

         FOR _x = 1 TO LAYER_CNT()               && Check all objects
            OBJ_FIND(_x)                         && Make object _x hot
            IF HOT_NUMBER() = 1                  && Is it marked?
               OBJ_TO_LAY(1,_x,3)
            ENDIF                                && Then move it!
         NEXT _x

See Also: LAYER_CURR() LAYER_INFO() LAYER_NUM() LAYER_ON()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson