首页>计算机>软件水平考试>复习指导>正文
计算机英语考试:BASIC语言控制语句

www.zige365.com 2008-11-24 23:03:44 点击:发送给好友 和学友门交流一下 收藏到我的会员中心
BASIC Control Statements   
  Program control structures are primitive.Several forms of if statement man be available:   
  if<expression>go to<statement number>   
  if<expression> then <jump>   
  if<expression) then<jump)else<junip>     
  where   
  <jump>::=<statement number>|goto<statement number>|  
  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 <expression> goto <statement number list>   
  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<转移>    
  式中    
  <jump>::=<语句号(码)>|goto<语句号(码)>|   
  对于算术表达式来说,一个零值可以作为布尔“假”来对待,而 非零值可作为布尔“真”来对待, 选择也可由如形式on语句来实现:    
  on<表达式>goto<语句号(码)表    
  如果该表达式的值被定为m则 第n条语句号(码)被选择为GOTO的目的地。    
  迭代可由for语句提供,有时也可由repeat语句提供,否则需要GOTO语句。    
  有些BASIC的版本(包括标准版本)具有带参数的子程序(过程及函数)。对另一些版本来说,控制(转移)是直接用GOSUB(代替GOTO)来 传送给一个子程序的开始部的,还 有一个[ENTER]语句,用来将控制. (转移)传递回GOSUB之下的那一 行。    
  BASIC不适用于大型程序,区为它缺少模块化特性。即使对小应程序中的应用,BASIC也可能会受到批评,因为还有另一些语言可用,这些语言要求显示说明,更好的详细结构化编程,以养成良好的编程风格,从而编出更易读色程序。标准化来得太晚,以致于天 能阻止不兼容的执行过程的激增.这样就损害了程序的可移植性,这与BASIC的广泛的适用性的优点是飞背道而驰的。这样就损害了程序的可移植性,这 与BASIC的广泛的适用性的优点是 飞背道而驰的。
我要投稿 新闻来源: 编辑: 作者:
相关新闻
软件水平考试:从测试用例看测试的问题及变化
计算机软件水平考前辅导ASP与数据库运用:密码验证
软考辅导:三考三捷我是怎么备考和应考的
计算机软件水平考试:从一个程序出发详细研究DataReade