Skip to main content

String modification (zpl)

  • December 16, 2019
  • 3 replies
  • 160 views

Forum|alt.badge.img
$FILENAME() returns the file name that includes ".zmx".  I would like to replace "zmx" with "cfg".  Can you suggest a way to accomplish this?

(If I knew the string length, I could use a $LEFTSTRING command, but I cannot find a string length command.)

Thanks.
Did this topic help you find an answer to your question?

Forum|alt.badge.img+1
  • Ultraviolet
  • December 16, 2019
Hello,

you can get the length of the string using the Numeric Function SLEN(), then you can use $LEFTSTRING()  with that length minus four.
I have attached an example macro that does this.

Thanks!

Forum|alt.badge.img
Ah,  I scoured the string function section and missed this one.  Thank you.

Cindy.Chen
  Filter$ can help filter the CFG format out: 
  PATHONLY$ = $PATHNAME()
   PATH$ = PathONLY$ + "\*.cfg"
   FILTER$ = PATH$
   FINDFILE TEMPFILE$, FILTER$

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings