RosettaCodeData/Task/Pointers-and-references/BBC-BASIC/pointers-and-references.bbc
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

26 lines
644 B
Text

REM Pointer to integer variable:
pointer_to_varA = ^varA%
!pointer_to_varA = 123456
PRINT !pointer_to_varA
REM Pointer to variant variable:
pointer_to_varB = ^varB
|pointer_to_varB = PI
PRINT |pointer_to_varB
REM Pointer to procedure:
PROCmyproc : REM conventional call to initialise
pointer_to_myproc = ^PROCmyproc
PROC(pointer_to_myproc)
REM Pointer to function:
pointer_to_myfunc = ^FNmyfunc
PRINT FN(pointer_to_myfunc)
END
DEF PROCmyproc
PRINT "Executing myproc"
ENDPROC
DEF FNmyfunc
= "Returned from myfunc"