MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

set option flag in function definition

  • To: mathgroup at
  • Subject: [mg128136] set option flag in function definition
  • From: Joug Raw <jougraw at>
  • Date: Tue, 18 Sep 2012 03:41:39 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:

Dear Experts,

I had one question regarding to the function definition.

I want to have a function that executes certain operation when I chose the
corresponding option flag.

For example,

a function called "f"

when I call it like f[arg1,arg2,arg3, optionX]
it executes command

If I call it like f[arg1,arg2,arg3,optionY]
it executes command

If I call it like f[arg1,arg2,arg3,optionSomethingElse]
it returns me
"No appropriate option flag was found. Please indicate correct options"

This looks a bit like scripts running in UNIX. I am wondering if I can do
the same in Mathematica easily?

Thank you so much for your kind help!

  • Prev by Date: Re: Landau letter, Re: Mathematica as a New Approach...
  • Next by Date: Re: Kernel exits (for lack of memory)
  • Previous by thread: Re: Epilog/Prolog and Show Question
  • Next by thread: Re: set option flag in function definition