Figure 4: Example getter and setter

		

     P cust_getName...

     P                 B                   export

     D cust_getName...

     D                 PI            25A   varying

      /free

         return %trimr(InCust.Name);

      /end-free

     P                 E

		
A
     



     P cust_setName...

     P                 B                   export

     D cust_setName...

     D                 PI             1N

     D    Name                       25A   const

      /free

         if (Name = *blanks);

             SetError(CUST_EBADNAME: 'Name can''t be blank!');

             return *OFF;

         endif;

         InCust.Name = Name;

         return *ON;

      /end-free

     P                 E

		
B