哪位帮我看看这一句代码,只有一句话(Installshield) var ss,ss1: WideString; //注意这里 ss1 := Copy(ss,Length(ss)-1,1); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 to genphone_ru(票票) 你写的是installshield脚本吗?to HHBB()问题是不一定是中文或者英文 先对szpath右边第一个字符做判断,如果是英文、数字,常用符号,则取右边第一个字符,如不是则去右边的两个字符 ss1 := Copy(ss,Length(ss)-1,1);if ss1[1]>#127 then ss1 := Copy(ss,Length(ss)-2,2); ss1 := Copy(ss,Length(ss)-1,1);if ss1[1]>#127 then ss1 := Copy(ss,Length(ss)-2,2); 用Api函数判断是否中文字符IsDBCSLeadByte具体可查Delphi自带的Windows SDK帮助 var ss,ss1: WideString; //注意这里!!!!!!! ss1 := Copy(ss,Length(ss)-1,1); 各位大哥,我现在是在Installshield里写安装啊 有一个办法,delphi提供了专门处理多字节字符的数据类型LongString,我在公司的中文短信程序常使用它。下面的程序在delphi中测试通过(重点看GetRightChar函数):unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Edit1: TEdit; Button1: TButton; Edit2: TEdit; procedure Button1Click(Sender: TObject); private function GetRightChar(s:string):string; { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);var s:string;begin s:=edit1.text; edit2.text:=GetRightChar(s);end;function TForm1.GetRightChar(s: string): string;var ws:WideString; len:integer;begin result:=''; if length(s)>0 then begin ws:=s; len:=length(ws);//如果字符串中还有中文你会发觉len值 Result:=ws[len]; end;end;end. stringlist是不是在win98会出错? 主窗体创建和显示后,再创建并显示多个其他的窗体,想让这些窗体在任务栏都有一个图标,怎么做? 高分!有谁用过delphi中的StringReplace函数? 关于求幂的问题 是否有属性或方法来清空stringgrid中的所有内容 Tmscomm控件问题?? 如何截获Word对象的DocumentBeforeSave事件? 请教access violation错误 有什么办法限定报表超过30条记录就另起一页呢?用QuickRep 关于DBISAM数据控件 有关消息处理的问题 连接两个或两个以上表的Adoquery,不可以修改或插入吗?
你写的是installshield脚本吗?to HHBB()
问题是不一定是中文或者英文
if ss1[1]>#127 then
ss1 := Copy(ss,Length(ss)-2,2);
if ss1[1]>#127 then
ss1 := Copy(ss,Length(ss)-2,2);
IsDBCSLeadByte
具体可查Delphi自带的Windows SDK帮助
ss1 := Copy(ss,Length(ss)-1,1);
下面的程序在delphi中测试通过(重点看GetRightChar函数):
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
private
function GetRightChar(s:string):string;
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
var
s:string;
begin
s:=edit1.text;
edit2.text:=GetRightChar(s);
end;function TForm1.GetRightChar(s: string): string;
var
ws:WideString;
len:integer;
begin
result:='';
if length(s)>0 then
begin
ws:=s;
len:=length(ws);//如果字符串中还有中文你会发觉len值
Result:=ws[len];
end;
end;
end.