FIND YOUR NEXT FEW LINES

Results for “meter”

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

48 snippets foundClear filters
CStructures & function interfaces

Keep caller data unchanged by passing a structure by value

C: A value parameter is a copy of the original structure.

C✓ Tested
PowerShellFunctions & parameter validation

Keep function-local assignments separate from caller state

PowerShell: Ordinary function assignments create local variables rather than replacing the caller’s variable.

PowerShell✓ Tested
PowerShellFunctions & parameter validation

Pass a block of behavior as an argument

PowerShell: Invoke a scriptblock with the call operator and an explicit input value.

PowerShell✓ Tested
PowerShellFunctions & parameter validation

Preserve a failure after local cleanup

PowerShell: A bare throw inside catch rethrows the current exception.

PowerShell✓ Tested
Bash ScriptsParameter expansion

Read a string’s character length

Bash Scripts: Bash parameter length counts characters under the current locale.

Bash Scripts✓ Tested
Bash ScriptsParameter expansion

Read a variable whose name is stored in another variable

Bash Scripts: Indirect expansion performs one extra variable-name lookup.

Bash Scripts✓ Tested
Bash ScriptsVariables & text

Remove a filename extension

Keep the path while removing its final extension.

filename✓ Tested
Bash ScriptsParameter expansion

Remove a known prefix with a shell pattern

Bash Scripts: The hash expansion removes the shortest matching prefix without changing the original variable.

Bash Scripts✓ Tested
PowerShellFunctions & parameter validation

Return a collection as one pipeline object

PowerShell: The unary comma prevents the returned array from being enumerated at this boundary.

PowerShell✓ Tested
CStructures & function interfaces

Return a status separately from a calculated result

C: An output pointer lets a function return success or failure independently of its numeric result.

C✓ Tested
PowerShellFunctions & parameter validation

Run cleanup after a caught exception

PowerShell: Use finally for cleanup that must occur after either success or failure.

PowerShell✓ Tested
HTMLData & disclosure

Show a bounded measurement

Display a measured value within a known range using HTML meter.

HTML✓ Tested