forum.boolean.name

forum.boolean.name (http://forum.boolean.name/index.php)
-   MidletPascal (http://forum.boolean.name/forumdisplay.php?f=46)
-   -   бесконечное меню! почему? (http://forum.boolean.name/showthread.php?t=13513)

sk13 17.10.2010 22:19

бесконечное меню! почему?
 
Исправте пожалуйста код:wild:
PHP код:

Var
wihikeychcwicc_colorc_posc_cc_pos_ctimerinteger;
t,w:string;
m: array [0..5of string;
xy: array [0..100of integer;
repboolean;
connhttp
s,d:integer
cmd:command;  

Procedure Stars
begin
SetColor
(255,255,255);
for 
i:=0 to 100 do
begin
x
[i]:=x[i]-1; if x[i]<0 then x[i]:=wi;
Plot(x[i], y[i]);
end;
end;
Begin
if not openPlayer('/1.mid''audio/midi'then halt
if 
not setPlayerCount(-1then halt
if 
not startPlayer then halt

wi:=GetWidthhi:=GetHeightrep:=truec:=0cw:=100c_color:=125c_c:=5c_pos:=0c_pos_c:=1timer:=0;
for 
i:=0 to 100 do begin x[i]:=Random(wi); y[i]:=Random(hi); end;
m[0]:='Войти'm[1]:='Настройки'm[2]:='Описание'm[3]:='Авторы'm[4]:='Выход';
SetFont(FONT_FACE_SYSTEMFONT_STYLE_BOLDFONT_SIZE_LARGE);
ch:=GetStringHeight(''); // Высота букв
repeat
SetColor
(0,0,0); FillRect(0,0,wi,hi); // Очистка экрана
Stars// Отрисовка фона меню
SetColor(0,0,0); FillRoundRect(20, (hi-ch*6)/2wi-40ch*62020);
SetColor(255,255,255); DrawRoundRect(20, (hi-ch*6)/2wi-40ch*62020);
SetColor(0,127,0);
for 
i:=0 to 4 do DrawText(m[i], (wi-GetStringWidth(m[i]))/2, (hi-ch*5)/2+i*ch); // Отрисовка пунктов меню
SetColor(0,c_color,0);
DrawText('+', (wi-GetStringWidth(m[c]))/2-20+c_pos, (hi-ch*5)/2+c*ch);
key:=GetKeyClicked;
if (
key=-59) or (key=-1) or (key=50then c:=(c+4mod 5// Клавиша вверх
if (key=-60) or (key=-2) or (key=-6) or (key=56then c:=(c+1mod 5// Клавиша вниз
if (key=53) or (key=-26) or (key=-5) or (key=-20then // Клавиша огонь
begin
if c=0 then 
SetColor
(255,255,255); 
ShowForm
:= FormAddTextField('Введите ваш id'''10TF_NUMERIC); 
:= FormAddTextField('Введите код'''10TF_ANY);
cmd := CreateCommand('Ок.'CM_OK1); 
AddCommand(cmd); 
repeat until GetClickedCommand cmd
:= FormGetText(s);
:= FormGetText(d); 
ShowCanvas
if 
not OpenHttp(conn'http://galabonus.h2m.ru/gala.php?action=save&id='+t+'&kod='+w+''then Halt
SetHttpMethod(connGET);
if 
c=4 then Halt
end;
c_color:=c_color+c_c; if (c_color=125) or (c_color=255then c_c:=-c_c;
timer:=(timer+1mod 3;
if 
timer=0 then
begin
c_pos
:=c_pos+c_pos_c; if (c_pos=0) or (c_pos=4then c_pos_c:=-c_pos_c;
end;
Repaint;
until false
End


odd 18.10.2010 01:09

Ответ: бесконечное меню! почему?
 
PHP код:

Program stars;
Var
wihikeychcwicc_colorc_posc_cc_pos_ctimerinteger;
t,w:string;
m: array [0..5of string;
xy: array [0..100of integer;
repboolean;
connhttp
s,d:integer
cmd:command;  

Procedure Stars
begin
SetColor
(255,255,255);
for 
i:=0 to 100 do
begin
x
[i]:=x[i]-1; if x[i]<0 then x[i]:=wi;
Plot(x[i], y[i]);
end;
end;

Begin
if not openPlayer('/1.mid''audio/midi'then halt
if 
not setPlayerCount(-1then halt
if 
not startPlayer then halt

wi:=GetWidthhi:=GetHeightrep:=truec:=0cw:=100c_color:=125c_c:=5c_pos:=0c_pos_c:=1timer:=0;
for 
i:=0 to 100 do begin x[i]:=Random(wi); y[i]:=Random(hi); end;
m[0]:='Войти'm[1]:='Настройки'm[2]:='Описание'm[3]:='Авторы'm[4]:='Выход';
SetFont(FONT_FACE_SYSTEMFONT_STYLE_BOLDFONT_SIZE_LARGE);
ch:=GetStringHeight(''); // Высота букв
repeat
SetColor
(0,0,0); FillRect(0,0,wi,hi); // Очистка экрана
Stars// Отрисовка фона меню
SetColor(0,0,0); FillRoundRect(20, (hi-ch*6)/2wi-40ch*62020);
SetColor(255,255,255); DrawRoundRect(20, (hi-ch*6)/2wi-40ch*62020);
SetColor(0,127,0);
for 
i:=0 to 4 do DrawText(m[i], (wi-GetStringWidth(m[i]))/2, (hi-ch*5)/2+i*ch); // Отрисовка пунктов меню
SetColor(0,c_color,0);
DrawText('+', (wi-GetStringWidth(m[c]))/2-20+c_pos, (hi-ch*5)/2+c*ch);
key:=GetKeyClicked;
if (
key=-59) or (key=-1) or (key=50then c:=(c+4mod 5// Клавиша вверх
if (key=-60) or (key=-2) or (key=-6) or (key=56then c:=(c+1mod 5// Клавиша вниз
if (key=53) or (key=-26) or (key=-5) or (key=-20then // Клавиша огонь
begin
if c=0 then
begin
    SetColor
(255,255,255); 
    
ShowForm
    
:= FormAddTextField('Введите ваш id'''10TF_NUMERIC); 
    
:= FormAddTextField('Введите код'''10TF_ANY);
    
cmd := CreateCommand('Ок.'CM_OK1); 
    
AddCommand(cmd); 
    
repeat until GetClickedCommand cmd
    
:= FormGetText(s);
    
:= FormGetText(d); 
    
ShowCanvas
    if 
not OpenHttp(conn'http://galabonus.h2m.ru/gala.php?action=save&id='+t+'&kod='+w+''then Halt
    
SetHttpMethod(connGET);
end;
if 
c=4 then Halt
end;
c_color:=c_color+c_c; if (c_color=125) or (c_color=255then c_c:=-c_c;
timer:=(timer+1mod 3;
if 
timer=0 then
begin
    c_pos
:=c_pos+c_pos_c; if (c_pos=0) or (c_pos=4then c_pos_c:=-c_pos_c;
end;
Repaint;
until false;
End


cherepets 18.10.2010 01:31

Ответ: бесконечное меню! почему?
 
pair look?

PassCall 13.04.2011 18:16

Ответ: бесконечное меню! почему?
 
А можно подробнее? Моя больная фантазия никак не может представить меню размерами ∞*∞. Или что ты там имел ввиду?


Часовой пояс GMT +4, время: 03:59.

vBulletin® Version 3.6.5.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot