* Literal or variable [[STRING]] values return the number of string bytes which is the same as the number of string characters.
* A numerical ''variable'' will return the number of bytes used by a numerical variable type.
** [[_BYTE]] variable types return 1 byte.
** [[INTEGER]] variable types return 2 bytes.
** [[SINGLE]] and [[LONG]] integer variable types return 4 bytes.
** [[DOUBLE]] and [[_INTEGER64]] variable types return 8 bytes.
** [[_FLOAT]] variable types return 32 bytes.
** [[_OFFSET]] and [[_MEM]] variable types return varying byte sizes.
** ''Note:'' [[_BIT]] variable types and bit multiples '''cannot be measured in bytes'''.
* '''LEN cannot return lengths of literal numerical values and will create a "variable required" status error in the IDE.'''
* '''LEN =''' can be used with a user defined [[TYPE]] variable to determine the number of bytes used in [[RANDOM]] file records:
:::: {{InlineCode}}[[OPEN]] file$ FOR [[RANDOM]] AS #n LEN <nowiki>=</nowiki> LEN(recordTypeVariable){{InlineCodeEnd}}'''
:* If a LEN = statement is not used, [[RANDOM]] default record length is 128 or sequencial is 512 up to a maximum of 32767 bytes.
:* [[BINARY]] OPEN statements will ignore LEN = statements. The byte size of a [[GET|read]] or [[PUT|write]] is determined by the [[Variable Types|variable type]].
{{PageExamples}}
''Example 1:'' With a string variable the byte size is the same as the number of characters.
{{CodeStart}}
LastName$ = "Williams"
PRINT {{Cl|LEN}}(LastName$); "bytes"
{{CodeEnd}}
{{OutputStart}} 8 bytes
{{OutputEnd}}
''Example 2:'' Testing [[INPUT]] for numerical [[STRING]] entries from a user.