Original Author Paul Laughton, 2011
Page 63
De Re BASIC!
The BACKGROUND() function returns true (1) if the program is running in the background. It returns
false (0) if the program is not running in the background.
If you want to be able to detect Background mode while Graphics is open, you must not call Gr.render
while in the Background mode. Doing so will cause the program to stop running until the Foreground
mode is re-entered. Use the following code line for all Gr.render commands:
IF !BACKGROUND() THEN GR.RENDER
Time Functions
CLOCK()
Returns the time in milliseconds since the last boot.
TIME()
Returns the time in milliseconds since 12:00:00 AM, January 1, 1970, UTC (the "epoch"). The time
interval is the same everywhere in the world, so the value is not affected by the TimeZone command.
TIME(<year_exp>, <month_exp>, <day_exp>, <hour_exp>, <minute_exp>,
<second_exp>)
Like TIME(), except the parameters specify a moment in time. The specification is not complete, as it
does not include the timezone. You may specify a timezone with the TimeZone command. If you do not
specify a timezone, your local timezone is used.
The parameter expressions may be either numeric expressions or string expressions. This is an unusual
aspect as it isn't allowed anywhere else in BASIC!. If a parameter is a string, then it must evaluate to a
number: digits only, one optional decimal point somewhere, optional leading sign, no embedded spaces.
If the string parameter does not follow the rules, BASIC! reports a syntax error, like using a string in a
place that expects a numeric expression.
TIME(...) (the function) and Time (the command) are inverse operations. TIME(...) can take the first six
return parameters of the Time command directly as input parameters.
With the USING$() or FORMAT_USING$() functions, you can express a moment in time as a string in
many different ways, formatted for your locale.
String Functions
GETERROR$()
Return information about a possible error condition.