Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8592041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:39:36+00:00 2026-06-11T23:39:36+00:00

I am trying to use extented RTTI features This is where i stuck. t

  • 0

I am trying to use extented RTTI features This is where i stuck.

t := (c.FindType('Classes.TStringList') as TRttiInstanceType);
SL := t.GetMethod('Create').Invoke(t.MetaclassType,[]);
t.GetMethod('Add').Invoke(SL,['Hello Do you like my hat?']);
Lines := t.GetProperty('Text').GetValue(SL.AsObject);

Untill now it works fine
Now i want to alter the value

Lines := 'Test';

t.GetProperty('Text').SetValue(**?**,Lines);

What should i give here the TRTTIinstancetype reference or the actual object reference.
If Actual Object reference how will i give that.

TestStringList := t(**how will i get the actual object from this TRTTIinstancetype**).
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:39:37+00:00Added an answer on June 11, 2026 at 11:39 pm

    The Instance parameter of SetValue is exactly the same as the Instance parameter of GetValue. So you simply need to pass exactly what already did when you called GetValue. Namely SL.AsObject:

    t.GetProperty('Text').SetValue(SL.AsObject, Lines);
    

    Regarding the very final part of your question, if you ever need to convert SL into an object with a specific class, TStringList in this case then you can use a runtime cast:

    MyStringList := SL.AsObject as TStringList;
    

    However, doing that rather implies that you don’t need to be using RTTI in the first place. Using the method in the first part of my answer is the RTTI way to do what you ask.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am all very new to this and am trying to use extended hex
I'm trying to use tabs on android 2.2 - 4.0. I've extended this demo:
Trying to use features to deploy custom fields, content type and list. So far
I'm trying to make use of the extended HTML Helper DisplayFor in this View:
I am trying to write a method that I can use in extended classes
I am trying to use a variable to get a function in a extended
i'm trying use facebook API to upload photo in my fan page. I downloaded
I am trying use gem tire to search in my application. I have tables
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.