HP 40gs HP 39gs_40gs_Mastering The Graphing Calculator_English_E_F2224-90010.p - Page 259

The SETVIEWS command, Only programs named in the, command or linked by the software will

Page 259 highlights

The SETVIEWS command The VIEWS menu is created by the SETVIEWS command. It follows a repetitive pattern of listing a menu option, followed by the name of the program that should run if the user chooses that option, followed by a code number which tells the calculator which view to drop the user into once the program finishes. Part of the job of the 'helper' program is usually to set up this view so that it shows what the programmer wants it to. You should therefore also think about what you want the user to be looking at once the program they have triggered stops running. Do you want them to be looking at the PLOT view - perhaps the option they chose was to draw a graph, with the program being there to set appropriate axes; or the NUM view - perhaps we are analyzing data - or should they be looking at the VIEWS menu again so they can make another choice? The syntax for SETVIEWS is as follows... SETVIEWS "Menu line1"; "Program name"; View_No; "Menu line2"; "Program name"; View_No; (repeated as many times as needed...) "Menu line3"; "Program name"; View_No: (Note the colon on the final entry) where View_No is: 0. Home view 1. Plot view 2. Symbolic view 3. Numeric view 4. Plot Setup 5. Symbolic Setup 6. Numeric Setup 7. Views menu 8. Aplet Note view 9. Aplet Sketch view 10. Aplet Catalog 11. List Catalog 12. Matrix Catalog 13. Notepad Catalog 14. Program Catalog 15. Views menu item 1 (Plot-Detail if the parent is the Function aplet) 16. Views menu item 2 (Plot-Table if the parent is the Function aplet) 17. Views menu item 3 (Overlay Plot if parent is the Function aplet) 18. Views menu item 4 (Auto Scale if parent is the Function aplet) 19. Views menu item 5 (Decimal if the parent is the Function aplet) 20. Views menu item 6 (Integer if the parent is the Function aplet) etc. The syntax for SETVIEWS allows any number of triples. Views 15 onwards vary according to which parent aplet is chosen. The list above assumes the parent is the Function aplet and will be different for other parents. The convention for the SETVIEWS command is to place it in a program with a name of .NAME.SV where NAME is whatever name you chose at design stage. When you run this program it severs the aplet's link to the normal VIEWS menu inherited from its parent and replaces it with the new options. If an aplet is created using the special software then it will probably not have this .NAME.SV program. The software creates the VIEWS menu in a different way that doesn't require it. This does not affect the aplet in any other way. The linking performed by the SETVIEWS command (or by the ADK) is also important in that it tells the calculator which programs are to be transmitted with the aplet when it is copied via cable or via infra-red link. Only programs named in the SETVIEWS command (or linked by the software) will be transmitted with the aplet by cable or by infra-red. 259

  • 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
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238
  • 239
  • 240
  • 241
  • 242
  • 243
  • 244
  • 245
  • 246
  • 247
  • 248
  • 249
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • 257
  • 258
  • 259
  • 260
  • 261
  • 262
  • 263
  • 264
  • 265
  • 266
  • 267
  • 268
  • 269
  • 270
  • 271
  • 272
  • 273
  • 274
  • 275
  • 276
  • 277
  • 278
  • 279
  • 280
  • 281
  • 282
  • 283
  • 284
  • 285
  • 286
  • 287
  • 288
  • 289
  • 290
  • 291
  • 292
  • 293
  • 294
  • 295
  • 296
  • 297
  • 298
  • 299
  • 300
  • 301
  • 302
  • 303
  • 304
  • 305
  • 306
  • 307
  • 308
  • 309
  • 310
  • 311
  • 312
  • 313
  • 314
  • 315
  • 316
  • 317
  • 318
  • 319
  • 320
  • 321
  • 322
  • 323
  • 324
  • 325
  • 326
  • 327
  • 328
  • 329
  • 330
  • 331
  • 332
  • 333
  • 334
  • 335
  • 336
  • 337
  • 338
  • 339
  • 340
  • 341
  • 342
  • 343
  • 344
  • 345
  • 346
  • 347
  • 348
  • 349
  • 350
  • 351
  • 352
  • 353
  • 354
  • 355
  • 356
  • 357
  • 358
  • 359
  • 360
  • 361
  • 362
  • 363
  • 364
  • 365
  • 366

The SETVIEWS command
The
VIEWS
menu is created by the
SETVIEWS
command. It follows a repetitive pattern of listing a menu
option, followed by the name of the program that should run if the user chooses that option, followed by a
code number which tells the calculator which view to drop the user into once the program finishes. Part of the
job of the ‘helper’ program is usually to set up this view so that it shows what the programmer wants it to.
You should therefore also think about what you want the user to be looking at once the program they have
triggered stops running. Do you want them to be looking at the
PLOT
view - perhaps the option they chose
was to draw a graph, with the program being there to set appropriate axes; or the
NUM
view - perhaps we
are analyzing data - or should they be looking at the
VIEWS
menu again so they can make another choice?
The syntax for
SETVIEWS
is as follows…
SETVIEWS
“Menu line1”; “Program name”; View_No;
“Menu line2”; “Program name”; View_No; (repeated as many times as needed…)
“Menu line3”; “Program name”; View_No: (Note the colon on the final entry)
where View_No is:
0. Home view
11. List Catalog
1. Plot view
12. Matrix Catalog
2. Symbolic view
13. Notepad Catalog
3. Numeric view
14. Program Catalog
4. Plot Setup
15. Views menu item 1 (Plot-Detail if the parent is the Function aplet)
5. Symbolic Setup
16. Views menu item 2 (Plot-Table if the parent is the Function aplet)
6. Numeric Setup
17. Views menu item 3 (Overlay Plot if parent is the Function aplet)
7. Views menu
18. Views menu item 4 (Auto Scale if parent is the Function aplet)
8. Aplet Note view
19. Views menu item 5 (Decimal if the parent is the Function aplet)
9. Aplet Sketch view
20. Views menu item 6 (Integer if the parent is the Function aplet)
10. Aplet Catalog
etc.
The syntax for
SETVIEWS
allows any number of triples. Views 15 onwards vary according to which parent
aplet is chosen. The list above assumes the parent is the Function aplet and will be different for other parents.
The convention for the
SETVIEWS
command is to place it in a program with a name of
.NAME.SV
where
NAME
is whatever name you chose at design stage. When you run this program it severs the aplet’s link to
the normal
VIEWS
menu inherited from its parent and replaces it with the new options. If an aplet is created
using the special software then it will probably not have this
.NAME.SV
program. The software creates the
VIEWS
menu in a different way that doesn’t require it. This does not affect the aplet in any other way.
The linking performed by the
SETVIEWS
command (or by the ADK) is also important in that it tells the
calculator which programs are to be transmitted with the aplet when it is copied via cable or via infra-red link.
Only programs named in the
SETVIEWS
command (or linked by the software) will be
transmitted with the aplet by cable or by infra-red.
259