CALL
CALL (p [, var1 [, …, varN])
Invoke a sub or func by address pointer p. Optional
var1 to varN variables of every SmallBASIC
data type can be passed to function or sub, the address pointer points
to.
Example 1: CALL with a subroutine pointer
sub MyPrint(i)
  print i
end
a = @MyPrint
call a, "test"      ' when using CALL for subroutines,
                    ' please use CALL without braketsExample 2: CALL with a function pointer
func Increment(i, b)
  return  i + b
end
x = 1
a = @Increment
y = call(a,x,2)     ' when using CALL for functions,
                    ' please use CALL with brakets
print yExample 3: CALL with a subroutine pointer and BYREF:
sub Increment(byref i, b)
  i = i + b
end
x = 1
a = @Increment
call a,x,2
print xExample 4: Passing function pointer to a function
func Increment(i)
  return i + 1
end
func Decrement(i)
  return i - 1
end
func MyFunc(f, i)
  return call(f,i)
end
a = @Increment
b = @Decrement
x = 2
x = MyFunc(a,x): print x
x = MyFunc(b,x): print xCode samples using CALL
    
      000 hello.bas  
      001 3 ways to print hello 5 times.bas  
      002 numeric variables.bas  
      003 conditional branching.bas  
      004 loops.bas  
      005 challenge.bas  
      006 arrays+.bas  
      Balleta 2-11-15.bas  
      bezier_pen.bas  
      bopit.bas  
      btn 21.bas  
      checkers.bas  
      chess.bas  
      dogstar5.bas  
      draw rectangle.bas  
      fireworks.bas  
      fizzle2.bas  
      form demo.bas  
      g2 Life.bas  
      g3 Life.bas  
      g4 Life.bas  
      g5 Life.bas  
      g6 Life.bas  
      hangman v2.bas  
      hangman.bas  
      image demo.bas  
      matrix_solve.bas  
      memory match game.bas  
      pirate.bas  
    
  Language
    
      AND  
      AS  
      BAND  
      BG  
      BOR  
      BYREF  
      CALL  
      CASE  
      CATCH  
      CONST  
      DECLARE  
      DEF  
      DO  
      ELIF  
      ELSE  
      ELSEIF  
      END  
      END TRY  
      ENDIF  
      EQV  
      EXIT  
      FALSE  
      FI  
      FOR  
      FUNC  
      GOSUB  
      GOTO  
      IF  
      IFF  
      IMP  
      IN  
      LABEL  
      LET  
      LIKE  
      LOCAL  
      LSHIFT  
      MDL  
      MOD  
      NAND  
      NEXT  
      NOR  
      NOT  
      ON  
      OR  
      REM  
      REPEAT  
      RETURN  
      RSHIFT  
      SELECT  
      STEP  
      STOP  
      SUB  
      THEN  
      THROW  
      TO  
      TRUE  
      TRY  
      UNTIL  
      USE  
      USG  
      USING  
      WEND  
      WHILE  
      XNOR  
      XOR