Loading ...
Sorry, an error occurred while loading the content.

Removing Decimal Points

Expand Messages
  • westerman@chanuteks.com
    I m using NoteTab Pro to write NC code for a Thermwood CNC router. We are making cabinet parts. In the following clip I m using the panel length and panel
    Message 1 of 3 , Jun 5, 2001
    • 0 Attachment
      I'm using NoteTab Pro to write NC code for a Thermwood CNC router. We
      are making cabinet parts. In the following clip I'm using the panel
      length and panel width inputs to create the program name.

      *********************************************

      H="Standard Euro Floor"

      ^!Set %p_OffsetX%=3
      ^!Set %p_OffsetY%=-3
      ^!Set %p_LPX%=^?{Panel Length=^%p_LPX%}
      ^!Set %p_LPY%=^?{Panel Width=^%p_LPY%}

      ( NAME: F^%p_LPY%^%p_LPX% )( FLOOR )
      ( DATE: ^$GetDate(mm-dd-yyyy h:nn am/pm)$ )

      *********************************************

      If we input 24 for length and 12 for witdh, the following is
      displayed:

      ( NAME: F1224 )( FLOOR )
      ( DATE: 06-05-2001 8:31 pm )

      The file name can only be 8 characters, so the above is acceptable.

      If we input 24.25 for length and 12.375 for width, the following is
      displayed:

      ( NAME: F12.37524.25 )( FLOOR )
      ( DATE: 06-05-2001 8:31 pm )

      The file name is now over 8 characters long and contains unwanted
      decimal points.

      Ideally it would display the first 3 digits from the width and the
      first 3 digits from the length. Thus the desired display:

      ( NAME: F123242 )( FLOOR )
      ( DATE: 06-05-2001 8:31 pm )

      I'm not having any luck on my own. Can anyone help me out?

      Thanks

      Craig ><>
      westerman@...
    • Alan C.
      Hi Craig, H= Standard Euro Floor ^!Set %p_OffsetX%=3 ^!Set %p_OffsetY%=-3 ^!Set %p_LPX%=^?{Panel Length=^%p_LPX%} ^!Set %p_LPY%=^?{Panel Width=^%p_LPY%} ^!Set
      Message 2 of 3 , Jun 5, 2001
      • 0 Attachment
        Hi Craig,

        H="Standard Euro Floor"

        ^!Set %p_OffsetX%=3
        ^!Set %p_OffsetY%=-3
        ^!Set %p_LPX%=^?{Panel Length=^%p_LPX%}
        ^!Set %p_LPY%=^?{Panel Width=^%p_LPY%}

        ^!Set %p_LPX%=^$StrReplace(.;"";^%p_LPX%;False;False)$
        ^!Set %p_LPY%=^$StrReplace(.;"";^%p_LPY%;False;False)$
        ^!Set %p_LPX%=^$StrCopy("^%p_LPX%";1;3)$
        ^!Set %p_LPY%=^$StrCopy("^%p_LPY%";1;3)$

        ( NAME: F^%p_LPY%^%p_LPX% )( FLOOR )
        ( DATE: ^$GetDate(mm-dd-yyyy h:nn am/pm)$ )
        ;-----<end<<

        In the above:
        strrepl lines replace all . with nothing
        strcopy returns first three characters/digits of a string

        Also you can have both L and W input as each of 2 fields in one prompt instead of in two prompts if you desire to do so.

        What follows, the demonstration line has been shortened ie has only the ending of your first line. But it demonstrates that with a semi colon and a space you can set two fields into one prompt.

        ^?{Panel Length=^%p_LPX%}; %p_LPY%=^?{Panel Width=^%p_LPY%}

        And a further illustrate of 2 fields set into one prompt:

        ^!Set %p_LPX%=^?{variable1}; %p_LPY%=^?{variable2}

        Regards. Alan.
        >*********************************************
        >
        >H="Standard Euro Floor"
        >
        >^!Set %p_OffsetX%=3
        >^!Set %p_OffsetY%=-3
        >^!Set %p_LPX%=^?{Panel Length=^%p_LPX%}
        >^!Set %p_LPY%=^?{Panel Width=^%p_LPY%}
        >
        >( NAME: F^%p_LPY%^%p_LPX% )( FLOOR )
        >( DATE: ^$GetDate(mm-dd-yyyy h:nn am/pm)$ )
        >
        >*********************************************
        >If we input 24.25 for length and 12.375 for width, the following is
        >displayed:
        >
        >( NAME: F12.37524.25 )( FLOOR )
        >( DATE: 06-05-2001 8:31 pm )
        >
        >The file name is now over 8 characters long and contains unwanted
        >decimal points.
        >
        >Ideally it would display the first 3 digits from the width and the
        >first 3 digits from the length. Thus the desired display:
        >
        >( NAME: F123242 )( FLOOR )
        >( DATE: 06-05-2001 8:31 pm )
      • Jody
        Hi Craig, ... Does in the ballpark count? :) I m to tired to continue, so here is one that is close. It needs to have a check to see how many is making the
        Message 3 of 3 , Jun 6, 2001
        • 0 Attachment
          Hi Craig,

          >I'm using NoteTab Pro to write NC code for a Thermwood CNC
          >router. We are making cabinet parts. In the following clip I'm
          >using the panel length and panel width inputs to create the
          >program name.

          Does "in the ballpark" count? :) I'm to tired to continue, so
          here is one that is close. It needs to have a check to see how
          many is making the file name and add or take away as needed to
          get to the 8 you want. Is "F" part of the filename or just the
          numbers?

          <--- Copy below this line --->
          H=Standard Euro Floor
          ; Last Updated 06-06-2001, Sojourner@..., jody

          ^!Set %p_OffsetX%=3
          ^!Set %p_OffsetY%=-3
          ^!Set %p_LPX%=^?{Panel Length}; %p_LPY%=^?{Panel Width}
          ^!Set %p_LPX%=^$StrReplace(".";;"^%p_LPX%";0;0)$
          ^!Set %p_LPY%=^$StrReplace(".";;"^%p_LPY%";0;0)$
          ^!Set %p_LPX%=^$StrDelete("^%p_LPX%";4;1)$
          ^!Set %p_LPY%=^$StrDelete("^%p_LPY%";4;1)$
          ( NAME: F^%p_LPY%^%p_LPX% )( FLOOR )
          ( DATE: ^$GetDate(mm-dd-yyyy h:nn am/pm)$ )

          <--- Copy above this line, right --->
          <--- click over a Library, and --->
          <--- choose "Add from Clipboard" --->

          Happy Clip'n!
          Jody

          http://www.notetab.net

          Subscribe, UnSubscribe, Options
          mailto:Ntb-Clips-Subscribe@yahoogroups.com
          mailto:Ntb-Clips-UnSubscribe@yahoogroups.com
          http://www.egroups.com/group/ntb-clips
        Your message has been successfully submitted and would be delivered to recipients shortly.