rm_jvinterpreter_jvutils.pas

来自「胜天进销存源码,国产优秀的进销存」· PAS 代码 · 共 1,132 行 · 第 1/4 页

PAS
1,132
字号
procedure JvInterpreter_Spaces(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := Spaces(Args.Values[0]);
end;

{ function AddSpaces(const S: string; const N: integer): string; }

procedure JvInterpreter_AddSpaces(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := AddSpaces(Args.Values[0], Args.Values[1]);
end;

{ function LastDate(const Dat: TDateTime): string; }

procedure JvInterpreter_LastDate(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := LastDate(Args.Values[0]);
end;

{ function CurrencyToStr(const Cur: currency): string; }

procedure JvInterpreter_CurrencyToStr(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := CurrencyToStr(Args.Values[0]);
end;

{ function Cmp(const S1, S2: string): boolean; }

procedure JvInterpreter_Cmp(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := Cmp(Args.Values[0], Args.Values[1]);
end;

{ function StringCat(var S1: string; S2: string): string; }

procedure JvInterpreter_StringCat(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := StringCat(string(TVarData(Args.Values[0]).vString), Args.Values[1]);
end;

{ function HasChar(const Ch: Char; const S: string): boolean; }

procedure JvInterpreter_HasChar(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := HasChar(string(Args.Values[0])[1], Args.Values[1]);
end;

{ function HasAnyChar(const Chars: string; const S: string): boolean; }

procedure JvInterpreter_HasAnyChar(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := HasAnyChar(Args.Values[0], Args.Values[1]);
end;

(*
{ function CharInSet(const Ch: Char; const SetOfChar: TSetOfChar): boolean; }
procedure JvInterpreter_CharInSet(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := CharInSet(string(Args.Values[0])[1], Args.Values[1]);
end;
*)

{ function CountOfChar(const Ch: Char; const S: string): Integer; }

procedure JvInterpreter_CountOfChar(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := CountOfChar(string(Args.Values[0])[1], Args.Values[1]);
end;

{ function DefStr(const S: string; Default: string): string; }

procedure JvInterpreter_DefStr(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := DefStr(Args.Values[0], Args.Values[1]);
end;

{ function GetWinDir: TFileName; }

procedure JvInterpreter_GetWinDir(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := GetWinDir;
end;

{ function GetTempDir: string; }

procedure JvInterpreter_GetTempDir(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := GetTempDir;
end;

{ function GenTempFileName(FileName: string): string; }

procedure JvInterpreter_GenTempFileName(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := GenTempFileName(Args.Values[0]);
end;

{ function GenTempFileNameExt(FileName: string; const FileExt: string): string; }

procedure JvInterpreter_GenTempFileNameExt(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := GenTempFileNameExt(Args.Values[0], Args.Values[1]);
end;

{ function ClearDir(const Dir: string): boolean; }

procedure JvInterpreter_ClearDir(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := ClearDir(Args.Values[0]);
end;

{ function DeleteDir(const Dir: string): boolean; }

procedure JvInterpreter_DeleteDir(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := DeleteDir(Args.Values[0]);
end;

{ function FileEquMask(FileName, Mask: TFileName): boolean; }

procedure JvInterpreter_FileEquMask(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := FileEquMask(Args.Values[0], Args.Values[1]);
end;

{ function FileEquMasks(FileName, Masks: TFileName): boolean; }

procedure JvInterpreter_FileEquMasks(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := FileEquMasks(Args.Values[0], Args.Values[1]);
end;

{ procedure DeleteFiles(const Folder: TFileName; const Masks: string); }

procedure JvInterpreter_DeleteFiles(var Value: Variant; Args: TJvInterpreterArgs);
begin
  DeleteFiles(Args.Values[0], Args.Values[1]);
end;

{ function LZFileExpand(const FileSource, FileDest: string): boolean; }

procedure JvInterpreter_LZFileExpand(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := LZFileExpand(Args.Values[0], Args.Values[1]);
end;

{ function FileGetInfo(FileName: TFileName; var SearchRec: TSearchRec): boolean; }

procedure JvInterpreter_FileGetInfo(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := FileGetInfo(Args.Values[0], TSearchRec(V2R(Args.Values[1])^));
end;

{ function HasSubFolder(APath: TFileName): boolean; }

procedure JvInterpreter_HasSubFolder(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := HasSubFolder(Args.Values[0]);
end;

{ function IsEmptyFolder(APath: TFileName): boolean; }

procedure JvInterpreter_IsEmptyFolder(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := IsEmptyFolder(Args.Values[0]);
end;

{ procedure AddSlash(var Dir: TFileName); }

procedure JvInterpreter_AddSlash(var Value: Variant; Args: TJvInterpreterArgs);
begin
  AddSlash(TFileName(TVarData(Args.Values[0]).vString));
end;

{ function AddSlash2(const Dir: TFileName): string; }

procedure JvInterpreter_AddSlash2(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := AddSlash2(Args.Values[0]);
end;

{ function AddPath(const FileName, Path: TFileName): TFileName; }

procedure JvInterpreter_AddPath(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := AddPath(Args.Values[0], Args.Values[1]);
end;

{ function BrowseForFolder(const Handle: HWnd; const Title: string; var Folder: string): boolean; }

{$IFNDEF BCB1}
procedure JvInterpreter_BrowseForFolder(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := BrowseForFolder(Args.Values[0], Args.Values[1], string(TVarData(Args.Values[2]).vString));
end;
{$ENDIF BCB1}

{ function DeleteReadOnlyFile(const FileName: TFileName): boolean; }

procedure JvInterpreter_DeleteReadOnlyFile(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := DeleteReadOnlyFile(Args.Values[0]);
end;

{ function HasParam(const Param: string): boolean; }

procedure JvInterpreter_HasParam(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := HasParam(Args.Values[0]);
end;

{ function HasSwitch(const Param: string): boolean; }

procedure JvInterpreter_HasSwitch(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := HasSwitch(Args.Values[0]);
end;

{ function Switch(const Param: string): string; }

procedure JvInterpreter_Switch(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := Switch(Args.Values[0]);
end;

{ function ExePath: TFileName; }

procedure JvInterpreter_ExePath(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := ExePath;
end;

{ function CopyDir(const SourceDir, DestDir: TFileName): Boolean; }

procedure JvInterpreter_CopyDir(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := CopyDir(Args.Values[0], Args.Values[1]);
end;

{ function TTFontSelected(const DC: HDC): boolean; }

procedure JvInterpreter_TTFontSelected(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TTFontSelected(Args.Values[0]);
end;

{ function TrueInflateRect(const R: TRect; const I: integer): TRect; }

procedure JvInterpreter_TrueInflateRect(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := Rect2Var(TrueInflateRect(Var2Rect(Args.Values[0]), Args.Values[1]));
end;

{ procedure SetWindowTop(const Handle: HWND; const Top: boolean); }

procedure JvInterpreter_SetWindowTop(var Value: Variant; Args: TJvInterpreterArgs);
begin
  SetWindowTop(Args.Values[0], Args.Values[1]);
end;

{ function KeyPressed(VK: integer): boolean; }

procedure JvInterpreter_KeyPressed(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := KeyPressed(Args.Values[0]);
end;

{ function Max(x, y: integer): integer; }

procedure JvInterpreter_Max(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := Max(Args.Values[0], Args.Values[1]);
end;

{ function Min(x, y: integer): integer; }

procedure JvInterpreter_Min(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := Min(Args.Values[0], Args.Values[1]);
end;

{ procedure SwapInt(var Int1, Int2: Integer); }

⌨️ 快捷键说明

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