Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form with private datasession calls a .prg. What happens
Message
 
 
To
07/05/1998 02:59:49
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00097056
Message ID:
00097596
Views:
28
>>>>>>>When i call a .prg from a form which has a private datasession, the program opens another datasession for all the cursors or tables.
>>>>>>>To solve this, i pass the datasession as a parameter and issue a 'set datasession to (parname). Is there another better solution to do this ???
>>>>>>
>>>>>>What we are doing is that we create a custom method in the form and put the program in it. The trouble with this approach is redundancy of coding especially if the program seems reusable, but it is safer and much easier to maintain.
>>>>>
>>>>>Jess: Well, i do always, but if the code must be used by a lot of process in different forms. In this case perhaps the solution is to place code in n object public for all, but then the problem is the same: differents datasessions.
>>>>>
>>>>>Thanks.
>>>>
>>>>Just like Ranjit has stated, we did create a Form Class with the program attached in it (built-in) via custom method so that it will be instantiated everytime the form is activated. The form class then is our default form on the entire application. No need to create an object specific for that program.
>>>
>>>Ok. that's a good solution, but, i have horrible doubts about this:
>>>
>>>I use a form class for all my applications, and this code is only needed in one of them. Is the correct way to subclass the form class to use it in this specific application or this reduce the performance of a form (class, subclass, subclass) ???. Does multiple heritage reduce performance ???. If not, i think you are in the right way. Thanks a lot.
>>
>>
>>It will not, because you have the option whether to call the method or not. As I understand, if you need it only in one form then you just create the method on that specific form, no need to place it in a form class.
>
>Sorry i have send a message without text.
>I need it in several forms, but in only one application. So i dont want to put it in the parent class of the form but in a subclass of it, used only by this application.
>Is this the correct way to go ???

Yes, a separate Form Subclass specific only for an the application. But make sure that the desired Form Subclass be setup on the Tools/Option at Forms page for you to have the right Default form during development.
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Previous
Reply
Map
View

Click here to load this message in the networking platform