PureBasic Forum
https://www.purebasic.fr/english/

[PB5.50] #PB_Any generated ID conflict
https://www.purebasic.fr/english/viewtopic.php?f=22&t=66683
Page 1 of 1

Author:  Yuri_D [ Wed Sep 28, 2016 7:31 pm ]
Post subject:  [PB5.50] #PB_Any generated ID conflict

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

Author:  nco2k [ Wed Sep 28, 2016 11:04 pm ]
Post subject:  Re: [PB5.50] #PB_Any generated ID conflict

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

c ya,
nco2k

Author:  Yuri_D [ Thu Sep 29, 2016 7:43 am ]
Post subject:  Re: [PB5.50] #PB_Any generated ID conflict

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:
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

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/