Jump to content

Need help with tcl please :(

Hey guys, hope you can help  me out with this code I've been developing in tcl which is the language used for vmd tk console, basically I'm trying to get this function to work. It measures the dihedral angle between 4 atoms from a molecule (trying to get phi and psi angles for a ramachandran plot), the way the function is supposed to work as follows:

measure dihed [{{<atomid1> <molid>} {<atomid2> <molid>} {<atomid3> <molid>} {<atomid4> <molid>}}]

The atomids are the id number of the atom in the molecule sequence which I'm able to easily get from my script (tested), but when I type the $var where <atomid> are supposed tto be, this is shown by the console: "expected integer but got "$var" measure dihed: bad atom index". I tried to manualy input the atomids, say.. instead of typing {{$var 0} ..... }} I just type {{12441 0} ..... }} and the function works. I've checked some forums and found no help at all. please I need some help :(

Link to comment
Share on other sites

Link to post
Share on other sites

I have zero experience with tcl, it looks VERY different from the programming paradigms i'm used to, and i don't really have enough from this post to guess, but I would say try printing out the value of $var to see what it is. I'm guessing it's not 12441, but something else, and the value it is might give you some insight into why it's not set correctly. 

Gaming build:

CPU: i7-7700k (5.0ghz, 1.312v)

GPU(s): Asus Strix 1080ti OC (~2063mhz)

Memory: 32GB (4x8) DDR4 G.Skill TridentZ RGB 3000mhz

Motherboard: Asus Prime z270-AR

PSU: Seasonic Prime Titanium 850W

Cooler: Custom water loop (420mm rad + 360mm rad)

Case: Be quiet! Dark base pro 900 (silver)
Primary storage: Samsung 960 evo m.2 SSD (500gb)

Secondary storage: Samsung 850 evo SSD (250gb)

 

Server build:

OS: Ubuntu server 16.04 LTS (though will probably upgrade to 17.04 for better ryzen support)

CPU: Ryzen R7 1700x

Memory: Ballistix Sport LT 16GB

Motherboard: Asrock B350 m4 pro

PSU: Corsair CX550M

Cooler: Cooler master hyper 212 evo

Storage: 2TB WD Red x1, 128gb OCZ SSD for OS

Case: HAF 932 adv

 

Link to comment
Share on other sites

Link to post
Share on other sites

tcl oh that brings back memories if I remember correctly one place it was or is used in is in the MUD client tinyFugee 

 

if this resource isn't a help . tcl website and getting started section

 

reply again I'll try to dig something up if I remember correctly it reminded me if rexx (I used arexx) and used it alot.

to err is human, to really mess things up requires an IP.

Link to comment
Share on other sites

Link to post
Share on other sites

20 hours ago, rcorkum said:

tcl oh that brings back memories if I remember correctly one place it was or is used in is in the MUD client tinyFugee 

 

if this resource isn't a help . tcl website and getting started section

 

reply again I'll try to dig something up if I remember correctly it reminded me if rexx (I used arexx) and used it alot.

actually the solution was easy af, somehow typing my variables in the function, between the <{}> was making the problem, all I had to do is replace the <{}> with  {""}

Link to comment
Share on other sites

Link to post
Share on other sites

21 hours ago, reniat said:

I have zero experience with tcl, it looks VERY different from the programming paradigms i'm used to, and i don't really have enough from this post to guess, but I would say try printing out the value of $var to see what it is. I'm guessing it's not 12441, but something else, and the value it is might give you some insight into why it's not set correctly. 

I solved it and the problem wasn't the $var at all, but the <{}> I was using instead of <" "> ... I felt like those times when you want to shoot yourself

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×