代码大全

(singke) #1

CharType=Letter;


C

if(IsLetter(InputChar)) ——
CharType=Letter;
else if(IsPunctuation(InputChar))
CharType=Punctuation;
else if(IsDigit(InPutChar))
CharType=Digit;
else if(IsControl(InputChar)) ——
CharType=ControlChar;


else

C

if(IsLetter(InputChar))
CharType=Letter;
else if(IsPunctuation(InputChar))
CharType=Punctuation;
else if(IsDigit(InputChar))
CharType=Digit;
else if(IsControl(InputChar))
CharType=ControlChar;
else
PrintMsg("Internal Error: Unexpectecd type of character detected.");


If-then-else if-then-else
Ada case if-then-else case
case if-then-else Ada Case


Ada Case if-then-else
case InputChar is
when 'a'..'z' | 'A'..'Z' =>
CharType := Letter;
when ' ' | ',' | '.' | '!' | '(' | ')' | ':' | ';' | '?' | '-' =>
CharType := Punctuation;
when 'o'..'9' =>
CharType: Digit;
when nul..us=>

Free download pdf