Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.12.31;
Скачать: CL | DM;

Вниз

запуск из одной процедуры другой процедуры   Найти похожие ветки 

 
FIL-23 ©   (2006-12-10 20:30) [0]

Удалено модератором
Примечание: Если желаешь публиковать абсолютно весь, проект, то размести его где ни будь, а сюда только ссылку, или урезай до приемлемого вида


 
Kostafey ©   (2006-12-10 20:50) [1]

Ошибка не в вызове процедуры, возможно в сомой процедуре или даже вне ее. У меня твой код нормально работает:

unit Unit1;

interface

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

type
TForm1 = class(TForm)
  procedure FormCreate(Sender: TObject);
  procedure FormDestroy(Sender: TObject);
  procedure N2Click(Sender: TObject);
private
  { Private declarations }
  procedure start;
  procedure question_select;
  procedure vars(var variant:integer);
  procedure verno();
public
  { Public declarations }
end;

var
i,a,n,balls,vopr:integer;
dir,dir2,ss,zz,yes:string;
win:tinifile;
mass:array[1..100]of integer;
f1,f2:file of char;
cop:char;
Form1: TForm1;

implementation

procedure tform1.start();
begin

randomize;
for i:=1 to n do mass[i]:=0;
{$i-}
//memo1.Visible:=true;
//radiogroup1.Visible:=true;
{label1.Visible:=true;
an1.Visible:=true;
an2.Visible:=true;
an3.Visible:=true;
an4.Visible:=true;
p1.Visible:=true;
p2.Visible:=false;
p3.Visible:=false;
p4.Visible:=false;
p5.Visible:=false;
label1.Caption:="ia?aue aii?in:";
balls:=0;
label2.Visible:=false; }
assignfile(f1,dir);
assignfile(f2,dir2);
while not eof(f1) do
begin
read(f1,cop);
cop:=chr(ord(cop) xor ord(6));
write(f2,cop);
end;
closefile(f1);
closefile(f2);
{$i+}
win:=tinifile.Create(dir2);
dir:=win.ReadString("num","num",dir);
n:=strtoint(ss);
vopr:=random(4)+1;
vars(vopr);
end;
{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
dir:=extractfilepath(application.ExeName)+"vopros.ini";
dir2:=extractfilepath(application.ExeName)+"vus.ini";
zz:=dir;
start();

end;

procedure tform1.question_select();
label ran;
begin
randomize;
ran:
a:=random(n);
for i:=1 to n do
if mass[i]=a then goto ran;
for i:=1 to n do
if mass[i]=0 then
begin
mass[i]:=a;
break ;
end;

{an1.Checked:=false;
an2.Checked:=false;
an3.Checked:=false;
an4.Checked:=false; }
end;

procedure tform1.verno();
begin
{if an1.Checked then
      if yes=an1.Caption then balls:=balls+1;
if an2.Checked then
      if yes=an2.Caption then balls:=balls+1;
if an3.Checked then
      if yes=an3.Caption then balls:=balls+1;
if an4.Checked then
      if yes=an4.Caption then balls:=balls+1;+}
end;

procedure tform1.vars(var variant:integer);
begin
question_select();
{case variant of
1: begin
      win:=tinifile.Create(dir2);
      memo1.Text:=win.ReadString("Q",inttostr(a),memo1.Text);
      an1.Caption:=win.ReadString("A",inttostr(a),an1.Caption);
      an2.Caption:=win.ReadString("W1",inttostr(a),an2.Caption);
      an3.Caption:=win.ReadString("W2",inttostr(a),an3.Caption);
      an4.Caption:=win.ReadString("W3",inttostr(a),an4.Caption);
      WIN.Free;
      yes:=an1.Caption;
      end;
2: begin
      win:=tinifile.Create(dir2);
      memo1.Text:=win.ReadString("Q",inttostr(a),memo1.Text);
      an1.Caption:=win.ReadString("A",inttostr(a),an1.Caption);
      an2.Caption:=win.ReadString("W1",inttostr(a),an2.Caption);
      an3.Caption:=win.ReadString("W2",inttostr(a),an3.Caption);
      an4.Caption:=win.ReadString("W3",inttostr(a),an4.Caption);
      WIN.Free;
      yes:=an2.Caption;
      end;
3: begin
      win:=tinifile.Create(dir2);
      memo1.Text:=win.ReadString("Q",inttostr(a),memo1.Text);
      an1.Caption:=win.ReadString("A",inttostr(a),an1.Caption);
      an2.Caption:=win.ReadString("W1",inttostr(a),an2.Caption);
      an3.Caption:=win.ReadString("W2",inttostr(a),an3.Caption);
      an4.Caption:=win.ReadString("W3",inttostr(a),an4.Caption);
      WIN.Free;
      yes:=an3.Caption;
      end;
4: begin
      win:=tinifile.Create(dir2);
      memo1.Text:=win.ReadString("Q",inttostr(a),memo1.Text);
      an1.Caption:=win.ReadString("A",inttostr(a),an1.Caption);
      an2.Caption:=win.ReadString("W1",inttostr(a),an2.Caption);
      an3.Caption:=win.ReadString("W2",inttostr(a),an3.Caption);
      an4.Caption:=win.ReadString("W3",inttostr(a),an4.Caption);
      WIN.Free;
      yes:=an4.Caption;
      end;
end;          }
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
assignfile(f2,dir2);
rewrite(f2);
closefile(f2);
end;

procedure TForm1.N2Click(Sender: TObject);
begin
randomize;
dir:=zz;
start();
end;

end.



 
i-am-vladko ©   (2006-12-10 20:56) [2]


> Удалено модератором
> Примечание: Если желаешь публиковать абсолютно весь, проект,
>  то размести его где-нибудь, а сюда только ссылку, или
> урезай до приемлимого вида

исправлено болгарином из Софии



Страницы: 1 вся ветка

Текущий архив: 2006.12.31;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.03 c
9-1140722396
Fenix
2006-02-23 22:19
2006.12.31
Поблемы с DCE. (нет компонента)


2-1165688017
addi
2006-12-09 21:13
2006.12.31
Размеры формы


15-1165856974
Ксардас
2006-12-11 20:09
2006.12.31
Учет входящего инет-трафика?


15-1165855670
Гоблин
2006-12-11 19:47
2006.12.31
MSSQL - посоветуйте книжку


2-1165900931
Babs
2006-12-12 08:22
2006.12.31
Переключение раскладки клавы