Results 1 to 3 of 3

Thread: About TClassList

  1. #1

    About TClassList

    Studying TClassList yesterday, thisd may be a stupid question. There's not much info to find on the net.
    but how can I access and change a class in the list?


    [pascal]
    type
    TTest = Class

    //

    end;

    var
    Test1 : TTest;
    TestList : TClassList;

    [/pascal]

    setup and creating items in the TClassList are OK.
    But- items of TClassList are of TClass, so how can I f.e. assign test1 to an item of the list.
    Marmin^.Style

  2. #2

    About TClassList

    You can't. TClass refers to a type. TClassList holds a list of types, not instances
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #3

    About TClassList

    It's a bit confusing at first. Basically, a TClass isn't an object, it's the object's type. It's a pointer to the RTTI for that class, and it's useful for a lot of high-level object-oriented work. If you want to put objects into a list, use a TObjectList.

Bookmarks

Posting Permissions

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