Code: Select all
Function ReadDataWord pLowByte, pHighByte, pIsLittleEndian, @pImageFile
put empty into tDataWord
put 0 into tPwr
If pIsLittleEndian then
put "Little Endian : " into tdebug
Repeat with N = pLowByte to pHighByte
put byteToNum(byte N of pImageFile) into tInt
put baseConvert(tInt, 10, 16) into tTemp
put tTemp and comma after tDebug
add tInt*(16^tPwr) to tValue
add 1 to tPwr
end Repeat
Else
correctly populates the variable tInt and its value may be viewed by stopping the code in the debugger. The code converts the integer tInt to base 16 and the hex value is stored in tTemp. However, if I try to place either tInt or tTemp into the variable tDebug the word "false" is added. Again this is visible in the debugger. Does Livecode have type conversions ? Any thoughts on what is happening ?put byteToNum(byte N of pImageFile) into tInt