PBScript 编程

标识符

PB 的标识符不区分大小写。

英文字母,下划线 可用于标识符开头
连字符 -、美元符号 $、井号 #、百分号 %  
加冒号为标号 用于 GOTO 语句

保留字

CONSTANT 常量标识符
This 代表对象本身
ParentWindow 仅在菜单中使用,表示菜单所在窗口
Super 代表父对象、父类
Alias and* autoinstantiate call case catch choose close* commit connect constant continue create* cursor declare delete describe* descriptor destroy Disconnect do dynamic else elseif end enumerated event execute exit external false fetch finally first for forward from function global goto halt if immediate indirect insert into intrinsic is last library loop next not of on open* or parent post* prepare prior private privateread privatewrite procedure protected protectedread protectedwrite prototypes public randonly ref return rollback rpcfunc select selectblob shared static step subroutine super system systemread systemwrite then this throw throws to trigger true try type until update* updateblob using variables while with within _debug
上述带星号*的为函数  

注释

// 注释文本 单行注释
/* 注释文本 */ 多行注释

语句

分号 ; 表示语句结束,不强制要求使用
续行 & 在行尾表示续行,不要用于注释中

数据类型

Integer Int 16 位整数
UnsignedInteger  UnsignedInt Uint 16 位无符号整数
Long 32 位整数
UnsignedLong  Ulong 32 位无符号整数
Boolean 布尔型
Blob 二进制数据
Real 6 位精度浮点数
Double 15 位精度浮点数
Character  Char 字符
String 字符串
Date 日期,YYYY-MM-DD
Time 时间,HH:MM:SS:mmmmmmm
DateTime 日期时间
Decimal  Dec 18 位有效数字的十进制数
ANY 通用类型,可存储各种类型的值
枚举类型 以叹号!结尾,只能使用 PB 已经定义的

字符串转义符

~~ 表示转义字符 ~
~n 表示换行
~" 表示双引号