HP F2222A#ABA hp 9g_user's manual_manuel de l'utilisateur_EF_HDP1SG181S5.pdf - Page 29

Relational Operators, Creating a New Program, Executing a Program

Page 29 highlights

⇒ The SWAP command swaps the contents in two memory variables. Relational Operators The relational operators that can be used in FOR loops and conditional branching are: = = (equal to), < (less than), > (greater than), ≠ (not equal to), ≤ (less than or equal to), ≥ (greater than or equal to). Creating a New Program 1. Select NEW from the program menu and press [ ]. 2. Select the calculation mode you want the program to run in and press [ ]. 3. Select one of the ten program areas (P0123456789) and press [ ]. 4. Enter your program's commands. • You can enter the calculator's regular functions as commands. • To enter a program control instruction, press [ 2nd ] [ INST ] and make your selection. • To enter a space, press [ ALPHA ] [ SPC ]. 5. A semicolon (;) indicates the end of a command. To enter more than one command on a command line, separate them with a semicolon. For example: Line 1: INPUT A ; C = 0.5 × A ; PRINT " C = " , C ; END You can also place each command or group of commands on a separate line, as follows. In this case, a trailing semicolon can be omitted. Line 1: INPUT A ; C = 0.5 × A [ ] Line 2: PRINT " C = " , C ; END Executing a Program 1. When you finish entering or editing a program, press [ / CL ESC ] to return to the program menu, select RUN and press [ ]. (Or you can press [ PROG ] in MAIN mode.) 2. Select the relevant program area and press [ ] to begin executing the program. 3. To re-execute the program, press [ ] while the program's final result is on the display. 4. To abort the execution of a program, press [ / CL ESC ]. A message appears asking you to confirm that you want to stop the execution. STOP : N Y Press [ ] to move the cursor to Y and then press [ ]. E-29

  • 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
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172

E-29
The
SWAP
command swaps the contents in two memory variables.
Relational Operators
The relational operators that can be used in
FOR
loops and conditional
branching are:
= = (equal to), < (less than), > (greater than),
(not equal to),
(less
than or equal to),
(greater than or equal to).
Creating a New Program
1. Select
NEW
from the program menu and press [
].
2.
Select the calculation mode you want the program to run in and press
[
].
3.
Select one of the ten program areas (
P0123456789
) and press [
].
4.
Enter your program’s commands.
• You can enter the calculator’s regular functions as commands.
• To enter a program control instruction, press [ 2nd ] [ INST ] and
make your selection.
• To enter a space, press [ ALPHA ] [ SPC ].
5.
A semicolon (;) indicates the end of a command. To enter more than
one command on a command line, separate them with a semicolon. For
example:
Line 1:
INPUT
A ; C = 0.5
×
A ;
PRINT
” C = ” , C ;
END
You can also place each command or group of commands on a
separate line, as follows. In this case, a trailing semicolon can be
omitted.
Line 1:
INPUT
A ; C = 0.5
×
A
[
]
Line 2:
PRINT
” C = ” , C ; END
Executing a Program
1.
When you finish entering or editing a program, press [
CL
/
ESC
] to return
to the program menu, select
RUN
and press [
]. (Or you can press
[ PROG ] in
MAIN
mode.)
2.
Select the relevant program area and press [
] to begin executing
the program.
3.
To re-execute the program, press [
] while the program’s final
result is on the display.
4.
To abort the execution of a program, press [
CL
/
ESC
]. A message
appears asking you to confirm that you want to stop the execution.
STOP : N
Y
Press [
] to move the cursor to
Y
and then press [
].