Page 1 of 2
Arrays
Posted:
Sat Dec 05, 2015 10:57 pm
by viscomjim
Would it be difficult to implement the use of single dimension arrays to espbasic? i.e. T(1), T(2), etc... This would be a great addition for sure! Thanks for your hard work!!!!
Re: Arrays
Posted:
Mon Dec 07, 2015 8:53 pm
by viscomjim
Maybe my question was confusing... What I am trying to do is assign values to variables that are referenced like an array, for example, using the variable T, I could assign values to it like this...
T(1) = 112
T(2) = 23
T(3) = 854
T(4) = 12
etc...
Typically, the variable T being used as an array would be dimensioned beforehand to the number of variables being used, ie,
Dim T(10) if I were to have 10 different values for the array T().
Is this a possibility with esp8266basic? This ability would come in handy for a multitude of applications.
Thanks again!!!!
Re: Arrays
Posted:
Mon Dec 07, 2015 9:05 pm
by Mmiscool
Not currently available but is some thing I am looking in to.
Re: Arrays
Posted:
Sat Jan 09, 2016 4:31 am
by AndyGadget
I'd second that request. Using an array as a lookup table has so many applications.
As a suggestion, how about using the syntax used in Picaxe Basic :
LOOKUP offset,(data0,data1...dataN),variable
- Offset is a variable/constant which specifies which data# (0-N) to place in
Variable.
- Data are variables/constants.
- Variable receives the result (if any).
Function:
Lookup data specified by offset and store in variable (if in range)