Модуль "Информация АТ" (часть 12) - getOwnNumbers

Рубрика: Исходники
Среда, 21 апреля 2010 г.
Просмотров: 164
последняя версия: 3.0.9 build 961 beta
от 07 декабря 2007 г.
function TfrmAT_Info.getOwnNumbers: Tstrings;
var
  str, tmp, s: string;
begin
  if not Form1.IsATConnected then exit;

  str:= SendATCommand('AT+CSCS=UCS2');
  if not ((str<>'') and xComPort.ATResult) then exit;
  str:= SendATCommand('AT+CNUM');
  if (str<>'') and xComPort.ATResult
    then begin
         str:= ExtractStr(str, #$D#$A'OK'#$D#$A);
                  RzRichEdit1.SelAttributes.Color:= clBlue;
                  RzRichEdit1.SelAttributes.Style:= [fsBold];
                  RzRichEdit1.Lines.Add(#9 + at_inf_r_text07);
                  RzRichEdit1.SelAttributes.Color:= clBlue;
                  RzRichEdit1.SelAttributes.Style:= [];
                  RzRichEdit1.Lines.Add(#9 + at_inf_r_text08);
         repeat
           tmp:= ExtractStr(str, #$D#$A'+CNUM: ');
           tmp:= ExtractStr(str, #$D#$A);
           // tmp = 'Bez,566,129'
           s:= ExtractStr(tmp, ',');
           tmp:= ExtractStr(tmp, ',');
                  RzRichEdit1.SelAttributes.Color:= clBlack;
                  RzRichEdit1.SelAttributes.Style:= [];
                  RzRichEdit1.Lines.Add(#9 + at_inf_r_text09 + s + '   ' + at_inf_r_text10 + tmp);           
         until str = '';
         RzRichEdit1.Lines.Add(#9 + #13#10);         
         {
          #$D#$A'+CNUM: Bez,566,129'#$D#$A
          #$D#$A'+CNUM: '#$1C'@4<,123,129'#$D#$A
          #$D#$A'+CNUM: '#$15'1<,654,129'#$D#$A
          #$D#$A'OK'#$D#$A
         }
         end;
end;
Rambler's Top100