File: menu

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 (79 lines) | stat: -rw-r--r-- 1,870 bytes parent folder | download | duplicates (3)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
option:eqweight multiple nolegend shuffle sort split detag nolabel

!!!!!
!! Menu generic anstype (also used by click and radio)
!!!!!

!set name_choose_code=!defof name_choose_code in anstype/menu.input
select_multiple_check=!getopt multiple in $(replyoption$i)
!if $(replytype$i)=menu and $select_multiple_check!=
  !changeto anstype/checkbox
!endif

good=!rows2lines $(replygood$i)
menulist=!line 2 to -1 of $good
menulist=!translate internal $\
$ to ; in $menulist
good=!line 1 of $good
replyGood$i=!item $good of $menulist
replyGood$i=!replace internal \\( by \( in $(replyGood$i)

!if $(replytype$i)=menu
  defaultest=!getopt default in $(replyoption$i)
  !if $(reply$i)=$name_choose_code and $defaultest!=$empty
    reply$i=$defaultest
  !endif
!endif

menucnt=!itemcnt $menulist
reply$i=!replace internal \\( by \( in $(reply$i)
!! see also in var.proc
!default m_reply$i=$(reply$i)
m_reply$i=!replace internal \\( by \( in $(m_reply$i)

c_=!char 1 of $(reply$i)
!if $c_=~ and $(replytype$i)=click
  c_=!char 2 to -1 of $(reply$i)
  c_=!item $c_ of $menulist
  !if $c_!=$empty
    reply$i=$c_
  !endif
!endif

!if $wims_read_parm=nocompare
  !exit
!endif

!if $(replyGood$i)=$empty
  Test=bad $i
  !exit
!endif

!if ' isin $menulist
  reply$i=!replace internal ' by ' in $(reply$i)
!endif
!if , isin $menulist
  reply$i=!replace internal , by , in $(reply$i)
!endif
menupos=!positionof item $(reply$i) in $menulist
!if $menupos=$empty
  test=NaN
  !exit
!endif

!if $(inputprompt$i)!=$empty
  reply_$i=$(inputprompt$i[$menupos])
  replyGood$i=$(inputprompt$i[$good])
  !if , isin $(replyGood$i)
    replyGood$i=!replace internal , by </li><li> in <ul><li>$(replyGood$i)</li></ul>
  !endif
!endif
menupos=!item 1 of $menupos
!if $menupos isitemof $good
  diareply$i=good
  !advance freegot
!else
  diareply$i=bad
!endif

!reset anstype_shuffle_$i