Zum Inhalt springen

# 🏷️ Uniface 10.4: Qualifiers and Parameters of the activate Statement

🚦 What are Qualifiers in activate?

Qualifiers are optional switches that let you control the behavior of the activate statement. They determine how and in which mode an operation is executed on a component instance.

Overview of the Most Important Qualifiers

Qualifier Meaning
/list Passes input and output parameters as typed Uniface lists.
/stateless Invokes the operation statelessly (creates a temporary instance that is deleted after execution).
/async Executes the operation asynchronously (no OUT/INOUT parameters, no return value).
/sync Executes the operation synchronously (default behavior).

Code Example:

activate /async "MyCpt".do_it(vArg1, vArg2)

The operation do_it is called asynchronously.

🧩 The Parameters of the activate Statement in Detail

Every activate statement consists of several components that you can use as needed:

Parameter Type Description
InstanceName String Name of the component instance (max. 16 characters). If not found, the instance is created.
OperationName Literal Name of the operation to execute (e.g., exec, accept, quit, or a named operation).
ArgumentList String Comma-separated list of arguments matching the operation’s parameters.

InstanceName

  • Specifies on which component instance the operation is executed.
  • If the instance does not exist, it is created automatically.

Code Example:

activate "myCpt"

OperationName

  • Name of the operation to execute.
  • Can be specified as a literal or a variable.
  • If no name is given, .exec() is used by default.

Code Example (Literal):

activate "myCptInstance".do_it()

Code Example (Variable):

$vOperation$ = "do_it"
activate "myCptInstance".$vOperation$()

activate "myCptInstance".do_it()

Code Example (Variable):

$vOperation$ = "do_it"
activate "myCptInstance".$vOperation$()

ArgumentList

  • Comma-separated list of values passed to the operation.
  • The number and type of arguments must match the operation’s declared parameters.
  • Uniface automatically converts data types when possible.

Code Example:

activate "myCptInstance".do_it(42, "Test")

📝 Tips for Using Qualifiers and Parameters

  • /list: Use this qualifier when you want to pass multiple input and output values as lists.
  • /stateless: Ideal for one-time, stateless calls—e.g., for services.
  • /async: Use asynchronous calls when you don’t need return values and the operation should run independently.
  • Parameter passing: Make sure the arguments match the number and type of the operation’s declared parameters.

💡 Practical Examples

1️⃣ Passing Typed Lists with /list

Code:

putitem vInParms, -1, $date(20250101)
putitem vInParms, -1, $number(5)
activate/list "SERV2".ADD_WEEK(vInParms, vOutParms)

Note: This post was created with AI support and based on the official Uniface 10.4 documentation. For further details, please refer to the original documentation.

Do you have questions or your own tips about qualifiers and parameters? Share them in the comments! 👇

2️⃣ Stateless Call with /stateless

Code:

activate /stateless "MyService".calculate(100, 200)

3️⃣ Asynchronous Call

Code:

activate /async "MyCpt".start_long_task()

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert