Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bindevents and classes
Message
From
09/11/2007 13:32:13
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
09/11/2007 12:38:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
MS SQL Server
Miscellaneous
Thread ID:
01267991
Message ID:
01268035
Views:
21
>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")	&&Memo field
>    =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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform