Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: record layouts

$
0
0

You can't directly mark groups, or members of groups as anything other than private.  Only fields mapping directly onto managed types (binary-long, string object references) are allowed to have more than private visibility.  However, you can mark fields in the record definition as properties, something like:

     $set sourceformat(free)

class-id a.

select test-file

assign       to "\temp\test.dat"

organization is indexed

access       is dynamic

record key   is test-key

lock mode    is manual.

fd  test-file.

      01 test-rec property protected.

          05  test-key    pic  x(07)        property protected.

end class.

class-id b inherits type a.

method-id m.

  set test-key to "ABCDEFG"

end method.

end class.

In this case, both test-rec and test-key are exposed as string properties, and access to the properties works by expanding the pic x field (or group) to a Unicode string for the get property and vice versa for the set property.  In this example, setting the test-rec property and setting the test-key property will in fact update the same data area in the inherited program.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>