delphi字符串转换为char数组
var
arrChar : array [0..4] of Char;
b : Byte;
s : string;
begin
s := 'Test';
Move(Pointer(s)^, arrChar, Length(s)); //string to array of char
ShowMessage(arrChar);
b := Ord(s[1]); //First byte string to one single byte
ShowMessage(Char(b));
end;
相关文档:
Delphi和C++数据类型对照表
Delphi 字长/值域 C++
ShortInt &n ......
Procedure TForm1.Button1Click(Sender: TObject);
Var
xmlstr,FileName: String;
f: Textfile;
Begin
xmlStr := '<?xml version="1.0" encoding="gb2312"?>';
xmlstr := xmlstr + '<user><name>张三</name><sex>男</sex></user>';
sh ......
Delphi 关键字详解---absolute//它使得你能够创建一个新变量, 并且该变量的起始地址与另一个变量相同.
var
Str: string[32];
StrLen: Byte absolute Str;
//这个声明指定了变量StrLen起始地址与Str相同.
//由于字符串的第0个位置保存了字符串的长度, 所以StrLen的值即字符串长度.
begin
Str := 'abc';
Edit ......
1、TStringList支持的最大行数是多少?(http://topic.csdn.net/t/20060209/14/4547405.html)
楼主结论:“TStringList的LoadfromFile函数应该只能读取15万行以内的数据,但TStringList和TList的Add函数可以加到几百万行(甚至更多)也不会出错。程序出错的原因应该是Add非法内存指针导致的,正如tanlim(求学者) &nb ......
Delphi in a Unicode World Part II: New RTL Features and
Classes to Support Unicode
By: Nick
Hodges
原文链接:http://dn.codegear.com/article/38498
Abstract: This article will cover the new features of the Tiburon
Runtime Library that will help handle Unicode strings.
//
& ......