02 2013 档案

摘要:1、从www.mysql.com下载mysql并安装,配置并启动mysql服务注意:目前,XE3文档中提到,目前支持到mysql 5.1,最新版5.6,经过我测试是连接总是不成功在此提供一个最小化的mysql5.1.68的绿色版,http://www.kuaipan.cn/file/id_70519068051405.htm2、在bin文件夹下查找libmysql.dll,这个文件也就是Connector/C (libmysql) ,dbexpress就是通过这个文件访问mysql的,把这个文件复制到%WinDir%\system32,或者把mysql的bin文件夹加入到path环境变量3、d 阅读全文
posted @ 2013-02-24 21:13 静候良机 阅读(1923) 评论(0) 推荐(0)
摘要:在函数中,使用Result作为返回变量,必须要等所有代码执行完成function TForm1.abc(x, y: Integer): Integer;begin if y = 0 then Result := 0 else Result := x / y;end;Delphi 2009,新增了Exit方法,指定返回值,同时退出函数function TForm1.abc(x, y: Integer): Integer;begin if y = 0 then Exit(0); Result := x / y; //如果y等于0,这一行不会被执行end;Exit方法,和C... 阅读全文
posted @ 2013-02-21 16:57 静候良机 阅读(833) 评论(0) 推荐(0)
摘要:本地变量,一般是随着函数执行结束,就不能再访问;而如果在匿名函数,访问了外部函数的本地变量,本地变量的生命周期会被扩展unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;type TIntSum = reference to procedure (x, y: Integer); TForm1 = ... 阅读全文
posted @ 2013-02-21 16:44 静候良机 阅读(596) 评论(0) 推荐(0)
摘要:在匿名函数中,可以修改本地变量的值unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs;type TIntSum = reference to procedure (x, y: Integer); TForm1 = class(TForm) procedure FormCreate(Sender: TObject); ... 阅读全文
posted @ 2013-02-21 16:24 静候良机 阅读(547) 评论(0) 推荐(0)
摘要:对于比较简单实现,不需要复用,开发者更喜欢在使用时,原地声明,而没有必要单独声明并实现这个方法对于使用C#和Objective-C的开发人员,应该很容易感受到匿名方法的便利。从Delphi 2009开始,Delphi也加入了对匿名方法的支持unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs;type //首先声明匿名方法的类型... 阅读全文
posted @ 2013-02-21 15:32 静候良机 阅读(1917) 评论(0) 推荐(1)
摘要:1、Code Foldingprocedure TForm1.btn1Click(Sender: TObject);begin{$REGION '测试区块'} ShowMessage('ok');{$ENDREGION}end;C##region Optional text that appears when the code block is folded...#endregion Objective-C#pragma region optional text...#pragma end_region 2、代码格式化3、 阅读全文
posted @ 2013-02-18 22:01 静候良机 阅读(366) 评论(0) 推荐(0)
摘要:NSMutableString *whole = [self.textView.textStorage mutableString]; [whole appendString:str]; NSURL *url = [NSURL URLWithString:[fileDir stringByAppendingFormat:@"%@.h", name]]; [str writeToURL:url atomically:YES encoding:NSUTF8StringEncoding error:nil]; NSData *data = [str d... 阅读全文
posted @ 2013-02-03 22:44 静候良机 阅读(197) 评论(0) 推荐(0)
摘要:// Create and configure the panel. NSOpenPanel* panel = [NSOpenPanel openPanel]; [panel setCanChooseDirectories:NO]; [panel setAllowsMultipleSelection:NO]; [panel setMessage:@"Import one or more files or directories."]; // Display the panel attached to the document's window. ... 阅读全文
posted @ 2013-02-03 21:54 静候良机 阅读(1061) 评论(0) 推荐(0)