Home > Archive > Tcl > March 2004 > Re: Bad diagnostics?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: Bad diagnostics?
|
|
| Charles Heizer 2004-03-30, 7:37 pm |
| Cameron Laird wrote:
> In article <sxlac.16681$K01.12900@newssvr27.news.prodigy.com>,
> Charles Heizer <cheizer@sbcglobal.net> wrote:
> .
> .
> .
>
>
> .
> .
> .
> It sounds as though you're able to do what you want with
> Tcl, and that's not only a good thing, but the main thing.
>
> However, I don't understand these two sentences of yours,
> above. I think you're saying that when [switch] is given
> bad data ("out of order"), it responds with an unhelpful
> error diagnostic ("wont execute properly"). Is that right?
> Is there a different error message switch might adopt that
> would suit you better?
I found if I use a switch command out of order I get a ERROR: unknown
command. Which is correct. I was just explaining that like some other
shell or console applications you can put the switches for a application
in almost any order, and the example is how I did it.
I would like to have a command like the switch command that does not
have a set order. I think this would be a handy command.
- Charles Heizer
| |
| Bryan Oakley 2004-03-30, 7:37 pm |
| Charles Heizer wrote:
> I found if I use a switch command out of order I get a ERROR: unknown
> command. Which is correct. I was just explaining that like some other
> shell or console applications you can put the switches for a application
> in almost any order, and the example is how I did it.
What do you mean by "out of order"? What sort of order are you trying to
impose? There is no switch bug that manifests itself based on when the
switch statement is called, assuming the switch statement is called
correctly.
>
> I would like to have a command like the switch command that does not
> have a set order. I think this would be a handy command.
I don't know about others, but I can't make sense of your question.
Could you give us an example of an "out of order" switch statement and
describe why it doesn't meet your needs?
It appears there is a disconnect between what the switch statement does
and what you want to do. Perhaps if we can better understand what you
want to do we can show you how to use the switch statement properly, or
perhaps suggest alternatives.
I encourage you to not just say "it doesn't work but I have a solution
that does". Let's figure out why you're having a problem with the switch
statement so you aren't leary of using it under the right circumstances.
| |
| Bruce Hartweg 2004-03-31, 10:46 am |
|
Charles Heizer wrote:
> Cameron Laird wrote:
>
>
>
> I found if I use a switch command out of order I get a ERROR: unknown
> command. Which is correct. I was just explaining that like some other
> shell or console applications you can put the switches for a application
> in almost any order, and the example is how I did it.
>
> I would like to have a command like the switch command that does not
> have a set order. I think this would be a handy command.
>
the switch command does NOT have a set order, it checks them in the
order given (i.e. if an input value could possibly match more than
one case it will match the first, but of all cases are unique you
do NOT need to go in any specific order with your inputs.
if you are getting an "ERROR: unknown command", then ther is something else
going wrong - either a typo or other syntax error. please post the exact
code you are trying & the exact and complete error messages you recieve.
Bruce
|
|
|
|
|