Page History
...
In 5250 programs (LANSA/RPG) or in a Windows programs (Visual LANSA/Visual Basic) the logic would be:
Define #NUMBER with a default value of zeroChange #NUMBER to #NUMBER + 1Display the incremented #NUMBER value
In stateless programs #NUMBER (and in fact your whole program and all its state) ceases to exist between interactions with the user. Therefore the variable cannot be used to remember it's previous value between interactions with the user.
The change to your programming approach is easy enough. You simply need to do this:
Define #NUMBERRestore the current value (i.e. state) of #NUMBERChange #NUMBER to #NUMBER + 1Save the new value (i.e. state) of #NUMBERDisplay the new #NUMBER value (at which point your program ceases to exist)
LANSA for the Web and the Framework both provide facilities to save and restore state for you (more on that later). Maintaining state is easy, but you need to understand that it is happening and how it impacts your applications.