Re: error: expected floating-point number but got

From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Thu Aug 04 2011 - 10:29:08 CDT

On Thu, Aug 4, 2011 at 11:21 AM, Shen, Han <han.shen_at_bme.gatech.edu> wrote:
> Hi,
>
> I tried to do some simple calculation then draw something in a certain pattern. So I use:
> graphics top sphere {$x2 $y2 $z2} radius 0.2 resolution 100

this is a VMD question, not a NAMD question,
so please send this kind of question to the
correct list. thank you.

>
> But error shows:
> expected floating-point number but got "$x"
>
> Anyone can tell me how to deal with it? Thanks in advance!

this is a beginner's Tcl error. if you use curly braces, you create
a literal string (or list). so instead of passing the value of $x2 you
pass on $x2 as a string. you have to use either double quotes or
the list command to have the variables expanded.
"$x2 $y2 $z2"

or

[list $x2 $y2 $z2]

cheers,
    axel.

>
> --
> Han Shen
> Wallace H. Coulter Department of Biomedical Engineering
> Georgia Institute of Technology and Emory University
>
>

-- 
Dr. Axel Kohlmeyer
akohlmey_at_gmail.com  http://goo.gl/1wk0
Institute for Computational Molecular Science
Temple University, Philadelphia PA, USA.

This archive was generated by hypermail 2.1.6 : Mon Dec 31 2012 - 23:20:39 CST