Call: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Line 12: Line 12:
Rem Call Example
Rem Call Example
'Call explicitly executes a procedure
'Call explicitly executes a procedure
Call Welcome
Call Welcome()
Call Message("NSB/App Studio is excellent.")
Call Message("AppStudio is excellent.")
Wave
Wave()
Function Welcome
Function Welcome()
   Print "Hello World!"
   Print "Hello World!"
End Function
End Function
Line 21: Line 21:
   Print "Message: " & Text
   Print "Message: " & Text
End Function
End Function
Sub Wave
Sub Wave()
   Print "Goodbye! "
   Print "Goodbye! "
End Sub
End Sub

Revision as of 14:10, 20 April 2013

Call procedurename[(argList)]

Description

Call is an explicit method of executing a FUNCTION procedure or a SUB procedure. The required component, procedurename, is any procedure name. The optional component, argList, is a comma-delimited list of variables to pass to the called procedure. The Call keyword is optional, procedures can be executed without the keyword, as

name[(argList)]

Example

Rem Call Example
'Call explicitly executes a procedure
Call Welcome()
Call Message("AppStudio is excellent.")
Wave()
Function Welcome()
  Print "Hello World!"
End Function
Function Message(Text)
  Print "Message: " & Text
End Function
Sub Wave()
  Print "Goodbye! "
End Sub

Output

Hello World!
Message: NSB/App Studio is excellent.
Goodbye!

Related Items

Sub, Function