Ik krijg nen error tijdes tcompilere:
procedure must be bound to a record of the same scope
weet er iemand wa da just betekent en hoe ik da moet oplosse??
Moderator: Praesidium
en in Programming in Oberon staat er nog iets over scopes van records - en dat heeft er iets mee te maken dat je recordvelden enkel aan mag roepen met recordnaam.veldnaam en dat "veldnaam" dus mag hergebruikt worden buiten de scope van het recordIt is good programming practice to declare objects local, i.e. to confine the existence of an object to that
procedure in which it has meaning. The procedure, i.e. the section of program text in which a name is
declared, is called its scope.
The rules of scope (validity of identifiers) are as follows:
1. The scope of an identifier is the procedure in which its declaration occurs, and all procedures enclosed
by that procedure, subject to rule 2.
2. If an identifier i declared in a procedure P is redeclared in some inner procedure Q enclosed in P, then
procedure Q and all procedures enclosed in Q are excluded from the scope of i declared in P.
3. The standard identifiers of Oberon are considered to be declared in an imaginary scope enclosing the
program.
Project Oberon wrote: Not only procedures, but also record types establish their own local scope. The list of record fields is anchored in the type record's field link, and it is searched by procedure FindField. If a record type R1 is an extension of R0, then R1's field list contains only the fields of the extension proper. The base type R0 is referenced by the BaseTyp field of R1. Hence, a search for a field may have to proceed through the field lists of an entire sequence of record base types.
The major part of module OCT is devoted to input and output of symbol files. A symbol file is a linearized form of an excerpt of the symbol table containing descriptions of all exported (marked) objects. All exports are declared in the global scope. Procedure Export traverses the list of global objects and transfers them into the symbol file.
Users browsing this forum: No registered users and 5 guests