AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Editores / Editor de código
  • Overview
  • Importing a class in text file format
  • How to?
  • Remarks
  • Examples
  • Importing a set of procedures in text file format
  • How to?
  • Remarks
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Otros
Procedimientos almacenados
Importing classes and sets of procedures (text file)
Overview
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:
  1. Open the relevant project.
  2. In the "Project explorer" pane, select the "Classes" folder.
  3. Right-click and select "Import text files" in the context menu.
    Importing text files
  4. In the file picker that is opened, select the text files to import and validate.
    Reminder: Use Shift or Ctrl to select multiple elements.
  5. 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:
  1. Open the relevant project.
  2. In the "Project explorer" pane, select the "Procedures" folder.
  3. Right-click and select "Import text files" in the context menu.
    Importing text files

    WEBDEV - Código ServidorWEBDEV - Código Navegador In WEBDEV, you have the ability to import sets of server or browser procedures:
    Importing text files
  4. In the file picker that is opened, select the text files to import and validate.
    Reminder: Use Shift or Ctrl to select multiple elements.
  5. 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.
Versión mínima requerida
  • Versión 23
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 23/05/2024

Señalar un error o enviar una sugerencia | Ayuda local