>Hi All,
>
>I am trying something new < g >, Bindevents().
>
>I need to run a different init of class object then the normal one. The main problem I see, is that this code that I am replaces has a lot of THIS and THISFORM.object in it. I still need most of those things done.
>
>Will this be a problem?
>
>The code is for a combobox init and looks like this:
>
>LOCAL i
>PUBLIC aWizFList
>DIMENSION aWizFList[1]
>=AFIELDS(aWizFList)
>FOR m.i = FCOUNT() TO 1 STEP -1
> IF INLIST(aWizFList[m.i,2],"G","M","U")
> =ADEL(aWizFList,m.i)
> DIMENSION aWizFList[MAX(1,ALEN(aWizFList,1)-1), ALEN(aWizFList, 2)]
> ENDIF
>ENDFOR
>THIS.RowSourceType = 5
>THIS.RowSource = "aWizFList"
>THIS.VALUE = THIS.LIST[1]
>
>
>can this be done?
Not quite sure why would you need to bindevent an .init() for this. There are several ways to do this:
- you can subclass your combo class and have your new init in the subclass
- this code may better go into .requery() - and you don't even need the code to be a part of the combo, it could be elsewhere; you pass the combo as a parameter to it, and instead of "this." use the parameter.
And, while we're at it, the array shouldn't be public, it should be a property of the combo itself. The .rowsource="this.aWizFlist" then.