Vilnius BASIC, sometimes known as BK BASIC, is a dialect of the BASIC programming language developed at Vilnius University (in Lithuania, then a republic of the Soviet Union) for the Elektronika BK-0010-01/BK-0011M and UKNC computers. It first appeared in 1986.
Overview
Unlike most microcomputer dialects of BASIC from the era, which were interpreters, Vilnius BASIC was a compile-and-go language. When the user entered the RUN command, the compiler read the source code and produced a threaded-code executable, which it then ran. This technique, known as "indirect threaded code," bridged the gap between slow interpretation and the complexity of full compilation.
In terms of style and features, Vilnius BASIC was similar to GW-BASIC and MSX BASIC, though it lacked some of the multimedia commands found in MSX. Notable limitations included the inability to place more than one statement on a single line (a feature normally implemented using a colon) and the inability to open more than one data file at a time.
Editing
Only the UKNC version of Vilnius BASIC featured a full-screen editor. Versions for the BK-0010 series machines used a line editor, reflecting their heritage as PDP-11-compatible systems from an era before cursor-addressable terminals were widely available.
Data Types and Variables
Vilnius BASIC supported four basic data types:
- Double-precision floating point (default) — stored in 8 bytes, ~17 digits of precision
- Single-precision floating point — denoted by
!suffix, stored in 4 bytes, ~7 digits of precision - Integer — denoted by
%suffix, stored in a 16-bit word (−32768 to +32767) - String — denoted by
$suffix
Variable names could be any length, but only the first two characters were stored, so PRT001 and PR would refer to the same variable.
Numeric constants could be typed in binary, octal, or hexadecimal by prefixing with & and a type letter (B, O, or H), e.g., A=&H9A8B.
Commands and Statements
Direct-mode commands included: CONT, LIST, NEW, RUN, CLOAD, CSAVE, AUTO, RENUM, DELETE.
Program statements included: DATA, DEF FN, DIM, END, FOR...TO...STEP...NEXT, GOSUB, GOTO, IF...THEN...ELSE, INPUT, LET (optional), LIST, PRINT, ON...GOTO, ON...GOSUB, READ, REM, RESTORE, RETURN, STOP.
Graphics
The system included graphics support with five color values (0–3). Key graphics commands included:
PSET (x,y),color— set a pixelLINE (x1,y1)-(x2,y2),color— draw a lineCIRCLE (x,y),radius,color— draw a circle (with optional arc and ellipse parameters)PAINT (x,y),fillcolor,bordercolor— flood fillDRAW "string"— a Logo-style turtle graphics command for drawing complex shapesPOINT(x,y)— returns the color number at a given location
Coordinates could be specified relative to the last point using the @ symbol, e.g., PSET @(5,5),3.
Example Program
1 CLS
2 FOR X%=30% TO 1% STEP -2%
3 ? AT(X%,1%);"*"
4 ? AT(X%,20%);"*"
5 NEXT X%
This program clears the screen, then prints asterisks in two horizontal lines at Y positions 1 and 20, using the ? shorthand for PRINT and the AT command for cursor positioning.