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

📄 misc.pas

📁 vVC显示图片 VC显示图片 VC显示图片 VC显示图片 VC显示图片
💻 PAS
字号:
unit Misc;

interface

uses
  Windows, Classes, SysUtils, Forms, Dialogs, ShlObj,
  Graphics, ActiveX, Controls, StdCtrls, Registry,
  ShellApi;

//------------------------------------------------------------
function BooleanToStr(BoolVal: Boolean): string;
function StrToBoolean(StrVal: string): boolean;
function AddThoundandFlag(Num: integer): string;
function GetIniFileName: string;

//------------------------------------------------------------

implementation


function BooleanToStr(BoolVal: Boolean): string;
begin
  if BoolVal then
    Result := 'True'
  else
    Result := 'False';
end;

function StrToBoolean(StrVal: string): boolean;
begin
  Strval := UpperCase(StrVal);
  if StrVal='TRUE' then
    Result := true
  else
    Result := false;
end;

function AddThoundandFlag(Num: integer): string;
var
  s: string;
  i,j: integer;
begin  
  s := IntToStr(Num);
  Result := '';
  j := 0;
  for i := Length(s) downto 1 do
  begin
    Result := s[i] + Result;
    Inc(j);
    if ((j mod 3)=0) and (i<>1) then Result := ','+Result;
  end;
end;

function GetIniFileName: string;
begin
  Result := ExtractFilePath(Application.ExeName)+'LineCounter.ini';
end;

end.
 

⌨️ 快捷键说明

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