[SPIP] +2.1.12
[velocampus/web/www.git] / www / plugins / auto / spip-bonux / tests / balises / set_merge.html
1 [(#REM)
2
3 la balise SET_MERGE sert a merger des valeurs dans un tableau #SET
4 #SET_MERGE{tab,t1} : merge tab et t1 dans tab
5 #SET_MERGE{tab,t1,t2} : merge t1 et t2 dans tab
6 ]
7
8 [(#REM) ----- 2 arguments ------ ]
9 [(#REM)
10 SET SET+GET|merge = SET MERGE
11 ]
12 #SET{Aa,#ARRAY{a,aaa}} #SET{Aaa,#ARRAY{a,aaa}}
13 #SET{Ab,#ARRAY{b,bbb}}
14 [(#SET{Ac,[(#GET{Aa}|array_merge{#GET{Ab}})]})]
15 #SET_MERGE{Aaa,#GET{Ab}}
16 [(#GET{Ac}|!=={#GET{Aaa}}|oui)[(#SET{err,"Aaa et Ac sont differents"})]]
17
18
19 [(#REM)
20 SET_MERGE peut etre fait sans declarer un SET prealable
21 ]
22 #SET{Ba,#ARRAY{a,aaa}}
23 #SET_MERGE{Bb,#GET{Ba}}
24 [(#GET{Ba}|!=={#GET{Bb}}|oui)[(#SET{err,"Ba et Bb sont différents"})]]
25
26 [(#REM)
27 Si une chaine est donnee a MERGE, elle est transformee en tableau
28 ]
29 #SET_MERGE{C,coucou}
30 [(#GET{C}|!=={#ARRAY{0,coucou}})[(#SET{err,"(C) String non compris par #SET_MERGE"})]]
31
32
33 [(#REM) ----- 3 arguments ------ ]
34 [(#REM)
35 SET SET+GET|merge = SET MERGE
36 ]
37 #SET{Fa,#ARRAY{a,aaa}}
38 #SET{Fb,#ARRAY{b,bbb}}
39 [(#SET{Fc,[(#GET{Fa}|array_merge{#GET{Fb}})]})]
40 #SET_MERGE{Fd,#GET{Fa},#GET{Fb}}
41 [(#GET{Fc}|!=={#GET{Fd}}|oui)[(#SET{err,"Fc et Fd sont differents"})]]
42
43
44 [(#REM)
45 MERGE peut etre fait sans declarer un SET prealable
46 ]
47 #SET{Ga,#ARRAY{a,aaa}}
48 #SET{Gb,#ARRAY{b,bbb}}
49 [(#SET{Gc,[(#GET{Ga}|array_merge{#GET{Gb}})]})]
50 #SET_MERGE{Gd,#GET{Ga},#GET{Gb}}
51 [(#GET{Gc}|!=={#GET{Gd}}|oui)[(#SET{err,"Gc et Gd sont différents"})]]
52
53
54 [(#REM)
55 Si une chaine est donnee a MERGE, elle est transformee en tableau
56 ]
57 #SET_MERGE{H,coucou,toutou}
58 [(#GET{H}|!=={#ARRAY{0,coucou,1,toutou}})[(#SET{err,"(H) String non compris par #SET_MERGE"})]]
59
60 [(#GET{err}|?{ERREUR,OK}) #GET{err} ]