RE: [Tcl-nap-users] return NAO object
Brought to you by:
dav480,
peter_turner
|
From: <Pet...@cs...> - 2006-03-19 23:04:32
|
Hi Salah,
=20
This can be a bit tricky the bottom line is to make the last
thing in the procedure the result and do not assign it to anything.
If you are using the procedure as a nap function then you can use return
to return the result.
=20
proc st {} {
nap "{1 2 3 4}"
}
=20
nap img =3D [st]
=20
will work
=20
nap img =3D st()
=20
will not work because the function must have at least 1 argument
=20
proc st1 {a} {
=20
nap "{1 2 3 4}"
}
=20
=20
nap img =3D st1(3)
=20
or=20
=20
nap img =3D [st1 3]
=20
will work.
=20
When using procedures as nap functions the function parameters are
separated by , and must be NAOs. The result should also be a nao.
Procedures can return a NAO, however, you need to do something like the
first example to return a result. If the result was in a NAO called say
"a" then put "nap a" as the last statement in the procedure.
=20
=20
Cheers
=20
Peter T
=20
=20
=20
=20
-----Original Message-----
From: tcl...@li...
[mailto:tcl...@li...] On Behalf Of salah
jubeh
Sent: Saturday, 18 March 2006 7:57 AM
To: NAP
Subject: [Tcl-nap-users] return NAO object
=20
Hi again=20
is there is a way to return a NAO out of function
=20
proc set_data { img} {
nap "$img =3D {1 2 3 4 _}"
}
set_data data
$data
=20
_____ =20
Yahoo! Mail
Bring photos to life! New PhotoMail
<http://pa.yahoo.com/*http:/us.rd.yahoo.com/evt=3D39174/*http:/photomail.=
m
ail.yahoo.com> makes sharing a breeze.=20
|