Chinese BASIC

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Template:Short description Script error: No such module "Unsubst". Chinese BASIC (Template:Zh) is the name given to several Chinese-localized versions of the BASIC programming language in the early 1980s.

Versions

At least two versions of Chinese BASIC were modified Applesoft BASIC that accepted Chinese commands and variables. They were built into some Taiwan-made Apple II clones. One of these was shipped with the best-selling Multitech Microprofessor II (known as Acer today). Another version was shipped with MiTAC's Little Intelligent Computer (Script error: No such module "Lang".).[1]Script error: No such module "Unsubst".

Multitech also developed a Zilog Z80-based port of the Chinese BASIC for its own line of high-end computers.

Example

In a typical Chinese BASIC environment, Chinese and English commands are interchangeable. It may also accept Chinese and Latin alphabet variables. For example, you may use <templatestyles src="Mono/styles.css" />PRINT A in line 50, <templatestyles src="Mono/styles.css" />印 A in line 200 and <templatestyles src="Mono/styles.css" />? A in line 250. They all do the same thing—to print out the value of <templatestyles src="Mono/styles.css" />A on screen.

File:Keyboard layout Chinese Traditional.png
Chinese (traditional) keyboard layout
Chinese BASIC
commands are printed in <templatestyles src="Template:Color/styles.css" />blue
  Applesoft BASIC
<templatestyles src="Mono/styles.css" />10 卜=0   10 Y=0
<templatestyles src="Mono/styles.css" />20 水, 火   20 INPUT E, F
<templatestyles src="Mono/styles.css" />30 日 = 水   30 FOR A = E TO F
<templatestyles src="Mono/styles.css" />40 卜 = 卜+對數(日)   40 Y = Y + LOG (A)
<templatestyles src="Mono/styles.css" />50 下一   50 NEXT A
<templatestyles src="Mono/styles.css" />60   60 PRINT Y

This program calculates the sum of log (E) + log (E+1) + log (E+2) + ... + log (F)Script error: No such module "Check for unknown parameters".. The Chinese characters used as variables are the 24 radicals of the Cangjie method, one of the earliest QWERTY keyboard-compatible Chinese input methods.

The significant length of an Applesoft BASIC variable name is restricted to two bytes. Therefore, the variables <templatestyles src="Mono/styles.css" />THISNUMBER and <templatestyles src="Mono/styles.css" />THATNUMBER are treated as the same. In Multitech's Chinese BASIC, a variable can be 3 bytes long (one Chinese character + one numeral).

See also

References

<templatestyles src="Reflist/styles.css" />

  1. Script error: No such module "citation/CS1".

Script error: No such module "Check for unknown parameters".

External links

Script error: No such module "Navbox".