ProgressBASIC

!!! Alpha version !!! Build 10160This article contains features that are only available in development versions.Click here to see more information about the current update.Almost perfect...?The Progressbar95 Wiki needs more information on this page. Click here to add more.

### Use

Write simple programs

**ProgressBASIC** (known as **PBASIC** before version 0.9970) is a programming language introduced in version 1.00 (or 0.9966 in cases of development) and improved in version 1.0160. It was created by Progressdata Refinement Department, and is available exclusively on 8-BIT computers. It is based on BASIC (Beginners' All-purpose Symbolic Instructional Code), a programming language created in 1964. Like BASIC, ProgressBASIC is used to write simple programs, which will, however, net a command bonus if the program is run successfully.

The basis of the language depends on the computer being used.

* In Pyrus -, it is possibly based on the custom display of the Apple I, according to its manual.
* In TPB-80, it is possibly based on TRSDOS.
* In Pabari 950, it is based on Atari BASIC.
* In Pomodoro 84, it is based on Commodore BASIC.
* In BX Spectre, it is based on Sinclair BASIC.
* In Pyrus =, it is based on Apple ProDOS.

## Commands

* Conditional
* Mathematical Functions
* Geometry
* File Commands
* Programming Commands

* IF
* FOR

## Description

The conditional operator. To execute **ACTION1**, the **CONDITION** must be true, or else the optional **ACTION2** will execute. If you use only the ELSE command, the "ELSE without IF" bonus will be awarded at the end of a level.

## Usage

```
**IF (CONDITION) THEN (ACTION1) ELSE [ACTION2]**

```

## Overview

CONDITION - is a boolean operation.

ACTION1 - is either a GOTO function or a variable assignment.

ACTION2 - (optional) same as ACTION1, but only executes if CONDITION is false.

## Example

**10 LET FOO=10**
**20 IF FOO>5 THEN GOTO 40**
**30 ELSE FOO=50**
**40 LET FOO=20**
**50 PRINT FOO**

## Description

Create a loop to repeat commands several times.

## Usage

**FOR VAR=VALUE1 TO VALUE2**
**-- SOME COMMANDS HERE --**
**NEXT VAR**

## Overview

VAR is a variable, VALUE1 is the starting value, it can be a number or a variable, VALUE2 is the finishing value. FOR must have NEXT at the end of the commands list!

## Example

**10 FOR I=1 TO 5**
 **20 PRINT I**
**30 NEXT I**

* SIN
* COS
* TAN
* PLUS
* MINUS
* MULTIPLY
* DIVIDE

## Overview

VALUE - is a number or an expression. It represents an angle in degrees.

## Overview

VALUE - is a number or an expression. It represents an angle in degrees.

## Overview

VALUE - is a number or an expression. It represents an angle in degrees.

## Overview

X and Y - are numbers or expressions

* PLOT
* LINE
* CIRCLE

## Description

Create a point/pixel at the (X1,Y1) coordinates.

## Overview

X1 and Y1 are either numbers or expressions.

## Example

**10 FOR I=1 TO 10**
**20 PLOT RND(160), 100**
**30 NEXT I**

## Description

Creates a line between the (X1,Y1) and (X2,Y2) points.

## Overview

X1, Y1, X2 and Y2 are either numbers or expressions.

## Example

**10 FOR I=1 TO 50**
**20 LINE 10, I\*2, 90, I\*2**
**30 NEXT I**

## Description

Creates a circle with the (X1,Y1) point as the center and RADIUS as its radius.

## Overview

X1, Y1 and RADIUS are either numbers or expressions.

## Example

**10 FOR I=1 TO 16**
**20 CIRCLE 80, 80, I\*2**
**30 NEXT I**

* LOAD
* SAVE
* CLEAR
* RUN

## Description

Loads a program from the tape to the memory.

## Overview

VALUE - is either a number (tape number) or a string (program name).

## Example

**LOAD ""** - Loads the next program.

**LOAD "Progressoid"** - Loads the "Progressoid" program.

**LOAD 1** - Load from slot #1.

## Example

**SAVE 2** - Save the program to slot #1.

## Description

Removes a PBASIC program from the memory.

## Example

**RUN**

* EDIT
* DELETE
* LIST
* PBLOAD
* PBSAVE
* PRINT
* INPUT
* COLOR
* FILL
* CLS
* RND
* BACKGROUND
* GOTO
* REM

## Description

Loads a PBASIC program from the tape to the memory.

## Overview

VALUE - can be a string (program name) or a number (slot index).

## Overview

VALUE - is a number (slot index) (Has only 3 slots at the time)

## Example

**10 PRINT "HELLO WORLD!"** - Output: HELLO WORLD!.

**10 LET FOO="BAR"**
**20 PRINT FOO** - Output: BAR.

## Description

Reads data from the keyboard into a variable.

## Example

**10 PRINT "ENTER DATA!"**
**20 INPUT I**
**30 PRINT I**

## Description

Sets the color of a graphic element (plot, line, circle, etc.).

## Overview

VALUE can be a string or an expression. Range is 1-16.

## Example

**10 FOR I=1 TO 16**
**20 COLOR I**
**30 CIRCLE 80, 100, I**
**40 NEXT I**

## Description

Fills a closed contour of pixels with a specific color.

## Example

**10 CIRCLE 100,50,25**
**20 FILL 100,50,4**

## Overview

This command does not feature any parameters.

## Description

Generates a random number between 1 and VALUE.

## Example

**10 FOR I=1 TO 16**
**20 PRINT RND(95)**
**30 NEXT I**

## Overview

VALUE can be a string or an expression. Range is 1-16.

## Example

**10 FOR I=1 TO 16**
**20 BACKGROUND I**
**30 NEXT I**

## Example

**10 LET FOO=40**
**20 GOTO FOO**
**30 PRINT "SKIP THIS ONE"**
**40 PRINT "DESTINATION"**

## Description

Adds an optional commentary. The interpreter ignores such lines.

## Example

**10 REM \*\*\*\*\*\*\*\*\*\*\*\*\*\***
**20 REM \* MY PROGRAM \***
**30 REM \*\*\*\*\*\*\*\*\*\*\*\*\*\***
**40 PRINT "HELLO!"**
## Errors

Errors are what you see when your code doesn't work.

* NIL
* SYNTAX ERROR

Nil is an error you get when there's not enough infromation.

Syntax Error is an error you get when you have made a mistake on the syntax of your code.

## Undefined Mathematical Functions

These are undefined math functions.

* Dividing by 0
* Inf/Inf
* Inf\*0
* Inf/0
* Nan\*0
* Nan/0
* Nan\*Inf
* Nan/Inf
* Inf/Nan

It gives you "INF" (Infinite).

It gives you "NaN" (Not a Number).

It gives you "NaN" (Not a Number).

It gives you "INF" (Infinite).

It gives you "NaN" (Not a Number).

It gives you "NaN" (Not a Number).

It gives you "NaN" (Not a Number).

It gives you "NaN" (Not a Number).

It gives you "NaN" (Not a Number).

## Trivia

* Attempting to go into a loop that goes on and on will award you the "Infinite loop" bonus.
* If you have used up all of the memory, ProgressBASIC will give a message saying "The memory is full!". It is unknown if it gives you a bonus.