From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Sun Nov 06 2011 - 20:31:00 CST

On Sun, Nov 6, 2011 at 8:26 PM, Casey Johnson <j.casey.johnson_at_gmail.com>wrote:

> Hi VMD users,
>
> I would like to make a tcl procedure that will set some data. The
> procedure I am trying to make is:
>
> proc process_atoms {atomselect_type, type, charge} {
> set type_wanted [atomselect top $atomselect_type]
> set_data $type_wanted $type $charge
> $type_wanted delete
> }
>
> I'm trying to call it like:
>
> process_atoms "name N' NH1 0.47
>

please note, that quoting in Tcl is done with either "" or {}
' is not allowed its function in shell script is taken over by {}.

>
> However when called, I get the error:
>
> can't read "atomselect_type": no such variable
>
> Pretty positive I'm missing some " or {.....any help would be great.
>

nope. lists - including argument lists - in Tcl are separated by whitespace
and not a comma. take those out and the error should vanish.

cheers,
    axel.

>
> Thanks
>

-- 
Dr. Axel Kohlmeyer
akohlmey_at_gmail.com  http://goo.gl/1wk0
College of Science and Technology
Temple University, Philadelphia PA, USA.