Click to See Complete Forum and Search --> : Dynamically create a database field


lovais
August 3rd, 2005, 02:53 PM
Hi,

Does any one know how to create a database field name dynamically or is there a function in crystal similar to the "eval" function in javascript.

I am tyring to loop thru 10 fields ... key0 thru key9 and I want to dynamically create them

Local StringVar str := "";

Local NumberVar i;
For i := 0 To 9 Do
(

str := str + totext({tablename.key[i]})
);
str

Eventually I want to get the value for str.

thanks

Madhi
August 6th, 2005, 05:07 AM
I think you are trying to concatenate the string values
If so, there is no other way other than specifing the field names

lovais
August 9th, 2005, 10:44 AM
Yes, that is what I am trying to do.... thanks anyway