Error 12378 : Problem with protected TempTable and bind

Posted by jmls on 13-Apr-2013 06:49

Progress 11.2

I have been fighting error 12378 (Attempt to reference uninitialized temp-table) for the past couple of days, and actually managed to get a basic example together of what is wrong

the "Creator" class defines the temp-table, and creates a record.

ClassA inherits ClassB which inherits ClassC

Class C calls the bind method to get the temp-table from Creator.

Custom.p creates  the creator class, calls the method to populate the temp-table and passes the class to ClassA

when you run custom.p, you will get the following messages

"ClassC: yes"

**Attempt to reference uninitialized temp-table. (12378)

However, if you uncomment the message in ClassB and rerun custom.p, you get the following messages

"ClassC: yes"

"ClassB: yes"

"ClassA: foo"

has anyone else come across this behaviour ? All thoughts and comments welcome.

I would appreciate it if you could run this on your machine and let me know the results (different versions of progress)

Many thanks

Julian

code follows:

/** Property.i */

def {&AccessMode} temp-table TTProperty no-undo serialize-name "Property" {&REFERENCE-ONLY}

    field PropertyName   as character .

/** custom.p */
def var c1 as temp.Creator no-undo.
c1 = new temp.Creator().
c1:init().
new temp.ClassA(c1).
message "here" view-as alert-box.
/** Class A */
class temp.ClassA inherits temp.ClassB:
  constructor ClassA(p_creator as temp.Creator):
    super(p_creator).
    for each TTProperty no-lock:
      message "ClassA" TTProperty.PropertyName view-as alert-box.
    end.
  end constructor.
end class.

/** Class B */

class temp.ClassB inherits temp.ClassC:

  constructor ClassB(p_creator as temp.Creator):

    super(p_creator).

/*   message "ClassB" can-find(first TTProperty) view-as alert-box.*/

  end constructor.

end class.

/** ClassC */

class temp.ClassC abstract:

  {temp/Property.i &AccessMode="protected" &REFERENCE-ONLY="reference-only"}  

  constructor ClassC(p_creator as temp.Creator):

    p_creator:GetProperties(output table TTProperty bind).

    message "ClassC" can-find(first TTProperty) view-as alert-box.

  end constructor.

end class.

All Replies

Posted by jmls on 13-Apr-2013 06:51

arrgh. forgot to add the creator class

/** creator.cls */

class temp.Creator:

{temp/Property.i}

constructor Creator():

end constructor .

method public void init():

   create TTProperty.

   assign TTProperty.PropertyName = "foo".

end method.

method public void GetProperties(output table for TTProperty bind):

end method.

end class.

Posted by jmls on 13-Apr-2013 09:40

Interesting. If you replace the message statement in classB with a

find first ttproperty no-lock.

then it works as well.

However, if you just have a

message "ClassB" view-as alert-box.

then the error message comes back.

It looks like you need to reference the temp-table in each sub-class before it can be accessible in the top class

Gonna try that in the project where I'm having some problems to see if it gets fixed.

Posted by jmls on 13-Apr-2013 13:32

and the answer is, yes , it does fix the problem ...

Would still be useful to know if this is a problem on other versions

Guess I'll have to log a bug report

This thread is closed