PDA

View Full Version : Concatenating a string variable to a pointer varia


ABC123

Everett Sheldon
02-15-2005, 10:17 AM
I am using a script found on this wonderful messageboard to export memo fields to a text file so I can import them into a MS Access database. The xbasic script is running properly, my only complaint is I want to input a string variable and concatenate it to a pointer variable and I can not get it to work.

while .not. tbl.fetch_eof()

report = alltrim(tbl.cr)

Tbl is the pointer to the table. Cr is the fieldname in the table who's data gets assigned to the variable report. What I want to do is not have to hard code the fieldname, but get it via a ui_get_text box and then concatenate them together. What I get so far is "tbl.cr" in the resulting txt file where I want the data in that field. I know someone on this message board can help and I thank you very much.
Everett

Stan Mathews
02-15-2005, 10:41 AM
From the interactive editor.....

tbl = table.open("dcinv")
? tbl.Dccode
= 110020.000000

myvar = "Dccode"
? eval("tbl."+myvar)
= 110020.000000

Everett Sheldon
02-16-2005, 06:13 AM
BEAUTIFUL!!!!! Thank you so much Stan. The eval() function did it for me. I was concatenating fine just not getting the value I wanted. Thanks again
Everett