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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

resolving a variable which contains a fieldname

Status
Not open for further replies.

bdenson

Programmer
Dec 12, 2001
14
GB
I have a program which populates a list with the names of the fields in the selected table.

Once the user selects a field, I now know which field he wants to work on, but how can I interrogate the contents of that field.

For example. user selects GENDER field.

THISFORM.mylist.value = "GENDER"

How can I count the number of empty GENDER fields, when all I have is THISFORM.mylist.value?

BTW I am an experienced programmer, but new to Visual FoxPro (V6). I.E. I will understand programming concepts, but don't assume I automatically know some foxpro quirks!

Thanks

Barry@2020dml.com
 
Hi Barry,

Try something like:

fieldname = THISFORM.mylist.value
COUNT FOR EMPTY(&fieldname)

Jim
 
Hi,
& is a macro code i VFP.

If Temp = "Test"
a="temp"
Then...
? &a ......... will diplay "TEST"
? EVAL(a) .... will display "TEST"
? (a)......... will display "temp"

So dpending on situation, you can use & or EVAL

I am providing lttle more explanation to what Jim wrote. I agree with the code Jim provided....
fieldname = THISFORM.mylist.value
COUNT FOR EMPTY(&fieldname)

:) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Thanks Guys!

Problem solved now!

Thanks again

Barry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top