Dear all,
I'm creating a model and I am following some examples. I cannot find the significance of the commands "lappend" and "eval". Can someone tell me where I can find a description? Thank you in advance. I report a short example below (I don't need help with this code, I just put an example from which I've read those commands):
set nodeList {}
for {set i 0} {$i < $numYnode} {incr i 1} {
lappend nodeList [expr $numXnode/2 + $i*$numXnode]
}
eval "recorder Node -file disp -time -node $nodeList -dof 1 2 -dT $deltaT disp"
for {set i 1} {$i < $numYnode} {incr i 1} {
set ele [expr $numXele-$numXele/2+($i-1)*$numXele]
set name11 [join [list $name1 $i] {}]
set name21 [join [list $name2 $i] {}]
recorder Element -ele $ele -time -file $name11 -dT $deltaT material 1 stress
recorder Element -ele $ele -time -file $name21 -dT $deltaT material 1 strain
}
prolem with lappend and eval
Moderators: silvia, selimgunay, Moderators
Re: prolem with lappend and eval
Hi,
'lappend' and 'eval' are tcl language commands ..
For 'lappend', check http://wiki.tcl.tk/1479 .. The command actually add a new item to an already defined vector or matrix .. In your code nodeList is an empty vector/matrix. For each increment inside the for loop, lapped add a new row to the initially defined vector.
For 'eval' check http://wiki.tcl.tk/1017
Thanks,
Jeena
'lappend' and 'eval' are tcl language commands ..
For 'lappend', check http://wiki.tcl.tk/1479 .. The command actually add a new item to an already defined vector or matrix .. In your code nodeList is an empty vector/matrix. For each increment inside the for loop, lapped add a new row to the initially defined vector.
For 'eval' check http://wiki.tcl.tk/1017
Thanks,
Jeena
Re: prolem with lappend and eval
Thank you very much!!!