Показать сообщение отдельно
Старый 12.10.2009, 10:44   #1
demon112
Знающий
 
Регистрация: 18.03.2009
Сообщений: 223
Написано 10 полезных сообщений
(для 17 пользователей)
Помогите упростить алгоритм...

в общем у мя есть такая строка line:='q'+HpPlayer+'i'+'w'+XPlayer+'i'+'e'+YPlayer +'i'+'r'+AlfaPlayer+'i'+'.';

мне из неё надо переменные. Я делаю так:
 repeat
 line1:=getChar(line, x);
 
 if line1='q' then
   begin
   y:=x;
   x:=x+1;
   repeat
   y:=y+1;
   line1:=getChar(line, y);
   until line1='i';
   HpPlayer:=StringToInteger(copy(line, x, y));
   x:=y;
   end;
 
  if line1='w' then
   begin
   y:=x;
   x:=x+1;
   repeat
   y:=y+1;
   line1:=getChar(line, y);
   until line1='i';
   XPlayer:=StringToInteger(copy(line, x, y));
   x:=y;
   end;
 
  if line1='e' then
   begin
   y:=x;
   x:=x+1;
   repeat
   y:=y+1;
   line1:=getChar(line, y);
   until line1='i';
   YPlayer:=StringToInteger(copy(line, x, y));
   x:=y;
   end;
 
  if line1='r' then
   begin
   y:=x;
   x:=x+1;
   repeat
   y:=y+1;
   line1:=getChar(line, y);
   until line1='i';
   AlfaPlayer:=StringToInteger(copy(line, x, y));
   x:=y;
   end;
  x:=x+1;
 until line1='.';
кто нить может облегчить алгоритм? а то мне расшифрововать надо много и быстро...
__________________
И суслики вам не помогут
(Offline)
 
Ответить с цитированием