lcCheck = ALLTRIM(CHRTRAN(m.lcStyle, "ABCDEFGHIJKLMNOPQRSTUVWXYZ-", SPACE(26))) && Remove letters from the string lnPos = AT(" ", m.lcCheck) && Do we have 1 or 2 numbers? IF m.lnPos > 0 lcNumberPart = LEFT(m.lcCheck, m.lnPos - 1) lcQuality = SUBSTR(m.lcCheck, m.lnPos + 1) && Assuming we can only have 2 numbers in the style lnPos = RAT(m.lcQuality, m.lcStyle) IF m.lnPos > 0 lcCheck = SUBSTR(m.lcStyle, 1, m.lnPos - 1) && We're removing quality part ELSE lcCheck = m.lcStyle ENDIF llStone = .T. && We do have a stone info if we have quality ELSE lcNumberPart = m.lcCheck lcQuality = "" lcCheck = m.lcStyle && What if we have a stone but no quality, say, E94s or even without stone W-E94 llStone = ISALPHA(RIGHT(m.lcStyle,1)) ENDIFwhich I'm testing for lcStyle = upper([w-4164bt5])