Autor Beitrag
Blacked
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Di 03.09.02 08:31 
Hidiho,

ich möchte gerne an meine Anwendung bei Aufruf einen Parameter übergeben... tja und hier meine Frage: Wie kann ich den im Programm abrufen und wie muss der Parameter aussehen?!
Muss der Parameter mit "/parameter" geschrieben werden...?
Und das abrufen wird das mit "ParamStr" gemacht?

Bin wie immer für jede Hilfe dankbar.

mfg Blacked :roll:

_________________
Modern programming is a race between the programmer striving to build bigger and better idiotproof programs and the Universe trying to build bigger and better idiots.
So far the Universe is winning.
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Di 03.09.02 09:27 
Hallo,

Programme ausführen tust du per ShellExecute (einfach hier im Forum nach suchen).

Die Parameter deines Programms liest du, wie du richtig erkannt hast, über Paramstr aus. Wie der Parameter an sich aufgebaut ist, ist relativ egal. Du kannst ihn mit / oder - oder auch ohne vorzeichen beginnen lassen. Allerdings ist es sicherlich von vorteil wenn du dich da an etablierte systeme hällst.

Gruß
Klabautermann
Blacked Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Di 03.09.02 09:34 
Mein Problem ist im moment das, das er einfach nicht darauf reagiert wenn ich ihm was übergebe und weis nicht wieso?! Hier mal mein Code, vielleicht ja dem ein oder andere was auf...
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.FormCreate(Sender: TObject);
begin
if LowerCase(ParamStr(0)) <> 'b' then
   begin
   Timer2.Enabled:=true;
   end
else
   begin
   Timer2.Enabled:=false;
   end;
end;


Und aufrufen tuhe ich meine EXE über eine Verknüpfung bei der ich dann einfach ein b hinten anhänge...

mfg Blackced[/code]

_________________
Modern programming is a race between the programmer striving to build bigger and better idiotproof programs and the Universe trying to build bigger and better idiots.
So far the Universe is winning.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Di 03.09.02 09:42 
Hallo Blacked,

ließ Dir noch mal genau das Topic durch welches Klabautermann genannt hat. Dann müsstest Du drauf kommen warum es nicht funktioniert!

Gruß
TINO
Blacked Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Di 03.09.02 09:50 
Upps hatte ich übersehen... allerdings hatte ich es auch schonmal so geschrieben, hatte allerdings einen kleinen Leichtsinnsfehler drinne!

Danke nochmal! :D

mfg Blacked

_________________
Modern programming is a race between the programmer striving to build bigger and better idiotproof programs and the Universe trying to build bigger and better idiots.
So far the Universe is winning.