📄 unit1.pas
字号:
var
x,n,m,t,p,i:integer;
begin
x:=aa;
i:=1;
m:=0;
while 3>2 do
begin
n:=length(inttostr(x));
if n<=3 then
begin
p:=x;
case p of
0 : t:=0;
1 : t:=1;
10 : t:=2;
11 : t:=3;
100 : t:=4;
101 : t:=5;
110 : t:=6;
111 : t:=7;
end;
m:=m+t*i;
break;
end
else
begin
p:=x mod 1000;
x:=x div 1000;
case p of
0 : t:=0;
1 : t:=1;
10 : t:=2;
11 : t:=3;
100 : t:=4;
101 : t:=5;
110 : t:=6;
111 : t:=7;
end;
m:=m+t*i;
i:=i*10;
end;
end;
result:=m;
end;
function tform1.shitoshilu(aa:integer):string;
var
x,n,p:integer;
m,t:string;
begin
x:=aa;
m:='';
while 3>2 do
begin
n:=length(inttostr(x));
if n<=4 then
begin
p:=x;
case p of
0 : t:='0';
1 : t:='1';
10 : t:='2';
11 : t:='3';
100 : t:='4';
101 : t:='5';
110 : t:='6';
111 : t:='7';
1000 : t:='8';
1001 : t:='9';
1010 : t:='A';
1011 : t:='B';
1100 : t:='C';
1101 : t:='D';
1110 : t:='E';
1111 : t:='F';
end;
m:=t+m;
break;
end
else
begin
p:=x mod 10000;
x:=x div 10000;
case p of
0 : t:='0';
1 : t:='1';
10 : t:='2';
11 : t:='3';
100 : t:='4';
101 : t:='5';
110 : t:='6';
111 : t:='7';
1000 : t:='8';
1001 : t:='9';
1010 : t:='A';
1011 : t:='B';
1100 : t:='C';
1101 : t:='D';
1110 : t:='E';
1111 : t:='F';
end;
m:=t+m;
end;
end;
result:=m;
end;
function tform1.ertoshi(aa:string):integer;
var
x,i,j,m:integer;
y:string;
begin
y:=aa;
j:=length(y);
m:=strtoint(y[j]);
x:=2;
for i:=(j-1) downto 1 do
begin
m:=m+strtoint(y[i])*x;
x:=x*2;
end;
result:=m;
end;
function tform1.batoer:string;
var
n,i:integer;
x,m,t,p:string;
begin
x:=edit1.text;
i:=1;
m:='';
n:=length(x);
for i:=1 to n do
begin
if i=1 then
begin
p:=x[i];
case strtoint(p) of
1 : t:= '1';
2 : t:= '10';
3 : t:= '11';
4 : t:= '100';
5 : t:= '101';
6 : t:= '110';
7 : t:= '111';
end;
m:=m+t;
end
else
begin
p:=x[i];
case strtoint(p) of
0 : t:= '000';
1 : t:= '001';
2 : t:= '010';
3 : t:= '011';
4 : t:= '100';
5 : t:= '101';
6 : t:= '110';
7 : t:= '111';
end;
m:=m+t;
end;
end;
result:=m;
end;
function tform1.shilutoer:string;
var
i,p,n:integer;
m,x,t:string;
begin
x:=edit1.Text;
n:=length(x);
if x[1]='0' then
begin
p:=2;
end
else
p:=1;
m:='';
for i:=p to n do
begin
if (i=1) or (p=2) then
begin
case x[i] of
'1':t:= '1';
'2':t:= '10';
'3':t:= '11';
'4':t:= '100';
'5':t:= '101';
'6':t:= '110';
'7':t:= '111';
'8':t:='1000';
'9':t:='1001';
'A':t:='1010';
'a':t:='1010';
'B':t:='1011';
'b':t:='1011';
'C':t:='1100';
'c':t:='1100';
'D':t:='1101';
'd':t:='1101';
'E':t:='1110';
'e':t:='1110';
'F':t:='1111';
'f':t:='1111';
end;
end
else
begin
case x[i] of
'0':t:='0000';
'1':t:='0001';
'2':t:='0010';
'3':t:='0011';
'4':t:='0100';
'5':t:='0101';
'6':t:='0110';
'7':t:='0111';
'8':t:='1000';
'9':t:='1001';
'A':t:='1010';
'a':t:='1010';
'B':t:='1011';
'b':t:='1011';
'C':t:='1100';
'c':t:='1100';
'D':t:='1101';
'd':t:='1101';
'E':t:='1110';
'e':t:='1110';
'F':t:='1111';
'f':t:='1111';
end;
end;
m:=m+t;
end;
result:=m;
end;
procedure TForm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
form1.Left:=100;
end;
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if shubiao=1 then
begin
sbi:=X - sbx;
sbj:=Y - sby;
form1.Left:=form1.Left+sbi;
form1.Top:=form1.Top+sbj;
end;
end;
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
sbx:=X;
sby:=y;
shubiao:=1;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
sbi:=5;
sbj:=5;
shubiao:=0;
end;
procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
shubiao:=0
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -