Can you post the code that errors out (and what goal your subroutine is solving)?

The error usually occurs when you try to read the value of an variable you haven't given a value yet.


...