Select only 5 characters

Select only 5 characters

fg
Participant Participant
681 Views
1 Reply
Message 1 of 2

Select only 5 characters

fg
Participant
Participant

Hello, I wanted to know if it is possible to create a macro that makes me select only the first 5 characters of the name of the NC program. For example my program is called GG444_EXEMPLE_LAV and I want to select only GG444. It can be done?

0 Likes
Accepted solutions (1)
682 Views
1 Reply
Reply (1)
Message 2 of 2

LasseFred
Collaborator
Collaborator
Accepted solution

is taken from Macro Programming Guide page 78

Substrings:
The substring function returns part of the string. You can define where the substring starts and its length. The original string is unchanged.
The basic structure is:
string substring( string str, int start, int length)
For example:
PRINT = substring("Scooby doo", 2, 4)
The command window displays the result, ooby.

 

 

______________________
Lasse F.