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

Edit History

WRITE

WRITE #fileN, var1 [, var2, … , varN]

Home > Reference > File

Store variables var1 to varN to a file as binary data. Variables can be numbers, strings and arrays.

See READ for reading variables from a file.

Example

a = 12.3
b = "test"
c = [1,2,3,4]

' Write variables to file
open "text.bin" for output as #1
write #1, a, b, c
close #1

' Read variables from file
open "text.bin" for input as #1
read #1, a, b, c
close #1

print a
print b
print c
Code samples using WRITE
000 hello.bas   005 challenge.bas   2048.bas   7gables.bas   agendus.bas   dogstar5.bas   irc-bot.bas   loadsavebmp_fltk.bas   mass_and_spring_system.bas   palm_cli.bas   palmcli.bas   PRINTA_OKOK.bas   screen labels.bas   strlib.bas   tabs2spaces.bas   tracklog.bas   typewriter with sound effects.bas   typewriter.bas  
File
ACCESS   BGETC   BLOAD   BPUTC   BSAVE   CHDIR   CHMOD   CLOSE   COPY   DIRWALK   EOF   EXIST   FILES   FREEFILE   INPUT   INPUT   KILL   LOCK   LOF   MKDIR   OPEN   READ   RENAME   RMDIR   SEEK   SEEK   TLOAD   TSAVE   WRITE  
This page was last edited on Fri, 15 Sep 2023 10:17:54 +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.