>I have a table that lists engineering drawings and their revisions. The list can have the same drawing number listed several times with different revision levels. I need to find the highest revision. This seems simple until you consider that a revision E is higher than an E2 because E2 was a temporary change that was incoporated into the E change. One more complication is when the drawing is revised behond revision Y(we din't use Z) the next revision is AA. So it dosen't seem a simple solution will work. Please Help!!
Steve,
I used this in the past might help :
lparameters tcValue
local lcValue, lnRevision, lnValue
lcValue = trim(chrtran(tcValue,'0123456789',''))
lnRevision = val(chrtran(tcValue,lcValue,''))
lnValue = 0
for ix=len(lcValue) to 1 step -1
lnValue = m.lnValue + ;
(asc(substr(m.lcValue,ix,1))-asc("A")+1)*26^(len(m.lcValue)-ix)
endfor
return lnValue*1000+iif(lnRevision=0,999,lnRevision)
Cetin