Page 1 of 1

Read & Write Encoded Integers

Posted: Wed Aug 27, 2008 11:46 pm
by kawasaki
Hey All,

Encoded Integers (Described below) I believe would be a good addition to PureBasic, because it will add that little bit extra to it becoming on parr with the more commercialised programming languages.
Encoded Integers

An ENCINT is a variable-length integer. The high bit of each byte indicates "continued to the next byte". Bytes are stored most significant to least significant. So, for example, $EA $15 is (((0xEA&0x7F)<<7)|0x15) = 0x3515.

- "Microsoft's HTML Help (.chm) format" by Matthew T. Russotto
Thanks,


Mike

Re: Read & Write Encoded Integers

Posted: Thu Aug 28, 2008 4:45 am
by Little John
kawasaki wrote:Encoded Integers (Described below) I believe would be a good addition to PureBasic, because it will add that little bit extra to it becoming on parr with the more commercialised programming languages.
Which are the "more commercialised programming languages" you are thinking of?

Regards, Little John

Posted: Thu Aug 28, 2008 1:28 pm
by kawasaki
Hey,

The more major candidates for commercialised programming languages in my oppinion, obviously are C, C# and C++. Not necessarily commercialised, but more flexible.

Since there are cases out there (such as the CHM format) that uses the Encoded Integer, it would just be nice to have the Encoded Integer in the File I/O commands.


Thanks,

Mike

Posted: Thu Aug 28, 2008 1:43 pm
by freak
This is the first time i hear of such a number format. Just because one file format uses it does not justify adding extra commands to the language.

Besides, it sounds like a fairly simple format. Some bitshifting and arithmetic operations should do the trick to read/write it.

Posted: Thu Aug 28, 2008 1:52 pm
by Rings
freak wrote:This is the first time i hear of such a number format.
used sometimes in packing/codecs algos .

Posted: Fri Aug 29, 2008 2:28 pm
by Little John
kawasaki wrote:The more major candidates for commercialised programming languages in my oppinion, obviously are C, C# and C++.
And these programming languages do support ENCINT variables?

Regards, Little John