Delphi: Caption on Text label to string array?

[ Delphi Forum -- by DelphiLand ]

Posted by Steve Learn on November 19, 2003 at 05:11:36:

Hi i'm attempting to write a program which takes a word and prints all the permutations for it. I have an algorithm but i'm stuck trying to convert a editbox.text caption to an array.

this is what I have so far:

  Max = 20;
  StringType = packed array [1..Max] of char;
  TheString: Stringtype;
procedure TForm1.StartClick(Sender: TObject);
  mystring: string[max];
  counter : integer;
  mystring := copy(WordEnter.Text,1,1);
  while (length(WordEnter.Text) < MAX) do begin
    counter := counter + 1;
  StringType(counter) :=  mystring(counter);

I enter a word in a text box then should parse each letter into a single array element but I get the invalid typecast error?

If anyone can tell me how to convert text to an array I would be grateful thanks...

Related Articles and Replies:

[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]