Difference between revisions of "Lua:byteTableToWord"

From Cheat Engine
Jump to navigation Jump to search
Line 20: Line 20:
 
   local bt = { 0x64, 0x00 }
 
   local bt = { 0x64, 0x00 }
 
   local value = byteTableToWord(bt)
 
   local value = byteTableToWord(bt)
   print(string.format('0x%02X', value))
+
   print(string.format('0x%0X', value))
 
   print(value)
 
   print(value)
  

Revision as of 07:58, 9 March 2017

function byteTableToWord(Table)

Converts a byte table to a WORD (2 bytes), interpreting them as an integer.


Function Parameters

Parameter Type Description
Table table The table of bytes to convert


Examples

Code:

 local bt = { 0x64, 0x00 }
 local value = byteTableToWord(bt)
 print(string.format('0x%0X', value))
 print(value)

Output:

 0x64 
 100 


See also

Related Functions