[PB5.50] #PB_Any generated ID conflict

You need some new stunning features ? Tell us here.
Yuri_D
User
User
Posts: 68
Joined: Wed Apr 13, 2016 7:39 am

[PB5.50] #PB_Any generated ID conflict

Post by Yuri_D »

Hi!

Just met with this unpleasant thing...
I'm using #PB_Any for gadgets enumeration in all modal form .pbf files and these files are Xincluded in the main form file.
During execution, if I open and close several forms, some buttons of the last opened form stop working.
I checked the Variable Viewer and found that gadget ID variables of the different forms (active and previously closed) contain same values....

Is it a bug of #PB_Any or in my head?)

BRG
Yury
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: [PB5.50] #PB_Any generated ID conflict

Post by nco2k »

no bug. take a look at my responses here: http://purebasic.fr/english/viewtopic.php?f=13&t=66299

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Yuri_D
User
User
Posts: 68
Joined: Wed Apr 13, 2016 7:39 am

Re: [PB5.50] #PB_Any generated ID conflict

Post by Yuri_D »

2 nco2k:

OK, thanks! I see that not only me suffering from this issue)
Problem is: I'm using files created by PB Form Designer and for simplicity/universality I want to keep them in .pbf format - IMHO PBFD shall create a cleaning code automatically if a parent window is defined and for this it shall create not a global variable for each gadget/window but a list or a map (user selectable). Currently I can't do this cleaning in cycle and I need to zero these variables one by one ... looks ugly:

Code: Select all

Procedure CloseModal( _iFormID.i)
   CloseWindow( _iFormID)
   Window_Connect = 0
   Button_CmConnect = 0
   Button_CmCancel = 0
   ipConnectTo = 0
   strUserName = 0
   strPassword = 0
   lstConnections = 0
   strConnectionName = 0
   lblConnectionName = 0
   lblConnect2IP = 0
   lblLogin = 0
   lblPassword = 0
   Button_CmAdd = 0
   Button_CmDelete = 0
   
   Window_AlarmEdit = 0
   Button_AseApply = 0
   Button_AseCancel = 0
   ; TODO: Finish
   
   Window_About = 0
   Button_AboutClose = 0
   imgDevice = 0
   txtAboutName = 0
   txtAboutVer = 0
   txtAboutCopyright = 0
   txtAboutCopyrightName = 0
   txtAboutEmail = 0
   DisableWindow( Window_Main, #False)
EndProcedure
Post Reply