Questions tagged as 'if'

1
answer

how to increase the ifelse limit in R?

I need to calculate the years of study from the PNAD questionnaire. I made a programming similar to this below, but I have many ifelse within the other (121 to be exact), because I have a larger chain of questions, but R does not calculate be...
asked by 05.12.2016 / 00:55
2
answers

Allow new conditions to be added without modifying code

I'm manipulating a .txt and I have to change values of type M31 to T90 for example. My code is like this: //Change machine tools for Sodick if (_strLinesFinal.Contains("M50"))...
asked by 11.10.2016 / 14:08
2
answers

Helps to make a condition in php

I have here my php code so that you can delete the client, but only delete it when you write the client name (which is in the html). but I do not know how to make the condition if someone writes a name of a client that is not in the database. An...
asked by 15.06.2015 / 00:19
3
answers

Performance "where in foreach vs if"

Which of the cases would perform best? var chaves = new list<string>(); foreach(var item in lista) { if(!string.IsNullOrEmpty(item.Chave)) { chaves.Add(item.Chave); } } Or listaValida = lista.Where(x => !string.IsN...
asked by 13.04.2017 / 17:13
5
answers

use if on sql server

I have 3 tables in my database, CUSTOMERS, DISTRIBUTORS and EXPORTS and I have a production order table where I get the type of customer (Distributor, customer or export) and the ID of each one. the doubt is: how can I put a if in sele...
asked by 10.06.2016 / 19:21
2
answers

How to use If Else correctly

I have the following checkboxes : <input type="checkbox" class="check" id="livros" value="livros"/> <input type="checkbox" class="check" id="folhas" value="folhas"/> <input type="checkbox" class="check" id="porta" value="porta...
asked by 21.02.2017 / 00:16
3
answers

What are [] in bash?

I'm starting in shell script now, and often reading other people's programs, I see the use of [] associated with if . For example: if [condition]; then fi I have also often seen use as follows: if [[condition]]; then fi...
asked by 30.08.2016 / 21:49
1
answer

Difference between If and IIf

In VB.NET, what's the difference between using If and IIf under these conditions? If Condicao Then x() Else y() End If IIf(Condicao, x(), y())     
asked by 23.09.2016 / 04:18
1
answer

Is it correct to create a variable within an if?

Is it correct to create a variable within an if? In the code below, you create a variable inside the if, and avoid using the same filter twice. if($id = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT)): /* Código */ endif; What do...
asked by 06.04.2016 / 22:02
3
answers

if and logical connectives

I need to find the least number and the second smallest number of five numbers entered. But this strange fact is happening: #Subtrair o menor numero encontrado do numero digitado dif1 = n1 - menor dif2 = n2 - menor dif3 = n3 - menor dif...
asked by 23.05.2018 / 12:09