|
|
| Author |
Message |
stevech
Joined: 23 Feb 2006
Posts: 657
|
|
Posted: 15 November 2006, 6:50 AM Post subject: ZBasic, Modules 101 |
|
|
What am I doing wrong here:
A.bas - contains
public foo1()
public var1 as byte
-------------------------------------
B.bas contains all this code
private b as byte
private foo2()
b = A.var1 ' works as you'd think, and is clearer, but
b = var1 ' is the same since the scope of var1 is "entire project"
call foo1() ' works as above
call A.foo1() ' yields a compiler error. The A. helps show what module this is in
end sub
--------------------------------------
As I read the manuals, call A.foo1() is permitted. |
|
| Back to top |
|
 |
mikep
Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX
|
|
Posted: 15 November 2006, 7:56 AM Post subject: Re: ZBasic, Modules 101 |
|
|
| stevech wrote: | | What am I doing wrong here: | Nothing, it looks like a compiler bug.
In my latest multi-module project (15 modules) I always use just the name without the scope prefix and I avoid name clashes. But I tried your example and got the same error with 1.4 version of the compiler. |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 15 November 2006, 20:01 PM Post subject: Re: ZBasic, Modules 101 |
|
|
| stevech wrote: | | As I read the manuals, call A.foo1() is permitted. |
You are correct; it should be. The cause of the problem, which also affects CallTask, has been determined and a solution has been implemented. Complete testing is yet to be done. |
|
| Back to top |
|
 |
stevech
Joined: 23 Feb 2006
Posts: 657
|
|
Posted: 15 November 2006, 20:35 PM Post subject: |
|
|
| One software project I worked on had a design review process. For each design/coding error (aka bug) that was found during development/test, the author had to throw a quarter in the bug jar. Unfortunately, we had quite a few lunches from that jar! |
|
| Back to top |
|
 |
|