Skip to main content

Subroutine

Command Description

Create a reusable sub-process

Command Prototype

Function name(arg1)

End Function

Parameter Description

ParameterRequiredTypeDefaultDescription
nameTrueidmyFunDefine the command name of a sub-function

Demo

TracePrint("--------------------------------Subroutine------------- ------------------------") 
//-------------------------------------------------------------------------------
//[Remarks] Create a reusable subroutine
//Input parameters:
// name--Define the command name of the subroutine.
// prop--set the properties of the command.
//out parameters:
// None
TracePrint ("Define a subroutine called test, pass in two parameters (a, b), and return the sum of the two data")
Function test(a,b)
Return a+b
End Function
TracePrint ("Call the test subroutine, pass in the parameters (1, 2)")
test(1,2)
TracePrint ("Execution result: "&test(1,2))