12-02-2013 11:58 AM
Hey All,
Gumby question today. I want have written code that opens a data log file when the "Log" button is clicked. Now I want to add code that, under certain circumstances, checks to see if a data log file exists. If it exists, I will close it before opening a new one.
My first thought is to check to see if an active Refnum exists. If so, I would close the associated file before opening a new one. Is this the right way to go? If so, how do I set up a check to see if an active refnum exists?
Many thanks.
12-02-2013 12:07 PM - edited 12-02-2013 12:09 PM
Simply check if the file exist. There is a tool in the advanced file io palette.
(Your idea is flawed because a file can exist even without an active reference)