COMMON-Statement and §Insert window_common% (AREV Specific)
At 29 MAR 1998 07:26:27AM W. Singer wrote:
When I insert a common statement for one variable
and afterwords want to introduce the Window_common% block
I get an error message that numeric data is required. When I
remove the common statement the program runs without any problems.
In the application the following steps happen:
1. The main program called by a menu option sets the common variable.
2. In the next step a window is opend.
3. The window processing calls several usbroutines which contain a
reference to the common variable defined in the main program4. The common statement is followed by the $insert command for the
window_common% block. At this point I get the error message.Does anybody have an explanation or a solution for this problem?
Thank you very much!
With kind regards
W. Singer
At 29 MAR 1998 08:32AM Andrew P McAuley wrote:
Common is relative - that is, it always occurs in the order the main program declares it, thus
Main progcommon a,b,c,dSub progcommon e,f,g,hin sub prog e==a f==b g==c d==h
so in tour example you have tried this in the sub prog
Maincommon a,b,c,dSub progcommon myvar,a,b,c,dso sub prog sees myvar as a, a as b, b as c etc.
Now in the window common it dimensions w to wcnt, and as wcnt has now been moved off by one wcnt is no longer valid.
Simple answer is that in a sub you can't declare new common unless it is labelled common.
At 30 MAR 1998 07:08PM W. Singer wrote:
Dear Mr. McAuley,
thank you very much for your explanation. It is a little bit difficult to understand, but I hope I will overcome the problem with this additional information.
W.Singer