User Tools

Site Tools


cdc:nos2.source:nam5871:dlarg

Table of Contents

DLARG

Table Of Contents

  • [00006] PROC DLARG
  • [00059] PROC DLABEND
  • [00060] PROC DLDFM

Source Code

DLARG.txt
  1. *DECK DLARG
  2. USETEXT DLFPDEF
  3. USETEXT ARGERR
  4. USETEXT ARGTBL
  5. USETEXT VDPARM
  6. PROC DLARG; # SCAN PARAMETERS FROM PROGRAM CALL #
  7.  
  8. *IF DEF,IMS
  9. #
  10. *1DC DLARG
  11. *
  12. * 1. PROC NAME AUTHOR DATE.
  13. * DLARG P.C.TAM 78/06/18
  14. *
  15. * 2. FUNCTIONAL DESCRIPTION.
  16. * SCAN ARGUMENTS FROM PROGRAM CALL.
  17. *
  18. * 3. METHOD USED.
  19. * GET EACH ARGUMENT, CHECK WITH VALID PARAMETER LIST,
  20. * SET PARAMETER TABLE.
  21. *
  22. * 4. ENTRY PARAMETERS.
  23. * RA+2 THRU RA+22 WORDS.
  24. *
  25. * 5. EXIT PARAMETERS.
  26. * VALUES SET IN ARGTBL COMMON BLOCK.
  27. *
  28. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  29. * ARGERR ARGTBL DLFPDEF VDPARM
  30. *
  31. * 7. ROUTNES CALLED.
  32. * DLABEND ABORT MAIN LINE
  33. * DLDFM DAYFILE MESSAGE PROCESSOR
  34. *
  35. * 8. DAYFILE MESSAGES.
  36. * NONE.
  37. *
  38.  #
  39. *ENDIF
  40. CONTROL PRESET;
  41. #
  42.   EXTERNAL VARIABLES
  43. #
  44. XREF
  45. BEGIN # RA COMMUNICATION AREA #
  46. ARRAY ARGRW [1:22] S(1);
  47. BEGIN # RA.ARGR #
  48. ITEM PSYMBO U(0,0,NL);# ACTUAL PARAMETER #
  49. ITEM PSEPAR U(0,ZL,AL);# ACTUAL PARAMETER SEPARATOR #
  50. END
  51. ARRAY ACTRW;
  52. BEGIN # RA.ACTR #
  53. ITEM ACTR U(0,ZL,AL);# NUMBER OF ARGUMENTS #
  54. END
  55. END
  56.  
  57. XREF
  58. BEGIN
  59. PROC DLABEND; # ABORT MAIN LINE #
  60. PROC DLDFM; # DAYFILE MESSAGE PROCESSOR #
  61. END
  62. #
  63.   LOCAL VARIABLES
  64. #
  65.  
  66. BASED ARRAY DUMMY; ;
  67.  
  68. SWITCH PARMTYPE
  69. , INTYPE, OTYPE, BTYPE, NTYPE, DTYPE;
  70.  
  71. ITEM
  72. ERRCODE I = 0, # ERROR RETURN CODE #
  73. ARGPTR I = 0, # POINTER TO AVAILABLE ARGUMENT ENTRY #
  74. LEFTSYM U, # LEFT PART SAVE AREA #
  75. I I, # TEMPORARY VARIABLE #
  76. K I, # TEMPORARY VARIABLE #
  77. MATCH B = TRUE; # SYMBOL MATCHED FLAG #
  78.  
  79. #**********************************************************************#
  80. BEGIN
  81.  
  82. #
  83.   LOOP TO READ ALL PARAMETERS
  84. #
  85. FOR ARGPTR = ARGPTR WHILE ARGPTR LS ACTR[0] AND ERRCODE EQ 0
  86. DO
  87. BEGIN
  88. ARGPTR = ARGPTR + 1; # MOVE POINTER TO NEXT ARG #
  89. LEFTSYM = PSYMBO[ARGPTR];# GET CURRENT ACTUAL PARAMETER #
  90. MATCH = FALSE;
  91. #
  92.   LOOP TO MATCH ACTUAL PARAMETER WITH FORMAL PARAMETER
  93. #
  94. FOR I = 1 STEP 1 WHILE I LQ PARMNO AND NOT MATCH
  95. DO
  96. BEGIN
  97. IF LEFTSYM EQ VDPARM[I]
  98. THEN
  99. BEGIN
  100. MATCH = TRUE;
  101. K = I;
  102. END
  103. END
  104. IF MATCH
  105. THEN
  106. BEGIN # FOUND A MATCH #
  107. I = ARGPTR + 1;
  108. IF (VDPMLEN[K] EQ 1 AND # PARAMETER OF LENGTH 1 #
  109. (PSEPAR[ARGPTR] EQ 1 OR # SEPARATOR IS , #
  110. PSEPAR[ARGPTR] EQ 15)) OR# SEPARATOR IS .) #
  111. (VDPMLEN[K] EQ 2 AND # PARAMETER OF LENGTH 2 #
  112. PSEPAR[ARGPTR] EQ 2 AND # SEPARATOR IS = #
  113. I LQ ACTR[0] AND # VALUE PRESENT #
  114. (PSEPAR[I] EQ 1 OR # NEXT SEP IS , #
  115. PSEPAR[I] EQ 15)) # NEXT SEP IS .) #
  116. THEN # PARAMETER CHECKED OK #
  117. BEGIN
  118. IF VDPMLEN[K] NQ 1
  119. THEN
  120. ARGPTR = I; # UPDATE ARGUMENT PTR #
  121. #
  122.   SWITCH TO DIFFERENT PROCESSING CASES
  123. #
  124. GOTO PARMTYPE[K];
  125.  
  126. INTYPE: # INPUT FILE NAME #
  127. I = INFILE; # SET INPUT FILE INDEX #
  128. GOTO ENDP;
  129.  
  130. OTYPE: # OUTPUT FILE NAME #
  131. I = OFILE; # SET OUTPUT FILE NAME #
  132. GOTO ENDP;
  133.  
  134. BTYPE: # ZZZZZDN FILE NAME #
  135. I = ZFILE; # SET ZZZZZDN FILE INDEX #
  136. GOTO ENDP;
  137.  
  138. NTYPE: # NEW DEBUG LOG FILE OPTION #
  139. I = NFILE;
  140. GOTO ENDP;
  141.  
  142. DTYPE: # IGNORE ERROR #
  143. I = DOPTION; # SET D OPTION INDEX #
  144.  
  145. ENDP:
  146. IF NOT ARGFLAG[I]
  147. THEN # OPTION HAS NOT BEEN SELECTED #
  148. BEGIN
  149. IF VDPMLEN[K] EQ 1
  150. THEN
  151. ARGENTR[I] = 1;
  152. ELSE
  153. ARGENTR[I] = PSYMBO[ARGPTR];
  154. ARGFLAG[I] = TRUE;
  155. END
  156. ELSE # DUPLICATE PARAMETER SELECT #
  157. ERRCODE = A$DUPERR;
  158. END
  159. ELSE # PARAMETER FORMAT ERROR #
  160. ERRCODE = A$FMERR;
  161. END
  162. ELSE # ILLEGAL PARAMETER #
  163. ERRCODE = A$ILLERR;
  164. END
  165.  
  166. FOR I = 1 STEP 1 WHILE I LQ DOPTION-1 AND ERRCODE EQ 0
  167. DO
  168. BEGIN
  169. LEFTSYM = ARGENTR[I];
  170. FOR K = I+1 STEP 1 WHILE K LQ DOPTION AND ERRCODE EQ 0
  171. DO
  172. BEGIN
  173. IF LEFTSYM EQ ARGENTR[K]
  174. THEN
  175. ERRCODE = A$DUFERR;
  176. END
  177. END
  178.  
  179. FOR I = 1 STEP 1 WHILE I LS DOPTION AND ERRCODE EQ 0
  180. DO # LOOP TO CHECK ALL FILE NAMES #
  181. BEGIN
  182. ARGPTR = 0;
  183. B<0, NL>ARGPTR = ARGENTR[I];
  184. IF ARGFLAG[I] AND # PARAMETER HAS BEEN SET #
  185. (I NQ INFILE OR # FOR INPUT FILE, IT CAN BE 0 #
  186. I EQ INFILE AND ARGPTR NQ O"33000000000000000000")
  187. THEN
  188. BEGIN
  189. FOR K = 0 STEP 1 WHILE K LS NC AND
  190. C<K, NC-K>ARGPTR NQ 0
  191. DO
  192. BEGIN # LOOP TO CHECK EACH CHAR #
  193. LEFTSYM = C<K, 1>ARGPTR;
  194. IF (K EQ 0 AND # 1ST CHAR MUST BE LETTER #
  195. (1 GR LEFTSYM OR LEFTSYM GR O"32")) OR
  196. (K NQ 0 AND # ALL OTHERS MUST BE ALPHANUMERIC #
  197. (1 GR LEFTSYM OR LEFTSYM GR O"44"))
  198. THEN
  199. ERRCODE = A$ILFERR;
  200. END
  201. END
  202. END
  203.  
  204. IF ERRCODE NQ 0
  205. THEN
  206. BEGIN
  207. P<DUMMY> = LOC(ARGM0[ERRCODE]);
  208. DLDFM(DUMMY);
  209. DLABEND;
  210. END
  211.  
  212. END
  213. TERM
cdc/nos2.source/nam5871/dlarg.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator