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

Edit History

INPUT

s = INPUT (len [, fileN])

Home > Reference > File

Reads ‘len’ bytes from file or console (if fileN is omitted) and returns the result as sting s. This function does not convert the data or remove spaces.

Example 1: Read from a file

' Create a file and write 10 bytes
open "test.txt" for output as #1
for byte = 100 to 110
    bputc #1, byte
next
close #1

' Open the file 
open "test.txt" for input as #1
' Read the first 5 byte
A = input(5, 1)
print A
' Read the second 5 byte
A = input(5, 1)
print A

close #1

Example 2: Read from console

' Read three characters from keyboard
A = input(3)
print A
Code samples using INPUT
002 numeric variables.bas   004 loops.bas   005 challenge.bas   006 arrays+.bas   3d_palmx.bas   3dtictac.bas   3dttt.bas   3dttt.bas   4tune.bas   7gables.bas   agendus.bas   ai.bas   amortig.bas   anball 1.0.bas   anomail.bas   bairstow.bas   Balleta 2-11-15.bas   BAS_NOW.bas   BAS_NOWv2.bas   base64.bas   biorythms.bas   blackbox.bas   Blackbox.bas   blackjack.bas   BlackJack.bas   block.bas   bmpreal.bas   bolmo.bas   bowling7.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 Tue, 18 Apr 2023 21:57:04 +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.