summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/script_commands.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 15fad965a..9c9b75fb0 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -1402,7 +1402,7 @@ script.
---------------------------------------
-*getarg(<number>)
+*getarg(<index>{,<default_value>})
This function is used when you use the 'callsub' or 'callfunc' commands. In the
call you can specify variables that will make that call different from another
@@ -1446,6 +1446,13 @@ You can pass multiple arguments in a function call:
getarg(0) would be 5, getarg(1) would be 4 and getarg(2) would be 3.
+Getarg has an optional argument since trunk r10773.
+If the target argument exists, it is returned.
+Otherwise, if <default_value> is present it is returned instead,
+if not the script terminates immediately.
+
+in the previous example getarg(2,-1) would be 3 and getarg(3,-1) would be -1
+
---------------------------------------
*return {<value>};