>If I have a string created as follows...
>
>x=CHR(255)+CHR(85)+CHR(0)+CHR(16)+CHR(0)+CHR(0)
>
>
>What is the fastest way to retrieve a specified byte as an integer?
>
>bytenum=2
>? asc(substr(x,bytenum,1))
>
>...is all I could think of.
>
>
>FYI - This is a value returned from an api call. In vb I could use a struct but as far as I know vfp has nothing like that.
See all the difernt BITxxx-functions in help, in this case you can use BITTEST()
Update, I mesread BYTE as BIT. For bytes the substr() function is easiest, just as you showed.