Solved

Property problems

Posted on 1998-06-03
6
146 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

22 Experts available now in Live!

Get 1:1 Help Now