Library functions: system functions

This category includes functions to interact with the environment outside the Proteus program.

The functions are:

GETENV(cLabel)

returns the string associated to cLabel in the environment, an empty string if cLabel is undefined

PUTENV(cLabel, cVal)

updates with cVal the string associated to cLabel in the environment; returns 0 if the environment space is full, 1 otherwise.
Note: this function, if called several times, causes a loss of memory because of the low-level implementation of the C library function putenv; this is true for the Unix™ version - the problem does not exist in the Windows™/Ms-Dos™ versions

ARGV(n)

returns the parameter n passed on the command line:

DATE()

returns current system date, formatted according to DATE_TYPE

TIME()

returns current system time, formatted according to TIME_TYPE

ISTIME(c)

returns 1 if c is in the format "hh:mm:ssx", where mm and ss are in the range 0-59, hh is in the range 1-12 (if x is 'p' or 'a') or 0-23 (if x is a space); returns 0 otherwise

TIMETOSEC(c)

returns the number of seconds in the time c; see ISTIME for the time format; returns -1 if the time is invalid

TIMEFROMSEC(nSeconds)

returns the time corresponding to nSeconds, formatted according to TIME_TYPE; nSeconds can also exceed the number of seconds in a day; this function returns an empty string if nSeconds is negative

CLOCK()

number of seconds elapsed from the start of the Proteus interpreter

SLEEP(nfSeconds)

suspends the execution of the script for nfSeconds; returns the number of seconds elapsed (at the end of the call) from the start of the Proteus interpreter. This function accepts floating point values; e.g. SLEEP(0.5) suspends execution for half a second

SYSTEM(cCommand)

runs cCommand and returns the error level at the exit; use:

SYSTEM("COMMAND /C string")

or

SYSTEM("cmd /C string")

to run internal Ms-Dos™/Windows™ commands; note: file names included in cCommand are not influenced by the command line parameter -k

CAPTURE(cCommand, cStdout[, cStderr[, cStdin]])

runs cCommand and returns the error level at the exit, like SYSTEM; the difference is the possibility to specify two variables where the standard output and the standard error will be redirected, and a string of character to be used for input; cStdout and cStderr are modified by reference (must be two variables); cStdin can be a constant or a variable

EXEC(cCommand)

runs cCommand and exits from Proteus; use:

EXEC("COMMAND /C string")

or

EXEC("cmd /C string")

to run internal Ms-Dos™/Windows™ commands; note: file names included in cCommand are not influenced by the command line parameter -k

Start of page Next topic Previous topic Contents Index
Midnight Lake iPhone Case Black Women Shoes Black Flat Shoes Leather Flats Black Patent Ballerinas Black Ballet Shoes Casual Shoes Black Shoes Women Balle Record Player Cufflinks Best iPhone XR Clear Cases iPhone XS/XS Max Leather Cases Sale Best iPhone 8/8 Plus Silicone Cases iPhone 7/7 Plus Cases & Screen Protector New Cases For iPhone 6/6 Plus iPhone 8 Case Sale iPhone Xr Case Online iPhone 7 Case UK Online iPhone X Case UK Sale iPhone X Case Deals iPhone Xs Case New Case For iPhone Xr UK Online Case For iPhone 8 UK Outlet Fashion Silver Cufflinks For Men Best Mens Cufflinks Outlet Online The Gold Cufflinks Shop Online Cheap Shirt Cufflinks On Sale Nice Wedding Cufflinks UK Online Top Black Cufflinks UK Online Mens Cufflinks Online Silver Cufflinks For Men Men Cufflinks UK Sale Gold Cufflinks UK Online Gold Cufflinks UK Silver Cufflinks UK Shirt Cufflinks Discount Online Mens Cufflinks Deals & Sales Girls Shoes For Dance Fashion Ballet Dance Shoes Best Ballet Flats Shoes UK Online Cheap Ballet Pointe Shoes UK Online Best Ballet Shoes Outlet Best Dance Shoes Sale Cheap Ballet Flats Sale UK Best Pointe Shoes Online UK Ballet Dance Shoes UK Shoes For Dance UK Best Ballet Slippers Shop Best Yoga Shoes Hotsell