<script type="text/javascript"> document.body.oncopy = function() { if (window.clipboardData) { setTimeout(function() { var text = clipboardData.getData("text"); if (text && text.length>300) { text = text + "/r/n/n本文来自CSDN博客,转载请标明出处:" + location.href; clipboardData.setData("text", text); } }, 100); } } </script> <script>function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>
array of const
Delphi的Format函数大家都用得很多,第二个参数用着确实很方便。最近在数 据库开发应用中需要自己创建一个带array of const参数的函数,对于常用的类型String,Integer,Pointer处理都没什么问题,但当用到Widestring类型时却出错,摸索 了一上午,感觉获益良多。现在将问题、解决问题的思路、分析方法等一一道来,希望对诸君有所启发就达到了我写这篇文章的目的了!
环境:Winxp + D7 进入D7,在默认的新建工程中增加一过程Test(m: Array of const); procedure TForm1.test(m: array of const); var i, zero: Integer; s, t: String; c: Char; const sBoolean: Array [Boolean] of string = ('False', 'True'); begin s := ''; for i := 0 to High(m) do with m[i] do case VType of //写到这,按住Ctrl点击VType,打开System单元,将VType的枚举值贴到Case语句 vtInteger: (VInteger: Integer; VType: Byte); vtBoolean: (VBoolean: Boolean); vtChar: |