Hey guys,
Okay, I'm finding it hard to locate an operator or function to use to compare types. I have a function that can acquire any type that extends a structure I've defined, but it's also possible that this function may acquire a type it isn't set to deal with, as the values are passed from a C dll. How do I compare types to check they are compatible, before extracting data?
Thanks,
Type Comparison
-
- User
- Posts: 74
- Joined: Fri Dec 02, 2005 3:11 pm
- Location: England
- Contact:
Type Comparison
Laz
Registered PureBasic user since Nov 2005
Check out FlashML at www.designrealm.co.uk... The ultimate Flash Component
Registered PureBasic user since Nov 2005
Check out FlashML at www.designrealm.co.uk... The ultimate Flash Component
- tinman
- PureBasic Expert
- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
If you have control of the base structure you could add a known identifier (either value or string) to the structure and make sure this matches with one you know how to handle.
Of course, that assumes the C DLL author won't be nasty enough to simply find out what the ID value is and copy it before stuffing it into their structure.
Got any more info on what you're trying to do?
Of course, that assumes the C DLL author won't be nasty enough to simply find out what the ID value is and copy it before stuffing it into their structure.
Got any more info on what you're trying to do?
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)