July 01, 2022, 01:52:34 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


2.0 Issues

Started by Rock Ridge Farm (Larry), March 12, 2011, 06:21:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zaphod

August 12, 2011, 01:06:41 AM #200 Last Edit: August 12, 2011, 01:13:16 AM by zaphod
Hello,
on version 2.094, on each compil i have the warning :

Compiling...
prime.iwb
File: C:\iwb2dev\perso\prime.iwb (13) Warning: Argument 9 (d1_handler) does not match the declaration of IWBDLGPROC
Different return type: none, should be int
File: C:\iwb2dev\bin\iwbstd.incc (9) Warning: See previous declaration of IWBDLGPROC
File: C:\iwb2dev\perso\prime.iwb (23) Warning: See previous declaration of d1_handler
No Errors

Linking...
IWBasic Linker v1.11 Copyright © 2011 Ionic Wind Software
Generating C:\dev\iwb2dev\perso\prime.exe
Build completed


Sorry, i found the dialog handler should be :


sub d1_handler(),int
SELECT @MESSAGE
CASE @IDCONTROL
...

LarryMc

The warning is due to a related change that was made by Sapero to resolve another problem I had.

In experimenting with some code I had inadvertently tried to pass parameters in an OnControl subroutine(to make it dual purpose).
It compiled just fine but caused problems that I couldn't identify what the root cause was.

Sapero added code to warn of the potential so these "hidden" problems couldn't happen to someone else.

If you think about it, the warning makes logical sense.  Handler routines require a 'return 0' and warns if you don't have one.

So, as zaphod discovered, to get rid of the warning simply declare the handler as

sub handler(), int

and if you do like i did and try to pass a parameter to a OnMessage/OnControl/OnMenu subroutine the compiler will tell you that that is incorrect.

The real problem here is the fact that this was a change that had an impact on user's and we failed to warn user's in advance.
For that I apologize.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library