Just create string-valued xplor variables and add them together. For example,
eval ($a = "Axel") eval ($b = "Brunger") eval ($c = $a + $b) display $c AxelBrunger However, for the *particular* case of appending numbers to strings, as in your filename example below, you need to go through one more step. You need to formally convert the number to a string before you can append it to another string. This is done with encode(). eval ($prefix = "/home/xplor/output/mystructure") eval ($filecount = 2) eval ($filename = $prefix + encode($filecount) + ".pdb") display $filename /home/xplor/output/mystructure2.pdb All of this is on page 17 of the printed xplor 3.1 manual. --John Kuszewski On Thursday, November 6, 2003, at 03:18 PM, Evgeny A. Fadeev wrote: > Hello, > > i wonder if there is a way to do string concatenation > within xplor? > > i have trouble with the following: > > evaluate ($dir = "./final/isomer1") > ! this seems to work so far, double quoting prevents > ! parsing of string as mathematical expression > loop > ..... > ..... > ..... > evaluate ($n = $n + 1) > write coordinates output=@$dir/struct$n.pdb end > end of loop > > i know that @$dir/struct$n.pdb is not a correct > xplor statement, but i just wonder how to do > calculate the path 'on the go', for that i would need > simple string concatenation, but all the examples i have seen so far > interpret the string "a/b" > as division of a by b > > I appreciate any response. > > Evgeny. > > _______________________________________________ > Xplor-nih mailing list > [email protected] > http://dcb.cit.nih.gov/mailman/listinfo/xplor-nih
