Here's some sample macro code using the F_EXIST() function. This will get
you started.

// assign default path and name for log file from shape file
#LOGFILE=SHPFILE()
#LOGFILE=STRIP_EXT(#LOGFILE)
#LOGFILE=STRTMP("%LOGFILE.log")

// check for existing file of same name
#EXIST=F_EXIST(#LOGFILE)

// prompt to overwrite if existing file found
IF(#EXIST=1)
  PAUSE[TX=STRTMP("%LOGFILE already exists.\n
       Overwrite the file?"), PT=1]
ENDIF

================================================== 
 Fred Lauzus, CAM Programming Coordinator 
 High Steel Structures, Incorporated 
  mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
http://www.highsteel.com <http://www.highsteel.com/>  
================================================== 
  

-----Original Message-----
From: Stannard, Rick [mailto:[EMAIL PROTECTED]
Sent: Monday, July 14, 2003 1:07 PM
To: 'Smartcam Forum'
Subject: [mfg-smartcam] macro help



Hello, 
  I have been using and modifying a macro that all of you have been adding
to without your knowledgefor quite a while, improving on it as I go.  I just
came up with something that I know there is a possibly simple answer for.

  How can I have my macro check to see if the file already exists and ask me
if I really want to overwrite it or not? 
  Then if I don't want it to overwrite, is it possible to ask me to specify
a file name to save it under and of course check to see if this file name is
unused.

  thanks, 

Rick Stannard 
Alcoa Fastening Systems 
Torrance Aerospace Operations 
3000 W. Lomita Blvd. 
Torrance, CA. 90505  USA 
Ph. (310)784-4394 
[EMAIL PROTECTED] 


======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================

Reply via email to