Thank you so much for your reply. I knew that "a" is an array, but I don't know how to use it as an input to a procedure and use its elements in the proc.
Would you please write the simple procedure of importing array "a" into a proc named mult?
or just provide a simple script or example of it...
I want to input a vector "a" (or matrix) to a procedure and do some algebraic operations with its elements:
set a(1) 2;
set a(2) 3;
proc mult {a} {
global b
set b [expr $a(1)*$a(2)]
}
mult $a
puts "$b"
when I run this script it says:
can't read "a": variable is array
can anyone help me...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.