Hi everyone,

I have a problem to assign a value with tcl/tk

ths is the code ( it should be simple to understand) :

library(tcltk)

valA<-tclVar("0")
valB<-tclVar("0")
valC<-tclVar("0")
id<-"A"
out<-"1"
out2<-"2"

print(paste("tclvalue(val",id,")",sep="")) # ok
print(as.name(paste("tclvalue(val",id,")",sep=""))) #ok
print(eval(as.name(paste("val",id,sep="")))) #seems to be OK
print(tclvalue(eval(as.name(paste("val",id,sep=""))))) #ok
print("fin")

tclvalue(valA)<-out # this is good
tclvalue(valA)
tclvalue(paste("val",id,sep="")) #dont work but its normal
tclvalue(as.name(paste("val",id,sep="")))# dont work...
eval(as.name(paste("val",id,sep="")))# ok
tclvalue(eval(as.name(paste("val",id,sep=""))))#ok
is(eval(as.name(paste("val",id,sep=""))))

#that is what I want to do but it dont work :
tclvalue(eval(as.name(paste("val",id,sep=""))))<-out2
#>target of assignment expands to non-language object

# Have you any idea to do what I want to do?

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to