⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 str16.pas

📁 企业端数据申报系统:单位管理模块 单位查询. 业务申报模块 在线数据下载 在线数据上传 在线业务申核 申报业务查询 磁盘数据导出 磁盘数据导入 在线业务模块 在线业务
💻 PAS
字号:
{*******************************************************}
{                                                       }
{         Delphi VCL Extensions (RX)                    }
{         For 16-bit applications only                  }
{                                                       }
{         Copyright (c) 1995, 1996 AO ROSNO             }
{                                                       }
{*******************************************************}

unit Str16;

interface

{$IFNDEF WIN32}

{$I RX.INC}

type
  ShortString = string;
  PShortString = ^ShortString;
  AnsiChar = Char;
  PAnsiChar = ^AnsiChar;

{ System32 unit functions and procedures }
procedure SetLength(var S: string; NewLength: Byte);
procedure SetString(var S: string; Buffer: PChar; Len: Byte);
procedure UniqueString(var S: string);

{ SysUtils32 unit functions and procedures }
function Trim(const S: string): string;
function TrimLeft(const S: string): string;
function TrimRight(const S: string): string;
function QuotedStr(const S: string): string;

{$ENDIF WIN32}

implementation

{$IFNDEF WIN32}

uses SysUtils;

procedure SetLength(var S: string; NewLength: Byte);
begin
  S[0] := Char(NewLength);
end;

procedure SetString(var S: string; Buffer: PChar; Len: Byte);
begin
  S[0] := Char(Len);
  if Buffer <> nil then begin
    if StrLen(Buffer) < Len then Len := StrLen(Buffer);
    Move(Buffer^, S[1], Len);
  end;
end;

procedure UniqueString(var S: string);
begin
end;

function Trim(const S: string): string;
var
  I, L: Byte;
begin
  L := Length(S);
  I := 1;
  while (I <= L) and (S[I] <= ' ') do Inc(I);
  if I > L then Result := ''
  else begin
    while S[L] <= ' ' do Dec(L);
    Result := Copy(S, I, L - I + 1);
  end;
end;

function TrimLeft(const S: string): string;
var
  I, L: Byte;
begin
  L := Length(S);
  I := 1;
  while (I <= L) and (S[I] <= ' ') do Inc(I);
  Result := Copy(S, I, 255);
end;

function TrimRight(const S: string): string;
var
  I: Byte;
begin
  I := Length(S);
  while (I > 0) and (S[I] <= ' ') do Dec(I);
  Result := Copy(S, 1, I);
end;

function QuotedStr(const S: string): string;
var
  I: Byte;
begin
  Result := S;
  for I := Length(Result) downto 1 do
    if Result[I] = '''' then Insert('''', Result, I);
  Result := '''' + Result + '''';
end;

{$ENDIF WIN32}

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -