Script Library
Script Library includes some useful functions:
string handling routines
MatchExpr
Declare
function MatchExpr(source: string; pattern: string): boolean;
Description
use to match a regular expression
Examples
//display a dialog if Username matchs '[allen]'
if MatchExpr(Username, '[allen]') then ShowMessage('Yes');
MatchString
Declare
function MatchString(source: string; pattern: string): boolean;
Description
use to match a wildcard pattern
Examples
//display a dialog if Username matchs '*allen*'
if MatchString(Username, '*allen*') then ShowMessage('Yes');
ShellExecuteCommand
Declare
function ShellExecuteCommand(FileName: string; Param: string; WorkDir: string; Flag: Integer): boolean;
Description
Executable a windows shell command
Examples
//display a dialog if Username matchs '[allen]'
ShellExecuteCommand('rar.exe','r d:\test','',0);
Example
Popup a dialog to accept input bookmark and tell all connections jump to this bookmark
Code:
defBookmark := '';
if inputQuery('Input bookmark', 'bookmark', defBookmark) then
RushApp.FTP.CWD('', defBookmark, RS_BOOKMARK);
|