?? pubfunc.pas
字號:
unit pubfunc;
interface
uses windows;
function GetStrValue(StrName,strText:string):string;
//function SmallToBig(Small:Real):string;
implementation
function GetStrValue(StrName,strText:string):string;
var
strRight:string;
n1:integer;
begin
strName:=strName+'=';
n1:=pos(strName,strText);
if n1=0 then
begin
result:='子串不存在!';
exit;
end;
strRight:=copy(strText,n1+Length(strName),Max_Path);
n1:=pos(';',strRight);
if n1>0 then
Result:=copy(strRight,1,n1-1)
else
Result:=strRight;
end;
//數字小寫轉為大寫金額
{function SmallToBig(Small:Real):string;
Var Str:String;
DotPos:Integer;
i:Integer;
bStart:Boolean;
sResult:WideString;
SmallDit:Double;
begin
{ Result:='零圓整';
SmallDit:=Round((Small-INT(Small))*100)/100;
Small:=INT(Small)+SmallDit;
if SmallDit<0.01 then
Exit;
Str:=FormatFloat('#.##',Small);
DotPos:=Pos('.',Str);
if DotPos=0 then
DotPos:=length(Str)+1;
bStart:=False;
For i:=DotPos-1 downto 1 do
begin
if (Str[i]<>'0') and (not bStart) then
bStart:=True;
if ABS(i-DotPos) MOD 4=1 then
begin
if (Str[i]='0') and (DotPos-i<>1) then
sResult:='零'+sResult;
Case DotPos-i of
1:sResult:='圓'+sResult;
5:sResult:='萬'+sResult;
9:sResult:='億'+sResult;
13:sResult:='兆'+sResult;
end;
bStart:=False;
end;
if (Str[i]<>'0') then
begin
Case ABS(i-DotPos) MOD 4 of
0:sResult:='仟'+sResult;
2:sResult:='拾'+sResult;
3:sResult:='佰'+sResult;
end;
end;
if i=3 then
Application.ProcessMessages;
Case Str[i] of
'0':if bStart and (sResult[1]<>'零') then
begin
sResult:='零'+sResult;
bStart:=False;
end;
'1':sResult:='壹'+sResult;
'2':sResult:='貳'+sResult;
'3':sResult:='叁'+sResult;
'4':sResult:='肆'+sResult;
'5':sResult:='伍'+sResult;
'6':sResult:='陸'+sResult;
'7':sResult:='柒'+sResult;
'8':sResult:='捌'+sResult;
'9':sResult:='玖'+sResult;
end;
if Str[i]<>'0' then
bStart:=True;
end;
Delete(Str,1,DotPos);
if Length(Str)>0 then
begin
Case Str[1] of
'0':if sResult<>'' then
sResult:=sResult+'零';
'1':sResult:=sResult+'壹';
'2':sResult:=sResult+'貳';
'3':sResult:=sResult+'叁';
'4':sResult:=sResult+'肆';
'5':sResult:=sResult+'伍';
'6':sResult:=sResult+'陸';
'7':sResult:=sResult+'柒';
'8':sResult:=sResult+'捌';
'9':sResult:=sResult+'玖';
end;
if Str[1]<>'0' then
sResult:=sResult+'角';
if Length(Str)>1 then
begin
Case Str[2] of
'1':sResult:=sResult+'壹';
'2':sResult:=sResult+'貳';
'3':sResult:=sResult+'叁';
'4':sResult:=sResult+'肆';
'5':sResult:=sResult+'伍';
'6':sResult:=sResult+'陸';
'7':sResult:=sResult+'柒';
'8':sResult:=sResult+'捌';
'9':sResult:=sResult+'玖';
end;
if Str[2]<>'0' then
sResult:=sResult+'分';
end else
sResult:=sResult+'整';
end else
sResult:=sResult+'整';
Result:=sResult; }
//end; }
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -