Je voudrais créer une unité sans fiche pour y mettre toutes mes procédures et fonctions personnelles mais je n'arrive pas à trouver un tutoriel sur le sujet.
J'ai donc créer l'unité suivante :
Et dans une autre unité, quand j'appelle mes fonctions :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 unit fonctions; interface uses SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs, StrUtils; type TForm_fonctions = class(TForm) function FormatFBDate(data : String) : String; function MagicQuote(data : String) : String; private public end; var Form_fonctions: TForm_fonctions; implementation function TForm_fonctions.FormatFBDate(data : String) : String; begin ... end; function TForm_fonctions.MagicQuote(data : String) : String; begin ... end; end.
j'ai le message suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 chaine := TForm_fonctions.FormatFBDate(MskEdt_cliDtNasc.Text);
Quelqu'un peut-il m'aider ?[Erreur] U_menu.pas(1024): Forme d'appel de méthode autorisée seulement pour les méthodes de classes
Cyril
Partager