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

458 questions
18
votes
4 answers

What is the definition of cardinality in SQL

My school book Database Systems defines cardinality as follows: The cardinality of a relation is the number of tuples it contains. By contrast, the number of tuples is called the cardinality of the relation and this changes as tuples are added or…
Tobias Schultz
  • 183
  • 1
  • 1
  • 4
17
votes
3 answers

how to use "if" statements inside pipeline

I'm trying to use if inside a pipeline. I know that there is where (alias ?) filter, but what if I want activate a filter only if a certain condition is satisfied? I mean, for example: get-something | ? {$_.someone -eq 'somespecific'} |…
Emiliano Poggi
  • 22,882
  • 7
  • 49
  • 64
16
votes
3 answers

Why is the function return in C a statement?

An expression generates a value, statements alter the status of the machine, aka, side effects. However, I keep reading that function return is a statement. If I call a function that returns a void, how does that change any status of the machine? Or…
SLN
  • 3,958
  • 1
  • 22
  • 47
13
votes
2 answers

What is the difference between a statement and a function in Python?

Edit: The suggested duplicate, does not answer my question, as I am primarily concerned with the difference in Python specifically. The suggested duplicate is far broader than this question. I have recently started to learn Python. I'm currently…
Gary
  • 883
  • 10
  • 32
10
votes
2 answers

Is there a VB equivalent to C#'s 'continue' and 'break' statements?

For sake of argument, how could I do this in VB? foreach foo in bar { if (foo == null) break; if (foo = "sample") continue; // More code //... }
Jude Allred
  • 10,577
  • 7
  • 25
  • 27
7
votes
3 answers

ISO C90 forbids mixing declarations and code... but allows it in certain instances?

I am using the following flags (where cc is either gcc 4.2 or clang 8.0): $ cc -Wall -Werror -pedantic -ansi -std=c89 main.c (I know the -ansi flag is a bit redundant in this case) The following gives me the expected error main.c:31:8: warning: ISO…
7
votes
2 answers

Custom Compound statements in c#

I would like to write my own custom compound statements that have a similar mechanism to using and lock mechanisms where they have code injected at the beginning and end of the statement block before compilation. I have tried searching for…
Gelion
  • 501
  • 7
  • 14
7
votes
3 answers

Two PLSQL statements with begin and end, run fine separately but not together?

Just wondering if anyone can help with this, I have two PLSQL statements for altering tables (adding extra fields) and they are as follows: -- Make GC_NAB field for Next Action By Dropdown begin if 'VARCHAR2' = 'NUMBER' and length('VARCHAR2')>0 and…
Twiss
  • 83
  • 1
  • 1
  • 4
7
votes
2 answers

Does adding a semicolon at the end of `return` make a difference?

The Rust Guide states that: The semicolon turns any expression into a statement by throwing away its value and returning unit instead. I thought I got this concept down until I ran an experiment: fn print_number(x: i32, y: i32) -> i32 { if x +…
sargas
  • 4,422
  • 5
  • 43
  • 62
6
votes
6 answers

Is a line in a Java program the same thing as a statement?

I'm a Java noob. I've only used it for a few days and I'm still trying to figure it all out. In a program, is a line the same thing as a statement?
Benny
  • 71
  • 2
6
votes
2 answers

What is meant by locality of declaration?

I was reading a book and here, a program is given like this - #include #include #include int main() { string filename; // #1 cout << "Please enter name of file to open : "; cin >> filename; …
dukeforever
  • 174
  • 7
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,460
  • 2
  • 26
  • 36
6
votes
1 answer

SQL Statement t1, t2 etc

Im quite new to SQL and I'm just trying to find out what it means when you use t1, t2 or t3 etc... I cant get my head around it and would just like to learn about it. I've tried looking all over google but i've found nothing yet... Can you…
user1847961
  • 97
  • 2
  • 2
  • 8
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
  • 10,204
  • 25
  • 85
  • 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,712
  • 4
  • 24
  • 58
1
2 3
30 31