Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New DS in a program - have problems - Urgent!
Message
From
02/01/2001 17:12:05
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00458554
Message ID:
00458673
Views:
18
Hi!

I already know that you have working solution, but it seems not quite good.

The work-around idea I just got seems better, with it you will not need to make a separate session object. Make a host form with private data session. Run it outside of screen so users will not see it at all. That form should get parameter - string with command that should be ran under private (separate) data session, or something other (form name). Your call will look like:

Do FORM MySessionHost.SCX WITH "Do MyForm.prg"

or something like that.

In the form you will have method to run other form (if form is modeless), so you will call it:

MySessionHost.DoCommand

For modal forms you can run hosted command just from Init method of host form:

lparameters lpCommand
&lpCommand
return .F.

Last 'return .F.' indicates that host form should be released immediately after init finished (modal form finished work).

There might be difficulties, however, when returning some value from modal form, but there are workarounds for that too.

HTH.

>Hi Vlad,
>
>First of all, thanks a lot for the quick response.
>
> I'd like to distinguish Form's DS from my application DS, IOW, I don't want to overload Form's DS with the tables, which are not relevant to this form. Besides, I may want to open the table, which is used in this form, and do some work on it. That's why I like to keep my application DS separate from calling form DS. That's why I tried the code, I showed, but it didn't work.
>
>Therefore, my question is: is it possbile at all to create a separate DS for my application (which currently consists only of programs) or I need to re-organize my application and create class with methods, instead of just programs. I know, this technique works, if there is another object (class) involved (as in my other colleague code this technique works just fine, but he uses classes). I just don't want to complicate my life yet, if it's not absolutely necessary. I was thinking about thisform.lockscreen (though I doubt, it would work).
>
>Do you have ideas for me?
>
>Thanks in advance.
>
>>Hi!
>>
>>I never even tried to work with data session by that way because I know a lot of bad things about it. Private data sessions are not reliable in VFP even when used by usual way, what say about manual editing?
>>
>>What the goals you want to get to when trying to make data session object manually?
>>
>>Note that grids are cleared out probably because original data session for form with grids is gone out of scope somewhere during application running. I think this occurred because data session you made is not native for form.
>>
>>> We have a main application, called JobControl, which in turn calls other applications. I have my application, called Stats. This application currently consists of several programs, which perform different statistics calculation. They worked in Form's DS. Today I decided, that it would be better to distinguish JobControl Form's DS from Stats DS, so I added the following in Stats main program: (commented this code for now):
>>>>>><<<<
>>>
>>>When I finish with my app and return to JobControl Form, all grids appear empty. What can I do, to prevent this behavior? Is it valid to create a new DS in a program or it would work only for class?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform