optional parameters for custom functions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • tigran
    Forum Member
    • Apr 2007
    • 57

    optional parameters for custom functions

    I'm aware that Indigo's built-in functions support optional parameters (e.g. HTTP.Download())

    Is it possible to define optional parameters in a custom function? For example

    function MyFunction(Param1, Param2, OptionalParam3 = nil)
    ---
    end

    Thanks!
  • Lorne
    Indigo Rose Staff Member
    • Feb 2001
    • 2729

    #2
    Yes, IIRC you just test whether that parameter is nil within the function. If it's nil, it was either unspecified or passed as nil.
    --[[ Indigo Rose Software Developer ]]

    Comment

    • tigran
      Forum Member
      • Apr 2007
      • 57

      #3
      Worked like a charm. Thanks!

      Comment

      Working...
      X