4D Write v16

WR GET COMMAND INFO

Home

 
4D Write v16
WR GET COMMAND INFO

WR GET COMMAND INFO 


 

WR GET COMMAND INFO ( area ; commandNumber ; applied ; stringValue ; name ; status ) 
Parameter Type   Description
area  Longint in 4D Write area
commandNumber  Longint in Number of the command to process
applied  Longint in 0=not applied, 1=applied, 2=partially applied
stringValue  String in Selected text value
name  String in Command name or text of the Tip
status  Integer in 0=disabled 1=enabled

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

 
PROPERTIES 

Product: 4D Write
Theme: WR Area Control
Number: 89469

 
HISTORY 

Created: 4D Write 6.5

 
ARTICLE USAGE

4D Write Language ( 4D Write v16)