LEN
d = LEN(x)
Returns the length of the variable x
.
The return value d
depends on the type of the variable
x
:
Type | Return Value |
---|---|
number | length of the STR(x) |
string | length of the string |
array | number of the elements |
map | number of the elements |
Example
10
i = 1.234
f = "abc"
s = dim a1(9) ' Array with 10 elements
dim a2(9,9) ' Array with 10x10 elements
1, y:2, z:3} ' Map variable with 3 elements
m = {x:
print len(i) ' Output: 2
print len(f) ' Output: 5
print len(s) ' Output: 3
print len(a1) ' Output: 10
print len(a2) ' Output: 100
print len(m) ' Output: 3
Code samples using LEN
003 conditional branching.bas
005 challenge.bas
100lines.bas
2048.bas
2048.bas
3d block lettes.bas
3d_torus.bas
3dtorus.bas
7gables.bas
agendus.bas
ai.bas
another look at trig functions.bas
arc_ui.bas
ascii 3d.bas
autumn scene.bas
Balleta 2-11-15.bas
BAS_NOW.bas
base64.bas
bb2fork smurf.bas
betrayal: crows ii.bas
bezier's autograph book.bas
Blackbox.bas
blackbox.bas
blushing snowflakes.bas
bomb.bas
bopit.bas
bulls and cows.bas
calc.bas
Calendar.bas