📄 littletest10.out
字号:
unit LittleTest10;
{ AFS 6 July 2003
This unit compiles but is not semantically meaningfull
it is test cases for the code formatting utility
example code submitted by Marcus Fuchs }
interface
uses SysUtils;
function BinToHex(const sBin: string): string;
implementation
uses Math, Classes;
function BinToHex(const sBin: string): string;
var
ex: extended;
begin
ex := Power(2, Length('12345'));
ex := Power(2, Pos('2', '12345'));
end;
function StreamReadln(Source: TStream): string;
function StreamReadChar(Source: TStream): char;
begin
if Source.Read(Result, Sizeof(char)) = 0 then
Result := #26; // end of file
end;
var
bufsize, charsRead: integer;
ch: char;
begin
bufsize := 255;
charsRead := 0;
SetLength(Result, bufsize);
repeat
ch := StreamReadChar(Source);
case ch of
#13: if StreamReadChar(Source) <> #10 then
Source.Seek(-1, soFromCurrent);
#10: ch := #13;
#26:
begin
ch := #13;
Source.Seek(0, soFromEnd);
end;
else
begin
// ...
end;{else}
end;{case}
until (ch = #13);
SetLength(Result, charsRead);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -