Autor Beitrag
Zero5
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

Win XP
D7 Ent
BeitragVerfasst: Mo 24.01.05 19:56 
Hi,

ich möchte den String eines Arrays in eine Property umzuwandeln, also:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
//normaler Zugriff
Class1.prop1 := 'test';

//Arrayzugriff
testArr[1] := 'prop1';
Class.testArr[1] := 'test';


quasi müsste man halt den String in Delphi-Code umwandeln.
Unter PHP geht sowas, in Delphi auch ?
Hab mir auch schon mal was zu RTTI angesehen, allerdings ist des net grad so durchsichtig, deshalb, bevor ich mir die Mühe mach, das tiefer einzusteigen, wäre es interessant zu wissen, ob es überhaupt funktioniert.

Crosslink:
www.spotlight.de/zfo...106511621-20603.html

Gruß
Christian

Moderiert von user profile iconAXMD: Delphi-Tags hinzugefügt.
Moderiert von user profile iconGausi: Topic aus Algorithmen, Optimierung und Assembler verschoben am Mi 26.01.2005 um 15:07
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: Mo 24.01.05 19:58 
1.) Für Code generell Delphitags verwenden

2.) Ich versteh nicht, was du eigentlich willst. Was willst du da in Delphicode umwandeln :gruebel:?

AXMD
Zero5 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

Win XP
D7 Ent
BeitragVerfasst: Mo 24.01.05 20:33 
Hi,

1. sorry für die Tags, werd ich mir merken.

2. In meinem Array steht z.B.
Arr[0] = 'Artist';

Mein Klasse mp3 hat auch die Property 'Artist'.
Nun möcht ich über den Inhalt des Arrays auf die
property zugreifen also,
mp3.Arr[0]
steht für
mp3.Artist

Ich hoffe, es ist jetzt rübergekommen, was ich meine

Gruß
Christian

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 25.01.05 22:47 
Siehe www.delphi-forum.de/...t+besitzt_28204.html

Weiterhin GetPropValue und SetPropValue

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Zero5 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

Win XP
D7 Ent
BeitragVerfasst: Mi 26.01.05 23:04 
Titel: Funktioniert jetzt => Danke !
Hi,

danke, hier der Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var
  ppi: PPropInfo;
if ppi <> nil then
  begin
    get := GetStrProp(mp3, 'id3v2Artist');
end;


Gruß
Christian

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt. Ist einfacher so :wink:
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 26.01.05 23:13 
Zero5 hat folgendes geschrieben:
1. sorry für die Tags, werd ich mir merken.
Ich glaube, Du hast das was falsch verstanden. Ich habe in Deinen Postings mal die Delphi-Tags eingefügt. Zitiere oder editiere einen dieser Posts, um zu sehen, wie einfach das ist, Delphi-Sourcecode hier im Forum zu benutzen. :-)

//edit: Ups, da hat Gausi wohl gleichzeitg mit mir moderiert ;-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".