fdutils.pas
来自「将图像转换为传真文件」· PAS 代码 · 共 50 行
PAS
50 行
unit FDUtils;
interface
uses
SysUtils;
function InchesToMillimeters(Inches : Double) : Double;
function MillimetersToInches(Millimeters : Double) : Double;
{$IFNDEF Win32}
function Trim(S : string) : string;
{$ENDIF}
implementation
const
InchesPerMeter = 39.37;
function InchesToMillimeters(Inches : Double) : Double;
begin
Result := Inches / InchesPerMeter * 1000.0;
end;
function MillimetersToInches(Millimeters : Double) : Double;
begin
Result := Millimeters * InchesPerMeter / 1000.0;
end;
{$IFNDEF Win32}
function Trim(S : string) : string;
var
I : Byte;
begin
//删除全部的空格
while (Length(S) >= 1) and (S[1] = ' ') do
Delete(S, 1, 1);
//删除全部尾部空格
for I := Length(S) downto 1 do
if S[I] = ' ' then
Delete(S, I, 1)
else
Break;
Result := S;
end;
{$ENDIF}
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?