Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Truncate a string


Recommended Posts

I have a string that is the program number. Say O13047101. I need to get rid of the "O" in the program number. How can I do this? Truncation?

 

Right now the section of my post looks like....

 

"<",sprogno,">" e$ #MAPPS Program display
      sprogno,"(",srevision,sissue,")", e$
      "(Part and Rev Number: ", srevision, ")", e$
      "(OP Number: ", sissue, ")", e$
      "(Programmer: ", sname, "DATE", 58, month$, "-", day$, "-", year$, sspace, ")", e$
      "(POST - Protomet Mori Seiki NH5000 Rev.A)", e$
      " ", e$
 
Which posts
 
%
< O13047101 > I Need <13047101>
O13047101 ( Part and Rev Number OPPERATION Number:  )
(Part and Rev Number:  Part and Rev Number )
(OP Number:  OPPERATION Number:  )
(Programmer:  YOUR NAME DATE : 08 - 18 - 15   )
(POST - Protomet Mori Seiki NH5000 Rev.A)
 
( T2 - IEM-C-AL 2.000X90XR.031X.492X4.00X5 ICR-T490 FLN D2.00-5-.75-R-13 )
N10 G00 G91 G28 Z0.
N11 G20
N12 G0 G17 G40 G49 G80 G90
( FACE OFF TOP OP10 )
N13 T2
N14 M6 ( IEM-C-AL 2.000X90XR.031X.492X4.00X5 ICR-T490 FLN D2.00-5-.75-R-13 )
N15 M11
N16 M8
N17 M88
N18 G0 G90 X-13.1863 Y25.4555 B0. S10000 M1003
N19 M10
N20 G5.1 Q1
N21 G43 H1 Z16.
N22 M3

 

Link to comment
Share on other sites

I am thinking

 

sprognoo = brksps(1, sprogno) If this is the correct way to use brksps?

 

And using this new string. My next question is, (if this will work) where can I put this? Just above where I am going to use it? Do I have to declare this variable somewhere else? Or can it just be…

 

 

sprognoo = brksps(1, sprogno) # Break string

"<",sprognoo,">" e$ #MAPPS Program display

      sprogno,"(",srevision,sissue,")", e$

      "(Part and Rev Number: ", srevision, ")", e$

      "(OP Number: ", sissue, ")", e$

      "(Programmer: ", sname, "DATE", 58, month$, "-", day$, "-", year$, sspace, ")", e$

      "(POST - Protomet Mori Seiki NH5000 Rev.A)", e$

      " ", e$

Link to comment
Share on other sites

I am thinking

 

sprognoo = brksps(1, sprogno) If this is the correct way to use brksps?

 

And using this new string. My next question is, (if this will work) where can I put this? Just above where I am going to use it? Do I have to declare this variable somewhere else? Or can it just be…

 

 

sprognoo = brksps(1, sprogno) # Break string

"<",sprognoo,">" e$ #MAPPS Program display

      sprogno,"(",srevision,sissue,")", e$

      "(Part and Rev Number: ", srevision, ")", e$

      "(OP Number: ", sissue, ")", e$

      "(Programmer: ", sname, "DATE", 58, month$, "-", day$, "-", year$, sspace, ")", e$

      "(POST - Protomet Mori Seiki NH5000 Rev.A)", e$

      " ", e$

 

Removed the color to help others. If what you put here worked then job done. If not then you would need to make the sgprono = new variable. Define the new variable what every you want and then call in place of the sgprono and it will also work. Yes just like sprogno is defined with a fmt statement your new variable will need the same fmt statement to define it.

 

HTH(Hope that Helps)

Link to comment
Share on other sites

Sorry for the colored text. Got it to work.

 

sprognotmp = sprogno
      sprognoo = brksps(2, sprognotmp) # Break string
      60,sprognoo,62,e$ #MAPPS Program display
      sprogno,"(",srevision,sissue,")", e$
      "(Part and Rev Number: ", srevision, ")", e$
      "(OP Number: ", sissue, ")", e$
      "(Programmer: ", sname, "DATE", 58, month$, "-", day$, "-", year$, sspace, ")", e$
      "(POST - Protomet Mori Seiki NH5000 Rev.A)", e$
      " ", e$
 
gets me
 
%
< 13047101 >
O13047101 ( Part and Rev Number OPPERATION Number:  )
(Part and Rev Number:  Part and Rev Number )
(OP Number:  OPPERATION Number:  )
(Programmer:  YOUR NAME DATE : 08 - 19 - 15   )
(POST -  Mori Seiki NH5000 Rev.A)
 
Thanks for your help
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...