Sorry, that description's much too vague for me to diagnose your problem. My best guess is that either a) "p" is not a defined variable at the time the function is called or b) you're not passing the parameters in the correct order. If that's not it, you may have to post some more of your code for inspection.
__________________
|