← 都来码 / Dolaima← 例程索引dbase/demo/demo_std.prg 原文

dbase/demo/demo_std.prg · 1012 字节 · 下载原文

* demo_std.prg —— dBase (xBase) 第一层:**标准输出**(std)
* demo_std.prg -- dBase (xBase) layer 1: **standard output** (std)
*
* 只用 `?` 与 `DO WHILE` 循环,不碰 Crt / BGI / 宿主 `ui_*`。
* Only `?` and a DO WHILE loop; no Crt / BGI / host `ui_*`.
*
* 跑法(桌面 vmlcli):
* How to run (desktop vmlcli):
*   dotnet scripts/vmlcli/bin/Release/net10.0/vmlcli.dll Examples/dbase/demo/demo_std.prg
*
* 本前端的两个事实:
* Two facts about this frontend:
*   ① `?` 把表达式**直接拼接**打印(不加分隔符),末尾自动换行。
*   ① `?` prints expressions **concatenated** (no separators) and adds a newline.
*   ② 数值转串用 `STR(n)`。
*   ② use STR(n) for number-to-string.

? "=== dBase 标准输出 demo ==="
? "=== dBase standard output demo ==="
? "你好,世界 / hello, world"
? "整数: " + STR(42)
? "计算: 7 * 6 = " + STR(7 * 6)

i = 1
s = 0
DO WHILE i <= 10
  s = s + i
  i = i + 1
ENDDO
? "循环求和: 1..10 = " + STR(s)