თარგი:Qif

ვიკიპედიიდან

თარგი:TProtected

This template employs some extremely complicated and esoteric features of template syntax.

Please do not attempt to alter it unless you are certain that you understand the setup and are prepared to repair any consequent collateral damage if the results are unexpected. Any experiments should be conducted in the template sandbox or your user space.

ეს თარგი ასრულებს ალბათობის ალგორითმის ფუნქციას if მაშინ then ან else.

  • პარამეტრი else არააუცილებელია.


Notare che qif non funziona se usato con subst.

[რედაქტირება] გამოყენების ინსტრუქცია

{{qif
  |test=ტესტირების ცვლადი პარამეტრი
  |then=შემთხვევა როდესაც 'test' არ არის ნული
  |else=შემთხვევა როდესაც 'test' არის ნული
}}

პარამეტრი else აუცილებელია არ არის. ამ შემთხვევაში შეგიძლიათ გამოყენოეთ ფორმა:

{{qif
  |test=ტესტირების ცვლადი პარამეტრი
  |then=შემთხვევა როდესაც 'test' არ არის ნული
}}

[რედაქტირება] ნიმუში

კოდი შედეგი
{{qif
  |test={{boolne|foo|bar}}
  |then=true
  |else=false
}}

true

{{qif
  |test={{booleq|foo|bar}}
  |then=true
  |else=false
}}

true

{{qif
  |test=
  |then=bar
}}
{{qif
  |test=foo
  |then=bar
}}

bar