Solved

Macro Substitution

Posted on 1997-05-30
1
651 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
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

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

26 Experts available now in Live!

Get 1:1 Help Now