# $result(5)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

$result - Various command return values

## SYNOPSIS

$result returnValue

## DESCRIPTION

$result is used to return the results of several commands:

buffer-info(2) $result is set to the same output string as printed to the message-line by this command.

change-font(2)

$result is used to return the user select font when hte windows font selection dialog is used (Windows systems only).

count-words(2)

$result is set to the same output string as printed to the message-line by this command.

file-op(2)

$result is used to return an error code when the command fails.

find-registry(2)

$result is used to return the name of a registry child node given the parent and index from the user.

mark-registry(2)

$result is used to return the full name of the given registry node.

replace-string(2)

query-replace-string(2)

$result is used to return the number of substitutions, the final replace mode ('a' for all, 'l' for last or 'q' for query) and the replace with string in a list.

osd(2)

$result is used to give and return information to osd item commands, information depends on the type of osd item.

osd-dialog(3)

osd-xdialog(3)

$result is used to return the button pressed by the user.

shell-command(2)

$result is set to the exit status of the system call. The combination of shell-command calls and return value checking can be used in a variety of ways, for example, to test the existence of a file:

    set-variable %filename @ml"Enter file name"
    shell-command &cat "test -f " %filename
    !if &equ $result 0
        ml-write "file exists"
    !else
        ml-write "file does not exists"
    !endif

show-region(2)

$result is set to the current status of the region when an argument of 0 is given to show-region.

spell(2)

$result is used to return information on the current word, the information depends on the argument given to spell.

$file-names(5)

$result is set to the absolute path of the $file-names query directory when the variable is set.

For more information see the help pages on referenced commands and variables.

## NOTES

The current value of $result is lost on the next command call which uses it. As a call to create-callback(2) can cause the execution of a macro to interrupt another which is waiting for user input, the value of $result should be copied before getting user input.

## SEE ALSO

buffer-info(2), change-font(2), count-words(2), file-op(2), find-registry(2), mark-registry(2), query-replace-string(2), osd(2), shell-command(2), show-region(2), spell(2), $file-names(5). create-callback(2), $status(5).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>