Autor Beitrag
Crowbar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 180

WinXP, SP2
D6 Enterprise
BeitragVerfasst: Mi 02.07.03 13:32 
Hallo,

ich möchte mit:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
Procedure TForm1.FormCreate(Sender: TObject);
begin
  if ParamCount > 0 then
    if ParamStr(1) = '/x' then ...;
  ...
end;

...einen Parameter auswerten. Dies funktioniert aus irgendeinem Grund nicht. Es kommt keine Fehlermeldung! Nur, ... wenn ich mein Programm debugge und ich mich auf "ParamCount" befinde, erhalte ich folgende Info: "Nicht verfügbarer Wert" und die Programmzeile wird übersprungen.

Was mache ich falsch?

Tschüss
Crowi

Moderiert von user profile iconTino: Delphi-Tags hinzugefügt.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 02.07.03 13:37 
Also bei mir funktioniert es. Ich hab zum Testen mal folgenden Code benutzt:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.FormCreate(Sender: TObject);
begin
  if ParamCount > 0 then
    Caption := ParamStr(1)
  else
    Caption := '(Leer)';
end;

Versuch mal ob der Parameter auch in der Titelleiste der Anwenung erscheint.

Gruß
Tino
Crowbar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 180

WinXP, SP2
D6 Enterprise
BeitragVerfasst: Mi 02.07.03 14:21 
Hi,
ich habe den Code ausprobiert, aber das "caption" bleibt leer.
Normalerweise klappt es auch, nur scheint bei meinem Programm irgendetwas anders zu sein?.

Tschüss Crowi
Crowbar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 180

WinXP, SP2
D6 Enterprise
BeitragVerfasst: Mi 02.07.03 14:26 
Hi,
jetzt klappt es plötzlich . Wahrscheinlich will mich mein Delphi ärgern.
Trotzdem Danke für die Hilfe.

Tschüss Crowi