SET MACRO PARAMETER

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 11


SET MACRO PARAMETER (selector; textParam)

ParameterTypeDescription
selectorLongintSelection to use
textParamTextText sent

Description

The SET MACRO PARAMETER command inserts the paramText text into the method from which it has been called.

If text has been selected in the method, the selector parameter can be used to set whether the paramText text must replace all of the method text or only the selected text. In selector, you can pass one of the following constants, added to the "4D Environment" theme:

ConstantTypeValue
Full method textLongint1
Highlighted method textLongint2

If no text has been selected, paramText is inserted into the method.

Compatibility Note: In order for the GET MACRO PARAMETER and SET MACRO PARAMETER commands to work correctly, the new "version" attribute must be declared in the macro itself. The "version" attribute must be declared as follows:

<macro name="MyMacro" version="2">
--- Text of macro ---
</macro>

Example

This macro builds a new text that will be returned to the calling method:

   C_TEXT($input_text)
   C_TEXT($output_text)
   GET MACRO PARAMETER(Highlighted method text;$input_text)
      `Suppose that the selected text is a table, i.e. "[Customers]"
   $output_text:=""
   $output_text:=$output_text+Command name(47)+"("+$input_text+")"  ` Select all ([Customers])
   $output_text:=$output_text+"$i:="+Command name(76)+"("+ $input_text+")" ` $i:=Records in selection([Customers])
   SET MACRO PARAMETER(Highlighted method text;$output_text)
      `Replaces the selected text by the new code

See Also

GET MACRO PARAMETER.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next