
7-6
Section
Details of BASIC Commands
149
day
Syntax:
DAY
[= <numerical expression>]
Description:
System variable. Returns the current day of the week or sets the day of the week.
<numerical expression> is an integer expression representing the day of the week. The days of the
week are represented in the following way:
Day code
Day
0
Sunday
1
Monday
2
Tuesday
3
Wednesday
4
Thursday
5
Friday
6
Saturday
Remarks:
If the <numerical expression> is not within the range specified in the table above then an
“ILLEGAL FUNCTION CALL” error (code B005) will occur.
Once the DAY variable has been set, it is automatically incremented by 1 with each passing day
(repeating the cycle 0 through 6).
The
DAY
variable has no relationship with the internal clock, it is quite possible to set a
DAY
that
is inconsistent with the current
DATE
$
Examples:
DAY = 4
See also:
DATE
$,
TIME
$
def fn
Syntax:
DEF FN
<function name>[(<variable name 1> [, <variable name n>])] = <expression>
Description:
Statement. Declares a user defined BASIC function.
<function name> is the name of the defined function. It may be any valid BASIC variable name.
Names starting with reserved words cannot be used. The following characters cannot be used at
the end of a name: $ % & ! #
<Variable name 1> [, <variable name n>] is an optional list of arguments that may be input to the
user defined function. Any valid variable name may be used as an input argument. It is not
possible to have arguments with the same name as the function being defined (i.e., <variable
name 1>).
The <expression> is the constant or string expression that uses <Variable name 1> [, <variable
name n>].
Remarks:
Note:
1.
The type of variable used when the function is called as a BASIC function must
match the variable used when the function was defined with the DEF FN statement.
A “TYPE MISMATCH” error (code B013) will occur if the variable types do not
match.
2.
The defined basic function is called by entering FN + the function name. For
example,
A
=
FNMYFUNC
(1,2) will call the
MYFUNC
function defined in the example
below.
3.
The result of the user-defined function must be assigned a variable when the
function is called. A “SYNTAX ERROR IN LINE …” error (code B002) will occur
if a variable is not assigned.
Examples:
> 10 DEF FNMYFUNC(A,B) = A+B
> 20 PRINT FNMYFUNC(1,2)
> RUN
3
See also:
Summary of Contents for C200H-ASC11
Page 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Page 2: ...iv...
Page 4: ...vi...