x = CHR(56)+CHR(203)+CHR(49)+CHR(1) y = STR(StrToLong(x)) ********************* FUNCTION StrToLong(m.lcLongstr) ********************* * Passed: 4-byte character string (lcLongstr) in low-high ASCII format * Returns: long integer value * Example: * m.longstr = "1111" * m.longval = strtolong(m.longstr) LOCAL i, lnRetval, lnAscCode, llIsNeg llIsNeg = BITTEST(ASC(m.lcLongstr),7) STORE 0 TO m.lnRetval FOR m.i = 0 TO 3 m.lnAscCode = ASC(SUBSTR(m.lcLongstr,i+1,1)) IF llIsNeg && Negative value ** Reverse bits m.lnAscCode = BITXOR(m.lnAscCode,0xFF) ENDIF m.lnRetval = m.lnRetval + (m.lnAscCode * (2^(i*8))) NEXT RETURN IIF(llIsNeg,-(m.lnRetval+1),m.lnRetval)(Function based on code posted by Borislav couple of days ago)