An "if" statement is a control structure in many programming languages that changes the execution flow depending on a condition.
1
vote
2answers
31 views
Using functions return values in an if condition javascript?
I have a simple if conditional like so,
if (gl.Node.moveUp.call(this) && this.parent._currentScene()) {
// Do something
}
Both functions return a boolean, does the condition get ...
-6
votes
1answer
33 views
PHP If Else filter_has_var [closed]
I am not sure if I am supposed to have multiple if's or else if's?
I am not sure if the semicolon is supposed to be at the end of each line?
if (filter_has_var(INPUT_POST, "bName"));
...
1
vote
1answer
35 views
Java If loop don't get executed: Scanner [duplicate]
My second scanner input get stored as desired but still the if condition comparing correctString == stringValue is not executed.
Could you help.
{
static String stringValue = "A";
public static void ...
0
votes
2answers
23 views
if statement for MFMailComposer dosn`t work
I have a simple problem:
If i click on my mail button and there is no E-Mail address deposited i want the alertView to show up and i don`t want it to go to the Mail composer but it does.
The ...
8
votes
5answers
267 views
how does a C-like compiler interpret the if statement
In C-like languages, we are used to having if statements similar to the following:
if(x == 5) {
//do something
}
else if(x == 7) {
//do something else
}
else if(x == 9) {
//do something ...
0
votes
2answers
15 views
Provide multiple mirrors if a file doesn't exist
I want a Mirror script which determines whether or not a certain file is accessible or not. If the mirror 1 is accessible, it will present the link to mirror 1. If mirror 1 is not accessible, it will ...
0
votes
1answer
24 views
Smali if structure modification
i need to modify "if statements" from smali codes to the condition will be true, in java could be something like that:
if(a > b){
.....
}
convert to:
if(true){
...
}
If is it ...
2
votes
1answer
71 views
How would I fix this code? (if-statements)
I am doing a beginner Java course. I'm not sure how I would store the variables for each if statement. This is what my code looks like:
// Variables for the final sum of all even numbers
int ...
0
votes
2answers
24 views
Excel function: “Not Isblank” with “Or” and if date is
I need a function that notify me if one of two cells is empty (or both of them) while if more than 30 days have passed . I used it before but with just one empty cell and it works perfectly:
...
1
vote
2answers
22 views
Windows Command Line Processor: Multiple and Nested IF Statements
Intended software: windows command line processor (version 6.1.7601.17514)
Hi,
I've been trying to build a multiple-statement command line that runs within a short-cut. My goal is to be able to ...
0
votes
2answers
47 views
Break loop from an if else statement
I'm new to jQuery, let me know if I'm doing it right. So here's my code. I nested this function in another function. I want it to execute (pretty much just toggling images) until a count of 3 then ...
-1
votes
0answers
37 views
if (form1.Opacity == 1) ~~ Not working C#
I am fairly new to C#, and cannot figure out this error or how to fix it. I want form2 to check if form1's opacity level, and if form1 has an opacity of 1, it closes itself (Form2).
public ...
1
vote
1answer
14 views
How do I display something only if there are results in the array from a query?
How would I rewrite this code to only display the <h3> tag only if there are results returned from the query?
I am very new to PHP, I know this can be done, I'm just not sure of the best ...
0
votes
7answers
72 views
Return True if alphanumeric (No methods or import allowed)
What would be a good way to make a function return True if, and only if, what is inputted is alphanumeric (contains only letters or numbers), without using methods or import?
So far in class, we only ...
-4
votes
2answers
77 views
C++ Memory Error when using if(condition) return: Unbelievable [closed]
Today I wrote some interesting code that convert an integer to Roman numerals.
Whole running codes are here:
#include <iostream>
#include <map>
#include <string>
using namespace ...
2
votes
5answers
71 views
Variable not initialized as condition c++
I want to do an if like:
if(x has not been initialized)
{...
}
Is this possible? Thanks
3
votes
5answers
39 views
Endif must be preceded by a matching if
I have a piece of vb.net code that I wrote. It's a for loop with two embedded if statements, and the compiler is telling me that each elseif and endif must be preceded by a matching if.
This is my ...
0
votes
1answer
29 views
Comparing Strings in IF( statement in php issue
I have not found a solution to this online, because I think its the way i am using the date format.
Problem: I have a date format: 2013-06-07 This formate is created by the following:
$thedate = ...
1
vote
3answers
40 views
Error with If-Else statement combine with Math in .bat file
It's supose to be simples, but i can't get it working ! Maybe someone could help...
I just need a program that check if '07503.csv' file exists, and than '07504.csv', '07505.csv'...until '07552.csv'. ...
0
votes
0answers
27 views
If condition takes only the first case in Unix
I've got an array with some values inside it. I have to check the values and move accordingly. This is my code.
var=$EOR
if [ "${arr[0]}" != "NUMBER" ];
then
FIELD1=`echo $var | awk ...
0
votes
0answers
26 views
Python Sockets - if statement not working
Basically when a client sends a string 'killsrv' I want the server to shutdown. I am using an if statement but it doesn't seem to be working. I did a test and switched:
if data == 'killsrv' :
to
...
0
votes
2answers
34 views
oracle how to write in stored procedure to get specific values
I am not sure how to write in stored procedure of Oracle. It is kind of new to me.
Table 1: Bank:
Bank_Id Description
001 FNB
002 ABSA
Table 2: Config
Config ConfigName
1 ...
-1
votes
1answer
19 views
y position animate in if statement
So i'm making a tiny html5 game. And I don't know how to formulate something.
I've got this:
if (40 in keysDown) { // Player holding down
hero.y = 300;
}
So if players hold down the arrow key, ...
0
votes
1answer
60 views
Bash: Nested if-statement doesn't finish scope
I have this function in bash, where an if-statement won't be run until the end of the scope, but only runs the first command after the if-statement, and then continues with the first-next command ...
0
votes
1answer
41 views
IFstatement in MySQL query
I want to write something like this :
<?php
$comment = mysql_query("SELECT * FROM `communication` WHERE `ID`='$index' order by `Date_add` desc");
echo "<div class=\"row\">";
while ($com = ...
-3
votes
5answers
96 views
Please can you help me with my IF statements?
Whats wrong with the following code (I think its something to do with the if statements), i've tried looking it up online, but to no success?
<form action="#" method="post" name="formSeven">
...
0
votes
2answers
30 views
PDO/MySQL fetch multiple columns with if statement
I'm currently trying to fetch two images location from my database, how do I return both columns and if both empty then echo another image. This is what I've got so far.
How do I return both photo and ...
1
vote
4answers
38 views
PHP: check whether items in the database have the same name
I am creating a PHP script that checks if your database contains an element with the same name. Here's the code:
<?php
$query = @mysql_query("SELECT * FROM category");
while($Row = ...
0
votes
5answers
86 views
else and if statement
World!
I am currently self teaching my self C++. I am reading principals and practice using C++ and while writing a program for one of the exercises I got curious about an outcome from a program I ...
0
votes
2answers
20 views
Match IDs taken from 2 inputs (JSON) and do something if positive
Here's a sample of a JSON entry output from Feedbin's entries.json:
[
{
"id": 2077,
"title": "Objective-C Runtime Releases",
"url": ...