摘要:1、检测主程序大小,防止破解补丁之类:function tform1.gesselfsf: integer;varf: file of byte;begin filemode:=0; assignfile(f,.\filename.exe); reset(f); result:=filesize(f); closefile(f);end;2、检测创建日期和时间,让破解补丁实效:function t......
摘要:delphi7对xml的支持分析zhjdelphi7对xml的支持---txmldocument类 delphi7 支持对xml文档的操作,可以通过txmldocument类来实现对xml文档的读写。可以利用txmldocument把xml文档读到内存中,从而可以进行编辑、保存操作。txmldocument类是通过dom(文档对象模型)接口来访问xml文档中的各个元素的。对于dom接口的实现有多种......
Delphi字符串函数大全
上一页 ... 说明 decodesoundexint(soundexint(hello)) 相当于 soundex(hello) 参考 <null> 【程序编程相关:
用 Delphi 学设计模式(二) 之 】 【推荐阅读:
lua头文件的pas翻译_lua.h
】 例子 edit2.text := decodesoundexint(spinedit2.value); 【扩展信息:
用程序实现压缩access(*.mdb)】 ━━━━━━━━━━━━━━━━━━━━━ 首部 function soundexword(const atext: string): word; $[strutils.pas 功能 返回探测文字数值 说明 没有参数alength已经固定为4 参考 <null> 例子 spinedit2.value := soundexword(edit1.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function decodesoundexword(avalue: word): string; $[strutils.pas 功能 返回探测文字数值的解码 说明 decodesoundexword(soundexword(hello)) 相当于 soundex(hello) 参考 <null> 例子 edit2.text := decodesoundexword(spinedit2.value); ━━━━━━━━━━━━━━━━━━━━━ 首部 function soundexsimilar(const atext, aother: string; alength: tsoundexlength = 4): boolean; $[strutils.pas 功能 返回两个字符串的探测字符串是否相同 说明 result := soundex(atext, alength) = soundex(aother, alength) 参考 <null> 例子 checkbox1.checked := soundexsimilar(edit1.text, edit2.text, spinedit1.value); ━━━━━━━━━━━━━━━━━━━━━ 首部 function soundexcompare(const atext, aother: string; alength: tsoundexlength = 4): integer; $[strutils.pas 功能 返回比较两个字符串的探测字符串的结果 说明 result := ansicomparestr(soundex(atext, alength), soundex(aother, alength)) 参考 function sysutils.ansicomparestr 例子 spinedit2.value := soundexcompare(edit1.text, edit2.text, spinedit1.value); ━━━━━━━━━━━━━━━━━━━━━ 首部 function soundexproc(const atext, aother: string): boolean; $[strutils.pas 功能 调用soundexsimilar返回两个字符串的探测字符串是否相同 说明 系统变量ansiresemblesproc的默认值 参考 function strutils.ansiresemblestext 例子 [var ansiresemblesproc: tcomparetextproc = soundexproc;] ━━━━━━━━━━━━━━━━━━━━━ 首部 function newstr(const s: string): pstring; deprecated; $[sysutils.pas 功能 返回一个新的字符串指针地址 说明 字符串s为空时返回nullstr 参考 procedure system.new 例子 ////////begin newstr,disposestr procedure tform1.button1click(sender: tobject); var p: pstring; begin p := newstr(edit1.text); edit2.text := p^; disposestr(p); end; ////////end newstr,disposestr ━━━━━━━━━━━━━━━━━━━━━ 首部 procedure disposestr(p: pstring); deprecated; $[sysutils.pas 功能 释放字符串指针p资源 说明 配合函数newstr使用 参考 procedure system.dispose 例子 <如上参见,如下参见> ━━━━━━━━━━━━━━━━━━━━━ 首部 procedure assignstr(var p: pstring; const s: string); deprecated; $[sysutils.pas 功能 将字符串s更新给字符串指针p 说明 更新值时会释放以前字符串指针的资源 参考 function sysutils.newstr;function sysutils.disposestr 例子 ////////begin assignstr procedure tform1.button1click(sender: tobject); var p: pstring; begin p := nil; assignstr(p, edit1.text); edit2.text := p^; disposestr(p); end; ////////end assignstr ━━━━━━━━━━━━━━━━━━━━━ 首部 procedure appendstr(var dest: string; const s: string); deprecated; $[sysutils.pas 功能 在字符串dest后追加字符串s 说明 相当于dest := dest + s;delphi6已经不建议使用 参考 <null> 例子 ////////begin appendstr procedure tform1.button1click(sender: tobject); var s: string; begin s := edit2.text; appendstr(s, edit1.text); edit2.text := s; end; ////////end appendstr ━━━━━━━━━━━━━━━━━━━━━ 首部 function uppercase(const s: string): string; $[sysutils.pas 功能 返回字符串s的大写形式 说明 非小写字符不处理 参考 procedure system.setlength 例子 edit2.text := uppercase(edit1.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function lowercase(const s: string): string; $[sysutils.pas 功能 返回字符串s的小写形式 说明 非大写字符不处理 参考 procedure system.setlength 例子 edit2.text := lowercase(edit1.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function comparestr(const s1, s2: string): integer; $[sysutils.pas 功能 返回比较两个字符 说明 当s1>s2返回值>0;当s1<s2返回值<0;当s1=s2返回值=0;区分大小写 参考 <null> 例子 spinedit1.value := comparestr(edit1.text, edit2.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function comparemem(p1, p2: pointer; length: integer): boolean; assembler; $[sysutils.pas 功能 返回比较两个内存指针 说明 comparemem(pchar(12a), pchar(12c), 2)=true;comparemem(pchar(12a), pchar(12c), 3)=false 参考 <null> 例子 checkbox1.checked := comparemem(self, form1, 8); ━━━━━━━━━━━━━━━━━━━━━ 首部 function comparetext(const s1, s2: string): integer; $[sysutils.pas 功能 返回比较两个字符串 说明 不区分大小写 参考 <null> 例子 spinedit1.value := comparetext(edit1.text, edit2.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function sametext(const s1, s2: string): boolean; $[sysutils.pas 功能 返回两个字符串是否相等 说明 不区分大小写 参考 <null> 例子 checkbox1.checked := sametext(edit1.text, edit2.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansiuppercase(const s: string): string; $[sysutils.pas 功能 返回字符串s的大写形式 说明 ansi(american national standards institute)美国国家标准协会;非小写的字符不变 参考 function windows.charupperbuff 例子 edit2.text := ansiuppercase(edit1.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansilowercase(const s: string): string; $[sysutils.pas 功能 返回字符串s的小写形式 说明 非大写字符不处理 参考 function windows.charlowerbuff 例子 edit2.text := ansilowercase(edit1.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansicomparestr(const s1, s2: string): integer; $[sysutils.pas 功能 反回比较两个字符串 说明 当s1>s2返回值>0;当s1<s2返回值<0;当s1=s2返回值=0;区分大小写 参考 function windows.comparestring 例子 spinedit1.value := ansicomparestr(edit1.text, edit2.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansisamestr(const s1, s2: string): boolean; $[sysutils.pas 功能 返回两个字符串是否相等 说明 区分大小写 参考 function sysutils.ansicomparestr 例子 checkbox1.checked := ansisamestr(edit1.text, edit2.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansicomparetext(const s1, s2: string): integer; $[sysutils.pas 功能 反回比较两个字符串 说明 当s1>s2返回值>0;当s1<s2返回值<0;当s1=s2返回值=0;不区分大小写 参考 function windows.comparestring 例子 spinedit1.value := ansicomparetext(edit1.text, edit2.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansisametext(const s1, s2: string): boolean; $[sysutils.pas 功能 返回两个字符串是否相等 说明 不区分大小写 参考 function sysutils.ansicomparetext 例子 checkbox1.checked := ansisametext(edit1.text, edit2.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansistrcomp(s1, s2: pchar): integer; $[sysutils.pas 功能 返回比较两个指针字符串 说明 当s1>s2返回值>0;当s1<s2返回值<0;当s1=s2返回值=0;区分大小写 参考 function system.comparestring 例子 spinedit1.value := ansistrcomp(pchar(edit1.text), pchar(edit2.text)) ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansistricomp(s1, s2: pchar): integer; $[sysutils.pas 功能 返回比较两个指针字符串 说明 当s1>s2返回值>0;当s1<s2返回值<0;当s1=s2返回值=0;不区分大小写;ignore(忽略) 参考 function windows.comparestring 例子 spinedit1.value := ansistricomp(pchar(edit1.text), pchar(edit2.text)) ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansistrlcomp(s1, s2: pchar; maxlen: cardinal): integer; $[sysutils.pas 功能 返回比较两个指针字符串指定长度 说明 当s1>s2返回值>0;当s1<s2返回值<0;当s1=s2返回值=0;区分大小写;length(长度) 参考 function windows.comparestring 例子 spinedit1.value := ansistrlcomp(pchar(edit1.text), pchar(edit2.text), spinedit2.value) ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansistrlicomp(s1, s2: pchar; maxlen: cardinal): integer; $[sysutils.pas 功能 返回比较两个指针字符串指定长度 说明 当s1>s2返回值>0;当s1<s2返回值<0;当s1=s2返回值=0;不区分大小写 参考 function windows.comparestring 例子 spinedit1.value := ansistrlicomp(pchar(edit1.text), pchar(edit2.text), spinedit2.value) ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansistrlower(str: pchar): pchar; $[sysutils.pas 功能 返回指针字符串小写形式 说明 非大写字符不处理 参考 function windows.charlower 例子 edit2.text := ansistrlower(pchar(edit1.text)); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansistrupper(str: pchar): pchar; $[sysutils.pas 功能 返回指针字符串大写形式 说明 非小写字符不处理 参考 function windows.charupper 例子 edit2.text := ansistrupper(pchar(edit1.text)); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansilastchar(const s: string): pchar; $[sysutils.pas 功能 返回字符串s的最后一个指针字符 说明 当字符串s为空串则返回空指针 参考 function sysutils.bytetype 例子 edit2.text := ansilastchar(edit1.text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ansistrlastchar(p: pchar): pchar; $[sysutils.pas ...
下一页 摘要:第一次上delphi感觉还是不错的,就是自己的英文太差了,里面的很多控件都不认识。初次上机 自己胡乱写了一个可以改变窗体背景色程序。unit unit1;interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls;type tform1 = cl......