Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output of the Array?? problem

Status
Not open for further replies.

6839470

Programmer
Mar 7, 2004
45
US

proc test {} {
global some k ::counter
set ::counter 0
wm title . ExecLog
set w .tcl
if {![jsLayout $w bigbox -title "Setup"]} {
frame $w.top -borderwidth 10
pack $w.top -side top -fill x
button $w.top.quit -text Quit -command exit
set but [button $w.top.run -text "Run it" -command joint]
pack $w.top.quit $w.top.run -side right
label $w.top.l -text Command: -padx 0
entry $w.top.cmd -width 20 -relief sunken -textvariable ::command
pack $w.top.l -side left
pack $w.top.cmd -side left -fill x -expand true
bind $w.top.cmd <Return> joint
focus $w.top.cmd
}
}

proc joint {} {
global ::command but at1 bt1 ct1 at2 bt2 ct2 ::counter
if {$::command == "start"} {
set matb [new_jMatrix]
set mat [new_jMatrix]
set matrixList [jMatrix_getList $mat]
set x1 [lindex [jMatrix_getList $mat] 12]
set y1 [lindex [jMatrix_getList $mat] 13]
set z1 [lindex [jMatrix_getList $mat] 14]
set matrixList [jMatrix_getList $matb]
set x2 [lindex [jMatrix_getList $matb] 12]
set y2 [lindex [jMatrix_getList $matb] 13]
set z2 [lindex [jMatrix_getList $matb] 14]

set ::at1($::counter) $x1
set ::bt1($::counter) $y1
set ::ct1($::counter) $z1

set ::at2($::counter) $x2
set ::bt2($::counter) $y2
set ::ct2($::counter) $z2


set data [float_array jntPtr] ;
jcJoint_getAngles $jntPtr $data 0;
set ::array_thumb($::counter) [float_get $data 0]
puts "$::at2($::counter)"
incr ::counter

} else {

set ::counter 0
incr ::counter
set fileid [open y:/$::command w+]
while {$::counter <= 500} {
puts $fileid "$::at1($::counter) $::bt1($::counter) $::ct1($::counter) $::at2($::counter) $::bt2($::counter) $::ct2($::counter) ";
}
while {$::counter <= 500} {
puts $fileid "$::array_thumb($::counter)"
}
close $fileid
}
}
 
I don't understand your question and don't have time to try to understand your code without an explanation.

1/ Give us a clear question with all the information needed to well understand.
2/ If you need to publish code, extract a minimal piece of code demonstrating only the behaviour you want to show.

ulis
 
sorry dude.....It is my mistake....
thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top