Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To lock screen or not
Message
From
15/04/2011 11:26:44
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01507393
Message ID:
01507501
Views:
59
>Craig's point was that without saving the Lockscreen condition the code would be dangerous. My point that adding code that stores and restores the Lockscreen condition does not make the code less dangerous.

Not exactly dangerous, but a comical way of shooting yourself in the foot, if you have this piece of code in various places. Then in a few months you add an object which does this, somewhere deep in the containership hierarchy, completely forgetting that it will unlock the _screen on exit from its .refresh(). Then your outermost object locks the screen, starts the refresh... and this object inside just unlocks it for you, far before the refresh is finished.

With screen locking this isn't dangerous, but if it's done on some more important setting (datasession, exclusive, exact, near, ansi... you see where this can go), it may actually break the code. Which is why it's considered good practice that any code which changes an app-wide (or form-wide) setting should restore that setting before exiting. Encapsulation, in a way.

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