Most voted "condition" questions
Use this tag on questions that have conditional execution as the center of the problem, i.e., that depend on boolean expressions for their execution.
Learn more…150 questions
Sort by count of
-
2
votes3
answers90
viewsIs it possible to use functions within a condition?
I was going through some websites when I came across the following excerpt: if (console.log(i), i && void 0 !== i.name) { // code here... } I tested it out: var i = {name: "mizuk"}; if…
-
2
votes1
answer54
viewsOutput condition on do-while in code C
I need the user to enter the numbers 1, 2 or 3 to choose the locations, and if not select one, ask again. But when entering the number 0 or 4, for example, it returns to the start screen (that would…
-
2
votes1
answer46
views"If <condition> Then" block makes no sense
I am in charge of maintaining a Vbscript application, but my main programming languages are Java (7+), Javascript and PHP (5.4+). During code review to refactoring the horrifying lines macaroni that…
-
2
votes1
answer125
viewsEasy counting between columns - Python
I’m starting in python and have trouble automating some calculations. I have a Dataframe with 8 columns [A, B, C, D, E, F, G, H] and 150 rows. I need to count how many times 2 columns are equal to…
-
2
votes2
answers143
viewsConditional structure does not work
Several times, especially when the second price is higher than the others, the program accuses that it is the cheapest. #Faça um programa que pergunte o preço de três produtos e informe qual produto…
-
2
votes2
answers571
viewsHow to handle multiple conditionals (if and if if followed) in Java and how to compress them?
Currently I have a small group of classes that implement a game of Snake with two players. I am implementing the movements as the keystrokes, currently the code is like this: // #----- Classe…
-
2
votes1
answer81
viewsCondition does not work in a Setter method
Why does my code give the following error: The operator '>' cannot be applied to type operands decimal and double. Code: class Funcionario { public string nome { get; set; } public string…
-
1
votes1
answer280
viewsHow to return a Boolean on the button
I have a button and I want when it’s clicked to return true in a if of another class, but I haven’t found any method of how I do it. Button b = new Button(); Other class: public static…
-
1
votes1
answer50
viewsDoubt how to jump 7 in 7 in the ids of own onItemClickListener android
How to make a condition in which it will jump 7 by 7 because I’m having to set it manually in hand, and if you have data on the defined ids, it will give error there would complicate . Below is an…
-
1
votes1
answer134
viewsProblem with condition
I am trying to create a script that ascertains whether the fine for late payment of the termination is due. The conditions are as follows:: 1 - If the prior notice is indemnified or waived (select),…
-
1
votes3
answers6114
viewsDisplay message after MYSQL query return empty
I have a script that makes a query in the database and displays the result... I would like when the query returns empty, a message is displayed to the user. The code: <?php //variavel dinamica…
-
1
votes3
answers149
viewsHow to delete a DIV if there is a word in another DIV in jQuery?
I’m trying to make the following condition: $(document).ready(function() { if($("#content .productName").html().indexOf("JBL","Oversound")==-1) { $("#pague-so").hide();} }); In this case, I want the…
-
1
votes2
answers161
viewsHow can I use something like an IF in an SQL query
I am applying a query SQL in the Oracle SQL Developer in multiple tables where a Column a view is null in some places and then I will need to use values from another Column and I don’t know how to…
-
1
votes1
answer1326
viewsHow to invoke function at the first click of the button and another at the second click
How do I call the first function within the first click of the button, by event ondblclick(); and the second function at the second click of the same button. I imagine invoking the function of the…
-
1
votes1
answer330
viewsCSS attribute with text line condition
Good morning, these lines make appear in my user-agent is being used by the client, it helped me with problems in the Trident engine that does not interpret the gradient in the text and works very…
-
1
votes1
answer761
viewsHow to pass range type input form values for Javascript defined variables to perform conditions?
I need to take values from a form of type "range" and through the values of each <input> of <form> want to store in a var Javascript within the page itself <html> so that within a…
-
1
votes1
answer148
viewsHow to duplicate visualization of HTML elements
I have 5 images, and 3 of them have the same class being exhibited on div To. <div id='A'> <img src="https://sites.google.com/site/mplayerplugin/thumbnails/09.jpg" class="figura" />…
-
1
votes2
answers207
viewsProblem with String Comparison Denial
A part of my code: // faça: do { System.out.println("Você deseja sentar na Janela (J) ou Corredor (C) ?"); opcaoSentar = leer.next(); // se a opção foi J if (opcaoSentar.equals("J")) {…
-
1
votes1
answer150
views -
1
votes1
answer64
viewsHelps in the logic of conditions and repetition in C++
I have the following verification code to know if a certain number belongs to a vector. I couldn’t think of a more precise way to get the program to say that the number DOES NOT belong to the…
-
1
votes1
answer9195
viewsFormatting to change Color and Status depending on another cell’s Conditional
VALOR= A/B 0 1 PERIGOSO 2 3 POBRE IA= A (400)/ 3 4 QUESTIONÁVEL 70 5 6 CONFIÁVEL 5,71 7 8 BOM > 9 EXCELENTE I want to automate a spreadsheet to get the result of the division that would…
-
1
votes1
answer127
viewsProblem with "Else if" and "<" ">" in VB.NET
I’m setting up a small system that if the number entered in the textbox3 is less than 3, appears in the textbox4 an "8%" message, and if it is a number between 4 and 6, it appears in textbox4 "9%".…
-
1
votes1
answer286
viewsconditional search in PHP using codeigniter
I have this table in my database I need to select all products belonging to a brand, but if the product code is the same you should not repeat the product, you should use the same product. Example,…
-
1
votes2
answers65
viewsExcel, analyze condition in data table
I need to change one column of values in excel according to the condition of another column. For example, analyze tax ratings and if they are "sales returns" I need to change the quantity to…
-
1
votes0
answers30
viewsconditional within the if?
I don’t know if I’m crazy kkkk but I think I remember seeing simple conditionals inside the printf. However, I don’t remember how it does. tipl, he does the same thing as this: if (xxx)…
-
1
votes0
answers26
viewsDoubt About Variable and Function
I am starting in Python, with the following characteristics: -User enters temperature limit -I read the user temperature compared to the sensor temperature -If Sensor Temperature is > User…
-
1
votes1
answer64
viewsTaking HTML data for a SELECT in another file without POST
Good morning guys, I am starting my life in PHP programming and I have a little problem here. I have the following form: <form action="cadastro_pex.php" method="post"> <label>Período:…
-
1
votes2
answers99
viewsHow to have a cycle interval, up to n and up to 0
In a validation function that passes the tests all will return 1, and if you enter one of the conditions will give return to 0. I want to cycle until the line breaks, so I’m using the interval:…
-
1
votes0
answers56
viewsWhy doesn’t my switch generate the right results?
I’m using a condition and a switch to determine some values for some variables, but I’m not getting the expected results. When the link <a href="index.php?post=myFile"></a> is clicked, I…
-
1
votes2
answers123
viewsCondition "if" does not enter
Why does this type of condition not work in Javascript? if (permissoes[0] || permissoes[5] || permissoes[10] || permissoes[15] || permissoes[20] || permissoes[25] || permissoes[30] || permissoes[35]…
-
1
votes1
answer531
viewsHow to delete line from a dataframe based on a python list?
I would like to know how to delete lines from a dataframe based on the accuracy of the values of a column and a list. For example: df: cod letra 101 a 202 b 303 c 404 d 505 e lista = list([202,505])…
conditionasked 5 years, 5 months ago Richard Lopes 21 -
1
votes10
answers5627
viewsFunction that returns if one can go to the database with true/false?
EXERCISE: Set the function possibleIrAoBanco, take two parameters, the first is diaDaSemana (string) and the second horaAtual(number), the function must return true, only if the database is open.…
-
1
votes2
answers117
viewsHow do I make "while" repeat 4 times only and break to the next C command?
int numeros, calculo, soma; numeros = 0; calculo = 0; while (calculo > 0) { printf("Digite o número: "); scanf("%d", &numeros); calculo++; } soma = calculo + soma; printf("A soma entre os…
-
1
votes5
answers431
viewsGo to certain link depending on the page
I’m developing a quiz with several themes, but it’s time to put it to a certain page depending on which page the person is on. I thought I’d use the if but he always goes for the last if, I’ll put…
-
1
votes2
answers117
viewsWrite a program that reads a character and displays the boolean value True (true) if it is a digit between ' 0' and ' 9' if not False (false)
def cont(caracter): digito = ord(caracter) return digito == 0 or digito == 9 def main(): usuario = str(input()) print(cont(usuario)) if __name__ == '__main__': main() Where is the error in that…
-
1
votes1
answer110
viewsConditional structure (if Else) javascript
I am studying Javascript and I have the following problem: <!DOCTYPE html> <html lang="pr-BR"> <head> <meta charset="UTF-8"> <meta name="viewport"…
-
1
votes1
answer64
viewsif - Else if condition being ignored by browser
Guys I have the following if - Else if condition for file upload check, depending on the file it allocates at a position of the array, however when arriving the name to do the validation it ignores…
-
0
votes1
answer145
viewsInitial condition (IF) does not work
I’m trying to make an old game. So far I managed to make the appointments change every turn and the function to delete the appointments. ps: I’m using black and red color instead of ball and "x". My…
-
0
votes1
answer34
viewsConditional Tags Worpress for mobile devices
How do I use a Conditional Tag in my wordpress theme so that a certain script is not loaded on mobile devices. There is such a tag? If there could show me an example? In this example the script…
-
0
votes0
answers211
viewsDo a Jquery conditional test?
I am making a page and I need it updated constantly, but only when the value of an external page I called with the Jquery.get() function is different from the one already contained in the file, it…
-
0
votes2
answers12933
viewsMultiple conditions on an if
I have a code here, and I need to put several conditions within an IF. In case I need to put it that way: if (X->meia != 's' || X->meia != 'S' || X->meia != 'N' || X->meia != 'n') {…
-
0
votes1
answer84
viewsIs there any alternative to a giant parole other than by switch case?
$metodo = array( "1"=> fazMetodo1(), //retorna algum valor "2"=> fazMetodo2(), //retorna algum valor "3"=> fazMetodo3() //retorna algum valor //... assim vai ); $inputId = "2"; if…
-
0
votes1
answer78
viewsCode does not read ELSE
Speak people, I’m a beginner in Android and I would like you to take me without a doubt. I am making an app for the user to complete all Edittext’s so that the program can perform the proper…
-
0
votes1
answer707
viewsif () syntax in a Trigger
I’m having difficulties with the if() syntax in phpmyadmin. I have to create a TRIGGER to insert information in a log when the name of an animal table animals is changed. But there is a syntax error…
-
0
votes1
answer32
viewsLINQ with multiple ON in OR condition?
I’m encountering a problem in the use of LINQ, I don’t have much knowledge of how it does. I have the following code: (from BEN in repositorioBEN.RetornaTodos() join CON in…
-
0
votes1
answer42
viewsError printing message inside condition
When I type any value other than 2 equal values, the "Invalid typed value!" message is displayed anyway. Anyone knows why? #include <stdio.h> #include <conio.h> int main(){ int x, y;…
-
0
votes2
answers1429
viewsIF / ELSE condition on Expression in Jasperreports
I need to perform a field check expression in my report created in Jasperreports studio, my situation is as follows, I need to realize the following account: $F{quantidade}/($F{quinze}/15.0) But…
-
0
votes0
answers26
viewsReplacing If/Else in Javascript
I am creating a form that will have several checkbox: <div class="checkbox"> <label> <input name="mini" id="SistemaRestauracao" class="mini" type="checkbox" value="1"> <b>…
-
0
votes1
answer194
viewsHow to implement an arraylist in one condition?
I need this code to have a class Estudante, one Professor and another Disciplina. I’m trying to limit the class students Disciplina in 50 with a ArrayList and a condition, but maybe they’re in the…
-
0
votes2
answers273
viewscomparing a variable with a vector or list
Usually to perform a conditional using an array or a list and need to perform a for and perform the if line by line in this way. //sendo item uma string e listaItens um List<String> for(String…