| System Functions |
|
| Formats | 1. Generate or
Initialize String: DIM(len[,fill$][,ERR=stmtref]
) 2. Read Total elements in Array: DIM(READ NUM(array_name[$][,subscript] ) ) 3. Get maximum index for an Array: DIM(READ MAX(array_name[$][,subscript] ) ) 4. Get minimum index for an Array: DIM(READ MIN(array_name[$][,subscript] ) ) 5. Find max/min value in Array: DIM(FIND [ MIN | MAX ] ( array_name[$] ) ) 6. Scan array for value: DIM(FIND array_name[$] comparision value[$] ) 7. Total numeric array: DIM(ADD array_name) 8. Return associated index: DIM(INDEX ADD array_name[$] [ keyword$ ] )
|
||||||||||||||||
| Returns | Initialized string, or information about dimensions of array. | ||||||||||||||||
| Description | Use the DIM( ) function to generate or initialize a string. You can also use it to obtain information about the size of an array you have already defined using the DIM directive. | ||||||||||||||||
| Format 1 | Generate or Initialize String DIM(len[,fill$][,ERR=stmtref]) Use this format to generate or initialize a string whose length you specify. The function fills the string by using the value for fill$. |
||||||||||||||||
| *Note* | This format of the function behaves almost like the DIM directive's format to initialize strings. However, instead of repeating only the first character of the string, as in the directive, the function repeats the complete value of the fill string. (Refer to the DIM Directive, for the format to initialize strings). | ||||||||||||||||
| If you omit
the fill string, ProvideX uses spaces as fill characters;
e.g., 0100 PRINT ":",DIM(11,"*Cat"),":" ->RUN *Cat*Cat*Ca: 0100 PRINT 'CS',"A Title",@(0,1),DIM(80,"-") 0110 REM The DIM( ) above returns a string of hyphens "-" 80 characters long ->RUN A Title -------------------- ... etc. |
|||||||||||||||||
| See Also | '+S' & '-S' Mnemonics. | ||||||||||||||||
| Formats 2,3,4 | Read Dimensions (Size) of Array Use Formats 2, 3, and 4 of the DIM( ) function (listed below) to read a given array's total number of elements, the minimum element's number and the maximum element's number. If the variable you specify is not an array, NUM and MIN will return 0, MAX will return -1. DIM(READ NUM(array_name[$][,subscript])) Use the DIM(READ NUM( )) function to read the total number of elements in a dimensioned array; e.g., 0100 DIM X[0:15] 0110 PRINT DIM(READ NUM(X)) ->run 16 |
||||||||||||||||
| DIM(READ MAX(array_name[$][,subscript])) Use the DIM(READ MAX( )) function to read the maximum element number in a dimensioned array; e.g., 0110 DIM X[0:15] 0120 PRINT DIM(READ MAX(X)) ->run 15 |
|||||||||||||||||
| DIM(READ MIN(array_name[$][,subscript])) Use the DIM(READ MIN( )) function to read the minimum element number in a dimensioned array; e.g., 0110 DIM X[0:15] 0120 PRINT DIM(READ MIN(X)) ->run 0 |
|||||||||||||||||
| Format 5 | Find
max/min value in Array +PxPlus Exclusive You can use this format of the DIM function to scan an array to determine the index of the highest or lowest element. The return value will be the index into the array. For Example: Assuming an array X$ contained 'Cat', 'Dog', 'Zebra', 'Ant', 'Pig' in elements 1 thru 5,
|
||||||||||||||||
| Format 6 | Scan
array for value +PxPlus Exclusive You can use this format of the DIM function to locate a value in an array that will match a expression. The return value will be the index into the array. For Example: Assuming an array X$ contained 'Cat', 'Dog', 'Zebra', 'Ant', 'Pig' in elements 1 thru 5,
|
||||||||||||||||
| Format 7 | Total
numeric array +PxPlus Exclusive The DIM (ADD X) format can be used to quickly total a numeric array. |
||||||||||||||||
| Format 8 | Lookup
and return index for given keyword +PxPlus Exclusive (build 9200) The DIM (INDEX xxx["keyword"] ) format can be used against any associative array in order to return the index of the element for the specified keyword. If no element with the specified keyword is found the return value will be zero. |