Finding an item in a collection of types

Blitz3D Forums/Blitz3D Programming/Finding an item in a collection of types

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Okay here is the issue. I have 5 or 6 checkboxes for the gui i am desigining. And each is a type. Each is assigned a unique name.
However, i want to be able to get the state/value of that checkbox, but simply passing its unique name into a function.
The code below works. But if its called every game loop one function slows the entire game down immensely.

Anyone know a better way to do this?




;==========================================================
;GET THE VALUE OF THE GIVEN CHECK BOX
;=========================================================
Function GUI_GET_CHECKBOX_VAL( CHECKBOXNAMESTR$ )
For TARGET_CHECK.GUI_CHECKBOX_TYPE=Each GUI_CHECKBOX_TYPE
If TARGET_CHECK\NAME$ = CHECKBOXNAMESTR$ Then

Return TARGET_CHECK\Value
End If
Next
End Function