10-13-2007 6:52 PM
Statics can be used only within Form....EndForm. Is there any similar thing which can be used outside Form so that one can persist data between calls to the subroutine
10-14-2007 7:00 AM
Hi Mala,
Static Local Data Objects
If you want to keep the value of a local data object after exiting the subroutine, you must use the STATICS statement to declare it instead of the DATA statement. With STATICS you declare a data object that is globally defined, but only locally visible from the subroutine in which it is defined.
But if you want to have a varibale outside the subroutines which persists their values between subroutine calls,it is better to define them as global variables and they will be available.
In case you have any further clarifications,do let me know.
Regards,
Puneet Jhari.
10-13-2007 9:13 PM
Hi Mala,
outside FORM variables are global: They are initialized at program start and will retain their values until end of program run.
STATICS means that the field will not lose it's value when the FORM processing is left. Next time the FORM is called, the value is still stored in the STATIC field. This means the variable field is like a global variable with the difference that you can not see it from outside the form.
Regards,
Clemens
10-14-2007 6:09 AM
Hi,
If you declare that variable globally (like in a top include). then that variable will be available..
Thanks
Naren
10-14-2007 7:00 AM
Hi Mala,
Static Local Data Objects
If you want to keep the value of a local data object after exiting the subroutine, you must use the STATICS statement to declare it instead of the DATA statement. With STATICS you declare a data object that is globally defined, but only locally visible from the subroutine in which it is defined.
But if you want to have a varibale outside the subroutines which persists their values between subroutine calls,it is better to define them as global variables and they will be available.
In case you have any further clarifications,do let me know.
Regards,
Puneet Jhari.