Форум по Delphi программированию

Delphi Sources



Вернуться   Форум по Delphi программированию > Все о Delphi > [ "Начинающим" ]
Ник
Пароль
Регистрация <<         Правила форума         >> FAQ Пользователи Календарь Поиск Сообщения за сегодня Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
  #1  
Старый 17.05.2010, 23:30
Аватар для dudila
dudila dudila вне форума
Прохожий
 
Регистрация: 14.04.2010
Сообщения: 6
Репутация: 10
Вопрос Помогите устранить ошибку в программе

Код:
unit Dudarev_5;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    LabeledEdit1: TLabeledEdit;
    LabeledEdit2: TLabeledEdit;
    LabeledEdit3: TLabeledEdit;
    LabeledEdit4: TLabeledEdit;
    LabeledEdit5: TLabeledEdit;
    procedure LabeledEdit1KeyPress(Sender: TObject; var Key: Char);
    procedure LabeledEdit2KeyPress(Sender: TObject; var Key: Char);
    procedure LabeledEdit3KeyPress(Sender: TObject; var Key: Char);
    procedure LabeledEdit4KeyPress(Sender: TObject; var Key: Char);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
Const m=4;
  type Mre=array [0..m-1] of real;
    var Key:Char;
    A,X,N,dX:real;
    MM,My:Mre;
procedure Inp_Real(Var Symb:Char);
  begin
    If not(Symb in ['0'..'9',',','-',#8])
      then Symb:=#0;
        end;
function otvet(A,X,N:extended):Real;
  begin
    otvet:=A*exp(N*ln(X))+exp(N*ln(X))/(2*A-5);
        end;
procedure Cr_Mx(Var MM:array of Real);
  var i:Byte;
    begin
      MM[0]:=x;
        for i:=1 To m-1 do
          MM[i]:=MM[i-1]+dX;
        end;
procedure Cr_My(MM:array of Real;var My:array of Real);
  var i:Byte;
    begin
      For i:=1 To m-1 do
        My[i]:= otvet(a,MM[i],n)
        end;
procedure TForm1.LabeledEdit1KeyPress(Sender: TObject; var Key: Char);
  begin
  Inp_Real(Key);
        end;
procedure TForm1.LabeledEdit2KeyPress(Sender: TObject; var Key: Char);
  begin
   Inp_Real(Key);
        end;
procedure TForm1.LabeledEdit3KeyPress(Sender: TObject; var Key: Char);
  begin
    Inp_Real(Key);
        end;
procedure TForm1.LabeledEdit4KeyPress(Sender: TObject; var Key: Char);
  begin
    Inp_Real(Key);
        end;
        
procedure TForm1.Button1Click(Sender: TObject);
Var
  i:Byte;
    begin
      LabeledEdit5.EditLabel.Caption:='';
if LabeledEdit1.text<>''
  then A:=StrTofloat(LabeledEdit1.text)
    else
      begin
        ShowMessage('Введите A');
          exit;
            end;
if LabeledEdit2.text<>''
  then X:=StrTofloat(LabeledEdit2.text)
    else
      begin
        ShowMessage('Введите X');
          exit;
            end;
if LabeledEdit3.text<>''
  then N:=StrTofloat(LabeledEdit3.text)
    else
      begin
        ShowMessage('Введите N');
          exit;
            end;
if LabeledEdit4.text<>''
  then dX:=StrTofloat(LabeledEdit4.text)
    else
      begin
        ShowMessage('Введите dX');
          exit;
            end;
    if x<0
  then
    begin
     ShowMessage('x должен быть >0');
          exit;
            end
else            
if ((exp(N*ln(X))>0) and (exp(N*ln(X+dX))>0) and  (exp(N*ln(X+2*dX))>0) and  (exp(N*ln(X+3*dX))>0))
  then
if (a<>2.5)
  then
     begin
        Cr_Mx(MM);
        Cr_My(My,MM);
          For i:=0 to m-1 do
          Labelededit5.EditLabel.Caption:=Labelededit5.EditLabel.Caption + IntToStr(i)+#9+
          FloatToStrF(MM[i],ffGeneral,5,3)+#9+
          FloatToStrF(My[i],ffGeneral,5,3)+#13
        else
          begin
           ShowMessage('Введены недопустимые значения');
            exit;
end;

end.

пишет" 'END' expected but 'else' found "

Помогите устранить ошибку ?пожалуйста!
И если не трудно взгляните правильно ли составлен массив и подскажите как сделать массив с переменным колличеством элементов?
Ответить с цитированием
 


Delphi Sources

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы не можете редактировать сообщения

BB-коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход


Часовой пояс GMT +3, время: 01:04.


 

Сайт

Форум

FAQ

Соглашения

Прочее

 

Copyright © Форум "Delphi Sources" by BrokenByte Software, 2004-2025