Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

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 program

4. 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 prog
    common a,b,c,d
 Sub prog
    common e,f,g,h

in sub prog e==a f==b g==c d==h

so in tour example you have tried this in the sub prog

 Main
    common a,b,c,d
Sub prog
    common myvar,a,b,c,d

so 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

View this thread on the forum...