Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which came first, Chicken or Egg
Message
From
05/10/2005 16:55:43
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
 
 
To
05/10/2005 16:16:05
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01056465
Message ID:
01056498
Views:
30
The reason I am doing ths is to color code the text boxes and command button based on the values in the databse. For example command3 might be red because there is not value in M.some_field.


What is strange is that I went to the first item after the form in the properties list (text1). I did my scatter memvar there, but the very next item (text2) did NOT see the value of the memvar. It is like there is some sort of clear after the text box is initiated???



>I have a form that I want to reinitialize the memory variables from a DBF everytime the form displays.

Do you mean a scatter memvar? You can put that in form.activate, or even in .refresh - though it largely may depend on what are you doing with these memvars.

>Naturally one would think this is easy since you just put it in the INIT of the form.
>
>NOT SO.
>
>The Form init is not the first thing to run.

Of course it isn't - and it never was. Check The Visual FoxPro Event Sequence (you can find it under "event sequence tracking" in the help).

>So I went to the first item below the form in the Properties window (a text box)and put my Init code there. I put a wait window there and it WAS first.
>
>
>Is that a reasonable way to do this????

It's not - you can change the order of instantiation by putting any object into background or foreground using Layout toolbar - and the backmost (is this a word?) object will be instantiated first. So you can't be sure your textbox is instantiated before all other objects on the form. You can only be sure it is instantiated before the form itself.

I'm usually the last one here to ask you why are you doing this and what are you trying to achieve, but... oblige me this time
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform