pmem_save - Save persistent memory
void pmem_save();
void pmem_save(uint8 slot_no);
Save the contents from the RAM structure that mirrors the persistent memory to the actual persistent memory correlated with current memory slot, or with slot_no.
pmem_save() should be called at least once after modify the contents using pmem_write() , so the modified data can be accessible on subsequent executions of the GPC script. |
No value is returned.
The persistent memory is an array of 128 bytes that can be used to store data structures such that they can continue to be accessed even after the end of the GPC script that created or last modified them.
For performance reasons the operations pmem_read()
and pmem_write()
are performed in RAM, therefore the persistent memory contents should first be loaded into RAM space by pmem_load()
and, if modified, saved with pmem_save()
.
void set_pvar(uint8 idx, int16 val) { pmem_write(idx, val); pmem_save(); }