I am using this code to do the same, but with possibility to define the string of "numbers"...
IncStrAlpha(Code : Code[20]) : Code[20]
//Increment Alpha Strig
SeqText := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; //sequence of "numbers"
i := STRLEN(Code);
REPEAT
Pos := STRPOS(SeqText,FORMAT(Code[i]));
IF Pos = STRLEN(SeqText) THEN BEGIN //Is last number in row
Code[i] := SeqText[1]; //take first number
i := i-1; //change number on higher position
END ELSE BEGIN
Code[i] := SeqText[Pos+1];
Switched := TRUE;
END;
UNTIL Switched or (i = 0);
EXIT(Code);
Comments
You can use it to do more complex code. Such as increment past z.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
RIS Plus, LLC
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
RIS Plus, LLC
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
How wonderfull that I can sometimes move something TO the Tips & Tricks forum!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
RIS Plus, LLC
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Andwian