Solved

Macro Substitution

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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses
Course of the Month8 days, 21 hours left to enroll

617 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