![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Bug Reports Post about errors or bugs encountered. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
This code doesn't reproduce your problem:
Code:
Sub Globals
'Declare the global variables here.
End Sub
Sub App_Start
Form1.Show
AddButton ("Form1", "Button1", 20,20,60,60,"Click Me")
AddEvent ("Button1", Click, "MySub")
End Sub
Sub MySub
Msgbox( Sender.Text )
End Sub
|
|
||||
|
Erel, you're right, the code you posted does not exhibit the behavior I described.
The program I'm attaching, however, does. Run the executable; click Button1, and Form2 opens. Click the 'Click Me' button, and a mesagew box appears. Close Form2. Click Button1 again, and Form2 opens once again. Click the 'Click Me' button, and the message box appears, but only once. Now run Basic4PPC and load the .sbp file. Run it (F5). Form1 opens. Click Button1. Form2 opens. Click the 'Click Me' button, and a message box appears. Close Form2. Click Button1 again, and Form2 reopens. Click the 'Click Me' button, and the message box appears twice in rapid succession. At least, that's the behavior on my desktop. BTW, I am using Basic4PPC 6.0 on a computer running Windows XP Pro. Gary |
|
||||
|
And on mine. It looks like Control("Button2").Dispose on the desktop isn't truly disposing it. It looks as though it still has an entry in an event table somewhere in B4PPC even though it is cleared from a control list and so doesn't error when added again. So when it is added back the second AddEvent adds a second event to the event table. Interestingly one would then think that closing Form2 and reopening would give three Message boxes - but sadly it doesn't
![]() |
|
||||
|
It is a bug.
It will happen when you use AddEvent with the same name more than once. As agraham wrote the event will fire twice no matter how many times AddEvent is used. This bug doesn't affect optimized compiled executables. It will be fixed in the next major update (not the soon to come update). |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Web browser for desktop and device | agraham | Additional Libraries | 46 | Today 09:56 AM |
| Editable Table - Device & Desktop | Erel | Code Samples & Tips | 11 | 11-21-2008 09:01 AM |
| Device or Desktop | DaveW | Questions & Help Needed | 2 | 11-07-2008 01:04 PM |
| Different behaviour DeskTop and Device | HARRY | Questions & Help Needed | 2 | 02-22-2008 01:36 PM |
| Using rapi from desktop to copy file from device to desktop | sunnyboyj | Questions & Help Needed | 9 | 02-08-2008 12:40 PM |