| Electronic Components Datasheet Search |
|
UM0715 Datasheet(PDF) 7 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0715 Datasheet(HTML) 7 Page - STMicroelectronics |
|
7 / 24 page ![]() UM0715 Basic command Doc ID 15798 Rev 2 7/24 4 Basic command The section below list detailed commands. Table 1. Basic commands Name Remarks DIM Use DIM to create a named list of numbers or strings. Arrays can have up to five dimensions. There must be no space between the name of the dimensioned variable and the opening parenthesis. 10 DIM name$(100) creates an array of 100 names. 10 DIM map(width, height) creates a 2d array of width * height entries, maybe representing grid squares on a map. 20 LET map(1,10) = 2.0 sets the top rigth element to 2.0. 30 LET map(width, height) is the bottom right element. If you try to access out of range elements the computer will throw an error. It’s possible to resize an array at any point by calling DIM on it again. If the array is one dimensional, elements will be preserved. If the array has higher dimensions then the elements will be scrambled. It’s allows to initialize arrays when you dimension them. Example 10 DIM days$[7] = “Mon”, “Tue”, ”Wed”, ”Thur”, ”Fri”, ”Sat”, ”Sun” this instruction will declare an array of days of the week. This method is useful for defining data. For 2d arrays, the first dimension is the lowest (x) dimension, so: DIM name$(2, 4) = ”Fred”, ”Bloggs”, ”Joe”, ”Sixpack” ”Homer”, ”Simpson” ”John”, ”Doe” is the correct order. Dimensioned variables are intimately connected with FOR ... NEXT loops. Use the loop counter to index into your array. Usage DIM id(numeric, numeric) 10 DIM array(10) creates a single-dimensioned array of 10 numerical elements. 10 DIM dictionary$(2, N) creates a 2-dimensional array of N * 2 strings. 10 DIM factorial(10) = 1!, 2!, 3!, 4!, 5!, 6!, 7!, 8!, 9!, 10! reates a list of the first ten factorials. |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |