Call: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Brendon (talk | contribs)
No edit summary
Brendon (talk | contribs)
No edit summary
Line 1: Line 1:
CALL ''procedurename''[(''argList'')]
Call ''procedurename''[(''argList'')]


'''Description'''
== 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
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'')]
name[(''argList'')]


'''Example'''
== Example ==


<pre>
<pre>
REM CALL Example
REM Call Example
'CALL explicitly executes a procedure
'Call explicitly executes a procedure
CALL Welcome
Call Welcome
CALL Message("NS Basic/App Studio is excellent.")
Call Message("NS Basic/App Studio is excellent.")
Wave
Wave
FUNCTION Welcome
FUNCTION Welcome
Line 26: Line 26:
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
Line 34: Line 34:
</pre>
</pre>


'''Related Items'''
== Related Items ==


[[sub|SUB]], [[function|FUNCTION]]
[[sub|SUB]], [[function|FUNCTION]]
[[Category:Language Reference]]

Revision as of 20:19, 8 August 2012

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("NS Basic/App Studio 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: NS Basic/App Studio is excellent.
Goodbye!

Related Items

SUB, FUNCTION