Search found 1 match

by 18369AT
Wed Aug 06, 2003 2:33 am
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 59390

Function for correct character sorting (195 - Anagram)

Here is quite efficient (I think) and easy-to-use function that helps to sort characters correctly:

[pascal]
function letval(c:char):integer;
var v:integer;
begin
if upcase(c)=c then
v:=(ord(c)-ord('A'))*2
else
v:=(ord(c)-ord('a'))*2+1;
letval:=v;
end;
[/pascal]

It generates character codes ...

Go to advanced search