dfitz
12-09-07, 08:26 AM
Hi,
I've been trawling through the forums to find an easy answer to my problem, and I'm not sure if i'm missing something or if it's too late on a Sunday night, in either case I have a couple of questions that are of importance to me and I imagine others at some point.
1) I'm trying to define a simple lookup table of values (just a one dimensional array) of length 255. I was initially trying to make this an array of floats, but I can settle for ints and just divide by 10 (one decimal point resolution for my numbers i'm looking up) when I access them. I've tried :
VARIABLE DMD_TABLE 255 ALLOT
to allocate initially and then to write values to the array I was trying:
0 CELL+
2 CELL+
4 CELL+
7 CELL+
10 CELL+
13 CELL+
16 CELL+
.
.
.
DMD_TABLE !
BUT, the plug-a-pod was crashing due to some memory accessing problem i'd say.
So in short, I have 255 numbers that don't change during my program (so they could be constants) and I need to know how to declare them.
2) I'd like to write a simple function that accesses the array and returns the value for a particular row, which I would have though would just be as simple as something like:
the_variable_name index_value + @
All help appreciated.
thanks.
Daniel
I've been trawling through the forums to find an easy answer to my problem, and I'm not sure if i'm missing something or if it's too late on a Sunday night, in either case I have a couple of questions that are of importance to me and I imagine others at some point.
1) I'm trying to define a simple lookup table of values (just a one dimensional array) of length 255. I was initially trying to make this an array of floats, but I can settle for ints and just divide by 10 (one decimal point resolution for my numbers i'm looking up) when I access them. I've tried :
VARIABLE DMD_TABLE 255 ALLOT
to allocate initially and then to write values to the array I was trying:
0 CELL+
2 CELL+
4 CELL+
7 CELL+
10 CELL+
13 CELL+
16 CELL+
.
.
.
DMD_TABLE !
BUT, the plug-a-pod was crashing due to some memory accessing problem i'd say.
So in short, I have 255 numbers that don't change during my program (so they could be constants) and I need to know how to declare them.
2) I'd like to write a simple function that accesses the array and returns the value for a particular row, which I would have though would just be as simple as something like:
the_variable_name index_value + @
All help appreciated.
thanks.
Daniel