[Gambas-user] Reading hex from a string socket read
adam krell
akrell at ...43...
Thu Feb 19 22:52:33 CET 2004
Well, that would solve some of my problem, but I'm not
sure if it is the best way in the long run. A
pack/unpack or sprintf() function would do the trick
in the language itself, rather than having to modify
the component. But I'm not really an expert in these
things.
-Adam
--- Daniel Campos <daniel.campos at ...338...> wrote:
>
> >
> > I know eventually there'll need to be some kind of
> "pack/unpack"
> > function set for Gambas because you need to go
> from binary to
> > hex to integer (or array) a lot when dealing with
> legacy systems
> > and ISO protocols. I don't think my C's up to
> that right now,
> > though (maybe I can figure out how it works in
> perl and copy
> > their code somehow.... ugh)
>
> I could add four new static methods in the "Net"
> class:
>
> Integer to binary string and vice-versa:
>
> EncodeInteger (Number as Integer,Len as Integer) As
> Integer
> DecodeInteger (Number As String) As Integer
>
>
> Integer in network order to binary string and
> vice-versa:
>
> EncodeNetInt (Number as Integer,Len as Integer) As
> Integer
> DecodeNetInt (Number As String) As Integer
>
> Should it help?
>
>
>
> >
> > Rob
> >
> >
> >
> >
>
-------------------------------------------------------
> > SF.Net is sponsored by: Speed Start Your Linux
> Apps Now.
> > Build and deploy apps & Web services for Linux
> with
> > a free DVD software kit from IBM. Click Now!
> >
>
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> >
>
https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
>
-------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps
> Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
>
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/gambas-user
__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
More information about the User
mailing list