Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Field from a variable 1

Status
Not open for further replies.

DaBuzz

Programmer
Nov 8, 2002
40
US
I need to calculate a value from a field where I call the field from a variable name.

Field name = Ded4amt
Ded4amt = 100

variable m.fieldname="Ded4amt"

TotalVal=m.fieldname

TotalVal should equal 100, I know the above syntax creates TotalVal="Ded4amt" I can't remember how to get 100 into TotalVal.

Thanks for any help with assistance in overcoming my lack of remembrance - I know I've done this a long time ago.....
 
i think it should look like this:
Code:
Ded4amt = 100
myfieldname="Ded4amt"
TotalVal=&myfieldname
?totalval
hope this helps. peace! [peace]

kilroy [trooper]
philippines

"If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get one million miles to the gallon, and explode once a year, killing everyone inside."
 
The EVAL() command is at least twice as fast as the "&" macrosubstitution and can be used in most (but not all) of the places where you can use "&".
Code:
REPLACE Ded4amt WITH 100
m.fieldname="Ded4amt"
TotalVal=EVAL(m.fieldname)
dbMark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top