Highlighted
Absent Member.
Absent Member.
955 views

inherits from superclasse with data.

My superclasse have a FD, like this:

.

.

.

End class-object.

Object.
Input-Output Section.
File-Control.
SELECT arqSYSCONF ...

File Section.
FD arqSYSCONF ...

Object-Storage Section.
01 InstanceData pic x(032).

*/////////////////////////////////////////////////////////////

The FD causes a problem in InstanceData.

I move "ajSauro" to InstanceData and in the class that inherits superclasse, the value of InstanceData is an unexpected value.

If I remove SELECT and FD, then it is OK.

Anybody have a soluction to this?

Hug

Antonio João

NextExpress + Dialog System.

Antonio João

Primavera do Leste / MT / Brasil

Tags (1)
0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: inherits from superclasse with data.

What version of Net Express are you using?

Can you please post a full example of what you mean including the class that inherits this class?

Thanks

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: inherits from superclasse with data.

Hi, Chris.
 
I am using Net Express 3.1.
 
I will send you a basic test (can I attach a file?).
I discovered that if I define a FD in the Super Class or in the class that inherits it, this does not work.
Thanks.
 
 
SUPERCLASSE

      *******************************************************************

       Class-id. superclasse

                 inherits from base.

      *-------------------------------

       Object                 Section.

      *-------------------------------

       Class-Control.

      *--------------

           superclasse is class "superclasse"

           base is class "base"

           .

      *-------------------------------

       Working-Storage        Section. *> Definition of global data

      *-------------------------------

       01           GlobalData          pic x(032).

      */////////////////////////////////////////////////////////////////*

      *             Definition of class data and methods                *

      */////////////////////////////////////////////////////////////////*

       Class-Object.

      *-------------

      *-------------------------------

       Object-Storage         Section.

      *-------------------------------

       01           ClassData           pic x(032).

      *//////////////////////////////////////////////////////////////////

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *                                                                 *

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       Method-id. "CriarObjeto".

      *-------------------------------

       Linkage                Section.

      *-------------------------------

       01           lnkObjeto           Object Reference.

      *-----------------------------------------------------------------*

       Procedure              Division  Returning lnkObjeto.

      *-----------------------------------------------------------------*

           Invoke   SUPER "New"         Returning lnkObjeto

 

 

           Move     'Por SuperClasse em "CriarObjeto"' to ClassData

 

 

           Invoke   lnkObjeto "setGlobalData" Using ClassData

 

           Exit     Method

           .

       End Method "CriarObjeto".

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *                                                                 *

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       Method-id. "setClassData".

      *-------------------------------

       Linkage                Section.

      *-------------------------------

       01           lnkClassData        pic x(32).

      *******************************************************************

       Procedure              Division  Using lnkClassData.

      *******************************************************************

           Move     lnkClassData        to ClassData

 

           Exit     Method

           .

       End method "setClassData".

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *                                                                 *

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       Method-id. "getClassData".

      *-------------------------------

       Linkage                Section.

      *-------------------------------

       01           lnkClassData        pic x(32).

      *-----------------------------------------------------------------*

       Procedure division returning lnkClassData.

           Move     ClassData           to lnkClassData

           Move     'Modificado por superclasse' to ClassData

 

           Exit     Method

           .

       End method "getClassData".

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       End class-object.

      */////////////////////////////////////////////////////////////////*

      *             Definition of instance data and methods             *

      */////////////////////////////////////////////////////////////////*

       Object.

      *-------------------------------

       Object-Storage         Section.

      *-------------------------------

       01           InstanceData        pic x(032).

       01           oVARIAVEIS.

         05         oFILEID1             PIC X(065) VALUE SPACES.

         05         oFileStatus1.

           10       oStatusKey11         PIC X.

           10       oStatusKey21         PIC X.

           10       oBinaryStatus1       REDEFINES oStatuskey21

                                        PIC 99 COMP-X.

      *//////////////////////////////////////////////////////////////////

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *                                                                 *

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       Method-id. "setGlobalData".

      *-------------------------------

       Linkage                Section.

      *-------------------------------

       01 lnkGlobalData          pic x(32).

       Procedure division using lnkGlobalData.

           Move     lnkGlobalData       to GlobalData

           Move     'ajSauro'           to InstanceData

 

           Exit     Method

           .

       End method "setGlobalData".

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *                                                                 *

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       Method-id. "getGlobalData".

      *-------------------------------

       Linkage                Section.

      *-------------------------------

       01           lnkGlobalData       pic x(32).

 

       Procedure division returning lnkGlobalData.

           Move     GlobalData          to lnkGlobalData

 

           Exit     Method

           .

       End method "getGlobalData".

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *                                                                 *

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       Method-id. "getSuperInstanceData".

      *-------------------------------

       Linkage                Section.

      *-------------------------------

       01 lnkInstanceData        pic x(32).

 

       Procedure division returning lnkInstanceData.

           Move     InstanceData        to lnkInstanceData

 

           Exit     Method

           .

       End method "getSuperInstanceData".

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       End object.

      *//////////////////////////////////////////////////////////////////

       End class SuperClasse.

      *******************************************************************

 
 

