"Fossies" - the Fresh Open Source Software Archive

Member "FreeBASIC-1.09.0-win64/examples/manual/operator/address-func.bas" (1 Jan 2022, 648 Bytes) of package /windows/misc/FreeBASIC-1.09.0-win64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Visual Basic source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 '' examples/manual/operator/address-func.bas
    2 ''
    3 '' NOTICE: This file is part of the FreeBASIC Compiler package and can't
    4 ''         be included in other distributions without authorization.
    5 ''
    6 '' See Also: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgOpAt
    7 '' --------
    8 
    9 'This program demonstrates how the @ symbol can be used
   10 'to create pointers to subroutines.
   11 
   12 Declare Sub mySubroutine ()
   13 
   14 Dim say_Hello As Sub() 
   15 
   16 say_Hello = @mySubroutine   'We tell say_Hello to point to mySubroutine.
   17                             'The sub() datatype acts as a pointer here.
   18 
   19 say_Hello() 'Now we can run say_Hello just like mySubroutine.
   20 
   21 Sub mySubroutine
   22     Print "hi"
   23 End Sub