File: add.proc

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (66 lines) | stat: -rw-r--r-- 1,976 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
!! add glose in a glossary
max_glossary=!defof MAX_SHEETS in wimshome/public_html/bases/sys/define.conf
title_limit=50
desc_limit=25
!if $cmd=new or $cmd=resume
  glossary=
  !for i=1 to $glossarytot
    gl=!record $i of wimshome/log/classes/$wims_class/tool/.glossaryindex
    !distribute lines $gl into a_,t_
    glossarys=!append line $i,$t_ to $glossarys
  !next i
!endif
!if $cmd=reply
  !if $pickglossary=$empty
    error=no_pick
    !exit
  !endif
  !if $iniparm=$empty
    error=no_parm
    !exit
  !endif
  pickglossary=$[floor($pickglossary)]
  !if $pickglossary=NaN or $pickglossary<1 or $pickglossary>min($max_glossary,$glossarytot+1)
    error=bad_glossary
    !exit
  !endif
  ititle=!singlespace $title
  ititle=!char 1 to $title_limit of $ititle
  tmp=!checkallpar $ititle
  !if $tmp=no
    ititle=!translate internal (){}[] to ------ in $ititle
  !endif
  !if $pickglossary=$[$glossarytot+1]
    !set iglosstitle=!singlespace $new_glossary
    !set idesc=!singlespace $new_glossarydesc
    !appendfile $gloss_dir/.glossary$pickglossary :$iniparm\
$ititle
    !appendfile $gloss_dir/.glossaryindex :0\
$iglosstitle\
$idesc
  !else
  !!!! FIXME mettre dans l'ordre alphabetique des titres. Cela vitera
  !!!! de proposer de changer l'ordre !
  !!! on peut supposer qu'ils le sont quand on en ajoute un
  !!! mais pas quand on modifie
    sh=!record $pickglossary of wimshome/log/classes/$wims_class/tool/.glossaryindex
    glosscnt=!recordcnt $gloss_dir/.glossary$pickglossary
    !if $glosscnt>=$max_glossary
      error=too_many_gloss
      !exit
    !endif
    !for i=1 to $glosscnt
      e=!record $i of $gloss_dir/.glossary$pickglossary
      !distribute lines $e into wdi,win
      !if $iniparm=$wdi
        test=$pickglossary
        error=already_exist
        !exit
      !endif
    !next i
    !appendfile $gloss_dir/.glossary$pickglossary :$iniparm\
$ititle
  !endif

  wims_module_log=class $class: add No$glosscnt to glossary $pickglossary
!endif