X-Git-Url: https://git.cyclocoop.org/admin/?a=blobdiff_plain;f=www%2Fplugins%2Fauto%2Fspip-bonux%2Ftests%2Fbalises%2Fset_merge.html;fp=www%2Fplugins%2Fauto%2Fspip-bonux%2Ftests%2Fbalises%2Fset_merge.html;h=86b149f7757a7814387bb49f3c4650dc1f3b3fe1;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hp=0000000000000000000000000000000000000000;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c;p=velocampus%2Fweb%2Fwww.git diff --git a/www/plugins/auto/spip-bonux/tests/balises/set_merge.html b/www/plugins/auto/spip-bonux/tests/balises/set_merge.html new file mode 100644 index 0000000..86b149f --- /dev/null +++ b/www/plugins/auto/spip-bonux/tests/balises/set_merge.html @@ -0,0 +1,60 @@ +[(#REM) + + la balise SET_MERGE sert a merger des valeurs dans un tableau #SET + #SET_MERGE{tab,t1} : merge tab et t1 dans tab + #SET_MERGE{tab,t1,t2} : merge t1 et t2 dans tab +] + +[(#REM) ----- 2 arguments ------ ] +[(#REM) + SET SET+GET|merge = SET MERGE +] + #SET{Aa,#ARRAY{a,aaa}} #SET{Aaa,#ARRAY{a,aaa}} + #SET{Ab,#ARRAY{b,bbb}} + [(#SET{Ac,[(#GET{Aa}|array_merge{#GET{Ab}})]})] + #SET_MERGE{Aaa,#GET{Ab}} + [(#GET{Ac}|!=={#GET{Aaa}}|oui)[(#SET{err,"Aaa et Ac sont differents"})]] + + +[(#REM) + SET_MERGE peut etre fait sans declarer un SET prealable +] + #SET{Ba,#ARRAY{a,aaa}} + #SET_MERGE{Bb,#GET{Ba}} + [(#GET{Ba}|!=={#GET{Bb}}|oui)[(#SET{err,"Ba et Bb sont différents"})]] + +[(#REM) + Si une chaine est donnee a MERGE, elle est transformee en tableau +] + #SET_MERGE{C,coucou} + [(#GET{C}|!=={#ARRAY{0,coucou}})[(#SET{err,"(C) String non compris par #SET_MERGE"})]] + + +[(#REM) ----- 3 arguments ------ ] +[(#REM) + SET SET+GET|merge = SET MERGE +] + #SET{Fa,#ARRAY{a,aaa}} + #SET{Fb,#ARRAY{b,bbb}} + [(#SET{Fc,[(#GET{Fa}|array_merge{#GET{Fb}})]})] + #SET_MERGE{Fd,#GET{Fa},#GET{Fb}} + [(#GET{Fc}|!=={#GET{Fd}}|oui)[(#SET{err,"Fc et Fd sont differents"})]] + + +[(#REM) + MERGE peut etre fait sans declarer un SET prealable +] + #SET{Ga,#ARRAY{a,aaa}} + #SET{Gb,#ARRAY{b,bbb}} + [(#SET{Gc,[(#GET{Ga}|array_merge{#GET{Gb}})]})] + #SET_MERGE{Gd,#GET{Ga},#GET{Gb}} + [(#GET{Gc}|!=={#GET{Gd}}|oui)[(#SET{err,"Gc et Gd sont différents"})]] + + +[(#REM) + Si une chaine est donnee a MERGE, elle est transformee en tableau +] + #SET_MERGE{H,coucou,toutou} + [(#GET{H}|!=={#ARRAY{0,coucou,1,toutou}})[(#SET{err,"(H) String non compris par #SET_MERGE"})]] + +[(#GET{err}|?{ERREUR,OK}) #GET{err} ]