2012/8/4 Logan Kelly <logan.kelly@uwrf.edu>
Is it possible to access elements of a list. I need the variable name—as a string—of the i_th element of a list. Something like
 
string variable_name = varnam(ylist[i])
 
Thanks,
 
Logan Kelly
 

_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users


I suppose you want to use it in a gretl function. Assuming xlist is a list containing the variables you are interested in, you may use:

loop foreach i xlist
    string $i = xlist.$i
endloop


--
Ignacio Diaz-Emparanza 
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)
UPV/EHU
Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.et.bs.ehu.es