One technique I use for "X" parts is to add a SERTXD at the very beginning of my program. Everytime the program starts up, it sends a three-character code (so, 1 in 16 million codes full hex 00 to FF, probably only 1.5 million - 1 to 10, A to B) to the PC which I can then backtrack to my Basic code.
<b><i>ylp88 </b> </i>