Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'MODI FILE' from a top level form
Message
From
09/09/2002 10:54:12
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
06/09/2002 12:10:49
Michael Devlin
A. James de Bruin & Sons - Llp
Bethpage, New York, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00697594
Message ID:
00698293
Views:
15
>Here is a question. How do I modify a file from a top level form?
>I have a top level form set up as a standalone EXE, which opens a file and runs a program that generates cursors based on the file. The form has command buttons which preview reports based on the generated cursors. I have code in the command click events to resize the form to allow the report preview to be viewed, since the DEFINE WINDOW does not make a new window on the desktop even when I include the IN DESKTOP clause. That solved the problem of viewing the report previews, not the solution I wanted, but it works. Now I am confronted by the fact that I want the user to be able to edit the file from another command button on the form, to make changes based on the data displayed in the form reports. The problem of not being able to DEFINE WINDOWs in the desktop has stopped me cold. No matter what I try, the MODI FILE command will not display the edit window anywhere except the default FoxPro _screen. Since the form is running as a standalone top level form, I have not been able
>to figure out how to include this functionality.

Haven't done this with Modi File, but did it with print preview, so it should apply.

First off, there's a difference between "...window {window name}" and "...in window {window name}". The first tells Fox to use the window, the other one to create a new window as a child of the window. Without the in clause, you are directing operation to a window of your own making.

What I usually do in such cases, is to create a form class with properties I need. In this case, it would be a top level (or in-top-level) form, desktop.
oF=create("mymodifileform")
oF.Caption="My caption for this editing window"
oF.show
modify file lcMyFile window (oF.Name)
After editing you may hide (if you think you would need to reuse it often) or release this form. While I haven't tried this, it does work for print preview. You may need to make some arrangements for the system menu to include the Save, Cut, Copy, Paste etc.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform