導航:首頁 > 文件教程 > delphi2010幫助文件

delphi2010幫助文件

發布時間:2024-09-17 21:13:51

Ⅰ 在delphi中如何選擇文件

usesFileCtrl;

functionSelectDirectory(varDirectory:string;//英文對話框
Options:TSelectDirOpts;HelpCtx:Longint):Boolean;overload;
functionSelectDirectory(constCaption:string;//中文對話框
constRoot:WideString;
varDirectory:string):Boolean;overload;

//以下是Delphi幫助的Demo:

usesFileCtrl;

const
SELDIRHELP=1000;
procereTForm1.Button1Click(Sender:TObject);
var
Dir:string;
begin
Dir:='C:/MYDIR';//預設為C:/MYDIR
ifSelectDirectory(Dir,[sdAllowCreate,sdPerformCreate,sdPrompt],SELDIRHELP)then
Label1.Caption:=Dir;//Dir返回選擇的文件夾
end;

Ⅱ 在Delphi中,怎麼查找字元串

Delphi提供的字元串函數里有一個Pos函數,它的定義是:

function Pos(Substr: string; S: string): Integer;

它的作用是在字元串S中查找字元串Substr,返回值是Substr在S中第一次出現的位置,如果沒有找到,返回值為0。

使用pos函數來查找字元第一次出現的位置

var
str1:string;
i,j:integer;
begin
str1:='dsf4654f6<ds>ad';
j:=pos('<',str1);//在字元串str1中查找"<"
ifj<>0then//得到的j是字元串中出現的位置,是整型
showmessage('<'+'在第'+inttostr(j)+'個位置');//第十個位置
end;

閱讀全文

與delphi2010幫助文件相關的資料

熱點內容
怎麼把ai文件存在一個pdf 瀏覽:851
java調用oracle存儲過程數據集 瀏覽:387
zbar源代碼編譯 瀏覽:77
聽壓縮文件小說用什麼軟體蘋果 瀏覽:892
java解析json 瀏覽:432
國外網路客服馬來西亞吉隆坡 瀏覽:362
編程裡面感嘆號是什麼意思 瀏覽:281
妖妖解除限制工具 瀏覽:648
日版蘋果5MD297JA能用嗎 瀏覽:692
qq微雲會員多少錢 瀏覽:559
默認sim卡數據電信什麼意思 瀏覽:180
卡槍代碼 瀏覽:992
億格瑞r300固件升級 瀏覽:658
最熱門的編程軟體有哪些 瀏覽:81
win764位右鍵隱藏文件 瀏覽:646
u盤有病毒文件隱藏的文件 瀏覽:725
aga屬於什麼文件 瀏覽:163
虛擬機配置文件在那 瀏覽:778
ststa面板數據怎麼做 瀏覽:540
菜鳥電腦如何在桌面上建文件夾 瀏覽:952

友情鏈接