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 | APPEND

Edit History

APPEND

APPEND a, var1 [, var2 [, …, varN]]

Home > Reference > Data

Inserts the values var1 to varN at the end of the array a. var1 to varN can be any data type.

Instead of APPEND the << Operator can be used.

Example 1: Append single number

a = [1,2,3]
print "Before APPEND: "; a

APPEND a, 4
print "After APPEND : "; a

' Output:
' Before APPEND: [1,2,3]
' After APPEND : [1,2,3,4]

Example 2: Append multiple numbers

a = [1,2,3]

APPEND a, 4, 5
print a              ' Output: [1,2,3,4,5]

Example 3: Append an array

a = [1,2,3]

APPEND a, [4,5,6]
print a              ' Output: [1,2,3,[4,5,6]]

Example 4: Append a string

a = ["a", "b", "c"]

APPEND a, "d"
print a                 ' Output: [a,b,c,d]

Example 5: Using << operator

a = [1,2,3]

a << 4
print a                  ' Output: [1,2,3,4]
Code samples using APPEND
004 loops.bas   006 arrays+.bas   2048.bas   4tune.bas   agendus.bas   bezier's autograph book.bas   bezierbounce.bas   hangman v2.bas   mine sweeper v4sb.bas   pen pad.bas   recognition_training.bas   recognition_training_az.bas   snake.bas   sokoban.bas   sokoban.bas   sokoban.bas   TinyBASIC.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 Mon, 18 Sep 2023 15:24:09 +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.