Call: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with "CALL ''procedurename[(''argList'')] '''Description''' CALL is an explicit method of executing a FUNCTION procedure or a SUB procedure. The required component, procedurename...")
 
No edit summary
 
(15 intermediate revisions by 4 users not shown)
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'''
<tabber>
JavaScript=
<syntaxhighlight lang="JavaScript">
//Call Example
//Call explicitly executes a procedure


<pre>
Welcome();
REM CALL Example
Message("AppStudio is excellent.");
'CALL explicitly executes a procedure
Wave();
CALL Welcome
function Welcome() {
CALL Message("NS Basic/App Studio is excellent.")
  NSB.Print("Hello World!");
Wave
}
FUNCTION Welcome
function Message(Text) {
   PRINT "Hello World!"
  NSB.Print("Message: " + Text);
END FUNCTION
}
FUNCTION Message(Text)
function Wave() {
   PRINT "Message: " & Text
  NSB.Print("Goodbye! ");
END FUNCTION
}
SUB Wave
</syntaxhighlight>
   PRINT "Goodbye! "
|-|
END SUB
BASIC=
</pre>
<syntaxhighlight lang="vb.net">
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
</syntaxhighlight>
</tabber>


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


<pre>
<pre>
Hello World!
Hello World!
Message: NS Basic/App Studio is excellent.
Message: AppStudio is excellent.
Goodbye!
Goodbye!
</pre>
</pre>


'''Related Items'''
== Related Items ==
[[sub|SUB]], [[function|FUNCTION]]
 
[[sub|Sub]], [[function|Function]]
 
[[Category:Language Reference]]
 
[[Category:Statements - Flow of control]]

Latest revision as of 13:41, 24 July 2019

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

//Call Example
//Call explicitly executes a procedure

Welcome();
Message("AppStudio is excellent.");
Wave();
function Welcome() {
  NSB.Print("Hello World!");
}
function Message(Text) {
  NSB.Print("Message: " + Text);
}
function Wave() {
  NSB.Print("Goodbye! ");
}

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: AppStudio is excellent.
Goodbye!

Related Items

Sub, Function