D
Dan Fitzpatrick
I am trying to port the OLE Reader from PHP to read Excel files on any=20
platform. I am stuck on the following function:
function GetInt4d($data, $pos) {
return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | \
(ord($data[$pos+2]) << 16) | (ord($data[$pos+3]) << 24);
}
My ruby version is:
def get_int_4_d(data, pos)
(data[pos]) | ((data[pos+1]) << 8) | \
((data[pos+2]) << 16) | ((data[pos+3]) << 24)
end
It works in some cases but in the example xls file I am using, when=20
data[pos,0] is the character =FE, the function returns -2 in PHP and=20
4294967294 in Ruby.
Thanks for your help.
Dan
platform. I am stuck on the following function:
function GetInt4d($data, $pos) {
return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | \
(ord($data[$pos+2]) << 16) | (ord($data[$pos+3]) << 24);
}
My ruby version is:
def get_int_4_d(data, pos)
(data[pos]) | ((data[pos+1]) << 8) | \
((data[pos+2]) << 16) | ((data[pos+3]) << 24)
end
It works in some cases but in the example xls file I am using, when=20
data[pos,0] is the character =FE, the function returns -2 in PHP and=20
4294967294 in Ruby.
Thanks for your help.
Dan