Autor Beitrag
MDX
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 18.05.08 19:40 
Ich habe ein Problem mit AppDir

Mein Delphi-Programm erkennt das nicht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.FormCreate(Sender: TObject);
var
AppDir: String;
begin
ShockwaveFlash1.Movie:=appdir+'flvaplayer.swf';
label1.caption:=appdir;
end;


Das Label1 ist leer...

Delphi: Delphi 7
Windows: Windows Vista Home Premium
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 18.05.08 19:50 
Ist bei deinem Code auch irgendwie logisch - du deklarierst eine Variable, weist ihr keinen Wert zu und verwendest sie dann. Klar, dass die leer ist :roll:

AXMD
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 18.05.08 20:06 
AppDir ist doch eine Standard Variable oder nicht???

Wie muss ich es denn sonst machen?
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 18.05.08 20:09 
Ich habe momentan kein Delphi installiert, glaube mich aber erinnern zu können, dass du bezüglich der "Standardvariable" Recht hast. Daher einfach deine Deklaration davon entfernen, da diese lokale Gültigkeit besitzt und das globale AppDir damit überdeckt.

AXMD
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 18.05.08 20:21 
Geht aber trotzdem nicht...
Silas
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 478

Windows XP Home
Delphi 2005, RAD Studio 2007, MASM32, FASM, SharpDevelop 3.0
BeitragVerfasst: So 18.05.08 20:27 
N'Abend,

nein, AppDir ist keine Standardvariable. Du kannst stattdessen ExtractFilePath(Application.ExeName) oder ExtractFilePath(ParamStr(0)) verwenden.

_________________
Religionskriege sind nur Streitigkeiten darüber, wer den cooleren imaginären Freund hat ;-)
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 18.05.08 20:30 
user profile iconSilas hat folgendes geschrieben:
N'Abend,

nein, AppDir ist keine Standardvariable. Du kannst stattdessen ExtractFilePath(Application.ExeName) oder ExtractFilePath(ParamStr(0)) verwenden.



Hi, Danke
benutze jetzt ExtractFilePath(ParamStr(0))!!!

THX