Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
1089160
1089160
For example:

Panel

...

copy src=$(filename)

if $(_lastrc) EQ 0
  delete src=$(filename)

if $(_lastrc) NE 0
  print msg="The source file could not be deleted."
end

else
  print msg="The copy operation failed."
end

print msg="The operation completed with a return code of $(_rc)."

...




Tip
titleA Stonebranch Tip

Anchor
1089178
1089178
Indenting lines underneath conditionals by putting spaces at the front of them, although not necessary, provides a visual cue that those lines are to be executed due to the evaluation of a conditional.

Anchor
1089179
1089179
Using this technique with nested conditionals provides an easy way to tell at which 'level' each of the commands belong.

Anchor
1089180
1089180
In addition, leaving a blank line before and after a conditional (not required by UDM) provides a way to visually indicate a block of related script commands.

Anchor
1089181
1089181
This improves the readability and maintainability of scripts in the future.

...


Anchor
1088729
1088729