General Purpose Math; Filling Arrays; Array Size; Purging Arrays And Variables - Agilent Technologies 3458A User Manual

Hide thumbs Also See for 3458A:
Table of Contents

Advertisement

the maximum array size is determined by available 3458A memory
(approximately 10 kbytes if no stored states or subprograms are stored). A
non-integer subscript is rounded to the nearest integer.
Arrays may be resized by re-declaring them. This initializes each element in
the array to a value of zero. You cannot, however, redefine the type of array
(real or integer) without scratching memory first (refer to the SCRATCH
command in chapter 6). Array elements may be used in the same ways simple
variables are used.

Filling Arrays

Array elements are initialized to zero when they are declared (DIM, REAL,
or INTEGER commands) or are re-sized. Once you have dimensioned an
array, use the FILL command to load your values into the array. The FILL
command has the following syntax:
FILL array_name, list
The following program fills an integer array with integer values.
10 OUTPUT 722; "INTEGER LIST(9)"
20 OUTPUT722; "FILL LIST 0,100,200,300,400,500,600,700,800,900"
30 END
Note
Use the FILL command carefully. It does not work if power is cycled. The
command is effectively deleted from the subprogram at this time. Use
separate LET statements for each value assigned.

Array Size

The SIZE? query command returns the number of elements in the specified
array. This number is one more than the index of the last element in the array
due to the option base 0 convention used by the 3458A. Thus, if you
dimension a 10-element array (e.g., DIM LIST(9) ), the SIZE? command will
return "10".
The following program defines an integer array with 10 elements and then
verifies the array size using the SIZE? command.
10 OUTPUT 722; "INTEGER IARRAY(9)"
20 OUTPUT 722; "SIZE? IARRAY"
30 ENTER 722; A
40 PRINT A
50 END
Purging Arrays and
All variables and arrays are stored in 3458A volatile memory. If the 3458A
loses power, all variables and arrays are lost. The SCRATCH command also
Variables
purges all variables, arrays, subprograms, and stored state names (stored
states are explained in chapter 3).

General Purpose Math

You can use general purpose math expressions, following standard BASIC
language conventions, from either the front-panel keyboard, the system
controller, or within 3458A subprograms. The standard math operators,
Chapter 7 BASIC Language for the 3458A
269

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents