计算机英语的四种变量,计算机英语:BASIC语言变量

计算机英语:BASIC语言变量

分类:软考

|

更新时间:2016-07-07|

来源:中华网考试

BASIC Variables

BASIC is designed to allow simple programs to be developed quickly,and is widely used on micro-computers.There are many versions of BASIC:However an ANSI standard does exist. Most versions are interpreted interactively, with, statements checked as they are typed in.

The end of a line serves to delimit declarations and statements.Colons can be used in most versions of BASIC to separate statements on the same line. All lines have to be numbered, and these numbers serves labels used as the destination of GOTO and GOSUB (subroutine call) statements.Standard BASIC allows up to two characters to be used as identifiers:a letter followed by a digit. Comments are prefixed by REM (for remark).

Types available vary with different versions.On the PET personal computer, there are point floating numbers (the default assumption for an identifier),integers (identifiers ending in%)and strings(identifiers ending in$).Variables of these types don’t have to be declared-, numbers have value()NN-handiest used, strings are null when first used . Howe herewith BASIC on some machines. variables do not have default initialization and an error is indicated if one tries to use an undefined variable.Explicit type con-version is possible, e.g. VAL converts a string representing a number to that number. Multi -dimensional arrays are static and declared using DIM.There are no records.

翻译:

BASIC语言变量

BASIC语言设计得允许迅速开发简络程序,同时它也被广泛地用到微机土。BASIC语言有许多版本,但的确存在着一种ANSI标准文本。大多数版本的BASIC语言,当其语句被键入时,该语句一边被检查,一边被交互地解释。

行结束符是用来给说明及语句定界的,大多数BASIC的版本中, 冒号被用来将同一行的语句分开。 所有的行均必须加以编号,这些编号被用作GOTO和GOSUB(一子程序 调用)语句的目的地的标号。标准的BASIC允许用多达二个字符作为 标识符:一个字母后跟一位数字, 注释前面冠有REM(注释)标志。

可用的变量类型随版本不同而 各异。在PET个人计算机中,有浮点 数型(缺省值假定为某一标识 符)、整型〔标识符用%来结尾〕和 字符串型(标识符用¥)。若这些 类型的变量末被说明,则当它们第 一次被用到时,数字值为O,字符串则为空。但是,在某些机器的BASIC中,变量并没有缺省值初始 化,如果有谁试图使用一个未加定义的变量的话,机器将批示为错误。类型的简易转换是可能的,如VAL可将代表一个数的串转换为该 数。多维数组是静态的,DIM利用 加以说明,BASIC中没有一记录。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值