it's not a problem if you want to use T1 and T25 in the same program. Cause if you do so, you won't put T25 in the pot of T1, suppose you have reserved the variable #501 to #524, and you put T25 in the pot of T3, you write(by hand or via a custom code) 25 in #503.
It will be a pleasure to write a macro for you, but I don't know when i can find the time to do it.
If your machine use a tool change macro, we have to integrate my idea inside the tool change macro.
Do you already have some variable reserved for whatever?
If you don't use tool change macro,more exactly, if M6 does'nt call a custom macro, it will be very simple
something like that should work
Code:
%
O9020
#1=501 (THE FIRST VARIABLE NUBER YOU RESERVE)
WHILE [#1 LE 524] DO1 (LOOP UNTIL IT FIND OR LOOK ALL THE RESERVED VARIABLE)
IF [#[#1] EQ #20] GOTO 10 (IF IT FIND IT)
#1=#1+1 (LOOK THE NEXT VARIABLE)
END 1
#3000=1 (TOOL NOT FOUND) (DISPLAY AN OPERATOR MESSAGE ''TOOL NOT FOUND'')
M99
N10 #1=#1-500 (CONVERT TO READABLE T NUMBER)
M6 T#1
M99
%
It assume that you reserved #501 to #524
and you have to set a parameter to call this program by m6