Hi Greg,
CLEAR PROGRAM should do the trick, but you cannot call it from the program that is being cleared. In addition, if there's any DEFINE CLASS in the code and you instantiated an object, you have to use CLEAR CLASS before.
If that doesn't work, use a proxy instead. Instead of replacing the existing program, save the new version with an appended version number (myprog_00012.prg instead of myprog.prg). For development purposes replace myprog.prg with code that uses ADIR() to determine the highest version (ADIR, ASORT) and then runs this version passing the return value back. Takes a bit longer to run, but should be much faster then restarting the app every time.
--
Christof