4D v15.4Command name |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v15.4
Command name
|
Command name ( command ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
command | Longint |
![]() |
Command number | |||||
Function result | String |
![]() |
Localized command name | |||||
The usefulness of this command has been greatly reduced over time as 4D continues to evolve:
The Command name command returns the name of the command whose command number you pass in command.
This name may vary from one 4D version to the next (commands renamed) or according to the application language(*).
(*) By default, the English language version is used starting with 4D v15; nevertheless, the "Use regional system settings" option on the Methods Page of the Preferences allows you to continue using the French language in a French version of 4D.
Note: The number of each command is provided in the Properties area of the documentation page.
The Command name command sets the OK variable to 1 if command corresponds to an existing command number, and to 0 otherwise. Note, however, that some existing commands have been disabled, in which case Command name returns an empty string (see last example).
In a form, you want a drop-down list populated with the basic summary report commands. In the object method for that drop-down list, you write:
Case of
:(Form event=On Before)
ARRAY TEXT(asCommand;4)
asCommand{1}:=Command name(1)
asCommand{2}:=Command name(2)
asCommand{3}:=Command name(4)
asCommand{4}:=Command name(3)
` ...
End case
In the English version of 4D, the drop-down list will read: Sum, Average, Min, and Max. In the French version*, the drop-down list will read: Somme, Moyenne, Min, and Max.
*with a 4D application configured to use the French programming language (see compatibility note)
The following code allows you to load all valid 4D commands in an array:
C_LONGINT($Lon_id)
C_TEXT($Txt_command)
ARRAY LONGINT($tLon_Command_IDs;0)
ARRAY TEXT($tTxt_commands;0)
Repeat
$Lon_id:=$Lon_id+1
$Txt_command:=Command name($Lon_id)
If(OK=1) //command number exists
If(Length($Txt_command)>0) //command is not disabled
APPEND TO ARRAY($tTxt_commands;$Txt_command)
APPEND TO ARRAY($tLon_Command_IDs;$Lon_id)
End if
End if
Until(OK=0) //end of existing commands
Product: 4D
Theme: Language
Number:
538
Created: 4D v6
4D Language Reference ( 4D v15)
4D Language Reference ( 4D v15.4)
4D Language Reference ( 4D v15.3)