Mike,

The only problem I've had with SHPFILE() is that before saving
a file for the first time it will return the name of the previous
file rather than "untitled.pm4".

I did spot a problems with the syntax. You are declaring #VAR5 as
a string variable and then assigning a numeric value to it:

  #VAR5=STRLEN(#VAR4)

You then perform a math function with the same variable.

  #VAR6=STRSUB(#VAR4,1,#VAR5-4)

A string has a numeric value of zero, so you are actually trying to extract
a sub string with a length of -4 characters.

  #VAR6=STRSUB(#VAR4,1,0-4)

It appears that you are attempting to strip the extension from the shape
file. There are better string manipulation tools for the handling of file
names.

>From page 84 of the SmartCAM Customization Guide:

  GET_NAME(strexpr) Returns the name and extension of the filename.
  GET_PATH(strexpr) Returns path portion of filename.
  STRIP_EXT(strexpr) Returns string without file extension.


In your example you could reduce your sample code to:

  VAR_REMOVE_ALL[]
  STRING:#VAR6

  #VAR6=SHPFILE()
  #VAR6=STRIP_EXT(#VAR6)

Or even shorten it to:

  VAR_REMOVE_ALL[]
  STRING:#VAR6

  #VAR6=STRIP_EXT(SHPFILE())

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



-----Original Message-----
From: Michael Senack [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 20, 2001 6:35 PM
To: '[EMAIL PROTECTED]'
Subject: [mfg-smartcam] Thanks!


I would like to take this opportunity and thank all the people from the user
group for their valuable input in making my CUT2.mcl a success.
I am still a bit fuzzy on the string stuff...but at least I know where to
get help.

This macro takes approx. 30 minutes of work and reduces it to 20 seconds!

If anybody would like a copy just e-mail me.

This leads me to this question...

VAR_REMOVE_ALL[]
STRING: #VAR4
STRING: #var5
STRING: #var6

#VAR4=SHPFILE()
#VAR5=STRLEN(#VAR4)
#VAR6=STRSUB(#VAR4,1,#VAR5-4)

The SHPFILE() does not return process model file path & process model file
name.
Why?
I am running Advance wire edm on Windows NT 4.0

Regards,

Michael Senack, X354
Your local friendly neighborhood CNC Programmer


======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [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