I need an array with integer elements. So I wrote "DIM AnalogMittel (20) as Integer" in my program and was astonished that a summation of all elements divided by 20 was maximal 255!
No I typed "DIM AnalogMittel (20) als Integer" and didn't get any syntax error!
Ok, it seems that arrays ar only exist with elements of bytes but it is not good that any text behind the bracket gives no error...
Is there a way to build an array with integers???
Frank
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks for your fast answer! Can you tell me how I can build my own methods??? (...or where where I can found more information about that...)
I found nothing about the data type of the arrays in the manuals... I think it is very critical that the compiler didn't critisise text after the brackets. I found my mistake only accidental...
Frank
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The data type of array is stated in the Help. 'An array is a special type of variable - one which can store several values at once. It is essentially a list of byte numbers in which each one can be addressed individually through the use of an "index". The index is a value in brackets immediately after the name of the array.' This is taken from the latest Help. I cannot remember when we edit the Array section but this may have been updated in 2016.
What version of GCB ? Release etc etc.
When you created the array you are totally correct - we should issue and alert regarding the variable type, but, see below.
For the next release. I do have multi-dimensional and different variable type support on the list. Limited functionality to start with - create array, read array element, update array element. But, there is no commitment to when or if we do this - but, this is truly next on the list of capabilities to add.
So, meanwhile.... how to add you own methods? This thread shows how to create 2D arrays - the method is similar for integer arrays. If you cannot make work - do ask. I am sure someone will help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I use v.0.95.010. It was not clear to me with the integrated helpfile:
"The Dim array command also sets up array variables. The maximum array size is determined by the parameter size is dynamically allocated by the compiler and depends on the specific chip used, as well as the complexity of the program.
The limit on array size varies dependent on the chip type. The 12F/16F series of chips the array limit is 80 elements. For the Atmel AVR or an 18F there is no limit other than free RAM however Great Cow BASIC limits the array size to 10,000 elements. If a memory limit is reached, the compiler will give an error message."
Now I have found your text in the actual helpfile...
Thanks a lot for your help and for your link!!!
Frank
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I need an array with integer elements. So I wrote "DIM AnalogMittel (20) as Integer" in my program and was astonished that a summation of all elements divided by 20 was maximal 255!
No I typed "DIM AnalogMittel (20) als Integer" and didn't get any syntax error!
Ok, it seems that arrays ar only exist with elements of bytes but it is not good that any text behind the bracket gives no error...
Is there a way to build an array with integers???
Frank
Not from the standard compiler.
You can easily build you own methods to read/update/delete a psuedo integer array.
Hi Anobium,
thanks for your fast answer! Can you tell me how I can build my own methods??? (...or where where I can found more information about that...)
I found nothing about the data type of the arrays in the manuals... I think it is very critical that the compiler didn't critisise text after the brackets. I found my mistake only accidental...
Frank
The data type of array is stated in the Help. 'An array is a special type of variable - one which can store several values at once. It is essentially a list of byte numbers in which each one can be addressed individually through the use of an "index". The index is a value in brackets immediately after the name of the array.' This is taken from the latest Help. I cannot remember when we edit the Array section but this may have been updated in 2016.
What version of GCB ? Release etc etc.
When you created the array you are totally correct - we should issue and alert regarding the variable type, but, see below.
For the next release. I do have multi-dimensional and different variable type support on the list. Limited functionality to start with - create array, read array element, update array element. But, there is no commitment to when or if we do this - but, this is truly next on the list of capabilities to add.
So, meanwhile.... how to add you own methods? This thread shows how to create 2D arrays - the method is similar for integer arrays. If you cannot make work - do ask. I am sure someone will help.
Hi Anobium,
I use v.0.95.010. It was not clear to me with the integrated helpfile:
"The Dim array command also sets up array variables. The maximum array size is determined by the parameter size is dynamically allocated by the compiler and depends on the specific chip used, as well as the complexity of the program.
The limit on array size varies dependent on the chip type. The 12F/16F series of chips the array limit is 80 elements. For the Atmel AVR or an 18F there is no limit other than free RAM however Great Cow BASIC limits the array size to 10,000 elements. If a memory limit is reached, the compiler will give an error message."
Now I have found your text in the actual helpfile...
Thanks a lot for your help and for your link!!!
Frank