Category "if-statement"

Keep getting error message not all control paths return a value

bool isEnemy(const string& check) { if (check == enemy1 || check == enemy2 || check == enemy3) // if the name being checked is an enemy of this kni

Statement that checks whether a URL contains a particular path?

Is there an if statement that allows me to check whether a URL contains a particular path? In my particular case (using wordpress), I'm trying to check wether

Writing a query for alternative column names as mentioned below eg

The query for, If the address is missing, displays the email id. If both address and email are missing then display ‘NA’. Give an alias name as CONT

Nested if statements vs &&(or) operator

I've been trying to solve this https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/profile-lookup/ with the following code

Can you use an if/else inside a .filter() / Is there any other way?

TASK: There is an array of words called overusedWords. These are words overused in this story. You want to let the user of your program know how many times the

Python Tkinter Button with If Else statements

I want to bind the Start_Button with 2 possible functions: If Choice_1_Button is clicked and then the Start_Button, the Start_Button should call foo1. But when

Error with if statement when checked variable is not defined

I have some variables A and B and I want to check them for a value and if both are False, the function shall render True: if ( A == 1 and B == 2 ) == False : do

Create a zip with only .pdf and .xml files from one directory

I would love to know how i can zip only all pdfs from the main directory without including the subfolders. I've tried several times changing the code, without a

UEFI function running wrong part in if else

I am writing a UEFI function which used to show status. But when I give it a EFI_STATUS type "2" as "state" argument, it execute "else" part, instead of "state

Assign within if statement Python

Is there a simpler alternative than res = returns_value_or_none(arg) if res: do_something_with(res) or if returns_value_or_none(arg): do_something_

VLOOK-up without N/A and 0 results (extraction from 2 sheets)

I am trying to create an if-vlookup that retrieves data from 2 sheets with following specs: if the retrieve from the 1st sheet shows N/A and 0 results than vloo

Using zipfile to archive directory contents while skipping files from list

I'm using zipfile to create an archive of all files in a directory (recursively, while preserving directory structure including empty folders) and want the proc

Can we write IF statement without else in javascript

I wrote some code to create an simple todo app in angular js. I have the following function code to remove the tasks from the list. Javascript code $scope.del

useState and if statement causing Error: Too many re-renders. React limits the number of renders to prevent an infinite loop

What I'm attempting to create is a React component which conditionally renders when the value of the prop boxToggle is true, and also returns null when the user

How do I use a query to get a date from an array formula?

On sheets, I'm using this formula to sum hours to a specific month from a drop-down menu. =QUERY('Form responses 1'!H2:L, "Select L, Sum(K) WHERE L is not NUL

IF Statements and Conditions for iMacros Firefox

So I'm trying to make a macro to catch Pokemon from maps in this game but there if you encounter a Turf War it will show this image: As you can see the click

Looping through a list in Python

Trying to loop through a list of numbers so that the output reads the result on a seperate line. Instructions Given: - Store numbers 1-9 in a list. - Loop thro

python if user input contains string

Very basic question. We have the code: a = input("how old are you") if a == string: do this if a == integer (a != string): do that Obviously it d

Nested if statements in cobol

I am trying to use nested if statements in Cobol. As far as I can tell I am following the style guides, but keep receiving the error: file_name.cob:64: Error: s

Input and output values for php into the browser?

I just started my module on php for school, having completed Javascript two months ago I am familiar with a lot of the elements but a bit rusty. Basically I set