[Gambas-user] Reading hex from a string socket read

adam krell akrell at ...43...
Thu Feb 19 15:01:43 CET 2004


Hi,

I am using the socket component to make a tcp
connnection and read some data.  The data needs to be
decoded from hex.  I'm doing that with this command:

Dim TwoByteCode AS Integer

TwoByteCode = Val(Str$(Asc(Mid$(Buffer,1,1))) &
Str$(Asc(Mid$(Buffer,2,1))))

Is there a more efficient way to do this?  If I am
decoding a long string of data this can really slow
down the program.

Thanks,

Adam

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools




More information about the User mailing list