Class that inherits SuperClasse

      *******************************************************************

       class-id. ClasseWithData data is protected

                 inherits from superclasse with data.

      *-------------------------------

       Object                 Section.

      *-------------------------------

       Class-Control.

      *--------------

           ClasseWithData is class "ClasseWithData"

           superclasse is class "superclasse"

           .

      *-------------------------------

       Working-Storage        Section. *> Definition of global data

      *-------------------------------

      */////////////////////////////////////////////////////////////////*

      *             Definition of class data and methods                *

      */////////////////////////////////////////////////////////////////*

       Class-Object.

      *-------------

      *-------------------------------

       Object-Storage         Section.

      *-------------------------------

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *                                                                 *

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       Method-id. "CriarObjeto".

      *-------------------------------

       Local-Storage          Section.

      *-------------------------------

       01           lsData              pic x(032).

      *-------------------------------

       Linkage                Section.

      *-------------------------------

       01           lnkObjeto           Object Reference.

      *-----------------------------------------------------------------*

       Procedure              Division  Returning lnkObjeto.

      *-----------------------------------------------------------------*

           Invoke   SUPER "CriarObjeto" Returning lnkObjeto

           Invoke   lnkObjeto "setInstanceData"

 

 

           Move     'Por ClasseWD em "CriarObjeto"' to ClassData

 

           Exit     Method

           .

       End Method "CriarObjeto".

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *                                                                 *

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       Method-id. "getClassData".

      *-------------------------------

       Linkage                Section.

      *-------------------------------

       01           lnkClassData        pic x(32).

      *-----------------------------------------------------------------*

       Procedure division Returning lnkClassData.

           Invoke   SUPER "getClassData" Returning lnkClassData

 

           Exit     Method

           .

       End method "getClassData".

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       End class-object.

      */////////////////////////////////////////////////////////////////*

      *             Definition of instance data and methods             *

      */////////////////////////////////////////////////////////////////*

       Object.

      *------------------------------

      *Input-Output           Section.

      *------------------------------

      *File-Control.

      *------------

      *    SELECT   arqSYSCONF    ASSIGN TO DISK

      *             ORGANIZATION IS     LINE SEQUENTIAL

      *             FILE STATUS  IS     oFileStatus1

      *             ACCESS MODE  IS     SEQUENTIAL.

      *******************************************************************

      *Data                   Division.

      *******************************************************************

      *------------------------------

      *File                   Section.

      *------------------------------

      *FD           arqSYSCONF

      *             LABEL RECORD        IS STANDARD

      *             RECORD CONTAINS     013 CHARACTERS

      *             VALUE OF FILE-ID    IS oFILEID1.

      *

      *01           scREG.

      *  05         scCHAVE.

      *    10       FILLER              PIC X(005).

      *  05         scDADOS.

      *    10       FILLER              PIC X(008).

      *//////////////////////////////////////////////////////////////////

      *-------------------------------

       Object-Storage         Section.

      *-------------------------------

       77           umaWindow           object reference value null.

      *//////////////////////////////////////////////////////////////////

       01           wOpenStatus         PIC X(006) VALUE SPACES.

       01           aString             object reference.

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *                                                                 *

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       Method-id. "setInstanceData".

      *-------------------------------

       Linkage                Section.

      *-------------------------------

       01           lnkInstanceData     pic x(32).

       Procedure division using lnkInstanceData.

           If       Address lnkInstanceData is equal null

           Move '"setInstanceData" em ClasseWithData' to InstanceData *>Definida em SUPERCLASSE

           Else

                    Move lnkInstanceData to InstanceData *>Definida em SUPERCLASSE

           End-If

 

           Exit     Method

           .

       End method "setInstanceData".

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *                                                                 *

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       Method-id. "getInstanceData".

      *-------------------------------

       Linkage                Section.

      *-------------------------------

       01           lnkInstanceData     pic x(32).

       Procedure              Division  Returning lnkInstanceData.

                 *> Definida em SUPERCLASSE

           Move     InstanceData        to lnkInstanceData

 

           Exit     Method

           .

       End method "getInstanceData".

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       End object.

      *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*

       end class ClasseWithData.

      *******************************************************************

Antonio João

Primavera do Leste / MT / Brasil

Tags (1)
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: inherits from superclasse with data.

You can attach a file by clicking on the Use rich formatting link below and then clicking on the Options tab at the top. File size is limited to 64KB though I believe.

What is the actual error that you are getting? Stating that it doesn't work is not much for me to go on and NX 3.1 is an extremely old product.

Thanks.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.