August 11th, 2004, 12:10 PM
Dynamic Array to Array OR String to Char
Edit : Ok, sorry, I'm stupid, I tried myString and it did not work..... I should have tried myString instead....! Well... I still want to know what would be the best way to solve the "Dynamic Array VS Array" problem.
I am filling some dynamic arrays with a variable number of items (determined at runtime). Some of them are String arrays, one of them is a Char array.
Passing these arrays to :
myFunction(asStrings1 : Array of String; asStrings2 : Array of String; acChars : Array of Char);
I get the following error for the Array of Char argument :
Incompatible types: 'Array' and 'dynamic array'.
How could I pass a Dynamic Array of Char to my fonction?
I thought I could use a String array instead. But I did not find a way to convert my "one character string" to a Char. I did not find a "String.CharAt" fonction in Delphi.
Anyone knows how to solve my "Array and Dynamic Array" or my "String to Char" problem?
August 12th, 2004, 12:28 AM
To pass an array of strings, use a TStringList object instead. As for an array of char, pass a String object instead. Both these objects are dynamic.
myfunction(aStrings1, aStrings2: TStringList; acChars : string);
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
August 13th, 2004, 08:47 AM