Bob,
Thanks, that email is a big help on the @ usage.
Otis
--Otis [email protected]
http://chemagic.org
> On Jul 8, 2016, at 9:19 AM, Robert Hanson <[email protected]> wrote:
>
>
> Happy to address that. @ is tricky because it has multiple uses:
>
>
> 1. Original use: "define"
>
>
> $ @molecule1 molecule=1
>
>
> $ select molecule1
>
>
>
>
> 2. Shortcut to {atomno=n}
>
>
> $ @3.color = "red"
>
> $ draw @1 @3
>
>
>
>
> 3. Math insertion into a Jmol command:
>
>
> $ draw ID @{"line"+i} ....
>
>
>
> 4. Explicit reference to a math variable in a select command.
>
>
> $ x = {model=1}
>
> $ select @x // "select x" also works here
>
>
> $ ch = "b"
>
> $ select chain=@ch // "select chain=ch" would not work here
>
>
>
>
> 5. Indirect math reference
>
> $ x = "y"
> $ y = 33
> $ print @x
>
>
> 33
>
>
> For a few more, see
> [http://chemapps.stolaf.edu/jmol/docs/index.htm?&fullmanual=1&ver=14.6&#jmolmathindirectreferencinganduseof@
> ]
>
>
> So what you did there:
>
>
> function() {....} {
>
>
>
>
> return @x
> }
>
>
> is not good practice. It is case #5, and is working only because whatever x
> is, there is no variable by the name of what its value is. "return" is a
> math/flow command and so does not use "@" for its parameters. What comes
> after "return" is a math expression, not a Jmol command.
>
>
> That help?
>
>
> Bob
>
>
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users