Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Dear Colleagues,
I am writing a macro to detect whether a Results file ( .xls) is present in a directory to prevent an error when using the Open(filename) command. I wondered if there is a way of testing in a macro the return value of the Open() command to see if it has failed to prevent the Directory window from opening? Thank you. Douglas Dr Douglas K Benn, BDS,DDS, M.Phil., Ph.D., Dipl. Dental Radiology (Royal College of Radiologists, England). Professor and Director of Oral & Maxillofacial Radiology Dept of General Dentistry Creighton University Dental School 2802 Webster St, Boyne 210 Omaha Nebraska 68178 Tel: (402)280 5025 Fax: (402)280 5094 |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hi,
On Jun 30, 2010, at 6:53 PM, Benn, Douglas K. wrote: > Dear Colleagues, > > I am writing a macro to detect whether a Results file ( .xls) is > present in a directory to prevent an error when using the > Open(filename) command. I wondered if there is a way of testing in a > macro the return value of the Open() command to see if it has failed > to prevent the Directory window from opening? > Perhaps first using the macro command File.exists(path) is the way to go. If it isn't there you won't have to muck around with Open(filename). See http://rsb.info.nih.gov/ij/developer/macro/functions.html#F for details. Cheers, Ben > Thank you. > > Douglas > > Dr Douglas K Benn, BDS,DDS, M.Phil., Ph.D., Dipl. Dental Radiology > (Royal College of Radiologists, England). > Professor and Director of Oral & Maxillofacial Radiology > Dept of General Dentistry > Creighton University Dental School > 2802 Webster St, Boyne 210 > Omaha > Nebraska 68178 > > Tel: (402)280 5025 > Fax: (402)280 5094 ... [show rest of quote]
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Dear Ben,
Thanks very much. Douglas Dr Douglas K Benn, BDS,DDS, M.Phil., Ph.D., Dipl. Dental Radiology (Royal College of Radiologists, England). Professor and Director of Oral & Maxillofacial Radiology Dept of General Dentistry Creighton University Dental School 2802 Webster St, Boyne 210 Omaha Nebraska 68178 Tel: (402)280 5025 Fax: (402)280 5094 -----Original Message----- From: ImageJ Interest Group on behalf of Ben Tupper Sent: Wed 6/30/2010 7:10 PM To: [hidden email] Subject: Re: File I/O errors Hi, On Jun 30, 2010, at 6:53 PM, Benn, Douglas K. wrote: > Dear Colleagues, > > I am writing a macro to detect whether a Results file ( .xls) is > present in a directory to prevent an error when using the > Open(filename) command. I wondered if there is a way of testing in a > macro the return value of the Open() command to see if it has failed > to prevent the Directory window from opening? > Perhaps first using the macro command File.exists(path) is the way to go. If it isn't there you won't have to muck around with Open(filename). See http://rsb.info.nih.gov/ij/developer/macro/functions.html#F for details. Cheers, Ben > Thank you. > > Douglas > > Dr Douglas K Benn, BDS,DDS, M.Phil., Ph.D., Dipl. Dental Radiology > (Royal College of Radiologists, England). > Professor and Director of Oral & Maxillofacial Radiology > Dept of General Dentistry > Creighton University Dental School > 2802 Webster St, Boyne 210 > Omaha > Nebraska 68178 > > Tel: (402)280 5025 > Fax: (402)280 5094 ... [show rest of quote]
|
Free forum by Nabble | Disable Popup Ads | Edit this page |