龙七

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年7月14日

摘要: 分类运算符操作操作数结果类型范例算术运算符+加整数,实数整数,实数X + Y-减整数,实数整数,实数Result - 1*乘整数,实数整数,实数P * InterestRate/实数除整数,实数实数X / 2div整数除整数整数Total div UnitSizemod取模整数整数Y mod 6+(一元)符号等同整数,实数整数,实数+7-(一元)符号相反整数,实数整数,实数-X布尔运算符not否定布尔型Booleannot (C in MySet)and与布尔型BooleanDone and (Total > 0)or或布尔型BooleanA or Bxor异或布尔型BooleanA x 阅读全文
posted @ 2011-07-14 23:21 龙七 阅读(273) 评论(0) 推荐(0) 编辑

摘要: //TStringList 常用方法与属性:var List: TStringList; i: Integer;begin List := TStringList.Create; List.Add('Strings1'); {添加} List.Add('Strings2'); List.Exchange(0,1); {置换} List.Insert(0,'Strings3'); {插入} i := List.IndexOf('Strings1'); {第一次出现的位置} List.Sort; {排序} List.Sorted := 阅读全文
posted @ 2011-07-14 17:52 龙七 阅读(1786) 评论(0) 推荐(0) 编辑

摘要: 一:发送方View Code varhwnd:THandle;cpStruct:COPYDATASTRUCT;beginhwnd:=FindWindow(nil,PChar(FORMNAME));ifhwnd<>0thenbegincpStruct.dwData:=0;cpStruct.cbData:=length('test')+1;cpStruct.lpData:=pchar('test');SendMessage(Handle,WM_COPYDATA,0,Cardinal(@cpStruct));//lParam和wParam的顺序不能交换,具 阅读全文
posted @ 2011-07-14 13:59 龙七 阅读(275) 评论(0) 推荐(0) 编辑

2011年7月13日

摘要: ; not allowed before ELSEElSE前不允许有“;”<clause> clause not allowed in OLE automation section在OLE自动区段不允许“<clause>”子句<name> is not a type identifier<name>不是类型标识符<name> not previously declared as a PROPERTY<name>前面没有说明PROPERTYGOTO <label> leads into or out of TRY 阅读全文
posted @ 2011-07-13 17:37 龙七 阅读(266) 评论(0) 推荐(0) 编辑

摘要: 错误信息形式为: Run-time error nnn at xxxx; 其中nnn是运行时的错误编号; xxxx是运行时的错误地址.编号说明I/O错误: (编号100-149)100磁盘读错误,若要对超过格式文件尾进行读取时101磁盘写错误,若磁盘满时,由CloseFile,Write,Writeln或Flush报告102没有指定文件,若文件变量没有由Assign或AssignFile赋值,由Reset, Rewrite,Append,Rename和Erase报告103文件没有打开,若文件未打开,由CloseFile,Read,Write,Seek,Eof, FilePos,FileSize 阅读全文
posted @ 2011-07-13 17:36 龙七 阅读(1494) 评论(0) 推荐(0) 编辑

摘要: 在看 API 文档时, 我们经常见到 GetLastError; 它可以返回操作后系统给的提示.但 GetLastError 返回的只是一个信息代码, 如何返回对应的具体信息呢?FormatMessage 可以, 但这个函数太复杂了; 可以用 SysErrorMessage 代替它.举例:var err: string; ErrorCode: DWORD;begin ErrorCode:=GetLastError; ShowMessage(IntToStr(ErrorCode)); err := SysErrorMessage(ErrorCode); ShowMessage(err); {操作 阅读全文
posted @ 2011-07-13 14:26 龙七 阅读(535) 评论(0) 推荐(0) 编辑

摘要: 一:创建DLLView Code library DemoDll;{ Important note about DLL memory management: ShareMem must be thefirst unit in your library's USES clause AND your project's (selectProject-View Source) USES clause if your DLL exports any procedures orfunctions that pass strings as parameters or function re 阅读全文
posted @ 2011-07-13 10:29 龙七 阅读(417) 评论(0) 推荐(0) 编辑

摘要: //通过 DLL Wizard 建立: View Code library TestDll;{ Important note about DLL memory management: ShareMem must be thefirst unit in your library's USES clause AND your project's (selectProject-View Source) USES clause if your DLL exports any procedures orfunctions that pass strings as parameters o 阅读全文
posted @ 2011-07-13 10:13 龙七 阅读(242) 评论(0) 推荐(0) 编辑

2011年7月12日

摘要: /*创建触发器[T_INSERT_卷烟销售表],该触发器较复杂。说明: 每当[卷烟库存表]发生 INSERT 动作,则引发该触发器。触发器功能: 实现业务规则。业务规则: 如果销售的卷烟品牌不存在库存或者库存为零,则返回错误。否则则自动减少[卷烟库存表]中对应品牌卷烟的库存数量和库存金额。*/IF EXISTS (SELECT NAME FROM SYSOBJECTS WHERE XTYPE = ’TR’ AND NAME = ’T_INSERT_卷烟销售表’)DROP TRIGGER T_INSERT_卷烟销售表GOCREATE TRIGGER T_INSERT_卷烟销售表ON 卷烟销售表F 阅读全文
posted @ 2011-07-12 17:53 龙七 阅读(190) 评论(0) 推荐(0) 编辑

摘要: 定义: 何为触发器?在SQL Server里面也就是对某一个表的一定的操作,触发某种条件,从而执行的一段程序。触发器是一个特殊的存储过程。 常见的触发器有三种:分别应用于Insert , Update , Delete 事件。 我为什么要使用触发器?比如,这么两个表: Create Table Student( --学生表 StudentID int primary key, --学号 .... ) Create Table BorrowRecord( --学生借书记录表 BorrowRecord int identity(1,1), --流水号 StudentID int , --学号 Bo 阅读全文
posted @ 2011-07-12 17:50 龙七 阅读(236) 评论(0) 推荐(0) 编辑