Official Content

​Defines local subroutines that will be triggered when you call them, in the same object, with the Do command.

Parameter-passing is not allowed. All the object variables are available to be used by the subroutine. Also, instantiated attributes (loaded with values) are available to be used by the subroutine.

Syntax

Sub 'Subroutine-Name' 
    Code
EndSub

Where:

Subroutine-Name
    Name of the subroutine defined.

Scope

Objects: Panel, Procedure, Transaction, Web Panel.
Generators: .NET, .NET Framework, Android, Apple, Java.

Samples

As an example, consider the following code defined inside a Procedure Source or inside an object Event: 


...
If &ConfirmedTicket  //Boolean variable
   Do 'PrintTicket'  //The 'PrintTicket' subroutine is called
EndIf
...

Sub 'PrintTicket'
    ...              // Subroutine code
EndSub


See Also


Do command
What is a subroutine?


Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant