Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Forms referred to in other forms
Message
 
À
13/08/1997 10:53:22
Renato De Giovanni
Via Fractal Information Systems
São Paulo, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00044440
Message ID:
00044476
Vues:
31
>>This is related to another question that appeared here recently. I have two apps in which, in the main.prg, I DO FORM form1 WITH variable1 and then READ EVENTS. form1 is like a main menu. A button.click in form1 has THISFORM.Hide, then DO FORM form2 WITH variable2. In the click for a grid (or textboxes in the columns) is, similarly, THISFORM.Hide, then DO FORM form3 WITH variable3. form2.Unload has form1.Show, and form3.Unload has form2.Show. Since form1, form2, and form3 are the filenames of the .SCX files, and should therefore be the default object names, I have not used the NAME clause of the DO FORM command. My question is: why does app#1 work and app#2 give me an "Unknown object" error when I try to unload form3? What could be different about them? I have tried using the NAME clause of DO FORM in app#2, to no avail. But I didn't seem to need NAME clauses in app#1 anyway.
>>
>>I suppose I do as Mr. Pikman suggested to someone and loop through _SCREEN.Forms(), looking for _SCREEN.Forms(x).Name, which I realize is the name property of the form, not the name of the form object (yes, I checked that). Perhaps that would be more secure anyway. But since form3 is only started from form2, and form2 only from form1, I shouldn't have to go searching like that, should I?
>
>Have you also tried this syntax:
>
>DO FORM formx NAME formx LINKED
>
>HTH,
>
>Renato
No I haven't. I'm not sure why I'd want it LINKED. But I have since realized that the two apps are not quite as I've described them. In app#1, form1 has two buttons. One opens form2, which can later open form3 as I said, and the other opens form3 directly. The form3.Unload doesn't have form2.Show. It loops through _SCREEN.Forms(), checks the .Name property of each, and .Shows the one with the name equal to form2.Name. If it doesn't find that name, it supposes that it was called from Form1 and has Form1.Show. In the App#2, form3 is always called from form2. However, I've found it necessary to search _SCREEN.Forms(x).Name for the name of form2, just as I did in App#1. It seems that just saying Formx.Show works for .Showing Form1 from Form2.Unload, but not for .Showing Form2 from Form3.Unload.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform