Hi Elai and Peter, thanks a lot for your suggestions. I am still reading your answers, but I didn't get at the begining the difference between
c<-NULL for (i in seq(3)) c[[i]]<-i c and the exempel with the tcl tk buttons. Now I think, it is clear. Its due to the interaction between R and tcl. The button created by R is executed far later by tcltk and therefore, the button doesn't take the "i" during its creation, but the last available "i" of its environment. Do you know any manuals, articles, etc... which describe the interaction between R and tcl. Now I learn only by examples which I find in the web. Alexander -- View this message in context: http://r.789695.n4.nabble.com/tcl-tk-command-function-with-arguments-tp4416470p4423969.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.