Similarly, the NextBASIC return stack area which was mentioned in Chapter 4 maintains a record of your program's currently-active subroutine and procedure calls, loops and error handlers.
The byte pointed by the RAMTOP variable shows the maximum address that is reserved for use by a NextBASIC program. We will visit this in more detail, in the section about the CLEAR command below.
Finally the User Defined Graphics area holds all the definitions to the system's UDGs as discussed in Chapter 13.
NextBASIC stores numbers, strings, arrays, programming lines and FOR...NEXT loops in strictly defined forms called data structures. The following discuss all these data structures that are user accessible. Integer-based variables, arrays and control structures are not available to the user and are hidden by NextZXOS in protected memory areas so they're not covered here.
Each line of NextBASIC program has the form:

MSB LSB
+---------+---------+-----------~ ~-----------+-----------------+
| 2 bytes | 2 bytes | ~ ~ | 0 0 0 0 1 1 0 1 |
+---------+---------+-----------~ ~-----------+-----------------+
Line Text Text ENTER
number Length
+
ENTER
Note that, in contrast with all other cases of two-byte numbers in the Z80N, the line number here is stored with its more significant byte (MSB) first: that is to say, in the order that you write them down (also known as Big-Endian order).
A numerical constant in the program appears as ASCII text followed by its binary form, using the character CHR$ 14 followed by five bytes for the number itself.
The variables have different formats according to their features. The letters in the names should be thought as starting off in lower case. The available variants and their formats are:
Number whose name is one letter only:

+-----------------+----------+----+---------~ ~---------+
| 0 1 1 | Exponent |Sign| 4 mantis~ ~sa bytes |
| | byte |Bit | ~ ~ |
+-----------------+----------+----+---------~ ~---------+
[?] [?]
Number whose name is longer than one letter:

+-----------------+-----------------~ ~-----------------+----------+----+---------~ ~---------+
| 1 0 1 | 0 ~ ~ 1 | Exponent |Sign| 4 mantis~ ~sa bytes |
| | ~ ~ | byte |Bit | ~ ~ |
+-----------------+-----------------~ ~-----------------+----------+----+---------~ ~---------+
Letter (≥60h) 2nd Letter Last Letter Value
Array of numbers:

# of
dimensions
+-----------------+-------------+--------+---------~ ~---------+-------------~ ~-------------+
| 1 0 0 | 2 bytes | 1 byte | 2 bytes ~ ~ 2 bytes | 5 bytes each~ ~ |
+-----------------+-------------+--------+---------~ ~---------+-------------~ ~-------------+
Letter (≥60h) Total length 1st dimension Last dimension Elements
of elements
and dimensions
+ 1 for # of
dimensions
ZX Spectrum Next User Manual, 3rd Edition (ISBN 978-1-5272-5496-1), written and illustrated by Phoebus R. Dokos. Copyright © 2020-2024 Phoebus Dokos / SpecNext Ltd. Licensed under CC BY-NC-SA 4.0. This is a transcription and can contain errors; check any doubt against the printed page.