Name:
readtable
Syntax:

READTABLE location,variable {, variable, variable...}

Location - is a variable/constant specifying the address.

Variable - receives the byte value stored at the table location.

Description:

Retrieve the value from an embedded lookup table.

Some PICAXE chips enable lookup data (e.g. LCD messages) to be embedded in a table within the program (via the table command). This is a very efficient way of storing data. See the 'table' command for more details.

Blocks of data may also be transferred to RAM via the tablecopy command.

When a data table is defined in a program code slot with the X2 parts, the data table is accessible only to the program within that slot. Each program slot using readtable commands should have its own 'table' defined.

18M2 Firmware

Please note the 'readtable' command is only supported for 18M2 firmware D.x (PICAXE chips labelled 18M2+) and is not available for use with 18M2 firmware 2.x (PICAXE chips labelled 18M2).

The PICAXE compiler will syntax check code for an 18M2 as correct when using the 'readtable' command but will generate an error when an attempt is made to download into an 18M2 with firmware 2.x.

Applies To:
M2, X1 and X2 parts
See Also:
Related Create:
    Share:
    Print:

    Read table data

    Read the contents of the table data and show the data read

    Code Example:
    	table 0,("Hello World")	; save values in table
    
    main:	for b0 = 0 to 10	; start a loop
    	  readtable b0,b1	; read value from table
    	  serout B.7,N2400,(b1)	; transmit to serial LCD module
    	next b0			; next character
    Copy Code Submit an Example

    Submit Your Own Code!

    You must be logged in to submit code examples. Login now.

    Comments

    • Login to leave a comment.