Table of Contents

CALL

PET VIC20 C64 C16 Plus4 C128

The CALL command executes a subroutine.

Syntax

CALL <subroutine_name> ([<param> [, <param>, ...]])

The called subroutine must be defined or forward declared before it can be called. See the Subroutines page for more information.

Example

CONST LT_BLUE = 14

REM ** Clears the screen and sets color **
SUB cls (color AS BYTE) STATIC
  MEMSET $0400, 1000, 32
  MEMSET $d800, 1000, color
END SUB

REM ** Call the routine **
CALL cls (LT_BLUE)
PRINT "screen cleared"

See also