Method Directive syntax help

Epicor 9.05.701

I’m writing a method directive, so that every new PartRev.RevisionNum goes up in letters, however, how do i write the syntax to say that the first new revision = “A” and then the next “B” and the next “C” and so on?

Many thanks in advance…

use char function and find the ASCII value of revision character … and increment the ASCII value, and output next seq …

here is the ASCII table http://www.theasciicode.com.ar/

the alphabet A-Z are sequential.

Hi, thank you for your reply,
although i have to admit im punching above my weight on this one!..i worked out that a capital A is ALT+65, i put this into the Chr() as per the screenshot, but the syntax didn’t like it. Plus, i don’t know how to say and output next sequence.

your help and guidance is much appreciated.

Thanks.

You need to find all the Revs for this Part
Sort them by RevisionNum
Convert the last one of the sorted list from a Char to its ASCII, using CODE() or ASC() (not sure which is for your language) intLastRev = LEFT(CODE(...),1) The LEFT( is to grab a single character)
Add 1 to the ascii value returned from the CODE() (or ASC() ) intNextRev = intLastRev + 1;
Set the new RevisionNum to CHR(intNextRev)

To be complete you should make sure the last rev is one char in the range of A-Z. If the last rev was inadvertantly set to ‘9’, the next rev would be ‘:’ (the next ASCII char after ‘9’)

The check for 1 char in length would be to handle when you want to roll over from Z to AA, to AB, to AC, etc …