Results 1 to 8 of 8

Thread: TStrings ?

  1. #1
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default TStrings ?

    I'm trying to use
    SCAR Code:
    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
    SCAR Code:
    Error: Could not call proc at line 63

  2. #2
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    your using parameters with addstrings right?
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  3. #3
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

  4. #4
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    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.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  5. #5
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's working, thanks Nava.

  6. #6
    Join Date
    Oct 2010
    Posts
    1,255
    Mentioned
    0 Post(s)
    Quoted
    15 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    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?
    I'm back

  7. #7
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by smurg View Post
    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:


    Simba Code:
    //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;
    I am Ggzz..
    Hackintosher

  8. #8
    Join Date
    Oct 2010
    Posts
    1,255
    Mentioned
    0 Post(s)
    Quoted
    15 Post(s)

    Default

    Quote Originally Posted by ggzz View Post
    writeln(ListBox.ITEMS.GetText);

    OR if you want to store it then:


    Simba Code:
    //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;
    Thanks, my Ctrl + Space was acting up on me.
    I'm back

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •