home *** CD-ROM | disk | FTP | other *** search
- function hex2int
- parameter in_str,flipit
-
- * This routine takes a string of hex bytes and
- * converts them to an integer. The order in
- * which the bytes are evaluated is set by flipit.
-
- int_value = 0
- multiplier = 1
- in_str = alltrim(in_str)
-
- if flipit
- for x = 1 to len(in_str)
- int_value = int_value + (asc(substr(in_str,x,1))*multiplier)
- multiplier = multiplier*256
- endfor
- else
- for x = len(in_str) to 1 step -1
- int_value = int_value + (asc(substr(in_str,x,1))*multiplier)
- multiplier = multiplier*256
- endfor
- endif
- return int_value