Bug in 4.0.0.2: Unit structure - prototypes

General discussion on mikroPascal for AVR.
Post Reply
Author
Message
JohannesH
Posts: 68
Joined: 23 Apr 2007 07:51

Bug in 4.0.0.2: Unit structure - prototypes

#1 Post by JohannesH » 20 Mar 2008 09:16

The mikroPascal AVR documentation tells us on page 44 how the structure of a unit should look like and about the use of prototypes for procedures and functions. Thats very similiar to the way other pascal compilers handle this.

The following code does not compile:

Code: Select all

Unit Myunit;
...
procedure MyProc;     //prototype
...
implementation
...
procedure MyProc;     //compiler error: Procedure MyProc already defined.
begin
...
end;
The compiler tells me: Procedure MyProc already defined.
So, we have to remove the prototype definition to be able to compile.
BUT that leads to the unwanted situation that the "implementation" section of a unit does not what it main task should be: "Encapsulating". Currently all procedures and function defined within the implementation section are visible from outside and prototypes lead to compiler error.

Johannes

Post Reply

Return to “mikroPascal for AVR General”