Categories > TinyButStrong general (FR) >

[fr] 2 conditions ou plus...

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: webmonster
Date: 2004-05-21
Time: 12:06

[fr] 2 conditions ou plus...

Rebonjour Skrol29!

Nous avons vu le thread concernant les 2 conditions ce qui est superbe.

Mais, encore une petite chose... (Columbo), comment peut-on indiquer que la condition soit l'une OU l'autre:

if ((var.user_data=4) or (var.user_data=5) or (var.user_data=6)) then ...

Y a-t-il une façon de faire?
By: Skrol29
Date: 2004-05-21
Time: 15:10

Re: [fr] 2 conditions ou plus...

Bonjour,

Pour l'instant le OR ne peut pas être réalisé dans les conditions TBS.
Si la condition est liée à des champs d'une base de données, je conseille d'ajouter un champ calculé à la requête founi le résultat de l'opération logique.
Sinon, on peut utiliser le paramètre 'onsection' pour calculer une condition ou 'onformat' pour gérer l'affichage.
By: RwD
Date: 2004-05-25
Time: 16:18

Re: [fr] 2 conditions ou plus...

Perhaps in version 3 then :P

I think that the logic should stay out of the templates as much as possible, and it should stay with simple tests. the rest should be done in the php program and variables.

Sorry for my poor French. I can grasp the basics and get both the question and answer from that. But don't expect my French to go much beyond:
-Bonjour. Ca va?
-Ca va bien, merci.

Only 2 years of French at school, I am surprised I can read it at all :P
By: Translator
Date: 2004-05-25
Time: 20:24

Re: [fr] 2 conditions ou plus...

This is a short translation of the crrent thread.

webmonster ask if there is a way to perform a conditional tag with an OR operator. Like:
if ((var.user_data=4) or (var.user_data=5) or (var.user_data=6)) then ...

Skrol29 replies that is not possible for TBS tags.
For a data item that comes from a database, Skrol29 suggests to make a calculated columns in the query. Otherwise to use parameter 'onsection'.