?? unit1.pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
txtInput: TEdit;
cmdCalc: TButton;
txtFind: TEdit;
txtANSI: TEdit;
txtWide: TEdit;
cmdClose: TButton;
procedure cmdCalcClick(Sender: TObject);
procedure cmdCloseClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
//以下程序將字符串中的字符的編碼一一找出
procedure TForm1.cmdCalcClick(Sender: TObject);
var
InputStr,FindStr:String;
InputStrW,FindStrW:WideString;
begin
//分別指定String及WindeString
InputStr:=txtInput.Text;
InputStrW:=txtInput.Text;
FindStr:=txtFind.Text;
FindStrW:=txtFind.Text;
//使用Pos函數計算結果
txtANSI.Text:=IntToStr(Pos(FindStr,InputStr));
txtWide.Text:=IntToStr(Pos(FindStrW,InputStrW));
end;
procedure TForm1.cmdCloseClick(Sender: TObject);
begin
Close;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -