Questions tagged as 'if'

2
answers

What does if (variable) {/ * action * /} mean?

By putting only the variable within if , for example if( variavél ){ /*ação*/} What does this if mean? And contrary if( !variavél ){ /*ação*/}     
asked by 27.01.2018 / 23:42
3
answers

What is the most recommended "try" or "if"

{ public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { double SalarioBase = 0, Descontos = 0, Vantagens = 0; try { SalarioBase = Con...
asked by 15.05.2017 / 00:19
1
answer

Problem with $ _POST and IF

I am trying to do if in case the person type 12 in any part of the text he enters the if but he is not entering if ($_POST['mensagem'] !="%12%"){ echo"vc digitou 12"; }     
asked by 23.03.2018 / 00:30
3
answers

Is it possible to use if else in MySQL queries?

I've been researching the internet and hearing rumors that it's possible to use if else in MySQL queries but have not seen anything concrete about it. Is it really possible? If so, how? I want to make a query in three distinct tables i...
asked by 15.06.2016 / 00:38
2
answers

If empty statement in function

Is it possible to create a function that ends with an empty if statement and let the code that called this function determine the action of if? Example: def if(): if x>6: x = input("Valor de x") if() print(x) x = input("Valor...
asked by 03.02.2018 / 07:56
1
answer

Difference between else if and elsif

I know that these two terms do not exist in the same language (correct me if I'm wrong), but in some languages (C #, in the example below), we have the following code: if(condicao){ ... } else if (condicao) { ... } In others (Perl, in...
asked by 24.03.2017 / 13:04
2
answers

Combine more than one condition in an if

Is it possible to combine more than one condition in the tire industry? Example: boolean existe = pessoa tem 23 ou pessoa tem 22 ? true : false ; I'm trying but I can not.     
asked by 24.03.2017 / 19:03
1
answer

IF condition in javascript only works once

I'm trying to make a Side Navigation , so on internet search, I found a little tutorial on the site: How TO - Side Navigation However, in my example I wanted a single button to open, and close, so I made the following changes: funct...
asked by 01.12.2016 / 12:47
3
answers

PHP - Comparing information [closed]

I'm trying to compare the number entered in the textbox with a number defined in the variable, like this: <?php $campo1 = $_POST['um']; $valor1 = 1; if($campo1 == $valor1){ $msg="ok"; } else{ $msg="erro"; } ?>...
asked by 07.01.2016 / 15:11
2
answers

Use value of a select with JavaScript

I need to use the value of a select in an if, I currently have this: Esse seria o HTML: <p>Quantidade de vidas? </p> <select> <option value="vidas1" id="vidas">Mais 1000</option> <option value="...
asked by 11.12.2018 / 19:03