Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
2 Form classes, same parent class, same codes, diff. tab
Message
De
22/12/2005 06:18:26
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01080098
Message ID:
01080117
Vues:
13
This message has been marked as the solution to the initial question of the thread.
>Hi all
>
>I have 2 form classes based on a parent class. These 2 forms contain same processing codes but uses different tables and cursor in terms on name only.
>
>Except for making the names same or macro substitution, is there any way to put the code into the base class?
>
>Please advise.

Yes, you can open two different tables with the same alias.

Let's assume for an example that you have material reception, and material delivery, in different tables. Structures are similar. Give a name to the combined table concept for instance, "MaterialMovement", or something more generic, like "TableProcessed".
* Form.Load()
use (ThisForm.cTableName) alias MaterialMovement
Later, the Grid.RecordSource, a TextBox.ControlSource, or any command, would all refer to the alias "MaterialMovement".
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform