CGETTXT

CGETTXT retrieves up to 127 bytes of the comment record text.

Using the API in a Program

The size of the segment retrieved can be determined by the value of the D<Prefix>@C@EXTXSZ variable. You can specify segments up to 127 bytes long. To preserve spacing within a comment, you can set this variable to the size of the text being appended to the comment. A value of zero in this variable tells the API to trim trailing spaces.

You can control word wrap and hard return placement at the end of each text line retrieved using the following variables:

  • D<Prefix>@C@OPHRRT

  • D<Prefix>@C@OPSFRT

  • D<Prefix>@C@NOHRRT

  • D<Prefix>@C@NOSFRT

To check whether you have reached the end of text stored in the comment, check the value of the variable CMT<Prefix>-NOT-EOT D<Prefix>@C@NEOT or D<Prefix>@C@EOT.

Programming Example

This example retrieves the text of a comment.

        EVAL      DCOM@C@OPSFRT  = 0    
        EVAL      DCOM@C@OPHRRT  = 0                        
        EVAL      DBDH@C@EXTXSZ  = PWSBDH#EXTXSZ            
        CALLP     U@@ATTACHIO('CGETTXT': DBDH@@HANDLE:      
                  %ADDR(DBDH@C@@PATH): %ADDR(DBDH@RECORD):  
                  %ADDR(DBDH@C@))                           
        DOW       DBDH@C@EOT <> 1