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
-1
votes
1 answer

python for statement with if inside it

Need help please. I'm trying to get this if statement within a for statement correct, but failing miserably at it. If an image isn't available, I badly need a fallback image to replace it. Thank you {% for post in posts|slice:":1" %}
-1
votes
2 answers

Setting more than one variable to the same value in c++

I had a question about if I could set more than one variable to the same value like this: int hours, minutes, seconds, TotalTimeInSeconds = 12; or if I had to type it in like this: int hours = 12, minutes = 12, seconds = 12, TotalTimeInSeconds =…
catpat4
  • 19
  • 1
  • 6
-1
votes
2 answers

How to put my own function in side an if statement?

I am trying to make a simple blackjack game and i want to be able to create my own function, which a can already do, and then put it inside an if statement so that if the user want's to 'stand' then it runs the function to 'stand'. However, when…
-1
votes
2 answers

Comparative select on the same table (mysql)

I'm really newbie with mysql and i'm tryin to do a simple select, but I can't figure it out. Thats what I have: I got this in a Table named Control: | CODE | OFFICE | | 1 | usa | | 2 | usa | | 3 | usa | | 4 | usa | | 5 | …
Irvıng Ngr
  • 418
  • 7
  • 15
-1
votes
1 answer

Can I use nested statements without curly brackets?

While not finding a "foreachelse" in the PHP manual, I came up with my own. Would you say the following is recommended? I am a fan of compact code, and I think it has good readability. Plus it works. $consequences = array("You ", "will ", "burn ",…
OnklMaps
  • 807
  • 8
  • 17
-1
votes
2 answers

Simple If statement VBA

I am getting "End if without block if" while executing below code. I have no idea why.Please help. If erange.Offset(0, 1).Value = "RTN" Then If erange.Value = "RASP" Then erange.Offset(0, 11).Value = "a" If erange.Value = "FEATHER EDGE"…
-1
votes
1 answer

PHP Prepared statements from web form issues

Only recently started using mysql so I'm slowly getting to grips with it, but trying to use PHP prepared statements for a webform, and upon submitting the webform, it's just displaying the php code. Any suggestions? Thanks
James Duffield
  • 103
  • 1
  • 1
  • 3
-1
votes
1 answer

How can I add multiple IF OR statements in an excel?

I have to test a condition where the parameters can be more than one string. For eg: I would like to test if (cell1="CA" or cell1="OR" or cell1="NV" or .....)` print 1 else print 0 How do I do this? Excel only allows me to check maximum of…
DSSD
  • 39
  • 1
  • 2
  • 5
-1
votes
3 answers

If statement isn't being caught

I can't for the life of me figure out why C is ignoring my if statement. I'm trying to skip all the procedures in the while statement when the input is -1000 (so that it doesn't print before exiting the program). Here is my code: int main() { int…
-1
votes
1 answer

How to use if statements inside each other to make chatbot(Node.js)

I am trying to create simple chatbot with node.js but I am having trouble getting if statements to work. I want the if statements to be inside of each other so that the user can only chat "How are you?" if he has already said "Hello". The current…
-1
votes
1 answer

I'm having a lot of trouble organising these if statements in Java

I have to do a recommend-a-laptop project for school, and I want to keep it as concise as possible by using very long if statements with multiple conditions. I have many of these, but here's one of them: if ((questionArray [0].equals ("A") &&…
APSmoove
  • 3
  • 1
-1
votes
1 answer

why can not we make an assignment in the class body?

if we try to do class A{ int a = 5 ; a=6; // we will get error } i saw this question it like mine but not the same Why can't I do assignment outside a method? but the answers did not convince me as here we see that declaration are statement as…
Sam
  • 239
  • 2
  • 12
-1
votes
1 answer

Very new to python, looking for some clarification

When I use this function: soup = BeautifulSoup(sock,'html.parser') for string in soup.stripped_strings: if string == "$": pass else: print string It prints out the following values, skipping the…
Harp Angell
  • 69
  • 1
  • 6
-1
votes
1 answer

how to add another condition pdo sql statement

i found in the internet this and so far so good with one condition!! but how can i add 2 or more conditions in the sql statement?? public static function getInstance() { if(!isset(self::$_instance)) { self::$_instance = new DB(); } …
-1
votes
1 answer

compiler error: Expected: end of statement when using "To" statement for array range excel vba

For a project I am working on I'm using a param array to grab string values from a user and then run an autofilter incorporating string values from the array. However, whenever I use a To statement(E.G. Boundaries = LBound(ArrayHere) To…
TechEmperor95
  • 389
  • 1
  • 4
  • 18