View Full Version : Setting a value in memory...??
jrhoads@cdsgroup.com
01-21-2002, 09:42 AM
Is it possible to set a specific value in memory, have a second value that would be incremented by one everytime someone starts the app, and compare the two? If the max (first value in memory) is reached, kick them out of the app? Is this actually possible? I know ILE has some nice memory functions.
BVining
01-21-2002, 09:42 AM
One approach would be to create a user domain user space, set a space pointer to the user space, have your max and current values in the space, check if current less than max and if not maintain the current value using the CMPSWP MI instruction (presumeably with both increment and decrement functions) within your application; if current greater than or equal to max then end the application. You'll need some general housekeeping routines to reset current to 0 if your applications fail without decrementing the current count and one to maintain max (if it ever changes), but what you describe is certainly doable (and reasonably fast) with ILE.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.