203 of 318
ZBasic System Library 193 ZX Microcontroller Family PersistentPoke Type Subroutine Invocation PersistentPoke(value, address) Parameter Method Type Description value ByVal Byte The to write to persistent memory. address ByVal int16 The persistent memory address to which to write. Discussion This routine will write the given value to the specified persistent memory address. The address of any persistent variable can also be obtained using the DataAddress property. For persistent variables, the DataAddress property is of type UnsignedInteger. Caution The first 32 bytes of persistent memory are reserved for the system. Modifying any of them may produce unpredictable results. The persistent memory (on-board EEPROM) has a limit specified by the manufacturer of a million write cycles. When this limit is exceeded the memory may become unreliable. Example Dim pi as PersistentInteger Call PersistentPoke(&H55, 1000) Call PersistentPoke(&H55, pi.DataAddress + 1) The second use of PersistentPoke() demonstrates how you can use the DataAddress property to write a byte value to any part of a persistent variable of any type. Compatibility BasicX does not support the use of the DataAddress property for persistent items. The BasicX system has only 512 bytes of persistent memory. This implementation has 1024 bytes of persistent memory of which the first 32 are reserved for system use. See Also PersistentPeek