[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [ESPResSo-devel] TCL procedures with variable calling parameters
From: |
Benedict Reynolds |
Subject: |
RE: [ESPResSo-devel] TCL procedures with variable calling parameters |
Date: |
Fri, 26 Oct 2007 15:41:16 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050921 |
Hey all,
There's a standard TCL package called cmdline which helps with this and
can be included with "package require cmdline". Ira used it in mbtools.
e.g.
proc ::mbtools::system_generation::flat::create_flat {args } {
::mmsg::send [namespace current] "placing lipids in a flat bilayer"
set options {
{bondl.arg 1.0 "bond length between atoms" }
{fixz "fix the z positions of all particles in this bilayer"}
}
set usage "Usage: create_flat \[bondl:fixz\] ]"
array set params [::cmdline::getoptions args $options $usage]
....
optional arguments are then accessed from the array i.e. $params(bondl)
Cheers,
Ben