>Or, you could convert the string "001BT007" as follows. Treat each letter as two digits. That is, from right to left: multiply 7 by 1, 0 by 10, 0 by 100, "T" (perhaps its ASCII value) by 1000, "B" by 100,000, 1 by 1e6, 0 by 1e7, 0 by 1e8. Note that for a 4-byte integer, your highest integer value is ca. 2e9.
>
>Also, I am assuming that all codes use the same format (e.g., 3 digits, 2 letters, 3 digits).
>
This is me solution. I like you opinion on it.
FUNCTION PKID
LPARAMETERS tcString
LOCAL lnumero,z
lnumero = 100000
FOR z = 1 TO LEN(tcString)
lnumero = lnumero + ASC(SUBSTR(UPPER(tcString),z,1))
ENDFOR
RETURN lnumero