Command WR GET COMMAND INFO

4D Write

WR GET COMMAND INFO

version 6.5


WR GET COMMAND INFO (area; commandNumber; applied; stringValue; name; status)

ParameterTypeDescription
areaLongint4D Write area
commandNumberLongintNumber of the command to process
appliedLongint0=not applied, 1=applied, 2=partially applied
stringValueStringSelected text value
nameStringCommand name or text of the Tip
statusInteger0=disabled
1=enabled

Description

The WR GET COMMAND INFO command allows you to get the status of the menu or toolbar command whose number is passed in commandNumber.

Note: The list of commands and their values is available in the "WR Commands" constants theme. You can either pass a value or a constant name. For more information about each command, you can also refer to Appendix B, Menu Item Numbers.

applied returns a value indicating whether the command is applied, not applied, or partially applied, to the current selection of text. applied will equal 0 if the command is not applied, 1 if it is applied, or 2 is it is partially applied. For example, consider the Bold menu command (Constant: wr cmd bold , Value: 502). When the following statement is executed:

   WR GET COMMAND INFO(area;wr cmd bold;applied;stringValue;name;status)

applied=1 if the currently selected text is in bold

applied=0 if the currently selected text is not in bold

applied=2 if only part of the currently selected text is in bold

stringValue contains a text that varies and is specific to each command. For example, consider the Font drop-down list (Constant: wr cmd font dropdown, Value: 1002). When the following statement is executed:

   WR GET COMMAND INFO(area;wr cmd font dropdown;applied;stringValue;name;status)

stringValue="Arial" if this is the currently selected font name.

name contains the name of the command. This is either the text of the menu command or the text of the tip displayed for that command.

status returns the status of the command. status will equal 0 if the command is disabled, and 1 if it is enabled.

Example

A form contains a button switching between hiding or showing invisible characters. The title of the button depends on the current screen settings:

   WR GET COMMAND INFO(area;wr cmd view invisibles;vApplied;vStringValue;vName;vStatus)
   Case of
      : (vApplied=1)
         BUTTON TEXT(bStatus;"Hide Invisible Characters")
      : (vApplied=0)
         BUTTON TEXT(bStatus;"Show Invisible Characters")
   End case

See Also

Appendix B: Menu Item Numbers, WR EXECUTE COMMAND.