Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

Re: arguments/realtime3d

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32283] Re: [mg32246] arguments/realtime3d
  • From: BobHanlon at aol.com
  • Date: Wed, 9 Jan 2002 23:38:12 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 1/9/02 4:13:08 AM, 6.6e-34 at gmx.de writes:

>Is there a way to obtain the number of arguments with wich
>the function was called as in
>f[x___?OptionQ]:=Module ...?
>I  would like to check if x contains only valid options of f (defined with
>Options[f,a->1])
>

Use the standard add-on package Utilities`FilterOptions`


To count the options, before or after filtering, use Length[{}]
 

Clear[f]
;

f[x_, opt___?OptionQ] := Length[{opt}];

f[x]

0

f[x, a->b, c->d]

2


Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: Re: more elements in a list
  • Next by Date: RE: more elements in a list
  • Previous by thread: arguments/realtime3d
  • Next by thread: Re: arguments/realtime3d