1、Cardinal这种类型?
例如Timer1.Interval,我怎么才能把STRING转换为Cardinal?
不就是无符号的32位整数
StrToIntDef(S,0);就是了,比直接用StrToInt保险的
2、GetMem函数
开辟内存,相当于c的malloc
var
myString:PChar;
Begin
GetMem(String,1024);//开辟1024个字节
FREEMEM(String,1024);//释放
end;
3、GetComputerName函数
var
ComputerBuf:array[0..127] of Char;
ComputerBufLen: DWord;
begin
ComputerBufLen:=128;
GetComputerName(ComputerBuf ,ComputerBufLen) ;
Showmessage(ComputerBuf);
end;
4、mod 和div 函数
如果
a ÷ b = c …… d
则
a mod b = d //mod为取余数
a div b = c //div为取商