delphi的帮助实在让人无比的心寒

murouwolf 2004-04-07 01:20:40
我在MSDN中从未见过象这么水的帮助:
he ini file format is still popular, many configuration files (such as the DSK Desktop settings file) are in this format. This format is especially useful in cross-platform applications, where you can't always count on a system Registry for storing configuration information. BaseCLX provides two classes, TIniFile and TMemIniFile, to make reading and writing ini files very easy.

TIniFile works directly with the ini file on disk while TMemIniFile buffers all changes in memory and does not write them to disk until you call the UpdateFile method.

When you instantiate the TIniFile or TMemIniFile object, you pass the name of the ini file as a parameter to the constructor. If the file does not exist, it is automatically created. You are then free to read values using the various read methods, such as ReadString, ReadDate, ReadInteger, or ReadBool. Alternatively, if you want to read an entire section of the ini file, you can use the ReadSection method. Similarly, you can write values using methods such as WriteBool, WriteInteger, WriteDate, or WriteString.

Following is an example of reading configuration information from an ini file in a form's OnCreate event handler and writing values in the OnClose event handler.

procedure TForm1.FormCreate(Sender: TObject);
var
Ini: TIniFile;
begin
Ini := TIniFile.Create( ChangeFileExt( Application.ExeName, '.INI' ) );
try
Top := Ini.ReadInteger( 'Form', 'Top', 100 );
Left := Ini.ReadInteger( 'Form', 'Left', 100 );
Caption := Ini.ReadString( 'Form', 'Caption', 'New Form' );
if Ini.ReadBool( 'Form', 'InitMax', false ) then
WindowState = wsMaximized
else

WindowState = wsNormal;
finally
TIniFile.Free;
end;
end;

基本的语法检查都欠缺
...全文
73 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
murouwolf 2004-04-08
  • 打赏
  • 举报
回复
我倒不是说我看不懂,只是觉得borland做得太水了啊。我以前刚学写程序的时候,喜欢照着例程敲代码,那时候最初级的语法检查都很有可能让我检查个好半天,我记得我学delphi的时候,刚学用if语句,结果因为BOOL变量让我检查了一下午,如果连官方自己提供的帮助都是不可靠的,那borland做得也太让人失望。以前我有一个朋友跟我抱怨说delphi的资料不好找,网上不多,当然那是几年前的时候,现在好象到处都是,不过我还是不清楚(delphi用得少,呵呵)。我只是觉得delphi那种不负责任的态度很容易引起coder的反感,前几日我看到有什么报道说现在delphi转.net的很多,楼上好象就有一个吧?borland应该出个象msdn之类的东东才好,个人感觉
getit911 2004-04-07
  • 打赏
  • 举报
回复
网上有各种关于delphi的资料集,都比help强,实在不行也可以看源码
Tensionli 2004-04-07
  • 打赏
  • 举报
回复
仅仅是供参考的,看看得了
猛禽 2004-04-07
  • 打赏
  • 举报
回复
呵呵,偶从来不尝试运行帮助中的代码,那个仅供参考
hhnick 2004-04-07
  • 打赏
  • 举报
回复
是,帮助的例子大部分都不能运行,错误一大堆。
stanely 2004-04-07
  • 打赏
  • 举报
回复
世界上没有完美的东西
ziqing 2004-04-07
  • 打赏
  • 举报
回复
这样练习英语
leeky 2004-04-07
  • 打赏
  • 举报
回复
帮助只是给你指一个路,你还要写得多么完美啊。
而且帮助总是就事论事,把焦点集中在目前的知识点。
CDSoftwareWj 2004-04-07
  • 打赏
  • 举报
回复
都N年了,早习惯了 hehe^^

828

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