Posted: Sun Oct 23, 2016 12:16 pm Post subject: Adding Records to tables
This morning I attempted to code adding records to a table
Code:
AL = getAddressList()
memrec = 0x0789B84C
for x = 1,2 do
mr = addresslist_createMemoryRecord(AL)
mr.Description = "Item " .. x+72 .. " Type"
mr.Address = memrec +x+2
mr.Type = vtByte
end
I got these results:
1. Records added at the bottom of the table--Expected that as I don't know how to add it as a child under "Items" folder
2. Addresses looked like decimal instead of hexadecimal, but right clicking them to show as hexadecimal did not change the appearance of the records.
How does one code this to correctly to have the records as a child and have hexadecimal addresses?
local AL = getAddressList()
local items = AL.getMemoryRecordByDescription("Items")
local memrec = 0x0789B84C
for x = 1, 2 do
mr = AL.createMemoryRecord()
mr.Description = "Item " .. x + 72 .. " Type"
mr.Address = string.format("%X", memrec + x + 2)
mr.Type = vtByte
mr.appendToEntry(items)
end
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum