Function list (DNM Script)
From kwiki
Contents |
General Information
For a more up-to-date list of function see category:DNM Script functions
They are mostly self-descriptive and/or are exact equivalent the the Win API/MFC functions (which are described on MSDN). The list has the following syntax:
ReturnValue FunctionName (ParamType Param);
Example:
int strlen (string Str) ;
This function returns length of string - returns integer (numerical value) and takes one argument: Str of type string. Usage:
var $sSomeString="Hello World!"; var $nLen=strlen($sSomeString); MessageBox($nLen);//12
More: Function declaration
List of function declarations
Basics
int GetLastError();
var GetLastAdditionalResult();
int MessageBox(string sMessage, [string Caption],[int Type=MB_OK]);
string InputBox (string strQuestion); //IDOK/IDANCED in GetLastAdditionalResult
void Sleep (int Milliseconds);
Conversions
string str (any_var); //converts to string
int int (any_var); //converts to integer
double double (any_var); //converts to double
string chr (numerical var); //converts ascii code to a char, eg. chr(65) returns A.
int asc (string var); //Returns the ANSI character code corresponding to the first letter in a string, eg. chr("A") returns 65.
Vars
empty_var var_getempty (); //- for comparsison purposes
bool var_isempty(any_var var);
string var_type(any_var var);
bool var_exists ("$some_var_name");//-use ""
string engine_internal_info ();
Arrays
numerical array_size (array_var var);
string array_info (array_var var);
Numerical
double sqrt (numerical var);
double abs (numerical var);
void srand();
int rand();
Strings
int strlen (string Str) ;
int strcmp (string Str1,string Str2,[bool IgnoringCase=FALSE]);
int strfind (string str,string strToFind,int startFrom,[ bool IgnoringCase=FALSE]);
String strsub (string str,int nFrom,[int nTo=nFrom]) ;
String strdel (string str,int nFrom,[int nTo=nFrom]) ;
String strins (string str,int nAt,strWhat);
String strreplace (string str,int nFrom,int nTo,strWithWhat);
String strupper (string str);
String strlower (string str);
Date & time
int TimeGetCurrent();
string TimeFormat(int nTime,[string format="%Y-%m-%d %H:%M:%S"]);//nTime : a value returned by e.g. time_get_current
int TimeGetYear(int nTime);//nTime : a value returned by e.g. time_get_current
int TimeGetMonth(int nTime);//nTime : a value returned by e.g. time_get_current
int TimeGetDay(int nTime);//nTime : a value returned by e.g. time_get_current
int TimeGetDayOfWeek(int nTime);//nTime : a value returned by e.g. time_get_current
int TimeGetHour(int nTime);//nTime : a value returned by e.g. time_get_current
int TimeGetMinute(int nTime);//nTime : a value returned by e.g. time_get_current
int TimeGetSecond(int nTime);//nTime : a value returned by e.g. time_get_current
Files & folders
bool FileDelete (string strPath);
bool FileRename (string pathSrc,string pathDest);
bool FileIsFolder (string strPath);
array(of strings) ReadDirectory (string strPath);
string UrlGetName (string strPath);
string UrlGetTitle (string strPath);
string UrlGetExt (string strPath);
string UrlGetParent (string strPath);
bool UrlIsSame (string strPath1,string strPath2);
string UrlJoin (string strPath1,string strPath2);
bool ShellExecute (string strOperation,string strPath,[string strParams],[string strDir]);// identical to Win Api's function ShellExecute
string GetCurrentDirectory ();
bool SetCurrentDirectory (string strPath);
Windows
int SendMessage(HWND hWnd,int Msg,[int wParam],[int lParam]);
HWND GetForegroundWindow();
bool SetForegroundWindow();
HWND FindWindow (string classname (or ""),string sWindowText (or ""));//top level windows only
