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. |
exec (string filename [, string& result, number& exitCode, mixed stdInput, number stdInputLen]) | 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. 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 | Load a V1 module filename. File extension .dll on Windows and .so on Linux is not necessary. On error false is returned. |
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. |
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 be binary OR combined: 0x000: Delete value key. 0x010: Delete all values of sub key and sub key itself if it has no other sub keys. 0x100: 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. |
V1 Version 0.95 - Documentation generated Sat, 09 Feb 2019 15:30