Well, then I suggest that you post the smallest and simplest program that demonstrates the error, and also post the error message. After all, how do you know that your "pseudo-code" is not perfectly correct, whereas what you actually tried is wrong?