Skip to content
Chixpy edited this page Feb 3, 2024 · 1 revision

Warning

Esta ayuda es para la versión 0.7. Está obsoleta e incompleta.

  // Input and Output
  Sender.AddMethod(Self, @cCHXScriptEngine.WriteLn,
    'procedure WriteLn(const s: String)');
  Sender.AddMethod(Self, @cCHXScriptEngine.ReadLn,
    'function ReadLn(const aQuestion, DefAnswer: String): String;');

  // String handling UTF8 from LazUTF8 unit
  Sender.AddFunction(@UTF8CompareText,
    'function UTF8CompareText(const S1, S2: String): Integer;');
  Sender.AddFunction(@UTF8CompareStr,
    'function UTF8CompareStr(const S1, S2: String): Integer;');
  Sender.AddFunction(@UTF8ToSys,
    'function UTF8ToSys(const S: String): String;');
  Sender.AddFunction(@SysToUTF8,
    'function SysToUTF8(const S: String): String;');
  Sender.AddMethod(Self, @cCHXScriptEngine.UTF8LowerCase,
    'function UTF8LowerCase(const AInStr: String): String;');
  Sender.AddMethod(Self, @cCHXScriptEngine.UTF8UpperCase,
    'function UTF8UpperCase(const AInStr: String): String;');

  // Misc string functions
  Sender.AddMethod(Self, @cCHXScriptEngine.RPos,
    'function RPos(const Substr: String; const Source: String) : Integer;');

  // Path and filename strings
  Sender.AddFunction(@CleanFileName,
    'function CleanFileName(const AFileName: String): String;');
  Sender.AddFunction(@ExcludeTrailingPathDelimiter,
    'function ExcludeTrailingPathDelimiter(const aString: String): String;');
  Sender.AddFunction(@ExtractFilePath,
    'function ExtractFilePath(const aFileName: String): String;');
  Sender.AddFunction(@ExtractFileName,
    'function ExtractFileName(const aFileName: String): String;');
  Sender.AddFunction(@ExtractFileNameOnly,
    'function ExtractFileNameOnly(const AFilename: String): String;');
  Sender.AddFunction(@ExtractFileExt,
    'function ExtractFileExt(const AFilename: String): String;');
  Sender.AddFunction(@ChangeFileExt,
    'function ChangeFileExt(const aFileName, aExtension: String): String;');

  // Files and Folders UTF8
  Sender.AddFunction(@FileExistsUTF8,
    'function FileExistsUTF8(const aFileName: String): Boolean;');
  Sender.AddFunction(@DirectoryExistsUTF8,
    'function DirectoryExistsUTF8(const aFileName: String): Boolean;');

  // Dialogs
  Sender.AddMethod(Self, @cCHXScriptEngine.AskFile,
    'function AskFile(const aTitle, aExt, DefFile: String): String;');
  Sender.AddMethod(Self, @cCHXScriptEngine.AskFolder,
    'function AskFolder(const aTitle, DefFolder: String): String;');  
Clone this wiki locally