Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One class, two behaviors
Message
 
 
To
10/09/1998 18:46:19
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00134266
Message ID:
00135319
Views:
11
Pamela,

>That makes alot of sense, but wait a minute. The array has a value of false until the SQL statement that populates it is executed (that statement is in the init method) When the SQL statement executes, it changes the dimensions on the array. And when I suspend the execution, execute the SQL statement and investigate the array property, it has all its elements present. So what you are saying is that somehow the control establishes the size of its rowsource without putting a value in it, before is runs the init code and then, even though the SQL statement changes the size of the array, the control has already decided its size and only picks up the first element.

Let me say this is speculation based on the observed behavior of the cbo, it's kind of hard to say exactly what goes on in the MS code without spending years in Codeview tracing it *s*.

At the time the array is only one row long, even though it contains .F., VFP might not actually figure out what to display till the end of the Init (or when it's dropped the first time) but it will have latched onto the fact that the RowSource is only 1 item long regardless of how long the array really is. The Requery() call synchs everything.

>Doug Hennig wrote that he has had the same experience with combo boxes, they work without requeries on forms but must be requeried on form classes. I guess it is an undocumented feature.

I can't say that I've ever put a cbo in a class so if it acts this way (ie bug) then I'd never have run into it.

>I have a blank .scx that I use to test classes like this, so it has nothing to do with code I put in the form.

that's a good way to test this kind of stuff.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform