计算机英语:BASIC语言控制语句

计算机英语:BASIC语言控制语句,第1张

计算机英语:BASIC语言控制语句,第2张

BASIC Control Statements
  Program control structures are primitive.Several forms of if statement man be available:
  ifgo to
  if then
  if
  where
  ::=|goto
  For arithmetic expressions a zero value can be treated as Boolean false,non-zero as true, Selection can also be performed by the on statement of the form:
  On goto
  If the expression evaluates to n, the nth statement number is selected for the destination of the GOTO.
  Iteration may be provided by a for statement and sometimes also by a repeat statement, otherwise the GOTO is require.
Some versions of BASIC (including the standard) have subroutines (procedures and functions)with parameters.For others, control is simply passed to the start of a subroutine using GOSUB (instead of GOTO), and there is a [ENTER] statement to pass control back to the line below that of the GOSUB.
  BASIC is unsuitable for large programs,lacking modularization features.It can be criticized for user even in small programs,as there are other languages available which require explicit declarations and encourage better detailed structuring, giving rise to better programming style and hence more readable programs. Standardization has come too late to pre-vent a proliferation of incompatible implementations, compromising portability of programs;this must beset against the advantage of the wide availability of BASIC 。

翻译:
BASIC语言控制语句
  程序控制结构是原始的。if语句有几种形式可用:
  if<表达式>goto<语句号(码)>
  if<表达式>then<转移>
  if<表达式>then(转移)else<转移>
  式中
  ::=<语句号(码)>|goto<语句号(码)>|
  对于算术表达式来说,一个零值可以作为布尔“假”来对待,而 非零值可作为布尔“真”来对待, 选择也可由如形式on语句来实现:
  on<表达式>goto<语句号(码)表
  如果该表达式的值被定为m则 第n条语句号(码)被选择为GOTO的目的地。
  迭代可由for语句提供,有时也可由repeat语句提供,否则需要GOTO语句。
  有些BASIC的版本(包括标准版本)具有带参数的子程序(过程及函数)。对另一些版本来说,控制(转移)是直接用GOSUB(代替GOTO)来 传送给一个子程序的开始部的,还 有一个[ENTER]语句,用来将控制. (转移)传递回GOSUB之下的那一 行。
  BASIC不适用于大型程序,区为它缺少模块化特性。即使对小应程序中的应用,BASIC也可能会受到批评,因为还有另一些语言可用,这些语言要求显示说明,更好的详细结构化编程,以养成良好的编程风格,从而编出更易读色程序。标准化来得太晚,以致于天 能阻止不兼容的执行过程的激增.这样就损害了程序的可移植性,这与BASIC的广泛的适用性的优点是飞背道而驰的。这样就损害了程序的可移植性,这 与BASIC的广泛的适用性的优点是 飞背道而驰的。

位律师回复
DABAN RP主题是一个优秀的主题,极致后台体验,无插件,集成会员系统
白度搜_经验知识百科全书 » 计算机英语:BASIC语言控制语句

0条评论

发表评论

提供最优质的资源集合

立即查看 了解详情