Alpha Video Training
Results 1 to 12 of 12

Thread: Callback Functions currently not supported

  1. #1
    "Certified" Alphaholic Marcel Kollenaar's Avatar
    Real Name
    Marcel
    Join Date
    Apr 2003
    Location
    Twente
    Posts
    1,514

    Default Callback Functions currently not supported

    Hi,

    Finally I found the official statement that callback functions are currently not supported by Xbasic. Tests already demonstrate that, an immediate Crash and Burn of A5.

    Does this mean that callback functions will be supported in the near future? Hmmmm, this would be nice. A problem might be that the amount of users who would use this kind of function is very small. Nevertheless I look foreward to it.

    Marcel

  2. #2
    Alpha Software Employee AaronBBrown's Avatar
    Real Name
    Aaron Brown
    Join Date
    Feb 2001
    Location
    Waltham, MA
    Posts
    2,836

    Default RE: Callback Functions currently not supported

    Marcel,

    While we don't have specific support for callback functions, we do have the concept of function pointers....


    foo(bar)
    foo(blah)


    FUNCTION foo AS V (fn AS F)
    fn()
    END FUNCTION

    FUNCTION bar AS V()
    ui_msg_box("In Bar", "In bar")
    END FUNCTION

    FUNCTION blah AS V ()
    ui_msg_box("In blah", "In Blah")
    END FUNCTION

  3. #3
    "Certified" Alphaholic Marcel Kollenaar's Avatar
    Real Name
    Marcel
    Join Date
    Apr 2003
    Location
    Twente
    Posts
    1,514

    Default RE: Callback Functions currently not supported

    Hi Aaron,

    Thanks. I tested this piece of code prompt. I saw these V-type now and then. It is a VOID type, isn't it?

    The passing of the function name is the passing of a pointer of that function to the function?

    Ehh, I hope this is correct English.. and I'm asking myself if I understand what Í've written...., I understand the principle. Ok, I'll start a Crash and Burn lesson with A5.

    Marcel

  4. #4
    Alpha Software Employee AaronBBrown's Avatar
    Real Name
    Aaron Brown
    Join Date
    Feb 2001
    Location
    Waltham, MA
    Posts
    2,836

    Default RE: Callback Functions currently not supported

    AS V is void type, so the function doesn't return a value.

    AS F is a function pointer, so I can also do this:

    DIM foo AS F

    foo = bar
    foo()

    FUNCTION bar AS V ()
    ui_msg_box("Bar", "In bar...would you like a drink?")
    END FUNCTION

  5. #5
    VAR
    Real Name
    Cheryl Lemire
    Join Date
    Jul 2003
    Location
    Pembroke Pines, FL
    Posts
    2,914

    Default RE: Callback Functions currently not supported

    Make mine a double please so I can crash and burn with Marcel :)

  6. #6
    "Certified" Alphaholic Marcel Kollenaar's Avatar
    Real Name
    Marcel
    Join Date
    Apr 2003
    Location
    Twente
    Posts
    1,514

    Default RE: Callback Functions currently not supported

    Hi Aaron,

    I think you have to pass these examples to Edward Larrabee. I can't find them in the helpfile, at least not at the place I would expect it, the DIM subject.

    Aaron thank you very much for these examples, next time I'll buy you a drink in the foobar ;-)

    Marcel

  7. #7
    "Certified" Alphaholic Marcel Kollenaar's Avatar
    Real Name
    Marcel
    Join Date
    Apr 2003
    Location
    Twente
    Posts
    1,514

    Default RE: Callback Functions currently not supported

    I did found a reference to the F type in "Variable Data Types and Scope" and a link to FUNCTIONS, but then the trail is lost.

  8. #8
    Alpha Software Employee AaronBBrown's Avatar
    Real Name
    Aaron Brown
    Join Date
    Feb 2001
    Location
    Waltham, MA
    Posts
    2,836

    Default RE: Callback Functions currently not supported

    I'll let him know.

    If you find bugs, let me know, as it has not been tested too much.

  9. #9
    "Certified" Alphaholic Marcel Kollenaar's Avatar
    Real Name
    Marcel
    Join Date
    Apr 2003
    Location
    Twente
    Posts
    1,514

    Default RE: Callback Functions currently not supported

    Obviously.

  10. #10
    Former Alpha Employee Edward Larrabee's Avatar
    Real Name
    Edward Larrabee
    Join Date
    Nov 2002
    Location
    New Hampshire
    Posts
    1,385

    Default RE: Callback Functions currently not supported

    What additional information do you need?

  11. #11
    "Certified" Alphaholic Marcel Kollenaar's Avatar
    Real Name
    Marcel
    Join Date
    Apr 2003
    Location
    Twente
    Posts
    1,514

    Default RE: Callback Functions currently not supported

    Hi Edward,

    At least the information and examples Aaron supplied and I would expect it that the F type would be listed by the DIM command. Than you have a complete listing of var types.

    Marcel

  12. #12
    "Certified" Alphaholic Marcel Kollenaar's Avatar
    Real Name
    Marcel
    Join Date
    Apr 2003
    Location
    Twente
    Posts
    1,514

    Default RE: Callback Functions currently not supported

    Hi Edward,

    Thank you very much for adding the F (function) type and the FOO examples in the DIM subject in the help file.

    Regards,

    Marcel Kollenaar

Similar Threads

  1. Bug or Not Supported?
    By Howard G. Cornett in forum Web Application Server v6
    Replies: 9
    Last Post: 03-08-2005, 02:34 PM
  2. Functions
    By dik_coleman in forum Alpha Five Version 5
    Replies: 7
    Last Post: 11-26-2003, 07:08 AM
  3. Two Functions
    By Dan Blank in forum Alpha Five Version 5
    Replies: 3
    Last Post: 01-13-2003, 04:45 PM
  4. functions
    By sparkey in forum Alpha Five Version 4
    Replies: 3
    Last Post: 07-11-2002, 05:54 AM
  5. Functions
    By tlyon in forum Alpha Five Version 4
    Replies: 9
    Last Post: 02-28-2002, 06:00 AM

Bookmarks

Posting Permissions

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