![]() |
Array mit 2 Strings
Hallo,
ich steh gerade auf dem Schlauch. Ich möcht einen Array, der wie folgt aufgebaut ist:
Delphi-Quellcode:
also ein Array mit 2 Strings.
UpdateListe: array['Monitor_Client.exe', 'Functions.dll'] of String;
Irgendwie bring ich das nicht hin... |
Re: Array mit 2 Strings
Da ich nicht genau weiß ob das Array jetzt nur zwei Elemente enthalten soll, oder pro Element zwei Strings hier die verschiedenen Varianten:
Delphi-Quellcode:
Aufruf wäre so:
type
TMySmallArray = Array[0..1] of String; var fMySmallArray: TMySmallArray;
Delphi-Quellcode:
oder als Record mit den Strings als Feld:
fMySmallArray[0] := 'Test1.exe';
fMySmallArray[1] := 'Test2.exe';
Delphi-Quellcode:
Aufruf wäre so:
type
TStringRecord = record fFeld1, fFeld2: String; end; TStringRecordArraySmall = Array[0..1] of TStringRecord; // Festgelegte Größe von 0 bis 1 TStringRecordArrayDyn = Array of TStringRecord; // Dynamische Größe var fStringRecordArraySmall: TStringRecordArraySmall;
Delphi-Quellcode:
fStringRecordArraySmall[0].fFeld1 := 'Test1.exe';
fStringRecordArraySmall[0].fFeld2 := 'Test2.exe'; |
Re: Array mit 2 Strings
Oder als Konstante:
Delphi-Quellcode:
Grüße vom marabu
const
TwoStrings: array [0..1] of String = ('string1', 'string2'); |
Re: Array mit 2 Strings
Zitat:
Genau das wollte ich machen merci marabu |
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:17 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz