var tmp:PAnsiChar; for i:=0 to 28 do
begin
tmp:=PAnsichar('a'+inttostr(i));
TQRLabel(tmp).caption:=print_xzcfjds[i,0];
end;编译时出现如下错误:
Unsafe type 'PAnsiChar'
Unsafe typecast of 'PAnsiChar' to 'TQRLabel'
Unsafe type 'tmp: PAnsiChar'不知该怎么解决这个问题,请大家帮帮忙,多谢
begin
tmp:=PAnsichar('a'+inttostr(i));
TQRLabel(tmp).caption:=print_xzcfjds[i,0];
end;编译时出现如下错误:
Unsafe type 'PAnsiChar'
Unsafe typecast of 'PAnsiChar' to 'TQRLabel'
Unsafe type 'tmp: PAnsiChar'不知该怎么解决这个问题,请大家帮帮忙,多谢
可是你声明的tmp,为指向null结束的AnsiChar字符串指针..指针是存放变量地址的要.
你试试声明为tmp:string; 试一试.
Unsafe type 'PAnsiChar'
Unsafe typecast of 'String' to 'TQRLabel'
Application.Messagebox(pchar('未找到配置文件: ' +
ExtractFileName(ConfigFile) + '!'), '提示信息', MB_OK);说我"Unsafe type 'PChar'"
TQRLabel(tmp),这个是什么意思?字符串转换成Label?还是想找到名字叫这个字符串的Label?
如果是第二个,那就绝错。
有一个差不多的问题。