>>>I'm looking at some code and they are saving values in either 8bit or 16bit or 32bit words. How can I do that in FoxPro. Sorry if this is detailed enough but I don't understand what these "words" are. It looks like they take an ASCII value and transform it into an different word.
>>
>>In VFP a SHORT is a 16 bit integer (a WORD), an INTEGER is 32 bits (a DWORD). 8 bits is a BYTE but VFP has no corresponding data type. Perhaps if you posted the code, we could be of more help. Since VFP is so loosely typed, it may not be necessary to make any modification.
>
>
>I was looking at the LZW compression method. There are example on the web in C and in VB. I have the method down on how to create the "compression table" but when writing the data out it creates new fake ascii values. So 0 to 255 are the normal one but when they create a new value in the compression table they assign it value 256 for the first one so that we know it's in the "compression table lookup" and not just a normal ascii value. So to write out the 256 they say you write it in 8bit/16bit/32bit values. The C code I started looking at is
http://www.dogma.net/markn/articles/lzw/lzw.htm. The code is at the bottom of the webpage
That's just a VFP short since 255 is the maximum value of a byte. VFP handles this in the proper manner. Just as an FYI, the storage is in least-to-most significant byte. So while we would write this in hex as 0x0100, it's internally stored in the reverse. In binary, it would look like this:
LSB MSB
0000 0000 0000 0001
George
Ubi caritas et amor, deus ibi est