Questions tagged [statements]

In computer programming a statement is the smallest standalone element of an imperative programming language. A program written in such a language is formed by a sequence of one or more statements. A statement will have internal components (e.g., expressions).

A statement is the smallest standalone element of an imperative programming language. A program written in such a language is formed by a sequence of one or more statements. A statement will have internal components (e.g., expressions).

Resources

471 questions
2
votes
0 answers

LIKE Statements Not Working in Java SQL Prepared Statement

I'm working on creating a Java interface for an SQL database. I'm using prepared statements to perform the search queries, however they only work with "=" statements and not with LIKE statements. The first sample code using "=" works successfully. …
2
votes
3 answers

Delphi: Executing Conditional Statements in a String

How can I execute in Delphi a conditional statements in a String? In PHP there is something like this:
REALSOFO
  • 852
  • 9
  • 37
2
votes
7 answers

If else statements not working- why?

After working on this code for a while and coming very close to the end, I've run into an unexpected problem. The if and else statements for choices 'B' and 'C' display nothing on the screen when they are typed in as user input. I've tried a few…
Dingles
  • 149
  • 2
  • 3
  • 8
2
votes
3 answers

Can you explain this code for me in layman's terms?

I'm doing a project where I need the code to be able to determine if input is odd or not. (I also need to be able to determine if it is even Can you explain what this means? Mainly the first part. if((x & 1) == 0) printf("EVEN!\n"); else …
2
votes
1 answer

Is there any reason Python 3 would execute a statement twice?

I have a function: def turn(self, keyEvent): if (keyEvent.key == pygame.locals.K_UP) and \ (self.body[0].direction != Directions.DOWN): self._pivotPoints.append(PivotPoint(self.body[0].location, \ Directions.UP)) …
Ryan
  • 73
  • 4
2
votes
2 answers

PDO SQLSTATE[HY093]: Invalid parameter number

Im stuck on this one, recently switched to PDO to learn myself. /** * update * @param string $table A name of a table to update into * @param string $data An associative array. * @param string $where WHERE = ?. */ public function update($table,…
egilviking
  • 29
  • 2
2
votes
3 answers

How to use quotations in SQL statement with MySQLi Prepared Statements in PHP?

I am using prepared statements to perform a SELECT query to my database, however the nature of the SQL syntax is causing a problem with MySQLi. When I attempt to prepare: SELECT user_id FROM Users WHERE email='?'; I am getting an error Warning:…
TheKarateKid
  • 772
  • 11
  • 19
2
votes
2 answers

Why was semi-colon chosen to end a statement?

Was it because while typing, semi-colon appears under little finger when hands are positioned in default position to say - with index finger on F and J? Or is there anything more substantial?
Jay
  • 1,210
  • 9
  • 28
  • 48
2
votes
1 answer

MySql query select complex max()

I have these records What I want is to find max value in balance and retrieve it with the associated name (I have foreign keys userid==balanceID), for example in this case it would be "name2 | 2000". Is here any Mysql'ist who could tell me how to…
Omega wow
  • 35
  • 3
2
votes
1 answer

Simple javascript IF statement - what is the correct syntax?

Suppose I have this URL: www.example.com/product-p/xxx.htm The following javascript code picks out the phrase product-p from the URL: urlPath = window.location.pathname; urlPathArray = urlPath.split('/'); urlPath1 =…
ghilton
  • 127
  • 1
  • 3
  • 12
1
vote
3 answers
1
vote
1 answer

XPath compare one statement with multiple statements

I have this xpath: //a[ substring-after( substring-before( @href , '.deviantart.com' ) , 'http://' ) != 'about' and substring-after( substring-before( @href , '.deviantart.com' ) , 'http://' ) != 'browse' and substring-after( substring-before( @href…
Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
1
vote
2 answers

What do the following Javascript statements return and why?

I am learning JavaScript and was asked this question, can anyone help? What do the following Javascript statements return and why? parseInt("07"); parseInt("09"); parseInt("010"); "1" + 2 + 3; "1" == 1; "1" === 1; "1" == true; "1" === false;
mtwallet
  • 5,040
  • 14
  • 50
  • 74
1
vote
2 answers

Does order of the states in the if statement matter?

from line 5 on my code which is, if (i + 2 < str.length() && str.charAt(i) == 'y' && str.charAt(i + 2) == 'k') Does the order of statements matter? I was wondering because when I assign str = "yak123ya" (i + 2 < str.length() && str.charAt(i) == 'y'…
1
vote
3 answers

How do I get the result of two select statement in a single row?

I am using two select statments in a php page as follows: $num1 = mysql_query("SELECT SId FROM mtable WHERE Pathogen='$pathogen1' && Topic='$topic1' && Indicator='$ind1' && IndicatorSubGroup='$subind1' "); and $num2 = mysql_query("SELECT SId FROM…
Gopipuli
  • 393
  • 1
  • 12
  • 37