Previous Topic Next topic Print topic


ILSMARTRESTRICT

Limits the generation of properties in ILSMARTLINKAGE classes to non-redefining elementary items.

Syntax:

Restriction: This directive is supported for managed COBOL only.
>>-.---.---.----.-ILSMARTRESTRICT-------><
   +-/-+   +-NO-+         

Properties:

Default: NOILSMARTRESTRICT
Phase: Syntax check
$SET: Initial
IDE equivalent: Check Expose group linkage items to managed code on the COBOL tab in the project's properties, click Options and check Limit property generation to non-redefining elementary items.

Example:

The following COBOL program is compiled with ILSMARTLINKAGE, ILSMARTRESTRICT, ILCUTPREFIX(lnk-b-) and ILCUTPREFIX(lnk-):

       program-id. BookLegacy.
						 ...
       linkage section.
       01 lnk-function            pic x.
       01 lnk-b-details.
          03 lnk-b-text-details.
             05 lnk-b-title       pic x(50).
             05 lnk-b-type        pic x(20).
             05 lnk-b-author      pic x(50).
       01 lnk-b-reprint-details redefines lnk-b-details.	
          03 lnk-b-invisible      pic x(20).
         
       procedure division using by value lnk-function
                                by reference lnk-b-details.

In C#, you can access the data in BookLegacy program in .NET managed COBOL as follows:

    BookLegacy myBook = new BookLegacy(); 
         //creates an object corresponding to the BookLegacy program
    Details myDetails = new Details(); 
         //creates an instance corresponding to the group lnk-b-details 
    . . .          
       myDetails.Title = "Great Expectations";
      
       myBook.BookLegacy("2", myDetails);
         // calls the BookLegacy method with myDetails, 
         // which corresponds to the group item lnk-b-details

Without ILSMARTRESTRICT set, you can also access other properties, such as group items and redefining elementary items:

...
myDetails.setDetails = "Great Expectations     Novel       Dickens";
myDetails.setInvisible = "can't see this";

See the C# WinBook demonstration in the Visual COBOL samples for more.

Previous Topic Next topic Print topic