SRL Archive - OSR Help

TStrings ?


bbri06

2010-06-07 19:14:43

I'm trying to use

List1.Items.AddStrings
but that accepts a type called TStrings. What is this type? I figured it might just be like a TStringArray, but SetLength doesn't work with TStrings and gives me the error

Error: Could not call proc at line 63

Awkwardsaw

2010-06-07 19:22:05

your using parameters with addstrings right?

bbri06

2010-06-07 19:26:21

Yes, I'm using parameters. I'm calling a function that is supposed to return TStrings;

Nava2

2010-06-07 19:42:17

TStrings is a container for a TStringArray..

I would suggest just using a TStringArray and a for loop with the .add() method.

Or, you might be able to use a TStrings object, but I doubt it.

bbri06

2010-06-07 20:37:59

It's working, thanks Nava.

smurg

2012-01-06 00:24:32

From: Nava2
TStrings is a container for a TStringArray..

I would suggest just using a TStringArray and a for loop with the .add() method.

Or, you might be able to use a TStrings object, but I doubt it.


Gravedig, but I need help and this thread is perfect.

Trying to retrieve values now from the listbox. Question is how?

Why is there no documentation anywhere?

Brandon

2012-01-06 00:59:49

From: smurg
Gravedig, but I need help and this thread is perfect.

Trying to retrieve values now from the listbox. Question is how?

Why is there no documentation anywhere?


writeln(ListBox.ITEMS.GetText);

OR if you want to store it then:



//Initform....
List1.ONENTER := @ListItems;

Procedure ListItems(Sender: TObject);
var
I: Integer;
Meh: TStringArray;
begin
SetLength(Meh, 3);
For I:= 0 To (List1.ITEMS.Count - 1) do
Meh[I] := List1.ITEMS.Strings[I];

writeln(Meh);
end;

smurg

2012-01-06 01:34:29

From: ggzz
writeln(ListBox.ITEMS.GetText);

OR if you want to store it then:


Simba Code:
[LEFT]//Initform….
List1.ONENTER := @ListItems;

Procedure ListItems(Sender: TObject);
var
I: Integer;
Meh: TStringArray;
begin
SetLength(Meh, 3);
For I:= 0 To (List1.ITEMS.Count - 1) do
Meh := List1.ITEMS.Strings;

writeln(Meh);
end;
[/LEFT]



Thanks, my Ctrl + Space was acting up on me.