Commands & Syntax > Commands > Macro Flow Control >

www.perfectkeyboard.com

 

Procedure END - < proc_def_end > ... [Pro]

 

Procedure END
<proc_def_end>
Available in: Professional edition

This command defines the end of procedure.

 

 

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)