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

  • SEARCH
  • Home
  • 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 4612852
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:27:41+00:00 2026-05-22T01:27:41+00:00

I have a record like this: Tcustomer=record Name: string; IDNumber: Integer; IsMarried: boolean; end;

  • 0

I have a record like this:

Tcustomer=record
  Name: string;
  IDNumber: Integer;
  IsMarried: boolean;
end;

And I have a TCustomers_Manager class that stores a list of all the customers. Is it possible to have a procedure like this:

Procedure ChangeCustomer(CustomerIndex: integer; field: string; value);

That sets the value for that specific field. For example:

ChangeCustomer(1, 'Name','John');

How can I implement this?

Update: To clarify, my question is basically in 2 parts:

1) How can I map the field name (in string) to the actual field in record?

2) Is it possible to pass a value that has different types? Or should I pass a single type and type cast it (like passing a string and then using strtoint())

  • 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-05-22T01:27:42+00:00Added an answer on May 22, 2026 at 1:27 am

    I would use TClientDataSet.

    1. Create TClientDataSet with fields ID, Name, etc.
    2. Open Dataset, Fill with InsertRecord or Insert/Post
    3. Find Record with Locate
    4. Use FieldByName(‘FieldName’).Value to access to or change data

    Or you can take any MemoryDataSet component and use it in same way.

    Second way is to convert record to class, declare Fields as published and use SetPropValue.

    If you want to pass any Value you can use Variant. But you have to check types before assign.

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

Sidebar

Related Questions

I have a an XSD that looks like this (roughly) <xs:schema id=Appointment targetNamespace=http://tempuri.org/Record.xsd elementFormDefault=qualified
I have a tree of active record objects, something like: class Part < ActiveRecord::Base
I have a table student like this id | name | zip 1 |
please i have a modified_by column in mysql table with string like this 40,1280825613|40,1280825617
I have a JSON result that contains numerous records. I'd like to show the
I have a DATETIME field. I would like to select all the records that
I have a record set that includes a date field, and want to determine
Let's say that I have a record in the database and that both admin
I have an Access form where each record has some info that is computed
I have a recordset that contains only 1 record but I need to display

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.