Optional argument in ::method and ::routine - REXX

This is a discussion on Optional argument in ::method and ::routine - REXX ; Hello, Say I have a routine defined like this ::routine myroutine public use arg arg1, arg2 return How can I make 'arg2' optional so that I can call both: myroutine(1, 2) myroutine(1) ?? I think what I really need is ...

+ Reply to Thread
Results 1 to 2 of 2

Optional argument in ::method and ::routine

  1. Default Optional argument in ::method and ::routine

    Hello,

    Say I have a routine defined like this

    ::routine myroutine public
    use arg arg1, arg2
    return

    How can I make 'arg2' optional so that I can call both:
    myroutine(1, 2)
    myroutine(1)
    ??

    I think what I really need is a way to detect within myroutine that arg2 has
    not been initialized by the caller.

    Thanks in advance and Regards,

    SerGioGioGio




  2. Default Re: Optional argument in ::method and ::routine

    Use the arg Bif

    if arg(2,'e')
    then say "arg 2 exists"
    else say "arg 2 doesn't exist"

    hth

    Jon
    "SerGioGio" <nospam> wrote in message news:44ddb006@news.starhub.net.sg...
    > Hello,
    >
    > Say I have a routine defined like this
    >
    > ::routine myroutine public
    > use arg arg1, arg2
    > return
    >
    > How can I make 'arg2' optional so that I can call both:
    > myroutine(1, 2)
    > myroutine(1)
    > ??
    >
    > I think what I really need is a way to detect within myroutine that arg2

    has
    > not been initialized by the caller.
    >
    > Thanks in advance and Regards,
    >
    > SerGioGioGio
    >
    >
    >




+ Reply to Thread

Similar Threads

  1. Re: A simple question regarding ruby method argument
    By Application Development in forum RUBY
    Replies: 8
    Last Post: 08-25-2007, 06:34 AM
  2. Annotation on interface method argument
    By Application Development in forum Java
    Replies: 3
    Last Post: 07-14-2007, 09:23 AM
  3. xmlhttp.open method...how to format the second argument
    By Application Development in forum XML SOAP
    Replies: 3
    Last Post: 04-30-2007, 04:06 PM
  4. Trouble sending XML as method argument in SOAP::Lite -> .Net
    By Application Development in forum XML SOAP
    Replies: 0
    Last Post: 01-13-2006, 03:56 PM
  5. optional argument
    By Application Development in forum basic.visual
    Replies: 5
    Last Post: 12-01-2003, 08:00 PM