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
6
votes
5 answers

Firebird multiple statements

is there any way to execute multiple statements (none of which will have to return anything) on Firebird? Like importing a SQL file and executing it. I've been looking for a while and couldn't find anything for this.
zz1433
  • 3,528
  • 2
  • 28
  • 36
5
votes
2 answers

How to sql-recursive statements work?

I am trying to understand sql recursive statements, but it is really hard for me. For example: Thats an exampe I am trying to understand and to write down the output. Can sb pls explain me how this works, step by step? greetings and thx in…
maximus
  • 11,264
  • 30
  • 93
  • 124
5
votes
3 answers

CollapsibleIfStatements

I recently stumpled upon the following warning using PMD (embedded in hudson), my code seems to suffer CollapsibleIfStatements, which I do not fully understand. The code looks like this // list to be filled with unique Somethingness List list = new…
Robert Heine
  • 1,820
  • 4
  • 29
  • 61
5
votes
1 answer

"does not name a type" error when using namespaces in c++

In the below code writing the statement A::x=5 is giving the error: 'x' in namespace 'A' does not name a type Can't we assign a value globally for x variable? #include int x = 10; namespace A { int x = 20; } A::x=5; int…
sivakrdy
  • 51
  • 2
5
votes
4 answers

What's the difference between `{}` and `()` in these code?

Destructuring_assignment#Assignment_without_declaration it says: the {a, b} on the left-hand side is considered a block and not an object literal. var a, b; {a, b} = {a:1, b:2};//Syntax Error! ({a, b} = {a:1, b:2}); // it works what the '()' do…
5
votes
6 answers

AND/OR (&&/||) logic for multiple condition statements

If you have an if-statement in C# that checks multiple conditions: if (a == 5 && b == 9) { ... } Does b == 9 still get checked if a == 5 condition is false, or does it automatically exit since there's no way this could pass anymore? Similarly, for…
miguelarcilla
  • 1,426
  • 1
  • 20
  • 38
5
votes
5 answers

C++ Multiple statements for conditional operator

I'm trying to use a conditional statement that does one thing in one condition but does two things if the other condition applies. Consider the following: ( h >= 0 && h < 24 ? hour = h : hour = 0, cout << "Invalid Hour Detected\n") If "h" is set…
Steve Eggering
  • 759
  • 2
  • 9
  • 23
5
votes
2 answers

Multiple IF statement conditions

I have a PHP script that runs through an array of values through my own custom function that uses the PHP function preg_match. It's looking for a match with my regular expression being $valueA, and my string to search being $valueB, and if it finds…
5
votes
2 answers

Dealing with large switch statements in CUDA

I understand that branching in CUDA is not recommended as it can adversely affect performance. In my work, I find myself having to implement large switch statements that contain upward of a few dozen cases. Does anyone have any idea how badly this…
gamerx
  • 579
  • 5
  • 16
4
votes
1 answer

Equivalent of "Get" statements VB6 to VB.NET 2022

I have some VB6 code that needs to be migrated to VB.NET, and I wanted to inquire about this lines of code, and see if there is a way to implement them in .NET. Get statements are no longer supported so how can I replace it? For i = 0 To ntc(j) - 1 …
MattL99
  • 137
  • 5
4
votes
1 answer

Expressions and Statements in JavaScript

I just started to learn JavaScript with the book "Eloquent JavaScript", which is accessible free of charge at eloquentjavascript.net. So far I really like the book, there's just one section I don't understand. It's the one about expressions and…
typeduke
  • 6,494
  • 6
  • 25
  • 34
4
votes
2 answers

Does Groovy's ternary conditional operator support statements, not just expressions?

Is it possible to include statements with expressions with Groovy's conditional operator? This is what I'm doing now, and I want break this down in a single conditional statement with the println statements... if(!expired){ println 'expired is…
raffian
  • 31,267
  • 26
  • 103
  • 174
3
votes
0 answers

Is gcc wrong by allowing the code with compound statement to compile?

I'm trying to add tuple elements into a vector. The below code is working: #include #include #include #include #include template std::vector to_vector(std::tuple x) { …
João Paulo
  • 6,300
  • 4
  • 51
  • 80
3
votes
1 answer

How to write multiple SQL statements like CREATE table in AWS Athena ( using CLI command - aws athena start-query-execution --query-string {value} )?

How to write multiple CREATE TABLE statement to execute multiple SQL statements via ATHENA CLI command - aws athena start-query-execution I have tried this but just with single SQL statement and it works fine. But I need to run multiple SQL…
3
votes
3 answers

Print a line if conditions have not been met

Hello fellow stackoverflowers, I am practising my Python with an example question given to me (actually a Google interview practice question) and ran into a problem I did not know how to a) pose properly (hence vague title), b) overcome. The…
user8226002
1
2
3
31 32