Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By viscomjim
#35783 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!!!!
User avatar
By viscomjim
#35925 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!!!!
User avatar
By AndyGadget
#38279 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)