const cDsChar:array [0..35] of char='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
function Ds36ToInt(ss:string):longword;
var sl:longword
s:byte;
begin
sl:=0;
while ss>'' do begin
sl:=sl*36;
s:=pos(ss[1],cDsChar);
inc(sl,s);
delete(ss,1,1);
end;
Result:=sl;
end;
function IntToDs36(sl:longword):string;
var ss:string
begin
ss:='';
repeat
ss:=cDsChar[sl mod 36]+ss;
sl:=sl div 36;
until sl=0;
result:=ss;
end;