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=12468)

im_zorg 06.05.2010 07:39

Вырезание из произвольной строки значения переменных...
 
PHP код:

for i:=0 to Length(msg)-do
 
begin
 
if GetChar(msg,i)=',' then m:=i;
 if 
GetChar(msg,i)='`' then j:=i;
 if 
GetChar(msg,i)='¬' then n:=i;
 if 
GetChar(msg,i)='o' then z:=i;
 if 
GetChar(msg,i)='i' then l:=i;
 if 
GetChar(msg,i)='p' then k:=i;
 if 
GetChar(msg,i)='q' then q:=i;
 if 
GetChar(msg,i)=';' then q:=i;
 
end;
 
botx:=stringtointeger(Copy(msg,0,m));
 
boty:=stringtointeger(Copy(msg,m+1,j));
 
botdir:=stringtointeger(Copy(msg,j+1,n));
 
botframe:=stringtointeger(Copy(msg,n+1,z));
 
Shotb.X:=stringtointeger(Copy(msg,z+1,l));
 
Shotb.X:=stringtointeger(Copy(msg,l+1,k));
 if 
stringtointeger(Copy(msg,k+1,q))=1 then shotb.alive:=true else shotb.alive:=false

вот так я вырезал но почему то последнии Shotb.X и shotb.alive вырезаются неправильно.
PHP код:

if shot.alive=true then alive:=else alive:=0;
bt.send_message(''+integertostring(x)+','+integertostring(y)+'`'+integertostring(pldir)+'¬'+integertostring(plframe)+'o'+integertostring(Shot.X)+'i'+integertostring(Shot.Y)+'p'+integertostring(alive)+'q;'); 

вот так отправляю строку с переменными... Есть ли нормальный способ???

im_zorg 06.05.2010 10:15

Ответ: Вырезание из произвольной строки значения переменных...
 
delete....


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

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