Hi again, I have just learned that twobin is a function written by the author of the code I'm trying to translate, so I have to look elsewhere for the solution. Thanks for your time! Ulf