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

True BASIC

此条目翻译品质不佳。 (2017年1月5日)翻译者可能不熟悉中文或原文语言,也可能使用了机器翻译。请协助翻译本条目或重新编写,并注意避免翻译腔的问题。明显拙劣的翻译请改挂((d|G13))提交删除。

True BASICBASIC的一种,由原来的BASIC作者约翰·凯梅尼及托马斯·卡茨两位教授所创立。他们有感自从BASIC这种编程语言微电脑上风行以来,其设计都与原来BASIC的设计逐渐偏离,所以他们希望可以透过这一套True BASIC语言来重新强调BASIC语言所应有的设计特色,使到原来为迷你电脑小型电脑设计的BASIC程序可以更好地移殖到微机上使用。巧合的是,当时所风行的各个BASIC版本,不论是苹果电脑Applesoft BASICMS-DOSGWBASICQuick BASIC,都是由微软所开发的。就连第一套编译式的BASIC版本、BorlandTurbo BASIC,也是基于微软的GW-BASIC语言。[1]

简介

True BASIC的语法是基于Dartmouth BASIC的版本7,于1985年开始推出市面。True BASIC在绘图方面的功能大大加强:它除了允许用户重新定义在640×480分辨率之下的16种颜色的调色板以外,亦增加了对绘画曲线图的支持。它更在语言中加入BitBLT的功能,并容许用户截取画面的部分并存储。这些绘图功能都是1980年代的迷你电脑BASIC的标准功能,但在微机版本上都欠奉的。

True BASIC在语法上尽可能忠于ANSI BASIC。为使用户设计出更好结构的程序,True BASIC取消了对GOTO命令及行号的支持。而这两项功能,微软一直到现在的Visual BASIC还在保留。不过,True BASIC亦允许用户在指示数值时省略LET命令。而对于变量的命名,亦由ANSI BASIC所要求的一个字母加一个数字,改为容许较长的描述性变量名称。

以下是一个用True BASIC所写的程序,用来计算 这条方程式:

slope = 2
let x = 3
y_intercept = 4
let y2 = slope * x + y_intercept
print "y2="; y2

这段代码执行后会显示:

y2= 10

True BASIC所提供的另外一个在较大型机很常见,但在微机电脑很少见的功能就是矩阵递归计算功能的支持。由于记忆所限,很多美国设计的微机BASIC都没有提供矩阵计算(但英国BBC、Acorn、Amiga的BASIC却有提供)。而True BASIC对global及local变量的支持,使recurssive的程序得以实现。这其实是因为当True BASIC推出之时,当时的微机的功能已经很强,足以比美较大型的电脑的缘故。

今天的True Basic包含着编译器在里面,可以将程序编译成可执行档。另外也支持Mac平台(classic OS),不过尚不支持MacOS X。

参考书目

  1. ^ 《家庭微电脑》创刊号,True BASIC专栏。
  2. ^ Kemeny, John G.; Kurtz, Thomas E. (1985). Back To BASIC: The History, Corruption, and Future of the Language. Addison-Wesley. 141 pp. ISBN 0-201-13433-0.

参看

外部链接

{{bottomLinkPreText}} {{bottomLinkText}}
True 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?