Einzelnen Beitrag anzeigen

btbe

Registriert seit: 15. Okt 2004
20 Beiträge
 
#9

Re: daten von gps-maus über Com-Port auslesen

  Alt 10. Nov 2004, 22:52
hm.... hab hier mal n ansatz, um die einzelnen elemente einer zeile in das entsprechende array zu schreiben...
Delphi-Quellcode:
procedure TForm1.ComPortTriggerAvail(CP: TObject; Count: Word);
begin
  { OnTriggerAvail; Read the data }
 for I:= 0 to Count -1 do
     Data := ComPort.GetChar;
   Label2.Caption := Label2.Caption + Data;
 if Data = '*then
  begin
   Memo1.Text := Label2.Caption;
   Label2.Caption := '';
  if pos('GPGGA', Label2.Caption) > 0 then
      begin
          while x < length(Label2.Caption) do
             begin
              if Label2.Caption[x] = ',then
                begin
                 y := y + 1;
                 x := x + 1;
                end
               else
                begin
                 GPGGA[y] := Label2.Caption[x];
                end;
             end;
      end;

 Label1.Caption := Label1.Caption + Data;
 end;
end;
komme aber nicht weiter, da wenn ich ein array ausgeben will, kommt diese Fehlermeldung:
Zitat:
Project Project1.exe raised expection class EAccesViolation with message 'Access violation at adress 004741C4 in module 'Project.exe'. Read of adress 00000001'. Process stopped. Use Step or Run to continue.
Also wenn jemand ne Ahnung hat wie ich hier weiter komme oder einen besseren Ansatz hat bitte so schnell wie möglich melden!

thnx
btbe
  Mit Zitat antworten Zitat