filler character



Software AG's platform-independent programming language with full support for open-source and Internet applications

filler character

Postby msbaujs » Thu Nov 29, 2012 5:37 pm

In a map I defined an array as MYL'_' for the presentation and a control Variable cv(*)
Sometimes i put move (AD=p) to CV (6:10) for avoiding data Entry , and i want also that the filler character will presented as empty and not with the '_? character

Can i do it?
msbaujs
 
Posts: 2
Joined: Thu Nov 29, 2012 5:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: filler character

Postby RGZbrog » Fri Nov 30, 2012 5:28 am

This was tested under Natural for Windows. You'll have to see how it fares on the mainframe.
DEFINE DATA LOCAL
1 #A (A5)   INIT <'ab'>
1 #B (A5)
1 #C (C)
1 #L (L)    INIT <TRUE>
END-DEFINE
REPEAT
  INPUT (AD=MDL'_')
        'A:' #A (CV=#C)
     // 'B:' #B
  IF  #L
    THEN
      RESET #L
      IF  #A = ' '
        THEN
          ASSIGN #C = (AD=PN)
        ELSE
          ASSIGN #C = (AD=P)
          COMPRESS #A
                   H'0000000000'
              INTO #A LEAVING NO SPACE
      END-IF
    ELSE
      ASSIGN #L = TRUE
      ASSIGN #C = (AD=D)
      EXAMINE #A FOR H'00' DELETE
  END-IF
END-REPEAT
END

If the field is empty, the CV is set to non-display (AD=N). Otherwise the filler is replace with non-displayable characters (H'00'). For display (ie to revert to underscores) the hex zeros are deleted.

This works for alpha fields; I haven't come up with a solution for numerics, yet.
User avatar
RGZbrog
 
Posts: 101
Joined: Mon Nov 23, 2009 1:34 pm
Location: California, USA
Has thanked: 0 time
Been thanked: 0 time

Re: filler character

Postby msbaujs » Fri Nov 30, 2012 5:20 pm

thank you , its work
msbaujs
 
Posts: 2
Joined: Thu Nov 29, 2012 5:30 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Natural