Questions tagged [turbo-basic]

Turbo Basic is a BASIC compiler developed by Borland for DOS in 1989. It includes a graphics API. It lives on as PowerBASIC.

Turbo Basic is a BASIC compiler and dialect originally created by Robert "Bob" Zale (1945-2012) and bought from him by Borland. When Borland decided to stop publishing it, Zale bought it back from them, renamed it to PowerBASIC and set up PowerBASIC Inc. to continue support and development of it.

This software is from the 1987-1988 period and features the Borland "black screen" similar to Turbo Pascal 4.0, Turbo C 1.0/1.5, and Turbo Prolog 1.1. Borland did not adopt its trademark "blue screen" integrated development environment until the 1989 period when Turbo C 2.0, Turbo C++ 1.1, etc. were released. By this time, Turbo Basic and Turbo Prolog were no longer being sold.

Borland's Turbo Basic contains extensions to classical Basic (while not breaking compatibility). One of those are drawing API, and mouse access.

Unlike most BASIC implementations of this period, Turbo Basic was a full compiler which generated native code for MS-DOS. Other implementations were either interpreters, or relied heavily on a runtime library. The integrated development environment could run a BASIC program internally for traditional BASIC debugging (see sample below), or generate an MS-DOS stand-alone executable file that could be run on other systems without the Turbo Basic product or runtime libraries.


Code example

The following program is an example of the ALGOL-like BASIC dialect that Turbo Basic supported. Unlike traditional BASIC, which used line numbers and had limited control structures and no support for ALGOL-like subroutines, modern BASIC dialects starting at this period were extended to make the language compatible with modern structured programming theory by discarding the line numbers and adding the control structures and subroutine definitions needed by structured programming.

INPUT "What is your name?: ", n$
PRINT "Hello "; n$
DO
  s$ = ""
  INPUT "How many stars do you want to print"; s
  FOR i = 1 TO s
    s$ = s$ + "*"
  NEXT i
  PRINT s$
  DO
    INPUT "Do you want to print more stars"; q$
  LOOP WHILE LEN(q$) = 0
  q$ = LCASE$(LEFT$(q$, 1))
LOOP WHILE q$ = "y"
PRINT "Goodbye "; n$

Note that s$ is a string and s is a single precision floating-point (number). They are separate variables.

Like the other Borland products of this era, the code executes within the integrated development environment.

via Wikipedia

5 questions
3
votes
1 answer

How can I include a ASM program into my Turbo Basic Program?

I found this ASM routine to get the key pressed. ASM routine to get key pressed Now I would like to include it to a Turbo Basic routine, but do not know how to do this. Can anyone here tell me how it is be done? THanks EDIT: I found a way: $INLINE,…
Walter Schrabmair
  • 1,251
  • 2
  • 13
  • 26
2
votes
2 answers

is there a way to read the Keyboard Modifier Key such as ALT or CTRL in DOS-Based Progarmms?

I do know that you might polling the keyboard buffer to get the Modifier Keys such as ALT or CTRL. But even in old DOS Programms there was an Action when I just pressed these keys (f.e. to change the Color of the MENU buttons by pressing ALT). Is…
Walter Schrabmair
  • 1,251
  • 2
  • 13
  • 26
1
vote
1 answer

An object as both an array and a variable?

I inherited this old TurboBasic code base, and I am converting it to something more modern. Can you explain how in this code snippet Wind can be both a variable and an array? Dim Wind(1:3,2:3) Sub WindFunction Shared Wind() local var …
Connor Albright
  • 723
  • 4
  • 13
  • 29
1
vote
3 answers

Using ParamArray ByRef

Is there any way to use ParamArray ByRef? Barring that, it there a workaround that accomplishes the same thing? I could do some overloads, but I am trying to avoid the clunkiness. Background: Porting over some old code, and trying to keep the same…
Connor Albright
  • 723
  • 4
  • 13
  • 29
0
votes
1 answer

vb.net equivalent of Using$()

Is there a modern vb.net equivalent to the Using$() function in [Turbo?] Basic?
Connor Albright
  • 723
  • 4
  • 13
  • 29