News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Float Lookup table

Started by shantanu@india, May 01, 2026, 10:30 AM

Previous topic - Next topic

shantanu@india

Hi ,
Suppose I have two tables...one for byte variables & another for float variables. I use "RecordPointer" byte to push & pop data from the table:
Dim  FloatTable[8]  as Float
Dim  ByteTable[8]   as Byte
Dim  RecordPointer  as Byte

Does FloatTable[RecordPointer] automatically point to the (RecordPointer+4) position of the FloatTable ? Or to get the first float value I have to use FloatTable[0] & to get the secondfloat value I have to use FloatTable[4]?
 
A small confusion!!

Regards
Shantanu

top204

#1
An array element number will return the full identifier type. i.e. Byte, Word, Long, DWord, Float etc, as long as the assignment is teh required variable type.

For example:

MyFloat = FloatArray[bIndex]

Will return the array value from the element position bIndex, as a Floating Point.

However...

MyWord = FloatArray[bIndex]

Will return the array value from the element position bIndex, as a 16-bit Word, but still move to the correct element within the array.

Regards
Les