Автор: fatfaldog
Дата сообщения: 11.10.2006 13:07
Никто не знает в чём проблема?
При попытке использовать FloatToStr или StrToFloat компилятор выдаёт ошибку: undeclared identifier: FloatToStr;
Использую Борланд Делфи 8. На 6 и 7 вроде всё нормально работало... Или я после C++ что-то забыл....
Если кому нужно, то вот текст программы(вторая процедура снизу):
[more]unit Kalkul;
interface
uses
System.Drawing, System.Collections, System.ComponentModel,
System.Windows.Forms, System.Data;
type
TKalkul = class(System.Windows.Forms.Form)
{$REGION 'Designer Managed Code'}
strict private
/// <summary>
/// Required designer variable.
/// </summary>
Components: System.ComponentModel.Container;
chislo1: System.Windows.Forms.TextBox;
chislo2: System.Windows.Forms.TextBox;
RadioButton1: System.Windows.Forms.RadioButton;
RadioButton2: System.Windows.Forms.RadioButton;
resbox: System.Windows.Forms.RichTextBox;
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;
CheckBox1: System.Windows.Forms.CheckBox;
Button9: System.Windows.Forms.Button;
Button7: System.Windows.Forms.Button;
Button10: System.Windows.Forms.Button;
Button11: System.Windows.Forms.Button;
Button12: System.Windows.Forms.Button;
Button8: System.Windows.Forms.Button;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure InitializeComponent;
procedure kalkprost;
procedure Button1_Click(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(TKalkul))]
var
a:real;
dei: char;
implementation
{$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 TKalkul.InitializeComponent;
begin
Self.chislo1 := System.Windows.Forms.TextBox.Create;
Self.chislo2 := System.Windows.Forms.TextBox.Create;
Self.RadioButton1 := System.Windows.Forms.RadioButton.Create;
Self.RadioButton2 := System.Windows.Forms.RadioButton.Create;
Self.resbox := System.Windows.Forms.RichTextBox.Create;
Self.Button1 := System.Windows.Forms.Button.Create;
Self.Button2 := System.Windows.Forms.Button.Create;
Self.Button3 := System.Windows.Forms.Button.Create;
Self.Button4 := System.Windows.Forms.Button.Create;
Self.Button5 := System.Windows.Forms.Button.Create;
Self.CheckBox1 := System.Windows.Forms.CheckBox.Create;
Self.Button9 := System.Windows.Forms.Button.Create;
Self.Button7 := System.Windows.Forms.Button.Create;
Self.Button10 := System.Windows.Forms.Button.Create;
Self.Button11 := System.Windows.Forms.Button.Create;
Self.Button12 := System.Windows.Forms.Button.Create;
Self.Button8 := System.Windows.Forms.Button.Create;
Self.SuspendLayout;
//
// chislo1
//
Self.chislo1.Location := System.Drawing.Point.Create(40, 32);
Self.chislo1.Name := 'chislo1';
Self.chislo1.Size := System.Drawing.Size.Create(88, 20);
Self.chislo1.TabIndex := 0;
Self.chislo1.Text := '';
//
// chislo2
//
Self.chislo2.Location := System.Drawing.Point.Create(40, 72);
Self.chislo2.Name := 'chislo2';
Self.chislo2.Size := System.Drawing.Size.Create(88, 20);
Self.chislo2.TabIndex := 1;
Self.chislo2.Text := '';
//
// RadioButton1
//
Self.RadioButton1.Checked := True;
Self.RadioButton1.Location := System.Drawing.Point.Create(140, 35);
Self.RadioButton1.Name := 'RadioButton1';
Self.RadioButton1.Size := System.Drawing.Size.Create(16, 16);
Self.RadioButton1.TabIndex := 2;
Self.RadioButton1.TabStop := True;
Self.RadioButton1.Text := 'RadioButton1';
//
// RadioButton2
//
Self.RadioButton2.Location := System.Drawing.Point.Create(140, 73);
Self.RadioButton2.Name := 'RadioButton2';
Self.RadioButton2.Size := System.Drawing.Size.Create(16, 16);
Self.RadioButton2.TabIndex := 3;
Self.RadioButton2.Text := 'RadioButton2';
//
// resbox
//
Self.resbox.Location := System.Drawing.Point.Create(232, 24);
Self.resbox.Name := 'resbox';
Self.resbox.Size := System.Drawing.Size.Create(104, 72);
Self.resbox.TabIndex := 4;
Self.resbox.Text := 'RichTextBox1';
//
// Button1
//
Self.Button1.Location := System.Drawing.Point.Create(160, 32);
Self.Button1.Name := 'Button1';
Self.Button1.Size := System.Drawing.Size.Create(24, 24);
Self.Button1.TabIndex := 5;
Self.Button1.Text := '+';
Include(Self.Button1.Click, Self.Button1_Click);
//
// Button2
//
Self.Button2.Location := System.Drawing.Point.Create(160, 71);
Self.Button2.Name := 'Button2';
Self.Button2.Size := System.Drawing.Size.Create(24, 24);
Self.Button2.TabIndex := 6;
Self.Button2.Text := 'X';
//
// Button3
//
Self.Button3.Location := System.Drawing.Point.Create(232, 112);
Self.Button3.Name := 'Button3';
Self.Button3.Size := System.Drawing.Size.Create(104, 24);
Self.Button3.TabIndex := 7;
Self.Button3.Text := 'сброс';
//
// Button4
//
Self.Button4.Location := System.Drawing.Point.Create(192, 72);
Self.Button4.Name := 'Button4';
Self.Button4.Size := System.Drawing.Size.Create(24, 24);
Self.Button4.TabIndex := 8;
Self.Button4.Text := '/';
//
// Button5
//
Self.Button5.Location := System.Drawing.Point.Create(192, 32);
Self.Button5.Name := 'Button5';
Self.Button5.Size := System.Drawing.Size.Create(24, 24);
Self.Button5.TabIndex := 9;
Self.Button5.Text := '-';
//
// CheckBox1
//
Self.CheckBox1.Location := System.Drawing.Point.Create(32, 120);
Self.CheckBox1.Name := 'CheckBox1';
Self.CheckBox1.Size := System.Drawing.Size.Create(168, 16);
Self.CheckBox1.TabIndex := 10;
Self.CheckBox1.Text := 'дополнительные функции';
//
// Button9
//
Self.Button9.Location := System.Drawing.Point.Create(24, 144);
Self.Button9.Name := 'Button9';
Self.Button9.Size := System.Drawing.Size.Create(48, 24);
Self.Button9.TabIndex := 14;
Self.Button9.Text := 'sin';
//
// Button7
//
Self.Button7.Location := System.Drawing.Point.Create(88, 144);
Self.Button7.Name := 'Button7';
Self.Button7.Size := System.Drawing.Size.Create(48, 24);
Self.Button7.TabIndex := 15;
Self.Button7.Text := 'cos';
//
// Button10
//
Self.Button10.Location := System.Drawing.Point.Create(24, 176);
Self.Button10.Name := 'Button10';
Self.Button10.Size := System.Drawing.Size.Create(48, 24);
Self.Button10.TabIndex := 17;
Self.Button10.Text := 'sqrt';
//
// Button11
//
Self.Button11.Location := System.Drawing.Point.Create(88, 176);
Self.Button11.Name := 'Button11';
Self.Button11.Size := System.Drawing.Size.Create(48, 24);
Self.Button11.TabIndex := 18;
Self.Button11.Text := 'lg';
//
// Button12
//
Self.Button12.Location := System.Drawing.Point.Create(152, 176);
Self.Button12.Name := 'Button12';
Self.Button12.Size := System.Drawing.Size.Create(48, 24);
Self.Button12.TabIndex := 19;
Self.Button12.Text := 'x^y';
//
// Button8
//
Self.Button8.Location := System.Drawing.Point.Create(152, 144);
Self.Button8.Name := 'Button8';
Self.Button8.Size := System.Drawing.Size.Create(48, 24);
Self.Button8.TabIndex := 20;
Self.Button8.Text := 'tg';
//
// TKalkul
//
Self.AutoScaleBaseSize := System.Drawing.Size.Create(5, 13);
Self.ClientSize := System.Drawing.Size.Create(392, 230);
Self.Controls.Add(Self.Button8);
Self.Controls.Add(Self.Button12);
Self.Controls.Add(Self.Button11);
Self.Controls.Add(Self.Button10);
Self.Controls.Add(Self.Button7);
Self.Controls.Add(Self.Button9);
Self.Controls.Add(Self.CheckBox1);
Self.Controls.Add(Self.Button5);
Self.Controls.Add(Self.Button4);
Self.Controls.Add(Self.Button3);
Self.Controls.Add(Self.Button2);
Self.Controls.Add(Self.Button1);
Self.Controls.Add(Self.resbox);
Self.Controls.Add(Self.RadioButton2);
Self.Controls.Add(Self.RadioButton1);
Self.Controls.Add(Self.chislo2);
Self.Controls.Add(Self.chislo1);
Self.Name := 'TKalkul';
Self.Text := 'WinForm';
Self.ResumeLayout(False);
end;
{$ENDREGION}
procedure TKalkul.Dispose(Disposing: Boolean);
begin
if Disposing then
begin
if Components <> nil then
Components.Dispose();
end;
inherited Dispose(Disposing);
end;
constructor TKalkul.Create;
begin
inherited Create;
//
// Required for Windows Form Designer support
//
InitializeComponent;
//
// TODO: Add any constructor code after InitializeComponent call
//
end;
procedure TKalkul.kalkprost;
begin
resbox.Clear;
resbox.AppendText(chislo1.Text+dei+chislo2.Text+'=');
a:=strtofloat(chislo1.Text);
end;
procedure TKalkul.Button1_Click(sender: System.Object; e: System.EventArgs);
begin
dei:='+';
kalkprost;
end;
end.
[/more]