KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Utility Method: Get All 4D Command Names
PRODUCT: 4D | VERSION: 13.0 | PLATFORM: Mac & Win
Published On: May 25, 2012

This method can be used to get an array of all 4D command names and command ID's.

Please note: this method requires the method from Tech Tip 76580 to get the highest command ID. Alternatively you can hard-code the value $limit_l; as of 4D v13 the highest value is 1215.

// Get all 4D command names and IDs.
C_POINTER($1;$commandNames_p_at;0)
C_POINTER($2;$commandIDs_p_al;0)

C_LONGINT($commandID_l;$limit_l)
C_TEXT($commandName_t)

$commandNames_p_at:=$1
$commandIDs_p_al:=$2

$limit_l:=UTIL_RES_GetLast4DCommandID

// Get all 4D commands.
For ($commandID_l;1;$limit_l)

   $commandName_t:=Command name($commandID_l)

   If ($commandName_t#"")
      APPEND TO ARRAY($commandNames_p_at->;$commandName_t)
      APPEND TO ARRAY($commandIDs_p_al->;$commandID_l)
   End if

End for