|
|
|
|
|
- Overview
- Importing a class in text file format
- How to?
- Remarks
- Examples
- Importing a set of procedures in text file format
- How to?
- Remarks
Importing classes and sets of procedures (text file)
From version 23, you have the ability to import existing classes or sets of procedures in text format. Therefore, the development teams can for example create a class generator corresponding to their development architecture. Importing a class in text file format How to? To import a class in text file format into a project: - Open the relevant project.
- In the "Project explorer" pane, select the "Classes" folder.
- Right-click and select "Import text files" in the context menu.
- In the file picker that is opened, select the text files to import and validate.
Reminder: Use Shift or Ctrl to select multiple elements. - The classes are imported into the project.
Remarks - The name of text file corresponds to the name of the class to import. For example, the "ClassA.txt" file is used to import the description of "ClassA" class.
- You have the ability to select several files. Each text file corresponds to a class.
- If a class with the same name is already found in the project, the code editor proposes not to import the class or to overwrite its content with the one of imported file.
- The '...' symbols to indicate that a code row continues on to the next row are not supported.. If the text file contains these symbols, it will not be imported..
- The comments found before a declaration (procedure, ...) are considered as belonging to the previous procedure.
- The declarations of procedures containing the '::' symbols are not supported.
- To import properties, all you have to do is replace PROCEDURE by PROPERTY in the text file containing the code of class and properties (see the example below).
Examples Examples of text files: - "ClassA.txt" file:
ClasseA est une Classe n est un entier FIN PROCÉDURE Constructeur() n = 5 PROCÉDURE Destructeur()
PROCÉDURE GetN() RENVOYER n - "ClassB.txt" file:
ClasseB est une Classe pclA est ClasseA dynamique FIN PROCÉDURE Constructeur()
PROCÉDURE Destructeur()
PROCÉDURE Test() SI pclA = Null ALORS trace("pas alloué") SINON trace(:pclA:GetN()) FIN
PROCÉDURE Init(pclA=Null) pclA = pclA - "cAnimal.txt" file containing properties:
cAnimal est une Classe PRIVÉ m_sIdentifiant est une chaîne PROTÉGÉ m_sNomAnimal est une chaîne m_ImageAnimal est une Image
FIN
PROCÉDURE Constructeur(sNom est une chaîne) // Définit l'identifiant de l'animal m_sIdentifiant = DonneGUID() // Mémorise le nom de l'animal m_sNomAnimal = sNom
PROCÉDURE Destructeur()
PROPRIETE Identifiant() RENVOYER m_sIdentifiant
PROPRIETE Identifiant(Valeur) // Pas de modification possible pour l'identifiant dbgAssertion(Faux, "L'identifiant ne peut pas être modifié")
PROPRIETE NomAnimal() RENVOYER m_sNomAnimal
PROPRIETE NomAnimal(Valeur) m_sNomAnimal = Valeur
PROPRIETE ImageAnimal() RENVOYER m_ImageAnimal
PROPRIETE ImageAnimal(Valeur) m_ImageAnimal = Valeur
Importing a set of procedures in text file format How to? To import a set of procedures in text file format into a project: - Open the relevant project.
- In the "Project explorer" pane, select the "Procedures" folder.
- Right-click and select "Import text files" in the context menu.
In WEBDEV, you have the ability to import sets of server or browser procedures: - In the file picker that is opened, select the text files to import and validate.
Reminder: Use Shift or Ctrl to select multiple elements. - The sets of procedures are imported into the project.
Remarks - The name of text file corresponds to the name of the set of procedures to import. For example, the "Set_bCompareFiles.txt" file is used to import the description of the set of procedures named "Set_bCompareFiles".
- You have the ability to select several files. Each text file corresponds to a set of procedures.
- If a set of procedures with the same name is already found in the project, the code editor proposes not to import the set of procedures or to overwrite its content with the one of imported file.
- The '...' symbols, indicating that a line of code continues over the next line, are not supported. A text file containing these symbols will not be imported.
- The declarations of procedures containing the '::' symbols are not supported.
- The comments found before a declaration (procedure, ...) are considered as belonging to the previous procedure. For example, you must not write :
// Description des paramètres d'entrée/sortie de 'gVérifieValeurRubrique': // // Syntaxe: //gVérifieValeurRubrique (<RubriqueHF>, <ValeurFichierTexte>, <sNomRubrique>, <nNumEnr>) // // Paramètres: // RubriqueHF: <indiquez ici le rôle de RubriqueHF> // ValeurFichierTexte: <indiquez ici le rôle de ValeurFichierTexte> // sNomRubrique: <indiquez ici le rôle de sNomRubrique> // nNumEnr: <indiquez ici le rôle de nNumEnr> // Valeur de retour: // Aucune PROCÉDURE gVérifieValeurRubrique(RubriqueHF,ValeurFichierTexte,sNomRubrique,nNumEnr) but you must write: PROCÉDURE gVérifieValeurRubrique(RubriqueHF,ValeurFichierTexte,sNomRubrique,nNumEnr) // Description des paramètres d'entrée/sortie de 'gVérifieValeurRubrique': // // Syntaxe: //gVérifieValeurRubrique (<RubriqueHF>, <ValeurFichierTexte>, <sNomRubrique>, <nNumEnr>) // // Paramètres: // RubriqueHF: <indiquez ici le rôle de RubriqueHF> // ValeurFichierTexte: <indiquez ici le rôle de ValeurFichierTexte> // sNomRubrique: <indiquez ici le rôle de sNomRubrique> // nNumEnr: <indiquez ici le rôle de nNumEnr> // Valeur de retour: // Aucune - The imported code can contain internal procedures.
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|