Re: if x=y or z or .....

From: J French (erewhon_at_nowhere.uk)
Date: 12/30/04


Date: Thu, 30 Dec 2004 10:23:23 +0000 (UTC)

On Thu, 30 Dec 2004 09:27:16 +0000 (UTC), "Mark Ashley" <priv@te.com>
wrote:

>Hi John
>
>I got your first example to compile but not the second one. Let me give you
>my real world example:
>
> if
>(piecetype='c1')or(piecetype='c4')or(piecetype='s1')or(piecetype='s3')
> or(piecetype='t1')or(piecetype='t3')or(piecetype='t4')
> then ottt:=true;
>
>compiles ok, and if piecetype is equal to c1,c4,s1,s3,t1,t3 or t4 then ottt
>is set to true.
>
> case piecetype of 'c1','c4','s1','s3','t1','t3','t4' begin
>ottt:=true;end;
>
>Does not compile - I get error "Ordinal type required".
>
>The case method looks a lot tidier and appears more "efficient" (maybe this
>is crap) so I would like to get it working - any further clues?

The Case method is, indeed, a much tidier way of coding
- well in my view anyway

The problem is that Case does not work with Strings



Relevant Pages

  • Re: Why leave the error handling to the caller?
    ... I didn't even mention the fact that it didn't compile. ... If the intended behavior of the program is to simply output all the strings with no further processing there would never be any reason for storing them and whatever is in the error recovery part of the program would better be the *entire* program. ... I assume the purpose of allocating the strings in some structure to begin with is that there really is some further processing to be done before outputting them. ... That would make the error handling function output data that would be wrong. ...
    (comp.lang.c)
  • Re: [Bugme-new] [Bug 11446] New: Automate "to compile as module" strings
    ... Automate "to compile as module" strings ... Component: Configuration ... tristate "BMAC support" ...
    (Linux-Kernel)
  • Re: csc (C# Compiler) bug
    ... > I seem to have found a bug in csc. ... Here is some source that does not compile properly: ... This does not happen with all strings ... Its not a bug, its actually correct. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: understanding chkrootkit: sshd section
    ... It is just giving you the output of strings. ... > would at last come to life i plowed through this crap and stumbled ... Strings prints out all of the ASCII in a binary file, ... I would probably just run chkrootkit on all the ...
    (comp.os.linux.security)
  • Re: understanding chkrootkit: sshd section
    ... It is just giving you the output of strings. ... > would at last come to life i plowed through this crap and stumbled ... Strings prints out all of the ASCII in a binary file, ... I would probably just run chkrootkit on all the ...
    (comp.security.unix)