#396 USE Keyword Instruction

3.2.0
closed
David Ashley
5
2012-08-14
2007-08-24
No

Referring to documentation rev. 655.

p. 78: The documentation misses the description of the ellipsis "..."

The ellipsis ("...") can be given in place of the last variable in the USE
STRICT ARG statement and indicates that more arguments may follow. It allows
defining a minimum amount of arguments that must be supplied or for which there
are default values defined and that may be followed optionally by any additional
arguments.

Example:

    call test "one"
    call test "one", "two"
    call test "one", "two", "three"
    call test "one",      , "three", "four", "five"
    exit

    test: procedure   /* a minimum of one argument must be supplied */
      use strict arg v1, v2="zwei", ...

      say "There are ["arg()"] argument(s); v1,v2=["v1","v2"]"
      do i=3 to arg()
         say "                       arg #" i"=["arg(i)"]"
      end
      say "--"
      return

Output:

    There are [1] argument(s); v1,v2=[one,zwei]
    --
    There are [2] argument(s); v1,v2=[one,two]
    --
    There are [3] argument(s); v1,v2=[one,two]
                           arg # 3=[three]
    --
    There are [5] argument(s); v1,v2=[one,zwei]
                           arg # 3=[three]
                           arg # 4=[four]
                           arg # 5=[five]

Discussion

  • David Ashley
    David Ashley
    2007-08-24

    Logged In: YES
    user_id=931756
    Originator: NO

    Fixed in SVN rev 709. I reordered some of the paragraphs but all of the suggested text that appears above is included.

     


Anonymous


Cancel   Add attachments