//Ord的用法
uses Dialogs;
type Colors = (RED,BLUE,GREEN);var S: string;
begin
S := 'BLUE has an ordinal value of ' + IntToStr(Ord(BLUE)) + #13#10;
S := S + 'The ASCII code for "c" is ' + IntToStr(Ord('c')) + ' decimal';
MessageDlg(S, mtInformation, [mbOk], 0);
end;//Pos 的用法
var S: string;begin
S := ' 123.5';
{ Convert spaces to zeroes }
while Pos(' ', S) > 0 do
S[Pos(' ', S)] := '0';
end;
uses Dialogs;
type Colors = (RED,BLUE,GREEN);var S: string;
begin
S := 'BLUE has an ordinal value of ' + IntToStr(Ord(BLUE)) + #13#10;
S := S + 'The ASCII code for "c" is ' + IntToStr(Ord('c')) + ' decimal';
MessageDlg(S, mtInformation, [mbOk], 0);
end;//Pos 的用法
var S: string;begin
S := ' 123.5';
{ Convert spaces to zeroes }
while Pos(' ', S) > 0 do
S[Pos(' ', S)] := '0';
end;
解决方案 »
- 求指出指针错误的地方
- 怎么实现根据运行时的某一变量的值,决定执不执行某一函数?
- 如何用WebBrowser编写多窗口浏览器,像傲游浏览器那样?
- 实现ini文件自加密, 谁能给个例子?
- delphi里如何改变bitbtn按纽的背景颜色?
- 买DELPHI代码,进来看看啊!
- 关于listview的问题请教
- ShellExecute(self.Handle, 'Open','USBHolte.exe',Pchar('username='+CurOperatorCode + ' password='+EncodePass), 'USB', 0);
- 请教:Timg控件怎么样把gif格式加进去?就象.ico一样的方便,我下了一个控件使用起来太麻烦了!
- dbcombobox的问题
- 簡繁通用的問題
- 关于stringgrid的 问题 ,急~!!
pos(sub,s)//取出sub在s的第一个位置
此汉字包括某编旁else
.............请问那里错了
var
s:widestring;
i:integer;
begin
s:='此汉字包括某编旁';
i:=pos('汉',s);
showmessage(inttostr(i));
end;