Agilent Technologies 8935 Series Manual do Utilizador Página 279

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 329
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 278
Chapter 8 279
IBASIC Controller
PROGram Subsystem
Example 8-30 Example querying the value of a one dimensional array
[Array(5)] with 6 elements
OUTPUT 714;"PROGram:SELected:NUMBer? Array"
ENTER 714;Result_array(*)
or
OUTPUT 714;"PROG:NUMB? Array"
ENTER 714;Result_array(*)
In this example, the array named Result_array(*) in the ENTER
statement must be dimensioned exactly the same as the array named
Array in the IBASIC program.
NOTE
Individual array elements cannot be queried with the :NUMBer?
command.
Example 8-31 Example querying the value of a one dimensional array whose
name is known but whose current size is unknown
10 DIM Temp$[5000] !This will hold 250 numbers @ 20 characters each
20 DIM Result_array(500) !This array will hold up to 501 values
30 OUTPUT 714;"PROG:NUMB? Array" !Query the desired array
40 ENTER 714;Temp$ !Enter the values into a temporary string variable
50 N=-1 !Initialize array pointer, assume option base 0
60 REPEAT !Start loop to take values from string and put in array
70 N=N+1 !Increment array pointer
80 Pos_comma=POS(Temp$,",") !Find comma separator
90 Result_array(N)=VAL(Temp$[1,Pos_comma-1]) !Put value into array
100 Temp$=Temp$[Pos_comma+1] !Remove value from temporary string
110 UNTIL POS(Temp$,",")=0 !Check for last value in temporary string
120 Result_array(N+1)=VAL(Temp$) !Put last value into array
130 END
The above example assumes that the dimensioned size of the IBASIC
array is smaller than the dimensioned size of the array named
Result_array.
NOTE
Individual array elements cannot be queried with the :NUMBer?
command.
Vista de página 278
1 2 ... 274 275 276 277 278 279 280 281 282 283 284 ... 328 329

Comentários a estes Manuais

Sem comentários