Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scrolling commands in form
Message
 
To
05/09/1997 12:00:04
Edward Crawford
City Facilities Management
Glasgow, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00048624
Message ID:
00048748
Views:
24
>>>One of my forms has begun to scroll commands in the form background when a button is pressed. At first I thought that it was encountering an error, and this caused the behavior, but I can't seem to capture any errors, and it doesn't do it if I run the program in my development directory. Any ideas?
>>>
>>>Ed
>>Ed,
>>
>>Make sure you SET TALK OFF in the load of your form's.
>
>Jim :
>
>Your suggestion works. I was makeing a call to a method out side of my form to reset the environment. Apparently setting the environment with the SET copmmands ties the setting to the data session, not the system as I thought. After I passed the DataSessionId to the method and set the DataSession, it worked.
>
>Ed
Ed,

There are some known problems with using SET DATASSESION so let me suggest an alternative.

In a class library create a line class named SetEnv. In the Init of this class put all you SET COMMANDs and finally RETURN .F. so the line never really gets created but the Init code runs. Now create a from class that you iwll use for all of your forms and in its Load put this code;

* FormClass LOAD
CreateObject("SetEnv","SetEnv")

Thsi will run the Init for that class for every form, the Init reutrns .F. so the line is never really created. It also runs that Init code in the data session for the form so there is no need to SET DATASESSION. All of the set code is in one place so it si esy to maintain, just like your UDF approach is now.

BTW, if you're interested this is called a Visitor design pattern in OO lingo. It is an object that briefly visits another object does it thing and leaves.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform