Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Clash

strtoint() não funciona?

Recommended Posts

Undeclared identifier: 'strtoint' linha 234. Essa linha: numero1 := strtoint(TextBox1.Text);To usando o Borland Delphi Architect. O Help dele ensina a sintaxe e tenho certezo que tá certo, alguma idéia do que está acontecendo?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Aqui está meu código, obrigado pela ajuda!!

unit WinForm;interfaceuses  System.Drawing, System.Collections, System.ComponentModel,  System.Windows.Forms, System.Data, System.Resources;type  TWinForm = class(System.Windows.Forms.Form)  {$REGION 'Designer Managed Code'}  strict private    /// <summary>    /// Required designer variable.    /// </summary>    Components: System.ComponentModel.Container;    Panel1: System.Windows.Forms.Panel;    TextBox3: System.Windows.Forms.TextBox;    GroupBox1: System.Windows.Forms.GroupBox;    GroupBox2: System.Windows.Forms.GroupBox;    Button1: System.Windows.Forms.Button;    Button2: System.Windows.Forms.Button;    Button3: System.Windows.Forms.Button;    Button4: System.Windows.Forms.Button;    Button5: System.Windows.Forms.Button;    Result1: System.Windows.Forms.Label;    TextBox1: System.Windows.Forms.TextBox;    /// <summary>    /// Required method for Designer support - do not modify    /// the contents of this method with the code editor.    /// </summary>    procedure InitializeComponent;    procedure Button1_Click(sender: System.Object; e: System.EventArgs);    procedure TWinForm_Load(sender: System.Object; e: System.EventArgs);    procedure Panel1_Paint(sender: System.Object; e: System.Windows.Forms.PaintEventArgs);    procedure Button1_Click1(sender: System.Object; e: System.EventArgs);    procedure GroupBox1_Enter(sender: System.Object; e: System.EventArgs);    procedure Button5_Click(sender: System.Object; e: System.EventArgs);    procedure Label1_Click(sender: System.Object; e: System.EventArgs);    procedure Button1_Click2(sender: System.Object; e: System.EventArgs);  {$ENDREGION}  strict protected    /// <summary>    /// Clean up any resources being used.    /// </summary>    procedure Dispose(Disposing: Boolean); override;  private    { Private Declarations }  public    constructor Create;  end;  [assembly: RuntimeRequiredAttribute(TypeOf(TWinForm))]implementation{$AUTOBOX ON}{$REGION 'Windows Form Designer generated code'}/// <summary>/// Required method for Designer support -- do not modify/// the contents of this method with the code editor./// </summary>procedure TWinForm.InitializeComponent;var  resources: System.Resources.ResourceManager;begin  resources := System.Resources.ResourceManager.Create(TypeOf(TWinForm));  Self.Panel1 := System.Windows.Forms.Panel.Create;  Self.Result1 := System.Windows.Forms.Label.Create;  Self.GroupBox1 := System.Windows.Forms.GroupBox.Create;  Self.GroupBox2 := System.Windows.Forms.GroupBox.Create;  Self.Button5 := System.Windows.Forms.Button.Create;  Self.Button4 := System.Windows.Forms.Button.Create;  Self.Button3 := System.Windows.Forms.Button.Create;  Self.Button2 := System.Windows.Forms.Button.Create;  Self.Button1 := System.Windows.Forms.Button.Create;  Self.TextBox1 := System.Windows.Forms.TextBox.Create;  Self.Panel1.SuspendLayout;  Self.GroupBox1.SuspendLayout;  Self.GroupBox2.SuspendLayout;  Self.SuspendLayout;  //   // Panel1  //   Self.Panel1.BackColor := System.Drawing.Color.WhiteSmoke;  Self.Panel1.BorderStyle := System.Windows.Forms.BorderStyle.FixedSingle;  Self.Panel1.Controls.Add(Self.Result1);  Self.Panel1.Location := System.Drawing.Point.Create(8, 16);  Self.Panel1.Name := 'Panel1';  Self.Panel1.Size := System.Drawing.Size.Create(144, 24);  Self.Panel1.TabIndex := 6;  Include(Self.Panel1.Paint, Self.Panel1_Paint);  //   // Result1  //   Self.Result1.Location := System.Drawing.Point.Create(0, 0);  Self.Result1.Name := 'Result1';  Self.Result1.Size := System.Drawing.Size.Create(152, 24);  Self.Result1.TabIndex := 13;  Self.Result1.TextAlign := System.Drawing.ContentAlignment.MiddleLeft;  Include(Self.Result1.Click, Self.Label1_Click);  //   // GroupBox1  //   Self.GroupBox1.Controls.Add(Self.Panel1);  Self.GroupBox1.Location := System.Drawing.Point.Create(8, 8);  Self.GroupBox1.Name := 'GroupBox1';  Self.GroupBox1.Size := System.Drawing.Size.Create(160, 48);  Self.GroupBox1.TabIndex := 11;  Self.GroupBox1.TabStop := False;  Self.GroupBox1.Text := 'Result';  Include(Self.GroupBox1.Enter, Self.GroupBox1_Enter);  //   // GroupBox2  //   Self.GroupBox2.Controls.Add(Self.Button5);  Self.GroupBox2.Controls.Add(Self.Button4);  Self.GroupBox2.Controls.Add(Self.Button3);  Self.GroupBox2.Controls.Add(Self.Button2);  Self.GroupBox2.Controls.Add(Self.Button1);  Self.GroupBox2.Location := System.Drawing.Point.Create(8, 88);  Self.GroupBox2.Name := 'GroupBox2';  Self.GroupBox2.Size := System.Drawing.Size.Create(160, 40);  Self.GroupBox2.TabIndex := 12;  Self.GroupBox2.TabStop := False;  Self.GroupBox2.Text := 'Commands';  //   // Button5  //   Self.Button5.Location := System.Drawing.Point.Create(136, 16);  Self.Button5.Name := 'Button5';  Self.Button5.Size := System.Drawing.Size.Create(16, 16);  Self.Button5.TabIndex := 4;  Self.Button5.Text := '=';  Self.Button5.TextAlign := System.Drawing.ContentAlignment.MiddleRight;  Include(Self.Button5.Click, Self.Button5_Click);  //   // Button4  //   Self.Button4.Location := System.Drawing.Point.Create(104, 16);  Self.Button4.Name := 'Button4';  Self.Button4.Size := System.Drawing.Size.Create(16, 16);  Self.Button4.TabIndex := 3;  Self.Button4.Text := '/';  Self.Button4.TextAlign := System.Drawing.ContentAlignment.MiddleLeft;  //   // Button3  //   Self.Button3.Location := System.Drawing.Point.Create(72, 16);  Self.Button3.Name := 'Button3';  Self.Button3.Size := System.Drawing.Size.Create(16, 16);  Self.Button3.TabIndex := 2;  Self.Button3.Text := 'X';  Self.Button3.TextAlign := System.Drawing.ContentAlignment.MiddleRight;  //   // Button2  //   Self.Button2.Location := System.Drawing.Point.Create(40, 16);  Self.Button2.Name := 'Button2';  Self.Button2.Size := System.Drawing.Size.Create(16, 16);  Self.Button2.TabIndex := 1;  Self.Button2.Text := '-';  Self.Button2.TextAlign := System.Drawing.ContentAlignment.MiddleLeft;  //   // Button1  //   Self.Button1.Location := System.Drawing.Point.Create(8, 16);  Self.Button1.Name := 'Button1';  Self.Button1.Size := System.Drawing.Size.Create(16, 16);  Self.Button1.TabIndex := 0;  Self.Button1.Text := '+';  Self.Button1.TextAlign := System.Drawing.ContentAlignment.MiddleRight;  Include(Self.Button1.Click, Self.Button1_Click2);  //   // TextBox1  //   Self.TextBox1.Location := System.Drawing.Point.Create(8, 64);  Self.TextBox1.Name := 'TextBox1';  Self.TextBox1.Size := System.Drawing.Size.Create(160, 20);  Self.TextBox1.TabIndex := 13;  Self.TextBox1.Text := 'TextBox1';  //   // TWinForm  //   Self.AutoScaleBaseSize := System.Drawing.Size.Create(5, 13);  Self.BackColor := System.Drawing.SystemColors.Control;  Self.ClientSize := System.Drawing.Size.Create(176, 134);  Self.Controls.Add(Self.TextBox1);  Self.Controls.Add(Self.GroupBox2);  Self.Controls.Add(Self.GroupBox1);  Self.Icon := (System.Drawing.Icon(resources.GetObject('$this.Icon')));  Self.Name := 'TWinForm';  Self.Text := 'Calculator';  Include(Self.Load, Self.TWinForm_Load);  Self.Panel1.ResumeLayout(False);  Self.GroupBox1.ResumeLayout(False);  Self.GroupBox2.ResumeLayout(False);  Self.ResumeLayout(False);end;{$ENDREGION}procedure TWinForm.Dispose(Disposing: Boolean);begin  if Disposing then  begin    if Components <> nil then      Components.Dispose();  end;  inherited Dispose(Disposing);end;constructor TWinForm.Create;begin  inherited Create;  //  // Required for Windows Form Designer support  //  InitializeComponent;  //  // TODO: Add any constructor code after InitializeComponent call  //end;procedure TWinForm.Button1_Click2(sender: System.Object; e: System.EventArgs);varnumero1, numero2, next: integer;beginif (next = 1) then  begin  numero1 := strtoint(TextBox1.Text);  next := 2;  end else  begin  numero2 := strtoint(TextBox1.Text);  next := 1;  end;TextBox1.Text := '';end;procedure TWinForm.Label1_Click(sender: System.Object; e: System.EventArgs);beginend;procedure TWinForm.Button5_Click(sender: System.Object; e: System.EventArgs);beginResult1.text := numero1 + numero2;end;procedure TWinForm.GroupBox1_Enter(sender: System.Object; e: System.EventArgs);beginend;procedure TWinForm.Button1_Click1(sender: System.Object; e: System.EventArgs);beginend;procedure TWinForm.Panel1_Paint(sender: System.Object; e: System.Windows.Forms.PaintEventArgs);beginend;procedure TWinForm.TWinForm_Load(sender: System.Object; e: System.EventArgs);beginend;procedure TWinForm.Button1_Click(sender: System.Object; e: System.EventArgs);beginend;end.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Clash,Olha no help a unit que tem esse comando e adiciona ela na seção uses do teu form!espero que isso resolva...Pablo Anízio.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.