View previous topic :: View next topic
|
Author |
Message |
vin12pr Warnings : 1 New User
Joined: 14 Jun 2006 Posts: 56
|
|
|
|
Here is a scnerio...
I would set a value for a variable and i would like to keep that value through out the program.Even thouigh If i attempt to modify the value.The default value should not change.
For Ex: If i have set variable A to 6 ,it should remain 6 through out the program.Even if an attempt is made to modify the value(Lets say to 7) in the program,It should not change.
Is there any way to do this?
Thnx in advance! |
|
Back to top |
|
|
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
Vin12,
unless an untill u change the value in the variable the value would not change u did not xpect this answer rite....
K assign the same value to an other variable(var2) and at the end re-assign the var2 to vaiable 1, this is a simple way of doin it.
Thamilzan. |
|
Back to top |
|
|
arindam111
New User
Joined: 29 Nov 2006 Posts: 27 Location: India
|
|
|
|
ohh! COBOL doesn't support STATIC like in Java/C# |
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
If you don't want to modify the value then design your program such that you don't code a modify, is that too difficult or am I missing something? |
|
Back to top |
|
|
vin12pr Warnings : 1 New User
Joined: 14 Jun 2006 Posts: 56
|
|
|
|
Please consider the same case for a online program.....
Thanks,
Vinay |
|
Back to top |
|
|
smiley Warnings : 1 New User
Joined: 08 Feb 2006 Posts: 27
|
|
|
|
online cics program?? dont allow user to enter values to this field..keep that field protected. |
|
Back to top |
|
|
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
Vinay,
As i told u b4 y dont u assign the value to an other variable and not tamper the same at at the end move the value of variable 2 to vaiable 1 it works with online also
Thamilzan. |
|
Back to top |
|
|
krishna_sureka
New User
Joined: 05 Sep 2006 Posts: 7 Location: Pune
|
|
|
|
COBOL don't support startic/constant. So you hvae to use the workround with two variables as explained by prav_06 or USE FILLER. Using filler, will make sure that value will not get changed atleast by INITIALIZE.
But if you specifically try to change the value, It can get changed. |
|
Back to top |
|
|
|