IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Delphi Discussion :

Probleme sur une fonction


Sujet :

Delphi

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    76
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 76
    Points : 53
    Points
    53
    Par défaut Probleme sur une fonction
    Bonjour,
    Je viens de créer une fonction mise à jour pour que lorsque une personne face un certain événement cette fonction mette à jour les variables qu’elle contiens.
    Quand j'exécute l'application Delphi s’arrête sur la ligne
    NC_var:= Champ_NC.Text ;
    et pose le curseur juste avant le point avant Text
    Je ne comprend pas en action script pour attribuer ce qui est écrit dans un champ Text a une variable on fait comme cela. Est ce différent en Delphi ?

    voila mon code :
    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
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
     
    unit main;
     
    interface
     
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, xmldom, XMLIntf, msxmldom, XMLDoc, Menus, ComCtrls, TabNotBk,
      StdCtrls;
     
    type
      TForm1 = class(TForm)
        XMLDoc: TXMLDocument;
        Champ_NC: TEdit;
        Champ_PC: TEdit;
        Champ_Adresse1: TEdit;
        Champ_Adresse2: TEdit;
        Champ_CPC: TEdit;
        Champ_VC: TEdit;
        Label1: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        Label4: TLabel;
        Label5: TLabel;
        Label6: TLabel;
      private
        { Private declarations }
      public
        { Public declarations }
      end;
     
    var
      Form1: TForm1;
      NC_var: String ;
      PC_var: String ;
      A1C_var: String ;
      A2C_var: String ;
      CPC_var: Integer ;
      VC_var: String ;
      nom_fichier: String;
     
    implementation
     
    {$R *.dfm}
     
     procedure MiseAjour();
     begin
      NC_var:= Champ_NC.Text ;
      PC_var:= Champ_PC.Text ;
      A1C_var:= Champ_Adresse1.Text ;
      A1C_var:= Champ_Adresse2.Text ;
      CPC_var:= Champ_CPC.Text ;
      VC_var:= Champ_VC.Text ;
      nom_fichier:= NC_var+PC_var;
     end;
    end;

  2. #2
    Expert confirmé
    Avatar de anapurna
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mai 2002
    Messages
    3 434
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Mai 2002
    Messages : 3 434
    Points : 5 846
    Points
    5 846
    Par défaut
    salut

    normal ton champs appartient à une forme
    il faut que ta mehode appartienne a cette forme pour qu'il puisse acceder au composant

    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
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    unit main;
     
    interface
     
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, xmldom, XMLIntf, msxmldom, XMLDoc, Menus, ComCtrls, TabNotBk,
      StdCtrls;
     
    type
      TForm1 = class(TForm)
        XMLDoc: TXMLDocument;
        Champ_NC: TEdit;
        Champ_PC: TEdit;
        Champ_Adresse1: TEdit;
        Champ_Adresse2: TEdit;
        Champ_CPC: TEdit;
        Champ_VC: TEdit;
        Label1: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        Label4: TLabel;
        Label5: TLabel;
        Label6: TLabel;
      private
        { Private declarations }
        procedure MiseAjour();
      public
        { Public declarations }
      end;
     
    var
      Form1: TForm1;
      NC_var: String ;
      PC_var: String ;
      A1C_var: String ;
      A2C_var: String ;
      CPC_var: Integer ;
      VC_var: String ;
      nom_fichier: String;
     
    implementation
     
    {$R *.dfm}
     
     procedure TForm1.MiseAjour();
     begin
      NC_var:= Champ_NC.Text ;
      PC_var:= Champ_PC.Text ;
      A1C_var:= Champ_Adresse1.Text ;
      A1C_var:= Champ_Adresse2.Text ;
      CPC_var:= Champ_CPC.Text ;
      VC_var:= Champ_VC.Text ;
      nom_fichier:= NC_var+PC_var;
     end;
    end;
    @+ Phil

Discussions similaires

  1. demande de conseille pour un probleme sur une fonction
    Par pierre-y dans le forum Général Python
    Réponses: 4
    Dernier message: 19/12/2012, 11h34
  2. Probleme sur une fonction
    Par phoenix345 dans le forum Windows Forms
    Réponses: 1
    Dernier message: 17/10/2010, 18h54
  3. Probleme sur une fonction
    Par Poisson59 dans le forum MS SQL Server
    Réponses: 5
    Dernier message: 11/12/2006, 17h23
  4. Probleme sur une fonction vérif
    Par PrinceMaster77 dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 29/10/2004, 13h25
  5. Probleme de pointeur sur une fonction
    Par nicky78 dans le forum C
    Réponses: 2
    Dernier message: 23/05/2004, 20h26

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo