Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Property problems

Posted on 1998-06-03
6
Medium Priority
?
155 Views
Last Modified: 2010-04-06
I have a delphi program that accepts one command line parameter in the format 'propertyname1:propertyvalue1;propertyname2:propertyvalue2;' etc. The idea is that when I launch the program, I can set the values of a chosen objects properties from the comand line. I've stripped the command line down into two arrays, PropertyName[] and PropertyValue[]. What I need to do now is say something along the lines of Form1.graph1.PropertyName[index] := PropertyValue[index]; (which doesn't work!) In javascript there's a function called eval, which would let me construct a command from a string, so I could say eval('form1.graph1.' + PropertyName[index] + ' = PropertyValue[index]'). If PropertyName[index] was set to say, 'title', the command that would be interpreted would be form1.graph1.title = propertyvalue[index].
 Is there a similar command in delphi, or another way to poke the values into the required properties (maybe there's an array of properties i can loop through searching for a name match??)
 any ideas greatly appreciated,
cheers.
0
Comment
Question by:acsmith
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1350011
I have written a unit which I use quite a bit.  It allows you to get & set PUBLISHED properties for any component.

E.g.
SetIntValue(MyComp, GetPropertyIndex(MyComp, 'Width'), 5);

If you'd like me to e-mail it to you, provide your e-mail address.

Cheers,
JB
0
 
LVL 1

Author Comment

by:acsmith
ID: 1350012
yes please, ta very much. my email is acsmith@hewitt.com
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1350013
Hi

I have mailed the unit to you.

Cheers,
JB
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:acsmith
ID: 1350014
excellent! works a treat. cheers jimbob. Can you answer this with an answer so I can award your points??
0
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 400 total points
ID: 1350015
Hi acsmith

Glad that it worked for you.

Cheers,
Dave
0
 
LVL 1

Author Comment

by:acsmith
ID: 1350016
cheers!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question