Please i want to write a function named edit1, who return for a variable X the result of edit("99….9",X), where the number of 9 is corresponding to the length of item X that is specify in the dictionnary.
Code: Select all
function string edit1(string varname)
string a = '"' + maketext("%d",maxvalue(varname)) + '"';
edit1 = edit(a,getvalue(varname));
end;
i wish that if i have for example a numeric variable Q101 in my dictionnary who have len = 5, and if the value of Q101 = 147 in data file,
edit1("Q101") = 00147.
the problem is that when i write maxvalue(varname) the program doesn't understand it is maxvalue(Q101); it doesn't compile.
How can i do please ?