- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there, I'm a portuguese student and I started to used in college Visual Fortran recently. So I started to learn it, but i already knew fortran programing
In the example "Celsius" they maded the callback routine UpdateTemp(dlg,control_name,callbacktype). Our problem is that we need to import other variables from the main program and we tried UpdateTemp(dlg,control_name,callbacktype,variable), this does give a compiling error, however the program crashs while executing.
My question is how can we import this variable from the main program to this callback soubroutine.
The other question is related with the menus in the toolbar. If I do this : result = APPENDMENUQQ(1, $MENUENABLE, '&Temp aplication'C, Do_dialog)
(Do_Dialog is the dialog subroutine that generates an controls de dialog box) this calls the subroutine...however this does work when the dialog subroutine has arguments...I tried to do
result = APPENDMENUQQ(1, $MENUENABLE, '&Temp aplication'C, Do_dialog(variable) )
My other question is how to call a subroutine using a menu.
Thank you for help... Eduardo Antunes
In the example "Celsius" they maded the callback routine UpdateTemp(dlg,control_name,callbacktype). Our problem is that we need to import other variables from the main program and we tried UpdateTemp(dlg,control_name,callbacktype,variable), this does give a compiling error, however the program crashs while executing.
My question is how can we import this variable from the main program to this callback soubroutine.
The other question is related with the menus in the toolbar. If I do this : result = APPENDMENUQQ(1, $MENUENABLE, '&Temp aplication'C, Do_dialog)
(Do_Dialog is the dialog subroutine that generates an controls de dialog box) this calls the subroutine...however this does work when the dialog subroutine has arguments...I tried to do
result = APPENDMENUQQ(1, $MENUENABLE, '&Temp aplication'C, Do_dialog(variable) )
My other question is how to call a subroutine using a menu.
Thank you for help... Eduardo Antunes
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Prototypes (number and types of arguments) of callback routines must exactly match the one stated in documentations, i.e, for dialogs (TYPE(Dialog), INTEGER, INTEGER) and for menus (LOGICAL). Elsewhere, even if you manage to compile it, you'll get run-time crashes. If you want to "import" other variables, you'll have to either
- Place these variables in a MODULE and USE that module in both main program and the callback
- Place them in a COMMON block declared in main and in callback.
There are other ways, but these are the most simple.
Similarly, menu callbacks must have a single LOGICAL argument; if you want to share some variables, you'll have to use a MODULE (or a COMMON).
Jugoslav
- Place these variables in a MODULE and USE that module in both main program and the callback
- Place them in a COMMON block declared in main and in callback.
There are other ways, but these are the most simple.
Similarly, menu callbacks must have a single LOGICAL argument; if you want to share some variables, you'll have to use a MODULE (or a COMMON).
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your help! It worked just fine!

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page