Rev 20 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | !set methtit=Montrer un but séparément (quand il y en a plusieurs) |
2 | !set methparmtype=choice |
||
3 | !set methhelp=Quand il y a plusieurs buts à démontrer, vous pouvez utiliser\ |
||
4 | cette méthode pour en isoler un dans un cas séparé. |
||
5 | |||
6 | !if $wims_read_parm iswordof form check |
||
16117 | bpr | 7 | !goto $wims_read_parm |
20 | reyssat | 8 | !endif |
9 | |||
10 | !if fixedgoal iswordof $m_options |
||
16117 | bpr | 11 | !set error1=fixedgoal |
20 | reyssat | 12 | !exit |
13 | !endif |
||
14 | |||
15 | !set n=!linecnt $m_goal |
||
16 | !if $n<1 |
||
16117 | bpr | 17 | !set error1=no_object |
18 | !exit |
||
20 | reyssat | 19 | !endif |
20 | !if $n<2 |
||
16117 | bpr | 21 | !set error1=Cette méthode est utilisable uniquement quand il y a plusieurs\ |
22 | buts à démontrer. |
||
23 | !exit |
||
20 | reyssat | 24 | !endif |
25 | |||
26 | !exit |
||
27 | :form |
||
16117 | bpr | 28 | Mettre le but |
29 | !set gl=!replace internal , by , in $m_goal |
||
30 | !set gl=!lines2items $gl |
||
31 | !set n=!itemcnt $gl |
||
32 | !formselect methparm1 from 0 to $n prompt $ch_choose,$gl |
||
33 | dans un cas séparé à démontrer. |
||
20 | reyssat | 34 | !exit |
35 | :check |
||
16117 | bpr | 36 | n=!linecnt $m_goal |
37 | !bound methparm1 between integer 0 and $n default 0 |
||
38 | !if $methparm1=0 |
||
20 | reyssat | 39 | error=empty_data |
40 | !exit |
||
16117 | bpr | 41 | !endif |
42 | l=!line $methparm1 of $m_goal |
||
43 | goal1=$l |
||
44 | goal2=!replace line number $methparm1 by $ in $m_goal |
||
45 | goal2=!nonempty lines $goal2 |
||
46 | goal2=!line 1 of $goal2 |
||
47 | !if $n>2 |
||
20 | reyssat | 48 | goal2=$goal2 ... |
16117 | bpr | 49 | !endif |
50 | casesplit=$goal1\ |
||
20 | reyssat | 51 | $goal2 |
16117 | bpr | 52 | !reset splitobject1,splitobject2 |
53 | n=!linecnt $objects |
||
54 | lt=< |
||
55 | !for i=1 to $n |
||
20 | reyssat | 56 | l=!line $i of $objects |
57 | w=!word 1 of $l |
||
58 | !if $w!=$lt |
||
16117 | bpr | 59 | splitobject1=!append line $l to $splitobject1 |
60 | splitobject2=!append line $l to $splitobject2 |
||
20 | reyssat | 61 | !else |
16117 | bpr | 62 | !if $l notsametext $lt $goal1 |
63 | splitobject2=!append line $l to $splitobject2 |
||
64 | !endif |
||
20 | reyssat | 65 | !endif |
16117 | bpr | 66 | !next i |
67 | splitobject1=!append line < $goal1 to $splitobject1 |
||
68 | objects=$splitobject1 |
||
69 | goalsplit=yes |
||
70 | methexp=Séparer le but $goal1 |
||
20 | reyssat | 71 | !exit |