[CG] raren error...

Forum van 1ste Bachelor Informatica.

Moderator: Praesidium

User avatar
Wim
Posts: 16

raren error...

Post#1 » Sat Feb 25, 2006 6:26 pm

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??

User avatar
Norfolk
WOZ
Posts: 780
Contact:

Post#2 » Sat Feb 25, 2006 6:54 pm

hmmm code zou welkom zijn...

User avatar
EagleEye812
Posts: 406

Post#3 » Sat Feb 25, 2006 7:13 pm

Ik heb die error ook een paar keer gehad, maar ik kan u ni direct zeggen hoe het te fixen
It 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.
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 record

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.

User avatar
Chatora
Posts: 37

Post#4 » Sat Feb 25, 2006 7:42 pm

Duidt dat niet op het feit dat ge probeert een procedure aan uw ADT toe te voegen, buiten de module waarin uw object gedefiniëerd is?

Ik meen mij te herinneren dat ik die error ook eens ben tegengekomen... of toch iets in dien aard, en toen was dat het probleem. :)
Last edited by Chatora on Sat Feb 25, 2006 7:43 pm, edited 1 time in total.

User avatar
Yo_rik
Posts: 69

Post#5 » Sat Feb 25, 2006 7:42 pm

Idd..
Je mag enkel methodes (procedures) voor een bepaald object declareren op dezelfde plaats waar je het object declareert, dus niet in een andere module of als geneste procedure.
Een oplossing is eerst een uitbreiding van het object maken en daarop de nieuwe methode definiëren.

User avatar
EagleEye812
Posts: 406

Post#6 » Sat Feb 25, 2006 8:10 pm

Aah, merci :)

User avatar
Wim
Posts: 16

Post#7 » Sun Feb 26, 2006 1:53 pm

merci manne voor den uitleg
ik kan verder nu :-)

Return to “1ste Bachelor”

Who is online

Users browsing this forum: No registered users and 5 guests