Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question on Read & Read Modal Window types
Message
From
16/10/2002 20:10:11
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
16/10/2002 19:10:42
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00712076
Message ID:
00712094
Views:
13
>I have just started maintenance work on a vfp6 app, where the majority of the forms in the app were converted from fpw2.6, using the 'converter tool??? (I vaguely remember this from vfp5 or 3???)

The converter doesn't create very good code. You would be better off redoing everything from scratch.

>All of the converted forms have - a formset,form, pageframe, and single page. Again I vaguely remember that some sort of conversion tool creates these objects.
>
>All of the converted forms have a window type of 'read'. I assume the converter makes it this way. In the drop down for windows types the choices are modeless, modal, read modal and read.
>
>There is a new(er) form that someone created, prior to my being here, that has a formset, and form, but not the pageframe/single page. It appears to have been created directly in vfp - and the window type is modal. This form (as well as any other new vfp forms I create) do not have read modal or read as a window type choice.
>
>Is read modal and read something that the converter creates just for converted forms? Or is there some other setting that needs to be true, or something that I have to do, to make the new(er) form have a window type of read.

I think this is for compatibility with the old code. For the recommended new way to do things, see READ EVENTS and CLEAR EVENTS.

>All the forms are called from a 'main menu form' with command buttons. When you click a command button/menu choice, the read forms pop up 'IN PLACE OF' the main menu form. However, when you click menu choice for the new(er) form, it pops up on top of and separate from the main menu form.
>
>The client likes the way that the read forms replace the main menu form. They want me to make the new(er) form do the same. How can I get a new vfp form to be a read form? Is that what makes it behave such that it replaces the instead of pops up over the main menu form?

Basically, you run your startup code, then issue READ EVENTS. This will create an "infinite loop", where VFP will wait for user input, react on it, and then go back to the READ EVENTS command - to continue waiting.

For instance, clicking on a button will "branch" from the READ EVENTS command to the Button.Click(). After finishing processing, the debugger will show that you are on READ EVENTS again.

To close your program, you issue CLEAR EVENTS. This will make execution continue after the READ EVENTS command.

So, your program structure is thus:

All your startup commands go before the READ EVENTS.

All your cleanup code goes after the READ EVENTS.

HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform