关于array of pchar 与 string 之间的转换问题(50分)

  • 主题发起人 主题发起人 Jacobi
  • 开始时间 开始时间
J

Jacobi

Unregistered / Unconfirmed
GUEST, unregistred user!
type
Tid3v1= record
Tag: array[0..2] of char
//00..02 , ='TAG'
Title:array[0..$1d] of char
//03..20
Artist:array[0..$1d] of char
//21..3e
Album:array[0..$1d] of char
//3f..5c
Year:array[0..3] of char
//5d..60
Comment:array[0..$1c] of char
//61..7d
Track:byte
//7e
Genre:byte
//7f
end;

我在修改的时候:
MyID3v1.title := edtTitle.text;
MyID3v1.artist := edtArt.text;
........

报错说“类型不匹配”,哪位富翁帮帮我吧,应该很容易的,但是我就是不知道怎么办
呵呵,多谢了!
 
CopyMemory(@MyID3v1.title[0],pchar(Edit1.Text),length(Edit1.Text));
 
lstrcpy(@Myid3v1.title, pchar(edit1.text));
 
StrPCopy(MyID3v1.title,edtArt.text)
 
PBYTE(STRING)^
 
StrPCopy(Myid3v1.title, edit1.text);
strPCopy的解释见帮助
Copies a Pascal string to a null-terminated string.
function StrPCopy(Dest: PChar
const Source: string): PChar;
Description
StrPCopy copies a Pascal-type string Source into a null-terminated string Dest.
It returns a pointer to Dest.
StrPCopy does not perform any length checking.
The destination buffer must have room for at least Length(Source)+1 characters.
与之对应的函数为StrPas,基本上这两个就够了!
 
多谢了,可惜我积分不多,只能每位才10分,呵呵
 
后退
顶部