Results 1 to 3 of 3

Thread: Function pointers?

  1. #1

    Function pointers?

    I tried the docs and the forum search before asking..
    Does TB support function/Sub pointers. As in getting the pointer to function as a long in another variable?
    Thanks

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Function pointers?

    Hi MouseTrap,

    thinBasic does not support this yet.

    But there are at least 2 ways around:

    Calling by name evaluated on run time:
    [code=thinbasic]

    '
    DIM myString AS STRING = "XML"
    CALL "Load_"+myString( "C:\test.xml" ) ' -- Name of procedure composed on run time


    SUB Load_XML( fName as string )
    ...
    END SUB

    SUB Load_CVS( fName as string )
    ...
    END SUB
    [/code]

    Calling by name or pointer:
    This is available via SDK functions for ThinBasic module developers. When you are creating module ( special DLL ) for thinBasic, you can retrieve script function pointers from the ThinBasic core.
    SDK for C/BASICs/Assembler is available in ThinBASIC SDK subfolder.

    When I look what SDK allows, I think your wish could become reality, but better to wait for more indepth info from Eros.


    I hope it helps,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3

    Re: Function pointers?

    Ok, thanks for clearing that up!

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •