Solved

Property problems

Posted on 1998-06-03
6
145 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
  • 3
  • 3
6 Comments
 
LVL 5

Expert Comment

by:JimBob091197
Comment Utility
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
Comment Utility
yes please, ta very much. my email is acsmith@hewitt.com
0
 
LVL 5

Expert Comment

by:JimBob091197
Comment Utility
Hi

I have mailed the unit to you.

Cheers,
JB
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 1

Author Comment

by:acsmith
Comment Utility
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 100 total points
Comment Utility
Hi acsmith

Glad that it worked for you.

Cheers,
Dave
0
 
LVL 1

Author Comment

by:acsmith
Comment Utility
cheers!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now