GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Download
  • News
  • Community
  • Resources
  • Language Reference
  • SmallBASIC Manual

This view

  • Original page
  • New address

GeezerVison is showing smallbasic.github.io — SmallBASIC | LEN

Edit History

LEN

d = LEN(x)

Home > Reference > Data

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

i = 10
f = 1.234
s = "abc"
dim a1(9)           ' Array with 10 elements
dim a2(9,9)         ' Array with 10x10 elements
m = {x:1, y:2, z:3} ' Map variable with 3 elements

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   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   calendar.bas  
Data
APPEND   ARRAY   DATA   DELETE   DIM   EMPTY   ERASE   INSERT   ISARRAY   ISDIR   ISFILE   ISLINK   ISMAP   ISNUMBER   ISSTRING   LBOUND   LEN   READ   REDIM   RESTORE   SEARCH   SORT   SWAP   UBOUND  
This page was last edited on Thu, 27 Apr 2023 15:32:03 +0200 | Markdown processed with pandoc 3.1.12.1
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.