Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Sprite, Image, Object Ids in Complex Projects

Author
Message
Abraxas
15
Years of Service
User Offline
Joined: 20th Aug 2009
Location:
Posted: 20th Aug 2009 20:12
Hi. I was wondering how people manage possible conflicts with Ids in complex projects? Specially with GDK and Object Oriented Programming.
All the CreateSomething functions ask for an Id for the Image, Object, etc... and I'm used to the opposite, that the CreateSomething functions return some unique Id that you hold in a variable.
I'm starting now with GDK, and have a couple of workarounds in mind, but I would like to know if I'm missing something obvious.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 20th Aug 2009 21:20 Edited at: 20th Aug 2009 21:20
Well, something as simple as this does the job well enough. Elaborations are of course possible.


For actually keeping track of things... arrays / lists are your friends

Abraxas
15
Years of Service
User Offline
Joined: 20th Aug 2009
Location:
Posted: 20th Aug 2009 21:57
Yes, a global variable for each one of the Id types is what I had in mind. I just wanted to be sure I was not missing some already built-in function or something. Thanks!

Login to post a reply

Server time is: 2024-11-24 02:57:29
Your offset time is: 2024-11-24 02:57:29