![]() |
|
|
|||||||
| Регистрация | << Правила форума >> | FAQ | Пользователи | Календарь | Поиск | Сообщения за сегодня | Все разделы прочитаны |
![]() |
|
|
Опции темы | Поиск в этой теме | Опции просмотра |
|
#1
|
||||
|
||||
|
Не понимаю в чем ошибка:
Код:
const N=14;//количество званий
var
Form1: TForm1;
x1,x2,x3,x4,x5,x6,x7,x8,y,x11,x22,x33,x44,x55,x66,x77,x88,r,
raiting: integer;
golos,akciy,m1,m2,m3,m4,m5,m6,m7,m8,z: real;
Status: array [1..N] of string = ('Новичок','Про','Мастер','Гуру','Легенда',
'Бог','Профессионал','Любимец','Премьер','Эрудит','Monster',
'Знаток','Nooob','Lamer');//Звания
//Icon: array [1..N] of string = ('1.png','2.png','3.png');//картинка
mmop: array [1..2*N] of integer = (0,5,10,15,20,25,50,100,500,1000,5000,10000,
50000,100000);//рамкиКод:
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
op:integer;
begin
Op:=StrToInt(edit1.Text);
for i:=1 to N do //идем по рангам
if Op in [mmop[i*2-1]..mmop[i*2]] then
Label3.caption:=Status[i];
//Img1.picture.loadfromfile(icon[i]);//картинка+текстПоследний раз редактировалось LorDHeLeGaL, 09.04.2012 в 11:15. |
|
#2
|
|||
|
|||
|
Здесь
Код:
mmop: array [1..2*N] of integer = (0,5,10,15,20,25,50,100,500,1000,5000,10000, 50000,100000);//рамки P.S. Указывай номер строки с ошибкой и ее текст, пожалуйста - мы не компиляторы ![]() |
|
#3
|
||||
|
||||
|
Цитата:
[Ошибка] Unit1.pas(115): Number of elements differs from declaration [Фатальная ошибка] Project1.dpr(7): Could not compile used unit '..\5\Unit1.pas' |
|
#4
|
|||
|
|||
|
Человек, откуда я знаю: какая у тебя строка имеет номер 115? У тебя в компиляторе она выделяется как-то, ну и пометь ты ее здесь тоже. Не важно как, главное укажи все места ошибок. Хорошо?
|
|
#5
|
||||
|
||||
|
Цитата:
У меня странность одна Если такой код Код:
var
Form1: TForm1;
Status: array [1..N] of string = ('Начинающий','Мастер','про');//Название статуса
Icon: array [1..N] of string = ('Icon1.png','Icon2.png','Icon3.png');//Картинка,обязятельно формат пнг.ЕСЛИ ДЖИПГ то потключай спец. юнит
mmop: array [1..2*N] of integer = (0,5,6,10,11,15);//рамки
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
op:integer;
begin
Op:=StrToInt(edit1.Text);
for i:=1 to n do //идем по всем рангам
if (Op>=mmop[i*2-1]) and (op<=mmop[i*2]) then
Label3.caption:=Status[i];
Img1.picture.loadfromfile(icon[i]);//грузим текст+картинку
end;А если такой Код:
const N=14;//Кол-во званий
var
Form1: TForm1;
x1,x2,x3,x4,x5,x6,x7,x8,y,x11,x22,x33,x44,x55,x66,x77,x88,r,
raiting: integer;// Переменные
golos,akciy,m1,m2,m3,m4,m5,m6,m7,m8,z: real;
Statys:string;
Status: array [1..N] of string = ('Новичок','Бывалый(ая)','Уважаемый(ая)','Мастер','Профессионал(ка)',
'Гуру','Неприкасаемый(ая)','Папа(Мама)','Ангел','Бог(Богиня)','Всемогущий(ая)',
'Mister(Miss)','Легенда','Премьер');//Iacaaiea caaiey
Icon: array [1..N] of string = ('1.png','2.png','3.png','4.png','5.png','6.png',
'7.png','8.png','9.png','10.png','11.png',
'12.png','13.png','14.png');//Ea?oeiea
mmop: array [1..2*N] of integer = (0,5,6,10,11,15,16,20,21,25,26,50,51,100,101,500,501,1000,1001,
5000,5001,10000,10001,50000,50001,100000,100001,500000);
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
op:integer;
begin
Op:=StrToInt(Edit1.Text);
for i:=1 to N do
if (Op>=mmop[i*2-1]) and (op<=mmop[i*2]) then
Label3.caption:=Status[i];
//Img1.picture.loadfromfile(icon[i]);Последний раз редактировалось LorDHeLeGaL, 09.04.2012 в 12:31. |