Texas Instruments NS/CLM/1L1/B Reference Guide - Page 28

Expression, Function, Param1, Param2, expression, Param1,Param2, Block, Program

Page 28 highlights

Define Define Var = Expression Define Function(Param1, Param2, ...) = Expression Defines the variable Var or the user-defined function Function. Parameters, such as Param1, provide placeholders for passing arguments to the function. When calling a user-defined function, you must supply arguments (for example, values or variables) that correspond to the parameters. When called, the function evaluates Expression using the supplied arguments. Var and Function cannot be the name of a system variable or built-in function or command. Note: This form of Define is equivalent to executing the expression: expression & Function(Param1,Param2). Define Function(Param1, Param2, ...) = Func Block EndFunc Define Program(Param1, Param2, ...) = Prgm Block EndPrgm In this form, the user-defined function or program can execute a block of multiple statements. Block can be either a single statement or a series of statements on separate lines. Block also can include expressions and instructions (such as If, Then, Else, and For). Note for entering the example: In the Calculator application on the handheld, you can enter multi-line definitions by pressing @ · instead of at the end of each line. On the computer keyboard, hold down Alt and press Enter. Note: See also Define LibPriv, page 22, and Define LibPub, page 23. Catalog > Define LibPriv Define LibPriv Var = Expression Define LibPriv Function(Param1, Param2, ...) = Expression Define LibPriv Function(Param1, Param2, ...) = Func Block EndFunc Define LibPriv Program(Param1, Param2, ...) = Prgm Block EndPrgm Operates the same as Define, except defines a private library variable, function, or program. Private functions and programs do not appear in the Catalog. Note: See also Define, page 22, and Define LibPub, page 23. Catalog > 22 TI-Nspire™ Reference Guide

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130

22
TI-Nspire™ Reference Guide
Define
Catalog >
Define
Var
=
Expression
Define
Function
(
Param1
,
Param2
,
...
) =
Expression
Defines the variable
Var
or the user-defined function
Function
.
Parameters, such as
Param1
, provide placeholders for passing
arguments to the function. When calling a user-defined function, you
must supply arguments (for example, values or variables) that
correspond to the parameters. When called, the function evaluates
Expression
using the supplied arguments.
Var
and
Function
cannot be the name of a system variable or built-in
function or command.
Note:
This form of
Define
is equivalent to executing the
expression:
expression
&
Function
(
Param1,Param2
)
.
Define
Function
(
Param1
,
Param2
,
...
) = Func
Block
EndFunc
Define
Program
(
Param1
,
Param2
,
...
) = Prgm
Block
EndPrgm
In this form, the user-defined function or program can execute a block
of multiple statements.
Block
can be either a single statement or a series of statements on
separate lines.
Block
also can include expressions and instructions
(such as
If
,
Then
,
Else
, and
For
).
Note for entering the example:
In the Calculator application
on the handheld, you can enter multi-line definitions by pressing
@
instead of
·
at the end of each line. On the computer
keyboard, hold down
Alt
and press
Enter
.
Note:
See also
Define LibPriv
, page 22, and
Define LibPub
,
page 23.
Define LibPriv
Catalog >
Define LibPriv
Var
=
Expression
Define LibPriv
Function
(
Param1
,
Param2
,
...
) =
Expression
Define LibPriv
Function
(
Param1
,
Param2
,
...
) = Func
Block
EndFunc
Define LibPriv
Program
(
Param1
,
Param2
,
...
) = Prgm
Block
EndPrgm
Operates the same as
Define
, except defines a private library
variable, function, or program. Private functions and programs do not
appear in the Catalog.
Note:
See also
Define
, page 22, and
Define LibPub
, page 23.