Creates a tablefrom one or more vectors (one-dimensional arrays).
alias (optional) Specifies a new name for the table column. By default, the input variable's name is used.
A table is built from vector (one-dimensional array) variables only. You cannot include expressions in the BUILD_TABLE function. For example, The following BUILD_TABLE call is not allowed:
result = BUILD_TABLE('EXT(0:5), COST(0:5)')
EXT = EXT(0:5) COST = COST(0:5) result = BUILD_TABLE('EXT, COST')
NOTE: ASC and DESC are reserved words (used by QUERY_TABLE for direction) and thus are not allowed to be used as variable names or aliases.
phone_data = BUILD_TABLE('DATE, TIME, ' + $ 'DUR, INIT, EXT, COST, AREA, NUMBER')
INFO
command to view the new table structure, for example:
INFO, /Structure, phone_data ** Structure TABLE_0, 8 tags, 40 length:
DATE | LONG | 901002 |
TIME | LONG | 93200 |
DUR | FLOAT | 21.4000 |
INIT | STRING | 'TAC' |
EXT | LONG | 311 |
COST | FLOAT | 5.78000 |
AREA | LONG | 215 |
NUMBER | STRING | 2155554242 |
The QUERY_TABLE function can be used to retrieve information from this table. For example:
res = QUERY_TABLE(phone_data, ' * Where COST 1.0')
phone_data1 = BUILD_TABLE('DATE Call_Date,' + $ TIME Call_Time, DUR Call_Length,' + $ 'INIT, EXT, COST Charge, AREA Area_Code,'+ $ 'NUMBER Phone_Number')
INFO, /structure, phone_data ** Structure TABLE_0, 8 tags, 40 length:
CALL_DATE | LONG | 901002 |
CALL_TIME | LONG | 93200 |
CALL_LENGTH | FLOAT | 21.4000 |
INIT | STRING | 'TAC' |
EXT | LONG | 311 |
CHARGE | FLOAT | 5.78000 |
AREA_CODE | LONG | 215 |
PHONE_NUMBER | STRING | 2155554242 |
For more information on BUILD_TABLE, see Chapter 9, Creating and Querying Tables, in the PV-WAVE User's Guide.
For information on reading data into variables, see Chapter 8, Working with Data Files, in the PV-WAVE Programmer's Guide.