User Tools

Site Tools


cdc:nos2.source:nam5871:np_zrbk

NP$ZRBK

Table Of Contents

  • [00003] PROC NP$ZRBK (WORDADR,FLAG)

Source Code

NP$ZRBK.txt
  1. *DECK NP$ZRBK
  2. *IF DEF,XFR
  3. PROC NP$ZRBK (WORDADR,FLAG) ;
  4.  
  5. BEGIN # NP$ZRBK #
  6.  
  7. #
  8. *** 1.PROC NAME AUTHOR DATE
  9. * NP$ZRBK L.T.NGUYEN 83/06/22
  10. *
  11. * 2.FUNTIONAL DESCRIPTION:
  12. * NP$ZRBK TAKES A WORD OF DISPLAY CHARACTER DATA AND REPLACES
  13. * TRAILING BLANKS WITH BINARY ZEROS OR ZERO WITH BLANKS.
  14. *
  15. * 3.INPUT PARAMS:
  16. * WORDADR - ADR THE WORD WHICH CONTAINS THE CHARACTER DATA.
  17. * FLAG - 0 FOR ZERO TO BLANK.
  18. * 1 FOR BLANK TO ZERO.
  19. *
  20. * 4.EXIT PARAMS: WORD = WORD WITH TRAILING BLANKS REPLACED BY
  21. * BINARY ZEROS OR ZERO BY BLANKS.
  22. *
  23. #
  24. DEF COLON #00# ;
  25. DEF BLNK #O"55"# ;
  26. BASED ARRAY WARDC S(1) ;
  27. BEGIN
  28. ITEM WORD C(0,0,10); # INPUT WORD #
  29. END
  30. ITEM WORDADR U ;
  31. ITEM FLAG B ;
  32. ITEM I I ;
  33.  
  34. P<WARDC> = WORDADR ;
  35.  
  36. IF FLAG
  37. THEN
  38. BEGIN # TRAILING BLANKS TO ZEROS #
  39. FOR I = 0 STEP 1 UNTIL 9
  40. DO
  41. IF C<I,1>WORD[0] EQ BLNK
  42. THEN
  43. C<I,1>WORD[0] = O"00" ;
  44. END # TRAILING BLANKS TO ZEROS #
  45. ELSE
  46. BEGIN # ZEROS TO BLANKS #
  47. FOR I = 0 STEP 1 UNTIL 9
  48. DO
  49. IF C<I,1>WORD[0] EQ COLON
  50. THEN
  51. C<I,1>WORD[0] = BLNK ;
  52. END
  53.  
  54. RETURN ;
  55. END # NP$ZRBK #
  56.  
  57. TERM
  58. *ENDIF
cdc/nos2.source/nam5871/np_zrbk.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator