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

Delphi Sources



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

Ответ
 
Опции темы Поиск в этой теме Опции просмотра
  #1  
Старый 25.01.2012, 16:39
cyber922 cyber922 вне форума
Новичок
 
Регистрация: 07.10.2011
Сообщения: 77
Версия Delphi: Turbo Delphi 20
Репутация: 10
По умолчанию переменные..

делаю программу
тест, но есть в ней ошибка, не пойму как исправить..(ошибка там, где выделенно..)



Код:
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
unit umain;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, ComCtrls, Buttons;
 
type
  TFmain = class(TForm)
    Panel1: TPanel;
    STFIO: TStaticText;
    STWelkome: TStaticText;
    STDATE: TStaticText;
    STTIME: TStaticText;
    TSmain: TPageControl;
    TabSheet1: TTabSheet;
    TSTEst: TTabSheet;
    TSResult: TTabSheet;
    Timer1: TTimer;
    Label1: TLabel;
    Label2: TLabel;
    StaticText1: TStaticText;
    StaticText2: TStaticText;
    BitBtn1: TBitBtn;
    Memo1: TMemo;
    Panel2: TPanel;
    TrackBar1: TTrackBar;
    StaticText3: TStaticText;
    Panel3: TPanel;
    StaticText4: TStaticText;
    STQutest: TStaticText;
    STtimetest: TStaticText;
    Label3: TLabel;
    Label4: TLabel;
    BBStarttest: TBitBtn;
    Panel4: TPanel;
    Memo2: TMemo;
    BByes: TBitBtn;
    BBno: TBitBtn;
    Leotv: TLabeledEdit;
    timer2: TTimer;
    BBnext: TBitBtn;
    Stdatetest: TStaticText;
    Sttimetest2: TStaticText;
    stStud: TStaticText;
    eresexTR: TEdit;
    Edit2: TEdit;
    eresneIR: TEdit;
    eRES: TEdit;
    eTEMP: TEdit;
    BBres: TBitBtn;
    vl: TEdit;
    procedure formShow(Sender: TObject);
    procedure ontimer(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure BBStarttestClick(Sender: TObject);
    procedure timer2Timer(Sender: TObject);
    procedure BBnextClick(Sender: TObject);
    procedure BByesClick(Sender: TObject);
    procedure BBnoClick(Sender: TObject);
    procedure BBresClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
procedure sumbal1(num1:word);
procedure sumbal0(num0:word);
     var
  Fmain: TFmain;
    Vtime:string;
    Votv:word;
    arotv: array[0..59] of integer;
    i:real;
    f,txt:textfile;
    fPath:string;
    vres:integer;
    Vnevrotizm,Vextr,Vextravert,Vneir,vl,Vtemperament:string;
           implementation
uses Ulogin;
     {$R *.dfm}
<font color="Black"><b>  procedure sumbal1(num1:word);</b></font>
  begin
if arotv[num1] =1 then vres:=vres+1;
       end;
 procedure sumbal0(num0:word);
 begin
if arotv[num0] =0 then vres:=vres+1;
 end;
 
<b><font color="Black"> procedure sumbal1(num1:word);</font></b>
 begin
if arotv [num1] =1 then vres:=vres+1;
 end;
procedure TFmain.BBnextClick(Sender: TObject);
begin
  if leotv= 'да' then arotv[i]:=0;
     I:=i+1;
 end;
 
procedure TFmain.BBnoClick(Sender: TObject);
begin
 Leotv.Text:='нет';
 votv:=1;
end;
 
procedure TFmain.BBresClick(Sender: TObject);
begin
 Vres:=0;
sumbal1(1);
sumbal1(3);
sumbal1(9);
sumbal1(11);
sumbal1(14);
sumbal1(17);
sumbal1(19);
sumbal1(22);
sumbal1(23);
sumbal1(25);
sumbal1(27);
sumbal1(30);
sumbal1(35);
sumbal1(38);
sumbal1(41);
sumbal1(43);
sumbal1(46);
sumbal1(49);
sumbal1(53);
sumbal1(57);
 
sumbal1(6);
sumbal1(33);
sumbal1(51);
sumbal1(55);
sumbal1(59);
 
Vextr:=vres;
 
Vres:=0;
sumbal1(2);
sumbal1(5);
sumbal1(7);
sumbal1(10);
sumbal1(13);
sumbal1(15);
sumbal1(18);
sumbal1(21);
sumbal1(23);
sumbal1(26);
sumbal1(29);
sumbal1(31);
sumbal1(34);  
sumbal1(37);
sumbal1(39); 
sumbal1(42);
sumbal1(45);
sumbal1(50);
sumbal1(54);
sumbal1(58);
sumbal1(60);
vneir:=vres;
 
 Vres:=0;
sumbal1(8);
sumbal1(16);
sumbal1(24);
sumbal1(28);
sumbal1(36);
sumbal1(44);
sumbal1(4);
sumbal1(12);
sumbal1(20);
sumbal1(32);
sumbal1(40);
sumbal1(48);
sumbal1(35);
  Vres:=0;
sumbal1(8);
sumbal1(16);
sumbal1(24);
sumbal1(28);
sumbal1(36);
sumbal1(44);
sumbal1(4);
sumbal1(12);
sumbal1(20);
sumbal1(32);
sumbal1(40);
sumbal1(48);
vres:=vl;
 
 
 if (Vneir<=10)and (Vneir>=0) then  Vnevrotizm:='эмоциональная устуйчивость';
if (Vneir<=20)and (Vneir>=11) then  Vnevrotizm:='Эмоциональная впечатлительность';
 if vneir>20 then Vnevrotizm:='невротизм';
 if (Vneir<=10)and (Vextr>=0) then  Vextravert:='интроверт';
  if vextr>10 then Vextravert:='невротизм';
  if (Vextr<=10)and (Vneir>=10) then  Vtemperament:='Меланхолик';
   if (Vextr<=10)and (Vneir>=10) then  Vtemperament:='Флегматик';
  if (Vextr<=10)and (Vneir>=10) then  Vtemperament:='Холерик';
    if (Vextr<=10)and (Vneir>=10) then  Vtemperament:='Сангвиник';
       ststud.caption:='студент' + flogin.Leuser.text;
       stdatetest.caption:='дата тестирования' +sttimetest.caption;
      eresextr.Text:=inttostr(vextr);
      eresneir.Text:=inttostr (vneir);
    vl.Text:=inttostr(vl);
    etemp.Text:=inttostr(etemp);
       tsMain.ActivePage:=TSResult;
    end;
 
 
procedure TFmain.BBStarttestClick(Sender: TObject);
begin
Vtime:=timetostr(time);
timer2.Enabled:=true;
fpath:=flogin.lefile.text;
assignfile(f,fpath);
reset(f);
Readln(f,txt);
memo1.Text:=txt;
BBstarttest.Enabled:=true;
end;
 
 
 
procedure TFmain.formShow(Sender: TObject);
begin
 stdate.Caption:=datetostr(date);
end;
procedure TFmain.ontimer(Sender: TObject);
begin
sttime.Caption:=timetostr(time);
end;
procedure TFmain.timer2Timer(Sender: TObject);
  begin
Sttimetest.caption:=timetostr (time-strtotime(vtime));
end;
procedure TFmain.BByesClick(Sender: TObject);
begin
 Leotv.Text:='да';
 votv:=1;
end;
end.



ошбки вот такие
Цитата:
[Pascal Error] umain.pas(139): E2010 Incompatible types: 'string' and 'Integer'
[Pascal Error] umain.pas(163): E2010 Incompatible types: 'string' and 'Integer'
[Pascal Error] umain.pas(192): E2010 Incompatible types: 'Integer' and 'TEdit'
[Pascal Error] umain.pas(195): E2010 Incompatible types: 'string' and 'Integer'
[Pascal Error] umain.pas(195): E2010 Incompatible types: 'string' and 'Integer'
[Pascal Error] umain.pas(196): E2010 Incompatible types: 'string' and 'Integer'
[Pascal Error] umain.pas(196): E2010 Incompatible types: 'string' and 'Integer'
[Pascal Error] umain.pas(197): E2010 Incompatible types: 'string' and 'Integer'
[Pascal Error] umain.pas(198): E2010 Incompatible types: 'string' and 'Integer'
[Pascal Error] umain.pas(198): E2010 Incompatible types: 'string' and 'Integer'

Как их сделать так чтоб они подходили к друг другу?

так же прилагаю саму исходник в ,архиве и вопросы для теста.. если кто захочет проверить на наличие ошибок
Вложения
Тип файла: rar Borland Studio Projects.rar (231.0 Кбайт, 3 просмотров)

Последний раз редактировалось cyber922, 25.01.2012 в 16:53.
Ответить с цитированием
  #2  
Старый 25.01.2012, 16:59
g101k g101k вне форума
Прохожий
 
Регистрация: 17.10.2011
Сообщения: 6
Репутация: 10
По умолчанию

Ну вопервых две одинаковых функции
Код:
1
2
3
4
procedure sumbal1(num1:word);
 begin
if arotv [num1] =1 then vres:=vres+1;
 end;

А во вторых весь проект усыпан ошибками не совпадения типов
То строку в число, то число в строку пихается

То из едита сразу же в число...

Последний раз редактировалось g101k, 25.01.2012 в 17:04.
Ответить с цитированием
  #3  
Старый 25.01.2012, 17:10
cyber922 cyber922 вне форума
Новичок
 
Регистрация: 07.10.2011
Сообщения: 77
Версия Delphi: Turbo Delphi 20
Репутация: 10
По умолчанию

Блин, инети глюканул, сообщение внизу..

Последний раз редактировалось cyber922, 25.01.2012 в 17:15.
Ответить с цитированием
  #4  
Старый 25.01.2012, 17:14
cyber922 cyber922 вне форума
Новичок
 
Регистрация: 07.10.2011
Сообщения: 77
Версия Delphi: Turbo Delphi 20
Репутация: 10
По умолчанию

Цитата:
Сообщение от g101k
Ну вопервых две одинаковых функции
Код:
1
2
3
4
procedure sumbal1(num1:word);
 begin
if arotv [num1] =1 then vres:=vres+1;
 end;

А во вторых весь проект усыпан ошибками не совпадения типов
То строку в число, то число в строку пихается

То из едита сразу же в число...

ну так прошу же, помогите исправить, с пояснениями что где и как...

Код:
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
unit umain;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, ComCtrls, Buttons;
 
type
  TFmain = class(TForm)
    Panel1: TPanel;
    STFIO: TStaticText;
    STWelkome: TStaticText;
    STDATE: TStaticText;
    STTIME: TStaticText;
    TSmain: TPageControl;
    TabSheet1: TTabSheet;
    TSTEst: TTabSheet;
    TSResult: TTabSheet;
    Timer1: TTimer;
    Label1: TLabel;
    Label2: TLabel;
    StaticText1: TStaticText;
    StaticText2: TStaticText;
    BitBtn1: TBitBtn;
    Memo1: TMemo;
    Panel2: TPanel;
    TrackBar1: TTrackBar;
    StaticText3: TStaticText;
    Panel3: TPanel;
    StaticText4: TStaticText;
    STQutest: TStaticText;
    STtimetest: TStaticText;
    Label3: TLabel;
    Label4: TLabel;
    BBStarttest: TBitBtn;
    Panel4: TPanel;
    Memo2: TMemo;
    BByes: TBitBtn;
    BBno: TBitBtn;
    Leotv: TLabeledEdit;
    timer2: TTimer;
    BBnext: TBitBtn;
    Stdatetest: TStaticText;
    Sttimetest2: TStaticText;
    stStud: TStaticText;
    eresexTR: TEdit;
    Edit2: TEdit;
    eresneIR: TEdit;
    eRES: TEdit;
    eTEMP: TEdit;
    BBres: TBitBtn;
    vl: TEdit;
    procedure formShow(Sender: TObject);
    procedure ontimer(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure BBStarttestClick(Sender: TObject);
    procedure timer2Timer(Sender: TObject);
    procedure BBnextClick(Sender: TObject);
    procedure BByesClick(Sender: TObject);
    procedure BBnoClick(Sender: TObject);
    procedure BBresClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
procedure sumbal1(num1:word);
procedure sumbal0(num0:word);
     var
  Fmain: TFmain;
    Vtime:string;
    Votv:word;
    arotv: array[0..59] of integer;
    i:real;
    f,txt:textfile;
    fPath:string;
    vres:integer;
    Vnevrotizm,Vextr,Vextravert,Vneir,vl,Vtemperament:string;
           implementation
uses Ulogin;
     {$R *.dfm}
  procedure sumbal1(num1:word);
  begin
if arotv[num1] =1 then vres:=vres+1;
       end;
 procedure sumbal0(num0:word);
 begin
if arotv[num0] =0 then vres:=vres+1;
 end;
procedure TFmain.BBnextClick(Sender: TObject);
begin
  if leotv= 'да' then arotv[i]:=0;
     I:=i+1;
 end;
 
procedure TFmain.BBnoClick(Sender: TObject);
begin
 Leotv.Text:='нет';
 votv:=1;
end;
 
procedure TFmain.BBresClick(Sender: TObject);
begin
 Vres:=0;
sumbal1(1);
sumbal1(3);
sumbal1(9);
sumbal1(11);
sumbal1(14);
sumbal1(17);
sumbal1(19);
sumbal1(22);
sumbal1(23);
sumbal1(25);
sumbal1(27);
sumbal1(30);
sumbal1(35);
sumbal1(38);
sumbal1(41);
sumbal1(43);
sumbal1(46);
sumbal1(49);
sumbal1(53);
sumbal1(57);
 
sumbal1(6);
sumbal1(33);
sumbal1(51);
sumbal1(55);
sumbal1(59);
 
Vextr:=vres;
 
Vres:=0;
sumbal1(2);
sumbal1(5);
sumbal1(7);
sumbal1(10);
sumbal1(13);
sumbal1(15);
sumbal1(18);
sumbal1(21);
sumbal1(23);
sumbal1(26);
sumbal1(29);
sumbal1(31);
sumbal1(34);  
sumbal1(37);
sumbal1(39); 
sumbal1(42);
sumbal1(45);
sumbal1(50);
sumbal1(54);
sumbal1(58);
sumbal1(60);
vneir:=vres;
 
 Vres:=0;
sumbal1(8);
sumbal1(16);
sumbal1(24);
sumbal1(28);
sumbal1(36);
sumbal1(44);
sumbal1(4);
sumbal1(12);
sumbal1(20);
sumbal1(32);
sumbal1(40);
sumbal1(48);
sumbal1(35);
  Vres:=0;
sumbal1(8);
sumbal1(16);
sumbal1(24);
sumbal1(28);
sumbal1(36);
sumbal1(44);
sumbal1(4);
sumbal1(12);
sumbal1(20);
sumbal1(32);
sumbal1(40);
sumbal1(48);
vres:=vl;
 
 
 if (Vneir<=10)and (Vneir>=0) then  Vnevrotizm:='эмоциональная устуйчивость';
if (Vneir<=20)and (Vneir>=11) then  Vnevrotizm:='Эмоциональная впечатлительность';
 if vneir>20 then Vnevrotizm:='невротизм';
 if (Vneir<=10)and (Vextr>=0) then  Vextravert:='интроверт';
  if vextr>10 then Vextravert:='невротизм';
  if (Vextr<=10)and (Vneir>=10) then  Vtemperament:='Меланхолик';
   if (Vextr<=10)and (Vneir>=10) then  Vtemperament:='Флегматик';
  if (Vextr<=10)and (Vneir>=10) then  Vtemperament:='Холерик';
    if (Vextr<=10)and (Vneir>=10) then  Vtemperament:='Сангвиник';
       ststud.caption:='студент' + flogin.Leuser.text;
       stdatetest.caption:='дата тестирования' +sttimetest.caption;
      eresextr.Text:=inttostr(vextr);
      eresneir.Text:=inttostr (vneir);
    vl.Text:=inttostr(vl);
    etemp.Text:=inttostr(etemp);
       tsMain.ActivePage:=TSResult;
    end;
 
`procedure TFmain.BBStarttestClick(Sender: TObject);
begin
Vtime:=timetostr(time);
timer2.Enabled:=true;
fpath:=flogin.lefile.text;
assignfile(f,fpath);
reset(f);
Readln(f,txt);
memo1.Text:=txt;
BBstarttest.Enabled:=true;
end;
 
procedure TFmain.formShow(Sender: TObject);
begin
 stdate.Caption:=datetostr(date);
end;
 
procedure TFmain.ontimer(Sender: TObject);
begin
sttime.Caption:=timetostr(time);
end;
 
procedure TFmain.timer2Timer(Sender: TObject);
  begin
Sttimetest.caption:=timetostr (time-strtotime(vtime));
end;
procedure TFmain.BByesClick(Sender: TObject);
begin
 Leotv.Text:='да';
 votv:=1;
end;
end.
Ответить с цитированием
Ответ


Delphi Sources

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

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

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

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


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


 

Сайт

Форум

FAQ

Соглашения

Прочее

 

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