User Tools

Site Tools


call

Table of Contents

call

call - a statement that transfers control to a subroutine

syntax

call name[(argumentlist)]
  • name is the subroutine's identifier
  • argumentlist lists the variables or constants passed to the subroutine

See also decl, sub

details

In a call statement, the keyword call is optional. However, if a subroutine is called explicitly with the keywordcall, the parentheses indicating the optional argumentlist can be omitted if no argument is passed. The keyword call has no influence on subroutine declaration.

example

' SharpBASIC call programming example
' -----------------------------------
incl "lib/sys.sbi";

decl sub printTitle(t:str);

const title = "a new programming language.";

main do
  call printTitle(tcase(title));
end

sub printTitle(t:str)
do
  print(t);
end
Output:

A New Programming Language

call.txt · Last modified: 2023/07/09 21:30 by admin