BBC BASIC for Windows
« Callback function address »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:50pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Callback function address  (Read 370 times)
ScriptBasic
Guest
xx Callback function address
« Thread started on: Jan 18th, 2014, 03:06am »

How do you get the address to a BBC4W defined callback function? I need to pass this address as an argument to my IupSetCallback() function.

Update

I think I got the idea how it should be done.

funcaddr% = FN_callback(FNmycallback(), 1)
« Last Edit: Jan 18th, 2014, 04:21am by ScriptBasic » User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Callback function address
« Reply #1 on: Jan 18th, 2014, 09:29am »

on Jan 18th, 2014, 03:06am, ScriptBasic wrote:
I think I got the idea how it should be done.

funcaddr% = FN_callback(FNmycallback(), 1)

Yes, that's correct (the '1' specifies the number of parameters the callback function expects).

Bear in mind that if you use callbacks you should avoid 'blocking' statements in your program, such as INPUT, GET and WAIT (with a non-zero parameter). If necessary the NOWAIT library provides non-blocking replacements for these.

Please also note that SYS itself can be a blocking function so if your callback needs to happen during a SYS call you must use the special non-blocking version FN_syscalln() provided in the CALLBACK library.

Richard.
« Last Edit: Jan 18th, 2014, 09:35am by admin » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls