Yesterday's improvements to SprintDLL's copyslot command made it possible to allocate chunks of memory and access them like arrays using constant indexes. That's very nice, but it would be even more helpful if the index could be determined at runtime from a slot's value. So today I made the pointer adjustment phrases and length switches accept either a constant number or a slot name. Therefore, things like this work:
allocslot native myInts: 4 sizesof int
newslot int toStore = 3
copyslot myInts dereferenced offset 1 sizesof int = toStore
newslot int index = 1
newslot int retrieve = 0
copyslot retrieve = myInts dereferenced offset index sizesof int
readslot /raw retrieve
// Prints 3
No comments:
Post a Comment