Solved

Macro Substitution

Posted on 1997-05-30
1
667 Views
Last Modified: 2012-05-04
How can I pass function names into a variable then
execute the variable.  Here's a Foxpro example of what
I need to do:
Function test;
cval='test'
&cval  -- This line executes the fuction test.
I'm storing serveral different function names within a database
field.  I need to pass the function into a delphi variable and
have the function processed.  Some of the values passed in
may look like this
  function1(abc) AND function2(xyz,123)
I would place it in a variable such as:
cval = 'function1(abc) AND function2(xyz,123)'
then execute the line like so:
if &cval then........
This is how it works in Fox.  If Delphi cannot support
syntax similar to Fox, perhaps there is a component that
I can store the information into a property and the
component executes that macro property.
Component DDEclientconv is close but isn't what I'm
looking for.    I could really use some help.   Thank you.
  -Paul      pwatnes@ix.netcom.com




0
Comment
Question by:pwatnes
[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
1 Comment
 

Accepted Solution

by:
arnoldu earned 200 total points
ID: 1336692
I think we have solved the problem you describe. What we actually did is we wrote a parser for evaluating any formular expression using the pascal version of lex / yacc, generated some routines to add access to variables and built up a unit which does nearly anything an expression can contain and which is easily expandable. If you accept this for an answer I can send you the source code in pascal and the lex- and yaccstuff.

//Arnold
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

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 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