FIND YOUR NEXT FEW LINES

Results for “conditional”

Small, practical examples. Search by task or narrow things down below.

24 snippets foundClear filters
SQLiteReporting & grouped calculations

Turn known group values into columns

SQLite: Conditional aggregation gives a portable pivot when the category set is known.

SQLite✓ Tested
Linux CommandsSearching text

Branch on whether a pattern exists

Linux Commands: Use grep -q in a conditional so an ordinary no-match result is not an unhandled failure.

Linux Commands✓ Tested
Bash ScriptsProcesses & environment

Handle a nonzero background-job exit

Bash Scripts: Wait reports a child’s exit code; put it in a conditional when failure is expected.

Bash Scripts✓ Tested
PythonGetting Started

Handle three possible outcomes

Python: Check high, normal and low values with an ordered conditional chain.

Python✓ Tested
C#Getting Started

Handle three possible outcomes

C#: Check high, normal and low values with an ordered conditional chain.

C#✓ Tested
JavaGetting Started

Handle three possible outcomes

Java: Check high, normal and low values with an ordered conditional chain.

Java✓ Tested
JavaScriptGetting Started

Handle three possible outcomes

JavaScript: Check high, normal and low values with an ordered conditional chain.

JavaScript✓ Tested
TypeScriptGetting Started

Handle three possible outcomes

TypeScript: Check high, normal and low values with an ordered conditional chain.

TypeScript✓ Tested
C++Getting Started

Handle three possible outcomes

C++: Check high, normal and low values with an ordered conditional chain.

C++✓ Tested
CGetting Started

Handle three possible outcomes

C: Check high, normal and low values with an ordered conditional chain.

C✓ Tested
GitInspecting the working tree

Test whether tracked working files changed

Git: A quiet diff returns status one for differences, so handle it in a conditional.

Git✓ Tested
Bash ScriptsFunction scope & composition

Use a function’s exit status as a boolean result

Bash Scripts: Return zero for success and test the function directly in a conditional.

Bash Scripts✓ Tested