Error handling in plugins

May 30, 2008
122
1
#1
What is best practice for argument validation in plugins? If I have a
plugin command with arguments, say

MYPLUGIN [/A] [/B arg]

how should I handle an unexpected argument /D? (Built in commands seem
to report a (Sys) error including the incorrect flag, how do I
replicate this?) What about /B with a missing argument, or /A with
extra arguments?

If anyone has published a plugin with source which could serve as an
example of argument handling good practice, that would be brilliant!

Paul.
 

samintz

Scott Mintz
May 20, 2008
1,244
11
Solon, OH, USA
#2
I published the EVENT plugin with source code. If you download it from
the JPsoft website, you'll get the source.

-Scott

"p.f.moore" <> wrote on 07/09/2008 11:02:26 AM:


> What is best practice for argument validation in plugins? If I have a
> plugin command with arguments, say
>
> MYPLUGIN [/A] [/B arg]
>
> how should I handle an unexpected argument /D? (Built in commands seem
> to report a (Sys) error including the incorrect flag, how do I
> replicate this?) What about /B with a missing argument, or /A with
> extra arguments?
>
> If anyone has published a plugin with source which could serve as an
> example of argument handling good practice, that would be brilliant!
>
> Paul.
>