A Scripting Language for Web, Linux and Windows

A Scripting Language for Web, Linux and Windows

System functions

The following system functions are supported.

Function/Arguments Return Description
print (mixed arg1...) 1 Print one or more arguments to screen respective the standard output.
printf (string format, mixed arg1...) string Print one or more arguments formatted to screen and return as string. Modifiers j, n, p are ignored. Modifiers are compatible with C++ printf
sprintf (string format, mixed arg1...) string Format one or more arguments and return as string. Modifiers j, n, p are ignored. Modifiers are compatible with C++ printf
print_r (mixed arg, bool asString=false) string / bool Print the content of a variable to screen. The difference to print () is that also Arrays are displayed in a user friendly format. If asString = true then the content is returned as string and not printed to screen. Otherwise true is returned.
sscanf (string string, string format [, mixed& arg1 ...]) mixed Parses input from a string according to a format. Modifiers j, n, p, * are ignored. Function is compatible with PHP sscanf
console_echo (bool echo) true Enable or disable the echo of keyboard within input() function. Usefull for passwords.
autonl (bool on) true Enable or disable new line \r\n after print() function. If on is true a new line will be printed automatically. In Web mode new line is disabled per default.
input ([string infotext, string default]) string Receive a string from keyboard respective standard input until ENTER (Ascii 13='\n') was received. Optional infotext can be printed to screen and default value can be returned. Note! The maximum length of returned string is 255 bytes.
getch (bool asciiNum=false) string / number Receive a character from keyboard respective standard input. If asciiNum = true the corresponding Ascii number is returned.
exit (number exitCode=0) true Exit the program immediately with exitCode.
include (string filename) bool Include a file and interprete it. If the filename does not exists, the program will be aborted with error. Compatible with PHP include() function.
require_once (string filename) bool Include a file if it was not included before and interprete it. If the filename does not exists, the program will be aborted with error. Compatible with PHP require_once () function.
eval (string code) mixed Evaluate V1 code without <?v1 ?> tags and return the content of last operation. For example eval('10*2;') will return 20.
call_user_func (string name [, mixed arg1...]) mixed Call a user defined function by its name. Arguments and return value depend on the user defined implementation. If the function is not declared, the program will be aborted with error.
function_exists (string function) bool Return true if function exists. User functions and buildin functions will be checked.
exec (string filename [, string& result, number& exitCode, mixed stdInput, number stdInputLen, string envVars]) bool Execute a program filename . If parameters result and exitCode are given as references to variables, then the output of the program and the exit code will be stored in these variables. If stdInput is given, then the standard input of the program will be the content of this parameter. stdInput can be also a File or Socket handle. Optional parameter stdInputLen set the length of input in bytes. Optional envVars contain a list with environment variables in following format "KEY1=VALUE1\0KEY2=VALUE2\0\0". On success true is returned.
system (string filename) string Execute a program filename and return the output of the program. On error false is returned.
dl (string filename [,bool fNative=false]) number Load a module filename. File extension .dll on Windows and .so on Linux is not necessary. If fNative is true then a module number is returned which can be used in dlsym () or call() function. To load special V1 modules fNative must be false and no module number is returned. On error false is returned.
dlsym (number module, string symbol) number Get pointer address of symbol in module loaded with dl() function. On Linux systems module can be 0 = RTLD_DEFAULT to search symbols in default order (e.g. libc symbols). On success pointer address is returned. If symbol is not found false is returned. See also Native function calling.
call (number module, mixed function, array paramDef [, mixed arg1 ... ]) mixed Call a native function of a module loaded with dl() function. The function can also be a memory pointer (number) returned from dlsym(). The array paramDef defines the parameters and return code of native funtion:
[[ 'type of param1' ... 'type of param N' ], 'type of return' ] For detailed description read manual Native function calling.
getenv (string var) string Return the environment variable var. If variable does not exists false is returned.
putenv (string var, string value) bool Set the value of environment variable var. On success true is returned.
error_reporting (number id) true Set the reporting of errors and warnings. id can have following values: 0 = no errors and warnings are shown, 1 = errors and warnings are shown.
security_mode (number mode) true Set the security mode. mode can have the following values: 0 = no security mode (default), 1 = temporary memory of files, sockets and processes will be blanked with zero bytes after the operation. This is useful to prevent reading sensitive data via memory dumps. Allthough you should take care to blank sensitive string variables manually with blankStr() function defined in lib/utils.inc.v1.
version (type=0) mixed Return the version of V1 interpreter or operating system. If type is 0 then V1 version number will be returned as float value, for example 0.95. type can have the following further values: 1 = OS type will be returned as string, for example Windows or Linux. 2 = OS version will be retuned as float value, on Windows Major.Minor, on Linux the kernel release. 3 = Return 1 if operating system is 64 Bit. 4 = Return detailed array with system information depending on OS type. Use print_r() function to get details.

Special system functions only available on Windows

See also example Working with the Windows registry.

Function/Arguments Return Description
getreg (string regKey [, string valueKey]) string / array Lookup a Windows registry key named with regKey. If valueKey is given then the value of the specified value key is returned, otherwise all sub keys and all values are returned as array. Use print_r () to dump the array. Registry keys only work with backslashes, for example: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run - If key was not found false is returned.
putreg (string regKey, string valueKeySubKey [, mixed value, number datatype=0]) bool Create a new Windows registry entry into the tree of regKey. If value is given then the second parameter is a value key, otherweise a sub key will be created. For values also a datatype can be given (0=String, 1=32 Bit Word, 2=64 Bit QuadWord, 3=Binary). On success true is returned.
delreg (string regKey, string valueKeySubKey, number mode=0) bool Delete a Windows registry entry from the tree of regKey. Parameter mode can have following values: 0 = Delete value key. 1 = Delete all values of sub key and sub key itself if it has no other sub keys. 2 = Delete complete sub key tree recursive. On success true is returned.
shellexec (string filename, string operation='open', bool isHidden = false) bool Execute a Windows shell programm. filename can be a executable or editable file, shortcut or URL. Optional parameter operation can have following values: open, edit, explore, print. If isHidden = true no window will be show. On success true is returned.

back to Home

V1 Version 0.96 - Documentation generated Wed, 03 Jan 2024 12:21