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
Solved

Macro Substitution

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 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