Texas Instruments TI89 Developer Guide - Page 349
EV_runningApp, OO_appGetPublicStorage
![]() |
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 349 highlights
Appendix A: System Routines - Apps 307 OO_appSetPublicStorage Declaration: void OO_appSetPublicStorage (ULONG ps) Category(ies): Apps Description: Save a value in the running app's public storage. The application control block of each app has a place to store user data. This public storage is large enough to contain a 32-bit value, typically a memory handle, but can be a pointer or integer. Garbage collecting Flash memory may involve moving an app. When this happens, the app is reinitialized after it is moved to its new location. Consequently, the contents of the app's data segment (static and global variables) are reset to their initial values. Public storage is a convenient place to save data which is preserved through app reinitialization. Inputs: ps - Value to save in the app's public storage. Outputs: None Assumptions: This routine assumes you want to store user data in the application control block indicated by the app ID in OS global variable EV_runningApp. This may not be the case with TI-BASIC extension functions and shared-code libraries. These types of routines are often called as subroutines from other applications, in which case EV_runningApp contains not the ID of your app, but the ID of the calling application. This is an instance when your routines should not modify the calling app's public storage. Side Effects: None Availability: On AMS 2.00 and higher TI-89 / TI-92 Plus Differences: None See Also: OO_appGetPublicStorage Example: This example illustrates how to save your global variables during Flash memory garbage collection. The idea is to group all your global variables into a single structure. Then when it is time to garbage collect, it is easy to allocate a block of memory from the heap large enough to hold your globals, and store the memory block's handle in public storage. (continued) TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001
![](/manual_guide/products/texas-instruments-ti89-developer-guide-95b636f/349.png)