Télécharger afnost.eso

Retour à la liste

Numérotation des lignes :

  1. C AFNOST SOURCE GF238795 17/11/17 21:15:01 9626
  2. subroutine afNoSt(pNoti,iret)
  3. character*500 buffer
  4. character*5 rep
  5. integer termLi,iLig,jLig,iPag
  6. integer ipart,ichap,posDeb,posFin
  7. integer nbNuCh,nbNuPa,nChap,nPart,mChap,mPart
  8. integer tppanu,nlig,mlig
  9. integer iret,iretRe,ichaf,nChaCh
  10. integer longlu
  11. -INC CCOPTIO
  12. segment,noti
  13. character*8 nomOpe
  14. character*500 blig(nlig)
  15. endsegment
  16. segment,strNot
  17. integer posChap(mChap)
  18. c posChap(ichap) : ligne contenant le titre du chapitre ichap
  19. integer posPart(mPart)
  20. c posPart(iPart) : ligne contenant le titre de la partie iPart (numerotation globale)
  21. integer chapPart(mPart)
  22. c chapPart(iPart) : chapitre dans lequel la partie iPart est contenue
  23. integer partPart(mPart)
  24. c partPart(iPart) : numerotation locale de la partie
  25. character*40 forChap
  26. character*40 forPart
  27. endsegment
  28. pointeur pnoti.NOTI
  29. pointeur struc.STRNOT
  30. iret=0
  31. c Recherche d element de structuration
  32. mchap=1000
  33. mpart=1000
  34. segini struc
  35. npart=0
  36. nchap=0
  37. tpPaNu=0
  38. mlig=pNoti.blig(/2)
  39. DO 44 iLig=1,mlig
  40. buffer=pNoti.blig(iLig)
  41. c Numerotation des chapitres et parties
  42. if (buffer(1:5).EQ.'PART{'.OR.buffer(1:5).eq.'CHAP{') then
  43. if (buffer(1:4).EQ.'PART') then
  44. npart=npart+1
  45. struc.posPart(npart)=iLig
  46. struc.chapPart(npart)=nChap
  47. tpPaNu=tpPaNu+1
  48. struc.partPart(npart)=tpPaNu
  49. endif
  50. if (buffer(1:4).eq.'CHAP') then
  51. tpPaNu=0
  52. nchap=nchap+1
  53. struc.poschap(nchap)=iLig
  54. endif
  55. posdeb=index(buffer(1:500),'{')
  56. if (posdeb.eq.0) then
  57. moterr(1:1)='{'
  58. interr(1)=ilig
  59. iret=1047
  60. return
  61. endif
  62. posdeb=posdeb+1
  63. posfin=index(buffer(1:500),'}')
  64. if (posfin.eq.0) then
  65. moterr(1:1)='}'
  66. interr(1)=ilig
  67. iret=1047
  68. return
  69. endif
  70. posFin=posFin-1
  71. pNoti.blig(iLig)=' '
  72. pNoti.blig(iLig)=buffer(posDeb:posFin)//CHAR(0)
  73. endif
  74. 44 continue
  75. mChap=nchap
  76. mPart=npart
  77. segadj struc
  78. nbNuCh=nChap
  79. nbNuPa=nPart
  80. IF(nbNuCh.NE.0) THEN
  81. nbNuCh=INT(LOG10(REAL(nbNuCh)))+1
  82. ELSE
  83. nbNuCh=0
  84. ENDIF
  85. IF(nbNuPa.NE.O) THEN
  86. nbNuPa=INT(LOG10(REAL(nbNuPa)))+1
  87. ELSE
  88. nbNuPa=0
  89. ENDIF
  90. write (struc.forchap,100) nbnuch,nbnuch
  91. 100 format('(i',i1,'.',i1,','' '',a)')
  92.  
  93. IF(nbnuch.NE.0) THEN
  94. write (struc.forpart,101) nbnuch,nbnuch,nbnupa,nbnupa
  95. ELSE
  96. write (struc.forpart,102) nbnuch,nbnuch,nbnupa,nbnupa
  97. ENDIF
  98.  
  99. 101 format('(i',i1,'.',i1,',''.'', i',i1,'.',i1,','' '' ,a)')
  100. 102 format('(i',i1,'.',i1,', i',i1,'.',i1,','' '' ,a)')
  101. do 13 ipart=1,nChap
  102. iLig=struc.posChap(ipart)
  103. buffer=pNoti.blig(iLig)
  104. ichaf=index(buffer,CHAR(0))
  105. write(pNoti.blig(iLig),struc.forChap) ipart, buffer(1:ichaf)
  106. 13 continue
  107. do 12 ipart=1,nPart
  108. iLig=struc.posPart(ipart)
  109. buffer=pNoti.blig(iLig)
  110. ichaf=index(buffer,CHAR(0))
  111. write(pNoti.blig(iLig),struc.forpart) struc.chappart(ipart),
  112. & struc.partpart(ipart), buffer(1:ichaf)
  113. 12 continue
  114. c On parcours la notice en partant du bas pour ajouter les soulignements
  115. nlig=mlig+nchap+npart
  116. segadj pNoti
  117. jLig=nLig
  118. iPart=nPart
  119. iChap=nChap
  120. IF(iChap.eq.0) THEN
  121. iPosChap=-1
  122. ELSE
  123. iPosChap=struc.posChap(iChap)
  124. ENDIF
  125. IF(iPart.eq.0) THEN
  126. iPosPart=-1
  127. ELSE
  128. iPosPart=struc.posPart(iPart)
  129. ENDIF
  130. do 14 iLig=mlig,1,-1
  131. c write(6,*) iLig,iPosPart
  132. buffer=pNoti.blig(iLig)
  133. if(iLig.eq.iPosPart) then
  134. nChaCh = index(buffer,CHAR(0))-1
  135. if(nChaCh.gt.0) then
  136. buffer(1:1)='-'
  137. do 90 iCha=2,nChaCh
  138. buffer(iCha:iCha)='-'
  139. 90 continue
  140. else
  141. buffer(1:1)=' '
  142. endif
  143. pNoti.blig(jLig)=buffer
  144. jLig=jLig-1
  145. struc.posPart(iPart)=jLig
  146. iPart=iPart-1
  147. if(iPart.eq.0) then
  148. iPosPart=0
  149. else
  150. iPosPart=struc.posPart(iPart)
  151. endif
  152. buffer=pNoti.blig(iLig)
  153. endif
  154. if(iLig.eq.iPosChap) then
  155. nChaCh = index(buffer,CHAR(0))-1
  156. if(nChaCh.gt.0) then
  157. buffer(1:1)='='
  158. do 92 iCha=2,nChaCh
  159. buffer(iCha:iCha)='='
  160. 92 continue
  161. else
  162. buffer(1:1)=' '
  163. endif
  164. pNoti.blig(jLig)=buffer
  165. jLig=jLig-1
  166. struc.posChap(iChap)=jLig
  167. iChap=iChap-1
  168. if(iChap.eq.0) then
  169. iPosChap=0
  170. else
  171. iPosChap=struc.posChap(iChap)
  172. endif
  173. buffer=pNoti.blig(iLig)
  174. endif
  175. pNoti.blig(jLig)=buffer
  176. jLig=jLig-1
  177. 14 continue
  178. call pagerSt(pNoti,struc)
  179. segsup struc
  180. end
  181. subroutine pagerSt(pNoti,struc)
  182. character*500 buffer
  183. integer termLi,iLig,jLig,iPag
  184. integer debLi,finLi
  185. integer ipart,ichap,posDeb,posFin,nChap
  186. integer iRet
  187. character*8 forNum
  188. -INC CCOPTIO
  189. segment,noti
  190. character*8 nomOpe
  191. character*500 blig(nlig)
  192. endsegment
  193. segment,strNot
  194. integer posChap(mChap)
  195. integer posPart(mPart)
  196. integer chapPart(mPart)
  197. integer partPart(mPart)
  198. character*40 forChap
  199. character*40 forPart
  200. endsegment
  201. character*5 rep
  202. pointeur pnoti.NOTI
  203. pointeur struc.STRNOT
  204. debLi=1
  205. finLi=pNoti.blig(/2)
  206. nChap=struc.posChap(/1)
  207. call gistty(termLi)
  208. termLi=termLi-3
  209. iLig=debLi-1
  210. iPag=0
  211. jLig=1
  212. nLig=finLi
  213. 123 if (iLig.lt.nLig) then
  214. iLig=iLig+1
  215. buffer=pNoti.blig(iLig)
  216. LONGLU=LEN(BUFFER)
  217. DO WHILE ( LONGLU.NE.1.AND. BUFFER(LONGLU:LONGLU) .EQ.' ')
  218. LONGLU = LONGLU -1
  219. ENDDO
  220. if (buffer(1:9).ne.'Section :') then
  221. jLig=jLig+1
  222. write(IOIMP,*) buffer(1:LONGLU)
  223. endif
  224. if(jLig.eq.termLi) then
  225. call gistty(termLi)
  226. termLi=termLi-1
  227. ipag=ipag+1
  228. jLig=0
  229. c122 write(IOIMP,104) '? (a pour aide) '
  230. 122 write(IOIMP,104)
  231. 104 FORMAT ('? ([A]ide/[H]elp) ', $ )
  232. c104 format(A16$)
  233. read (IOTER,fmt='(a5)',end=124,err=124) rep
  234. if (rep.eq.'q'.or.ierr.ne.0) goto 124
  235. if (rep.eq.' '.or.rep.eq.' ') then
  236. goto 123
  237. endif
  238. if (rep.eq.'a'.or.rep.eq.'A') then
  239. write(IOIMP,*) 'Commandes :'
  240. write(IOIMP,*) 'q : quitter'
  241. write(IOIMP,*) 'd : debut'
  242. write(IOIMP,*) 's : sommaire'
  243. write(IOIMP,*) 'num : aller a la section'
  244. write(IOIMP,*) 'entree pour la suite '
  245. goto 122
  246. endif
  247. if (rep.eq.'h'.or.rep.eq.'H') then
  248. write(IOIMP,*) 'Commands :'
  249. write(IOIMP,*) 'q : quit'
  250. write(IOIMP,*) 'd : beginning'
  251. write(IOIMP,*) 's : table of contents'
  252. write(IOIMP,*) 'num : go to section'
  253. write(IOIMP,*) 'enter for next page '
  254. goto 122
  255. endif
  256. if (rep.eq.'s') then
  257. call afStSo(pNoti,struc)
  258. goto 122
  259. endif
  260. if (rep.eq.'d') then
  261. iLig=debLi-1
  262. goto 123
  263. endif
  264. posdeb=index(rep,'.')
  265. if (posdeb.ne.0) then
  266. 103 format('(i',i1,'.',i1,')')
  267. write (forNum,103) posdeb-1,posdeb-1
  268. c write(6,*) 'Format de lecture',forNum
  269. read(rep(1:posdeb-1),forNum,iostat=iRetRe) ichap
  270. if(iRetRe.ne.0) then
  271. write(IOIMP,*)'Numero incorrect : ', iChap
  272. goto 122
  273. endif
  274. write (forNum,103) 5-posdeb,5-posdeb
  275. c write(6,*) 'Format de lecture',forNum
  276. read(rep(posdeb+1:5),forNum,iostat=iRetRe) ipart
  277. if(iRetRe.ne.0) then
  278. write(IOIMP,*)'Numero incorrect : ', iPart
  279. goto 122
  280. endif
  281. call afStPa(struc,iPart,ichap,iLig,iRet)
  282. if(iRet.ne.0) then
  283. write(IOIMP,*)'Numero incorrect : ', iChap, iPart
  284. go to 122
  285. else
  286. goto 123
  287. endif
  288. endif
  289. write (forNum,103) 5,5
  290. c write(6,*) 'Format de lecture',forNum
  291. ichap=-3
  292. read(rep,forNum,iostat=iRetRe) ichap
  293. if(iRetRe.ne.0) then
  294. else
  295. if(nChap.ne.0) then
  296. call afStCh(struc,iChap,iLig,iRet)
  297. else
  298. call afStPa(struc,ichap,0,iLig,iRet)
  299. endif
  300. if(iRet.ne.0) then
  301. write(IOIMP,*)'Numero incorrect : ',iChap
  302. go to 122
  303. else
  304. goto 123
  305. endif
  306. endif
  307.  
  308. c moterr(1:4)=pNoti.nomOpe
  309. c interr(1)=ipag
  310. c call erreur(-357)
  311. endif
  312. goto 123
  313. endif
  314. 124 continue
  315. segsup struc
  316. end
  317. subroutine afStSo(pNoti,struc)
  318. character*500 buffer
  319. integer iLig
  320. integer ipart,ichap,nChap
  321. -INC CCOPTIO
  322. segment,noti
  323. character*8 nomOpe
  324. character*500 blig(nlig)
  325. endsegment
  326. segment,strNot
  327. integer posChap(mChap)
  328. integer posPart(mPart)
  329. integer chapPart(mPart)
  330. integer partPart(mPart)
  331. character*40 forChap
  332. character*40 forPart
  333. endsegment
  334. pointeur pnoti.NOTI
  335. pointeur struc.STRNOT
  336. nChap=struc.posChap(/1)
  337. iChap=0
  338. do 12 ipart=1,struc.posPart(/1)
  339. if(iChap.LT.struc.chapPart(iPart)) then
  340. write(IOIMP,*)
  341. do while(iChap.LT.struc.chapPart(iPart).AND.iChap.LE.nChap)
  342. iChap = iChap+1
  343. iLig=struc.posChap(iChap)
  344. buffer=pNoti.blig(iLig)
  345. LONGLU=LEN(BUFFER)
  346. DO WHILE ( LONGLU.NE.1.AND. BUFFER(LONGLU:LONGLU) .EQ.' ')
  347. LONGLU = LONGLU -1
  348. ENDDO
  349. write(IOIMP,*) buffer(1:LONGLU)
  350. end do
  351. endif
  352. iLig=struc.posPart(ipart)
  353. buffer=pNoti.blig(iLig)
  354. LONGLU=LEN(BUFFER)
  355. DO WHILE ( LONGLU.NE.1.AND. BUFFER(LONGLU:LONGLU) .EQ.' ')
  356. LONGLU = LONGLU -1
  357. ENDDO
  358. write(IOIMP,*) buffer(1:LONGLU)
  359. 12 continue
  360. end
  361. subroutine afStPa(struc,iPartL,iChap,iLig,iRet)
  362. integer ipart,ipartL,ichap,iLig
  363. integer iRet
  364. -INC CCOPTIO
  365. segment,strNot
  366. integer posChap(mChap)
  367. integer posPart(mPart)
  368. integer chapPart(mPart)
  369. integer partPart(mPart)
  370. character*40 forChap
  371. character*40 forPart
  372. endsegment
  373. iRet=-1
  374. pointeur struc.STRNOT
  375. do 12 ipart=1,struc.posPart(/1)
  376. if(struc.chapPart(ipart).eq.ichap.and.
  377. & struc.partPart(iPart).eq.ipartL) then
  378. iRet=0
  379. iLig=struc.posPart(iPart)-1
  380. return
  381. endif
  382. 12 continue
  383. iRet=1
  384. return
  385. end
  386. subroutine afStCh(struc,iChap,iLig,iRet)
  387. integer iLig
  388. integer ichap
  389. integer iRet
  390. -INC CCOPTIO
  391. segment,strNot
  392. integer posChap(mChap)
  393. integer posPart(mPart)
  394. integer chapPart(mPart)
  395. integer partPart(mPart)
  396. character*40 forChap
  397. character*40 forPart
  398. endsegment
  399. pointeur struc.STRNOT
  400. iRet=-1
  401. if(iChap.le.0.or.iChap.gt.struc.posChap(/1)) then
  402. iRet=1
  403. return
  404. endif
  405. iRet=0
  406. iLig=struc.posChap(iChap)-1
  407. return
  408. end
  409.  
  410.  
  411.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales