Skip to content

CountOfSubkeys - cRegistry

Returns the number of Subkeys for the Key that is currently open

Type: Function
Return Data Type: Integer

Syntax

Function CountOfSubkeys Returns Integer

Call Example

Get CountOfSubkeys to IntegerVariable

Description

Use the CountOfSubkeys function to determine how many SubKeys a Key has. You must have opened a Key before invoking this method.

Use cRegistry.pkg

Object oRegistry is a cRegistry

    Procedure DoShowCountOfSubkeys
        Boolean bOpened

        // Open the Key...
        Get OpenKey "Software\Data Access Worldwide" To bOpened
        If bOpened Begin
            Showln 'Count=' (CountOfSubkeys(self))
            Send CloseKey // must close all open Keys
        End
    End_Procedure

End_Object

Send DoShowCountOfSubkeys of oRegistry

See Also

CountOfValues

Return Value

The number of SubKeys in the Key