Chr(charcode) 返回 string,其中包含有与指定的字符代码相关的字符
四.转换函数
CBool(expression) 转换为Boolean型
CByte(expression) 转换为Byte型
CCur(expression) 转换为Currency型
CDate(expression) 转换为Date型
CDbl(expression) 转换为Double型
CDec(expression) 转换为Decemal型
CInt(expression) 转换为Integer型
CLng(expression) 转换为Long型
CSng(expression) 转换为Single型
CStr(expression) 转换为String型
CVar(expression) 转换为Variant型
Val(string) 转换为数据型
Str(number) 转换为String
五.时间函数
Now 返回⼀个 Variant (Date),根据计算机系统设置的⽇期和时间来指定⽇期和时间。
Date 返回包含系统⽇期的 Variant (Date)。
Time 返回⼀个指明当前系统时间的 Variant (Date)。
Timer 返回⼀个 Single,代表从午夜开始到现在经过的秒数。
TimeSerial(hour, minute, second) 返回⼀个 Variant (Date),包含具有具体时、分、秒的时间。
DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]]) 返回 Variant (Long) 的值,表⽰两个指定⽇期间的时间间隔数⽬
Second(time) 返回⼀个 Variant (Integer),其值为 0 到 59 之间的整数,表⽰⼀分钟之中的某个秒
Minute(time) 返回⼀个 Variant (Integer),其值为 0 到 59 之间的整数,表⽰⼀⼩时中的某分钟
Hour(time) 返回⼀个 Variant (Integer),其值为 0 到 23 之间的整数,表⽰⼀天之中的某⼀钟点
Day(date) 返回⼀个 Variant (Integer),其值为 1 到 31 之间的整数,表⽰⼀个⽉中的某⼀⽇
Month(date) 返回⼀个 Variant (Integer),其值为 1 到 12 之间的整数,表⽰⼀年中的某⽉
Year(date) 返回 Variant (Integer),包含表⽰年份的整数。
Weekday(date, [firstdayofweek]) 返回⼀个 Variant (Integer),包含⼀个整数,代表某个⽇期是星期⼏
第⼆章 扩展运⽤
第⼀节 全⾯控制 Excel
⼀、⾸先创建 Excel 对象,使⽤ComObj:
Dim ExcelID as Excel.Application
Set ExcelID as new Excel.Application
1) 显⽰当前窗⼝:
ExcelID.Visible := True;
2) 更改 Excel 标题栏:
ExcelID.Caption := \'应⽤程序调⽤ Microsoft Excel\';
3) 添加新⼯作簿:
ExcelID.WorkBooks.Add;
4) 打开已存在的⼯作簿:
ExcelID.WorkBooks.Open( \'C:\\Excel\\Demo.xls\' );
5) 设置第2个⼯作表为活动⼯作表:
ExcelID.WorkSheets[2].Activate;