Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Differences between cap and qui

    Dear all,

    does anyone know the differences between the commands capture and quietly? So far it seems pretty much the same to me.

    Regards.

  • #2
    -quietly- simply suppresses the output of the command, nothing more.

    -capture- does that plus the following:
    1. If the -capture-d command(s) produced an error condition, instead of breaking as would normally happen, execution continues to the next command, and,

    2. the error code generated by the command is saved in c(rc), so you can subsequently interrogate it.

    So the difference between -capture- and -quietly- shows up when the command encounters an error condition. -quietly- allows execution to break after the error, whereas with -capture- it continues, and information about the error condition is saved for later use.

    If you program in certain other languages, you might think of -capture- as analogous to a try-catch block.

    Comment

    Working...
    X