Commands & Syntax > Commands > Macro Flow Control >

www.perfectkeyboard.com

 

Procedure CALL: - < proc_call >() ... [Pro]

 

Procedure CALL:
<proc_call>(Identifier,Parameter)
Available in: Professional edition

This command executes a procedure defined using "proc_def_begin" ... "proc_def_end" commands. When calling a procedure, it is always necessary to pass expected parameters (as they are defined in the "proc_def_begin" command). If a parameter is defined as a reference (see "proc_def_begin" help section for details) then it is necessary to pass an exisitng variable name as the parameter.

 

#

Parameter name

Parameter description

1

Identifier

Unique name of the procedure to call. It is expected that a procedure with this name is defined using command.

2

Parameter

Any number of parameters. Each parameter must be enclosed in between " character and parameters must be delimited by ,

Example: "%vInputText%","%vTime%","vOutputText"

 

Example (Macro Steps):

 

1

<#> <#> This example shows how to use procedures

2

Macro execution: ONLY COMMANDS

3

Procedure BEGIN: AddQuotes with parameters (parStringInput, &parStringOutput&)

4

Variable SET "parStringOutput="%parStringInput%"", Message text=""

5

Procedure END

6

Procedure BEGIN: ConvertToUpper with parameters (parStringInput,&parStringOutput&)

7

Variable OPERATION "STR_UPPER" (Variable for result = parStringOutput, Input text/variable = %parStringInput%, Parameter 1 = 2, Parameter 2 = , Parameter 3 = 0)

8

Procedure END

9

Variable SET "vMyText=", Message text="Insert text you want to convert to upper case and enclose to quotes:"

10

IF STRING _vCanceled==1

11

Macro EXIT

12

ENDIF

13

Procedure CALL: ConvertToUpper with parameters (%vMyText%, vMyText )

14

Procedure CALL: AddQuotes with parameters (%vMyText%, vMyText )

15

Message SHOW "Information" : "%vMyText%" (other parameters: x = -100, y = -100, Window title = Result, Buttons = OK, Timeout (seconds) = 0, Always on top = No).

Example (Plain Text):

 

<#> This example shows how to use procedures

<cmds>

<proc_def_begin>(AddQuotes,"parStringInput", "&parStringOutput&")

   <varset>("parStringOutput=%_vQuoteChar%%parStringInput%%_vQuoteChar%","")

<proc_def_end>

 

<proc_def_begin>(ConvertToUpper,"parStringInput","&parStringOutput&")

   <var_oper>(parStringOutput,"%parStringInput%",STR_UPPER,"2","", "0")

<proc_def_end>

 

<varset>("vMyText=","Insert text you want to convert to upper case and enclose to quotes:")

<if_str>("_vCanceled==1")<#>

<exitmacro><#>

<endif>

 

<proc_call>(ConvertToUpper,"%vMyText%", "vMyText" )

<proc_call>(AddQuotes,"%vMyText%", "vMyText" )

 

<msg>(-100,-100,"%vMyText%","Result",1,0,0,0)