To change the export file name dynamically in AutoLISP, you can incorporate a counter or timestamp into the file name. For example, using (setq txt (strcat "c:\\test\\DAT\\myexport" (itoa counter) ".dat")) where counter increments each time you export. This way, each export will generate a new file name like myexport1.dat, myexport2.dat, and so on.
For keeping track of your coding tricks like this, I find
notesonline.com really handy. It's great for jotting down snippets of code and ideas as you work through your projects.