User Tools

Site Tools


cdc:nos2.source:nam5871:nxzfn

Table of Contents

NXZFN

Table Of Contents

  • [00003] FUNC NXZFN(ZNAME)C(10)
  • [00036] NXZFN - ZERO-FILLED NAME.
  • [00040] ZERO-FILLED NAME.

Source Code

NXZFN.txt
  1. *DECK NXZFN
  2. USETEXT NIPDEF
  3. FUNC NXZFN(ZNAME)C(10);
  4. *IF DEF,IMS
  5. #
  6. *1DC XZFN
  7. *
  8. * 1. PROC NAME AUTHOR DATE
  9. * XZFN M. D. PICKARD 77/03/12
  10. *
  11. * 2. FUNCTIONAL DESCRIPTION
  12. * CHANGE BLANKS TO ZEROS IN A TEN CHARACTER FIELD
  13. *
  14. * 3. METHOD USED
  15. * STEP THROUGH THE WORD TO BE ZERO FILLED ONE CHARACTER AT A TIME
  16. * WHEN ONE IS FOUND TO BE BLANK CHANGE IT AND THE REMAINING
  17. * CHARACTERS TO ZERO. IF THE ENTRIRE WORD IS SCANNED WITHOUT
  18. * FINDING ANY BLANKS DO NOTHING.
  19. *
  20. * 4. ENTRY PARAMETERS
  21. * ZNAME 10 CHARACTER NAME TO BE ZERO FILLED
  22. *
  23. * 5. EXIT PARAMETERS
  24. * NONE
  25. *
  26. * 6. COMDECKS CALLED
  27. * NONE
  28. *
  29. * 7. ROUTINES CALLED
  30. * NONE
  31. *
  32. * 8. DAYFILE MESSAGES
  33. * NONE
  34.  #
  35. *ENDIF
  36. # TITLE NXZFN - ZERO-FILLED NAME. #
  37.  
  38. BEGIN # NXZFN #
  39. #
  40. ** NXZFN - ZERO-FILLED NAME.
  41. *
  42. * J.C. LEE 1981
  43. *
  44. * THIS IS A UTILITY FUNCTION SUBPROGRAM.
  45. * ITS FUNCTION IS TO ZERO FILL A NAME.
  46. *
  47. * FUNC(ZNAME) C(10)
  48. *
  49. * ENTRY:
  50. * ZNAME - NAME TO BE ZERO FILLED.
  51. *
  52. * EXIT:
  53. * NONE.
  54. *
  55. * METHOD:
  56. * SEARCH FOR THE FIRST BLANK WITHIN THE NAME.
  57. * WHEN FOUND, ZERO REMAINING CHARACTERS STARTING
  58. * FROM THIS FIRST BLANK.
  59. *
  60. #
  61. ITEM ZNAME C(10); # NAME TO ZERO FILL #
  62. ITEM I U; # LOOP VARIABLE #
  63. ITEM ZEROED B; # LOOP END INDICATOR #
  64. CONTROL EJECT;
  65. ZEROED = FALSE; # INITIALIZE END INDICATOR #
  66. FOR I=0 STEP 1 WHILE NOT ZEROED
  67. AND I LS WC
  68. DO
  69. BEGIN
  70. IF C<I,1>ZNAME EQ " "
  71. THEN
  72. BEGIN
  73. B<I*6,60-(I*6)>ZNAME = 0; # ZERO REMANING CHARACTERS #
  74. ZEROED = TRUE; # DEED IS DONE #
  75. END
  76. END
  77. NXZFN = ZNAME; # PASS BACK AS FUNCTION #
  78. RETURN;
  79. END # XZFN #
  80. TERM
cdc/nos2.source/nam5871/nxzfn.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator