Solved

Macro Substitution

Posted on 1997-05-30
1
647 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 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

10 Experts available now in Live!

Get 1:1 Help Now