Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private-Declaration produces deadlock
Message
 
 
To
08/05/2000 09:38:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00367209
Message ID:
00367491
Views:
43
Thomas,

By having private memvars if you recurse into the contained object when it will reuse the memvars established by the caller method which will destroy our array and loop counter. Local prevents this, because each call to the method gets it's own copies of the memvars. As a general rule: Never ever use PRIVATE memvars in method code, use LOCAL memvars instead. You should only rarely ever use PRIVATE memvars anywhere in your code, LOCAL is far safer.

It's also possible you are infinite looping, maybe one of your contained objects is calling back to thisform.Resize() or this.parent.Resize().


>Hi all,
>last week I had a problem with some code in one of my formclasses. After several debugs and tests I now have found out, that it all depended on the 'private'-declaration of two variables. After changing 'private' to 'local' everything is working fine. However I don't have any explanation for this.
>
>Perhaps someone can give me a hint. Here is the original code:
>
>* Begin code
>Private laArray(1), liFlag /* now changed to Local
>With This
> .Lockscreen = .T.
> For liflag = 1 To .ControlCount
> = AMembers(laArray, .Controls(liFlag), 1)
> If AScan(laArray, 'resize') > 0
> .Controls(liFlag).Resize
> EndIf
> EndFor
> .Lockscreen = .F.
>EndWith
>* End code
df (was a 10 time MVP)

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

Click here to load this message in the networking platform