For faster navigation, this Iframe is preloading the Wikiwand page for Turbo BASIC.

Turbo BASIC

Turbo BASIC是一个BASIC 编译器与编辑器,最初由Robert 'Bob' Zale所开发,后来被Borland买下。当Borland决定不再贩售之后,Zale从Borland手中买回它,将它改名为PowerBASIC并创立PowerBASIC公司,以继续支援与研发。今天仍然存在市面上。

这个软件在1987-1988年期间,和Borland的Turbo Pascal 4.0, Turbo C 1.0/1.5,与Turbo Prolog 1.1相似,以"black screen"为特征。到了1989年推出Turbo C 2.0, Turbo C++ 1.1,……等时,Borland便不再没有采取它注册商标式的"blue screen" IDE。在这时,Turbo Basic与Turbo Prolog不再贩卖。

与这个时期的多数BASIC编辑器不同的是,Turbo BASIC是个完整的编译器,能编译出MS-DOS底下的原生程式码。其它编辑器或许是直译器,或者是大量依赖于执行函式库。Turbo Basic的整合化开发环境能在其中执行一个BASIC程式(参见下面的例子)以为传统BASIC测试,或是产生完全独立的MS-DOS可执行档(.EXE),能在其它没有安装Turbo BASIC或是其执行函式库的电脑上执行。当然编译出来的可执行程式档会比原来仅含程式码的.bas档案大得多。

Turbo Basic声称其乃以x86组合语言撰写,所编译出来的程式比其他程式所编译的执行速度较快。另外,因为早期对于中文系统的缺陷,Turbo Basic在中文环境下的使用存在一些问题。例如,在倚天中文环境底下虽然可以显示中文文字,但是IDE有乱码,且使用其INPUT命令并不能直接输入中文字。后来的UCDOS,天汇等汉字系统已经能够很好地支持Turbo BASIC。在Turbo Basic的IDE编辑环境中,甚至在Turbo Basic所编译出的软件中,都可以顺利地输入中文字。

程式码范例

[编辑]

下面的程式例子是Turbo Basic所支援的类似ALGOL之BASIC语法。与传统使用行号的,而控制结构有限且不支援类似ALGOL之副程式的BASIC编程语言不同的是,在这个时期出现的现代BASIC编辑器的功能扩充了,放弃了行号,加入了结构化程式设计所需的控制结构与副程式定义,使得这类语言符合现代的结构化编程理论。

INPUT "What is your name:", A$
PRINT "Hello "; A$
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$ = LEFT$(Q$, 1)LOOP WHILE(Q$ = "Y")OR(Q$ = "y")PRINT "Goodbye "; A$

像这个时代的其它Borland产品,程式码执行于IDE里。

{{bottomLinkPreText}} {{bottomLinkText}}
Turbo BASIC
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?