I am writing a program which I want to call with a parameter from the
command line. I've built a little test program and all works as expected.

However, if the user passes too many parameters on the command line, I get a
"Wrong number of parameters" error which they can then click "ignore" on. I
can't place an ON ERROR before the line because then PARAMETERS is no longer
the first statement in the program.

I'll immediately do a check on PARAMETERS() - if it is over 1 then show a
message and return, otherwise continue. It seems as if PARAMETERS() returns
the correct value even if the "PARAMETERS m.ppar1" doesn't have enough
variables.

Is there a cleaner way to handle this?

--
TIA
Andrew Howell

Re: FPW2.6a handling errors and calling parameters from the command line by Al

Al
Wed Sep 22 07:46:36 CDT 2004

Interesting
you could add a number of dummy vaiables in the parameters statement
and then check if passed

al

"Andrew Howell" <ajh@work> wrote in message
news:OajhE9JoEHA.3564@tk2msftngp13.phx.gbl...
> I am writing a program which I want to call with a parameter from the
> command line. I've built a little test program and all works as expected.
>
> However, if the user passes too many parameters on the command line, I get
a
> "Wrong number of parameters" error which they can then click "ignore" on.
I
> can't place an ON ERROR before the line because then PARAMETERS is no
longer
> the first statement in the program.
>
> I'll immediately do a check on PARAMETERS() - if it is over 1 then show a
> message and return, otherwise continue. It seems as if PARAMETERS()
returns
> the correct value even if the "PARAMETERS m.ppar1" doesn't have enough
> variables.
>
> Is there a cleaner way to handle this?
>
> --
> TIA
> Andrew Howell
>
>



Re: FPW2.6a handling errors and calling parameters from the command line by Ook

Ook
Wed Sep 22 10:10:31 CDT 2004

PARAMETERS lcParm1, lcParm2, lcParm3, lcParm4, lcParm5, lcParm6, lcParm7,
lcParm8, lcParm9, lcParm10

Then check for the proper parameters. Don't forget that parameters passed
from the command line will all be of type char, so numbers, dates, etc. will
have to be converted back to the desired type.


"Andrew Howell" <ajh@work> wrote in message
news:OajhE9JoEHA.3564@tk2msftngp13.phx.gbl...
> I am writing a program which I want to call with a parameter from the
> command line. I've built a little test program and all works as expected.
>
> However, if the user passes too many parameters on the command line, I get
a
> "Wrong number of parameters" error which they can then click "ignore" on.
I
> can't place an ON ERROR before the line because then PARAMETERS is no
longer
> the first statement in the program.
>
> I'll immediately do a check on PARAMETERS() - if it is over 1 then show a
> message and return, otherwise continue. It seems as if PARAMETERS()
returns
> the correct value even if the "PARAMETERS m.ppar1" doesn't have enough
> variables.
>
> Is there a cleaner way to handle this?
>
> --
> TIA
> Andrew Howell
>
>



Re: FPW2.6a handling errors and calling parameters from the command line by Andrew

Andrew
Thu Sep 23 04:06:04 CDT 2004

Al Marino wrote:
> Interesting
> you could add a number of dummy vaiables in the parameters statement
> and then check if passed

Cheers Ook + Al, I'll go for that - it'll be a little cleaner from the
user's perspective.

--
Regards
Andrew Howell