Autor Beitrag
Regan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: Di 07.08.07 15:08 
Hallo Leute,
ich hab ein sehr schwerwiegendes Problem:
Ich habe folgenden Code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TForm1.FormCreate(Sender: TObject);
var
  Source: TMemoryStream;
  Response: TStringStream;
begin
Response := TStringStream.Create('');
Source := TMemoryStream.Create;
              try
                Source.LoadFromFile(memo3.Text);
                HTTP.Post('http://www.magiccards.info/preferences.html', Source, Response);
              finally
                Source.Free;
              end;
end;
und bekomme dann folgende Fehlermeldung:
Zitat:
[Fehler] magiccardinfo.pas(124): E2003 Undefinierter Bezeichner: 'HTTP'

Warum kommt denn da so ein blöder Fehler?

MfG
Regan

Moderiert von user profile iconTino: Code- durch Quote-Tags ersetzt.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 07.08.07 15:14 
Moin!

Das Objekt mit Namen "HTTP" existiert nicht, du hast es nicht deklariert oder falsch geschrieben - aber sagt der Compiler doch schon... :roll:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Di 07.08.07 15:16 
Ist die Frage jetzt wirklich ernst gemeint? Ich frage weil ich so eine Frage nicht von dir erwartet hätte. :gruebel:

Zu Deiner Frage: Du musst eine Variable mit dem Namen HTTP und dem Typ TIdHTTP definieren und anschl. eine Instanz erzeugen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var
  http : TIdHTTP;
begin
  http := TIdHTTP.Create;
...


Lg, Martin

_________________
Ein Nutzer der Ecke ;-)
Regan Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: Di 07.08.07 15:22 
Das ist jetzt niocht euer Ernst oder? :autsch: :autsch: :oops:
Ich vergrab mich mal lieber in ein Loch. *schaufel

Ich hätte nicht gedacht, dass das so einach ist. OK. Aber das löst mein Problem vollständig. Danke an alle. Und ich dachte immer HTTP ist irgendwo global definiert. Aber das eine function ist....