(I am using F90/95 with the FTN95 Silverfrost compiler)
Is it possible to test for an undefined variable, that is intentionally undefined unless some event has occured?
For example, lets say I define X to be an integer but give it no initial value. During the course of the program X will be given a value ONLY if an event Y occurs. Later, I would like to initiate one set of commands if event Y has occured, and another set if it has not occured. I'd like to know whether I can test X to ask if it is undefined, or if it has a value, and use the outcome of this test to select which set of commands to initiate.
I realise that I could use a flag that is set when event Y occurs but I have limited flexibility to introduce new variables to this particular application, so an ability to test the existing variable X would be the preferred first solution.
I'd really appreciate any advice on this
Is it possible to test for an undefined variable, that is intentionally undefined unless some event has occured?
For example, lets say I define X to be an integer but give it no initial value. During the course of the program X will be given a value ONLY if an event Y occurs. Later, I would like to initiate one set of commands if event Y has occured, and another set if it has not occured. I'd like to know whether I can test X to ask if it is undefined, or if it has a value, and use the outcome of this test to select which set of commands to initiate.
I realise that I could use a flag that is set when event Y occurs but I have limited flexibility to introduce new variables to this particular application, so an ability to test the existing variable X would be the preferred first solution.
I'd really appreciate any advice on this