Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Max Value
Message
From
15/05/2002 03:24:42
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
14/05/2002 12:28:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00656234
Message ID:
00656749
Views:
6
>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 :
*function Rev2Num && A=1999, B=2999, B1=2001, B56=2056, ZZ=702999
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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform