{///////// ConfigFunction /////////////////////////////////////////////////////
In this Unit, I define some functions to operation the Config File. the Unit's
is a Partion of ConfigDLL project.
Westengine Corporation Adai Lee 2001-10-12
///////////////////////////////////////////////////////////////////////////////
}
unit MyFunction;interface
uses classes,Forms,ADODB,DB,DBGrids;
function EnterMaineInterFace(AOwer:Tcomponent;ALinkString:string;AOperator:string):TForm;
function EnterImportInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
function EnterEditInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
function EnterSerchInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterMedicineNameInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterBusinessInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterUsersInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterChangePassWordInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterExportInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
function EnterSerchBusinessmanInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterSerchOutInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterEditExportInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
function EnterHintInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterUpDownKeyInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterStockPlanInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterAvailabilityInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterMedicineNumberInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterCollectIndatabaseInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterCollectOutdatabaseInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterAboutInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterAddStockPlanInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
function EnterEmployeeInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterPasswordSystemInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterServiceUnitInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterMenZhenChargeInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterHospitalChargeInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterMenZhenDayShouFeiInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterMenZhenMonthShouFeiInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterHospitalMonthShouFeiInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterHospitalDayShouFeiInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterCalculatePriceInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterCollectSetInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterBackupResumeInterFace(AOwer:TComponent;ALinkString:string):TForm;
function OpenAddInfoDataSet(ADataSet:TADODataSet;AConnectString:String;ALinkString:string;ADataSource:TDataSource):Boolean;
Function Lock(Key, Source: String): String;
Function UnLock(Key, Dest: String): String;
Function SmallToLarge(ASmallPrice:Real):String;
Function ACharToLarge(aString:string):string;
Function IntegerToStringEight(AInteger:integer):string;
Function BeforeMonth(aDateTime:TDateTime):string;
Function apartString(aString:string):Real;
procedure SearchRecords(var aADODataSet:TADODataSet;var aCommand:String);
implementation uses Dialogs,SysUtils,_GlobalDefine, main, Import, USerch, USerchPrint,
UMedicineName, UBusinessName, UUsers, UChangePassWord, UOutDataBase,
USerch_businessman, USerchOutDataBase, UUpDown, UHint, UStockPlan,
UAvailability, UNumber_Medicine, UCollectIndatabse, UCollectOutDataBase,
UAbout, UEmployee, UAddStockPlan, UPassWordSystem, UServiceUnit,
UShouFei, UHospitalShouFei, UDayCollect,
UHospitalDayCollect, USetCollectDateORTime, UMonthCollect,
UHospitalMonthCollect, UCalculatePrice, UBackupResume;procedure SearchRecords(var aADODataSet:TADODataSet;var aCommand:String);
begin
with aADODataSet do
begin
if Active then Close;
ConnectionString:=ctLinkString;
CommandText:=aCommand;
Prepared;
Open;
end;
end;Function Lock(Key, Source: String): String;
{
功能:用户口令加密。
============================================================
加密密匙(Key);调用时为用户ID编号;进入该函数后,若
Length(Key)<Length(Source)则在Key后补字符0
直至Length(Key)=Length(Source);用用户ID作
加密密匙可以防止系统管理员或非法用户直接修
改用户口令字或通过复制其他用户的口令字或
角色编号进入系统。
对Source的要求: ord(Source[i]) < 198 在输入和确认时检查
目的是使 Source[i] + Key[i] < 256;
加密算法 : 先将 IntToStr(ord(Source[i]) + ord(Key[i]))
拼接在一起; 然后再将整个字符串倒转生成加密后的
口令字或角色编号(放在T_USER表中的ROLE_CRYPT字段)
============================================================
}
var
i,len : integer;
tmp,str : String;
Dest : String;
begin
str := '';
Dest:= '';
len := Length(Source); while Length(Key) < len do Key := Key + '0'; //先将 IntToStr(ord(Source[i]) + ord(Key[i]))拼接在一起;
for i:=1 to len do
begin
tmp := IntToStr( ord(Source[i]) + ord(Key[i]) );
while Length(tmp) < 3 do tmp := '0' + tmp ;
str := str + tmp;
end; len := Length(str); //将整个字符串倒转
for i:=len downto 1 do Dest := Dest + str[i]; Result := Dest;
end;Function UnLock(Key, Dest: String): String;
{
功能:用户口令解密。
============================================================
解密密匙(Key);调用时为用户ID编号;进入该函数后,若
Length(Key)<Length(Dest) 则在Key后补字符0
直至Length(Key)=Length(Dest);
Dest : 为加密字符串
解密算法 : 先将整个字符串倒转; 以三位为一个单元减去ord(Key[i])
生成一个字符; 拼接在一起恢复口令字或角色编号
============================================================
}
var
i,len : integer;
p : byte;
tmp,str : String;
Source : String;begin
str := '';
Source:= ''; len := Length(Dest); while Length(Key) < (len div 3) do Key := Key + '0'; for i:=len downto 1 do str := str + Dest[i]; //字符串倒转 try
begin
len := len div 3;
for i:= 1 to len do
begin
tmp := copy(str, i*3-2, 3);
p := StrToInt(tmp) - ord(Key[i]);
Source := Source + chr( p );
end;
end
except
Source := ''; //若口令或角色编号中含有非法字符, 则置空
end;
Result := Source;
end;Function BeforeMonth(aDateTime:TDateTime):string;
var
aTmpYear,aTmpMonth:string;
begin
aTmpYear:=FormatDateTime('yyyy',aDateTime);
aTmpMonth:=FormatDateTime('mm',aDateTime);
if aTmpMonth='01' then
Result:=IntToStr(StrToInt(aTmpYear)-1)+'-'+'12'
else
Result:=aTmpYear+'-'+IntToStr(StrToInt(aTmpMonth)-1);
end;
未完待续!
In this Unit, I define some functions to operation the Config File. the Unit's
is a Partion of ConfigDLL project.
Westengine Corporation Adai Lee 2001-10-12
///////////////////////////////////////////////////////////////////////////////
}
unit MyFunction;interface
uses classes,Forms,ADODB,DB,DBGrids;
function EnterMaineInterFace(AOwer:Tcomponent;ALinkString:string;AOperator:string):TForm;
function EnterImportInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
function EnterEditInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
function EnterSerchInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterMedicineNameInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterBusinessInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterUsersInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterChangePassWordInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterExportInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
function EnterSerchBusinessmanInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterSerchOutInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterEditExportInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
function EnterHintInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterUpDownKeyInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterStockPlanInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterAvailabilityInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterMedicineNumberInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterCollectIndatabaseInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterCollectOutdatabaseInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterAboutInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterAddStockPlanInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
function EnterEmployeeInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterPasswordSystemInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterServiceUnitInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
function EnterMenZhenChargeInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterHospitalChargeInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterMenZhenDayShouFeiInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterMenZhenMonthShouFeiInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterHospitalMonthShouFeiInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterHospitalDayShouFeiInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterCalculatePriceInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterCollectSetInterFace(AOwer:TComponent;ALinkString:string):TForm;
function EnterBackupResumeInterFace(AOwer:TComponent;ALinkString:string):TForm;
function OpenAddInfoDataSet(ADataSet:TADODataSet;AConnectString:String;ALinkString:string;ADataSource:TDataSource):Boolean;
Function Lock(Key, Source: String): String;
Function UnLock(Key, Dest: String): String;
Function SmallToLarge(ASmallPrice:Real):String;
Function ACharToLarge(aString:string):string;
Function IntegerToStringEight(AInteger:integer):string;
Function BeforeMonth(aDateTime:TDateTime):string;
Function apartString(aString:string):Real;
procedure SearchRecords(var aADODataSet:TADODataSet;var aCommand:String);
implementation uses Dialogs,SysUtils,_GlobalDefine, main, Import, USerch, USerchPrint,
UMedicineName, UBusinessName, UUsers, UChangePassWord, UOutDataBase,
USerch_businessman, USerchOutDataBase, UUpDown, UHint, UStockPlan,
UAvailability, UNumber_Medicine, UCollectIndatabse, UCollectOutDataBase,
UAbout, UEmployee, UAddStockPlan, UPassWordSystem, UServiceUnit,
UShouFei, UHospitalShouFei, UDayCollect,
UHospitalDayCollect, USetCollectDateORTime, UMonthCollect,
UHospitalMonthCollect, UCalculatePrice, UBackupResume;procedure SearchRecords(var aADODataSet:TADODataSet;var aCommand:String);
begin
with aADODataSet do
begin
if Active then Close;
ConnectionString:=ctLinkString;
CommandText:=aCommand;
Prepared;
Open;
end;
end;Function Lock(Key, Source: String): String;
{
功能:用户口令加密。
============================================================
加密密匙(Key);调用时为用户ID编号;进入该函数后,若
Length(Key)<Length(Source)则在Key后补字符0
直至Length(Key)=Length(Source);用用户ID作
加密密匙可以防止系统管理员或非法用户直接修
改用户口令字或通过复制其他用户的口令字或
角色编号进入系统。
对Source的要求: ord(Source[i]) < 198 在输入和确认时检查
目的是使 Source[i] + Key[i] < 256;
加密算法 : 先将 IntToStr(ord(Source[i]) + ord(Key[i]))
拼接在一起; 然后再将整个字符串倒转生成加密后的
口令字或角色编号(放在T_USER表中的ROLE_CRYPT字段)
============================================================
}
var
i,len : integer;
tmp,str : String;
Dest : String;
begin
str := '';
Dest:= '';
len := Length(Source); while Length(Key) < len do Key := Key + '0'; //先将 IntToStr(ord(Source[i]) + ord(Key[i]))拼接在一起;
for i:=1 to len do
begin
tmp := IntToStr( ord(Source[i]) + ord(Key[i]) );
while Length(tmp) < 3 do tmp := '0' + tmp ;
str := str + tmp;
end; len := Length(str); //将整个字符串倒转
for i:=len downto 1 do Dest := Dest + str[i]; Result := Dest;
end;Function UnLock(Key, Dest: String): String;
{
功能:用户口令解密。
============================================================
解密密匙(Key);调用时为用户ID编号;进入该函数后,若
Length(Key)<Length(Dest) 则在Key后补字符0
直至Length(Key)=Length(Dest);
Dest : 为加密字符串
解密算法 : 先将整个字符串倒转; 以三位为一个单元减去ord(Key[i])
生成一个字符; 拼接在一起恢复口令字或角色编号
============================================================
}
var
i,len : integer;
p : byte;
tmp,str : String;
Source : String;begin
str := '';
Source:= ''; len := Length(Dest); while Length(Key) < (len div 3) do Key := Key + '0'; for i:=len downto 1 do str := str + Dest[i]; //字符串倒转 try
begin
len := len div 3;
for i:= 1 to len do
begin
tmp := copy(str, i*3-2, 3);
p := StrToInt(tmp) - ord(Key[i]);
Source := Source + chr( p );
end;
end
except
Source := ''; //若口令或角色编号中含有非法字符, 则置空
end;
Result := Source;
end;Function BeforeMonth(aDateTime:TDateTime):string;
var
aTmpYear,aTmpMonth:string;
begin
aTmpYear:=FormatDateTime('yyyy',aDateTime);
aTmpMonth:=FormatDateTime('mm',aDateTime);
if aTmpMonth='01' then
Result:=IntToStr(StrToInt(aTmpYear)-1)+'-'+'12'
else
Result:=aTmpYear+'-'+IntToStr(StrToInt(aTmpMonth)-1);
end;
未完待续!
解决方案 »
- 请教一下TcxCheckGroup的用法
- 操作中英文混合的字符串的操作问题!
- 求救:winsocket有关的~~~
- 如果处理语音聊天中的回音问题
- 用delphi怎样把image类型里的内容取出来,反映在memo控件里?
- 如何在image控件上添加imagelist控件里的图像?
- 高手请入,不但有分挣,还有.......
- checkbox.onchang事件 能实现?如何实现啊
- 一个报表设计的问题:如何实现报表与程序间变量的交互?(对不起,只有这些分了?)
- Delphi下载版本求解!!!
- 看不懂了,晕了,真不知道如何理解这一行,高手请进!
- 学习下载的源代码。在单元文件的开始即 Unit XXXX前有如下一行"{$i c:\include.txt}",是什么意思?
Function apartString(aString:string):Real;
var
i,j:integer;
aTmpStr:string;
begin
j:=0;
For i:= 1 to Length(aString) do
begin
if aString[i] = '=' then
begin
j:=i+1;
Break;
end;
end;
aTmpStr:='';
For i:= j to Length(aString) do
aTmpStr:=aTmpStr+aString[i];
Result:=StrToFloat(aTmpStr);
end;function EnterBackupResumeInterFace(AOwer:TComponent;ALinkString:string):TForm;
begin
theBackupResumeLinkString:=ALinkString;
Result:=TFBackupResume.Create(AOwer);
end;function EnterMenZhenMonthShouFeiInterFace(AOwer:TComponent;ALinkString:string):TForm;
begin
theMenZhenMonthShouFeiLinkString:=ALinkString;
Result:=TFMonthCollect.Create(AOwer);
end;function EnterHospitalMonthShouFeiInterFace(AOwer:TComponent;ALinkString:string):TForm;
begin
theHospitalMonthShouFeiLinkString:=ALinkString;
Result:=TFHospitalMonthCollect.Create(AOwer);
end;function EnterCollectSetInterFace(AOwer:TComponent;ALinkString:string):TForm;
begin
theCollectSetLinkString:=ALinkString;
Result:=TFSetCollectDateORTime.Create(AOwer);
end;function EnterMenZhenDayShouFeiInterFace(AOwer:TComponent;ALinkString:string):TForm;
begin
theMenZhenDayShouFeiLinkString:=ALinkString;
Result:=TFDayCollect.Create(AOwer);
end;function EnterHospitalDayShouFeiInterFace(AOwer:TComponent;ALinkString:string):TForm;
begin
theHospitalDayShouFeiLinkString:=ALinkString;
Result:=TFHospitalDayCollect.Create(AOwer);
end;function EnterEditInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
begin
theEditLinkString:=ALinkString;
theInfoOperateKind:=AOperateKind;
Result:=TInDataBase.Create(AOwer);
end;function EnterAddStockPlanInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
begin
theAddStockPlanLinkString:=ALinkString;
theInfoOperateKind:=AOperateKind;
Result:=TFAddStockPlan.Create(AOwer);
end;function EnterServiceUnitInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theServiceUnitLinkString:=ALinkString;
Result:=TFServiceUnit.Create(AOwer);
end;function EnterBusinessInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theBusinessLinkString:=ALinkString;
Result:=TFBusinessName.Create(AOwer);
end;function EnterCollectIndatabaseInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theCollectIndatabaseLinkString:=ALinkString;
Result:=TFCollectIndatabase.Create(AOwer);
end;function EnterCollectOutdatabaseInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theCollectOutdatabaseLinkString:=ALinkString;
Result:=TFCollectOutdatabase.Create(AOwer);
end;function EnterPasswordSystemInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
thePasswordSystemLinkString:=ALinkString;
Result:=TFPassWordSystem.Create(AOwer);
end;function EnterStockPlanInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theStockPlanLinkString:=ALinkString;
Result:=TFStockPlan.Create(AOwer);
end;function EnterAvailabilityInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theAvailabilityLinkString:=ALinkString;
Result:=TFAvailability.Create(AOwer);
end;function EnterEmployeeInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theEmployeeLinkString:=ALinkString;
Result:=TFEmployee.Create(AOwer);
end;function EnterChangePassWordInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theChangePassWordLinkString:=ALinkString;
Result:=TFChangePassWord.Create(AOwer);
end;function EnterSerchBusinessmanInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theSerchBusinessmanLinkString:=ALinkString;
Result:=TFSerch_businessman.Create(AOwer);
end;function EnterUsersInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theUsersLinkString:=ALinkString;
Result:=TFusers.Create(AOwer);
end;function EnterUpDownKeyInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theUpDownKeyLinkString:=ALinkString;
Result:=TFUpDown.Create(AOwer);
end;function EnterHintInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theHintLinkString:=ALinkString;
Result:=TFHint.Create(AOwer);
end;function EnterMedicineNumberInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theMedicineNumberLinkString:=ALinkString;
Result:=TFNumber_Medicine.Create(AOwer);
end;function EnterMenZhenChargeInterFace(AOwer:TComponent;ALinkString:string):TForm;
begin
theMenZhenChargeLinkString:=ALinkString;
Result:=TFMenZhenShouFei.Create(AOwer);
end;function EnterHospitalChargeInterFace(AOwer:TComponent;ALinkString:string):TForm;
begin
theHospitalChargeLinkString:=ALinkString;
Result:=TFHospitalShouFei.Create(Aower);
end;
下面继续:
begin
theMainLinkString:=ALinkString;
theOperator:=AOperator;
Result:=TFormMainFace.Create(AOwer);
end;function EnterExportInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
begin
theExportLinkString:=ALinkString;
theInfoOperateKind:=AOperateKind;
Result:=TFOutDataBase.Create(AOwer);
end;function EnterEditExportInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
begin
theEditExportLinkString:=ALinkString;
theInfoOperateKind:=AOperateKind;
Result:=TFOutDataBase.Create(AOwer);
end;function EnterImportInterFace(AOwer:Tcomponent;ALinkString:string;AOperateKind:integer):TForm;
begin
theImportLinkString:=ALinkString;
theInfoOperateKind:=AOperateKind;
Result:=TInDataBase.Create(AOwer);
end;function EnterSerchInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theSerchLinkString:=ALinkString;
Result:=TFSerch.Create(AOwer);
end;function EnterSerchOutInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theSerchOutLinkString:=ALinkString;
Result:=TFSerchOutDataBase.Create(AOwer);
end;function EnterMedicineNameInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theMedicineNameLinkString:=ALinkString;
Result:=TFMedicineName.Create(AOwer);
end;function EnterAboutInterFace(AOwer:Tcomponent;ALinkString:string):TForm;
begin
theAboutLinkString:=ALinkString;
Result:=TFAbout.Create(AOwer);
end;function EnterCalculatePriceInterFace(AOwer:TComponent;ALinkString:string):TForm;
begin
theCalculatePriceLinkString:=ALinkString;
Result:=TFCalculatePrice.Create(AOwer);
end;function OpenAddInfoDataSet(ADataSet:TADODataSet;AConnectString:String;ALinkString:string;ADataSource:TDataSource):Boolean;
begin
with ADataSet do
begin
if Active then Close;
ConnectionString:=AConnectString;
CommandText:=ALinkString;
try
Open;
Result:=True;
except
Result:=False;
end;
end;
ADataSource.DataSet:=ADataSet;
end;Function ACharToLarge(aString:string):string;
begin
if aString='1' then Result:='壹';
if aString='2' then Result:='贰';
if aString='3' then Result:='叁';
if aString='4' then Result:='肆';
if aString='5' then Result:='伍';
if aString='6' then Result:='陆';
if aString='7' then Result:='柒';
if aString='8' then Result:='捌';
if aString='9' then Result:='玖';
if aString='0' then Result:='零';
end;Function SmallToLarge(ASmallPrice:Real):String;
var
aTmpStr,aResultStr:String;
i,aStrLength,aLocation:integer;begin
aResultStr:='';
aTmpStr:=FloatToStr(ASmallPrice);
aStrLength:=Length(aTmpStr);
aLocation:=0;
For i:= 1 to aStrLength do
begin
if aTmpStr[i] = '.' then
begin
aLocation:=i;
Break;
end;
end;
if aLocation = 0 then
begin
if aStrLength > 5 then exit;
Case aStrLength of
9:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'亿'
+ACharToLarge(aTmpStr[2])+'仟'
+ACharToLarge(aTmpStr[3])+'佰'
+ACharToLarge(aTmpStr[4])+'拾'
+ACharToLarge(aTmpStr[5])+'万'
+ACharToLarge(aTmpStr[6])+'仟'
+ACharToLarge(aTmpStr[7])+'佰'
+ACharToLarge(aTmpStr[8])+'拾'
+ACharToLarge(aTmpStr[9])+'元'
+'零角零分';
end;
8:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'仟'
+ACharToLarge(aTmpStr[2])+'佰'
+ACharToLarge(aTmpStr[3])+'拾'
+ACharToLarge(aTmpStr[4])+'万'
+ACharToLarge(aTmpStr[5])+'仟'
+ACharToLarge(aTmpStr[6])+'佰'
+ACharToLarge(aTmpStr[7])+'拾'
+ACharToLarge(aTmpStr[8])+'元'
+'零角零分';
end;
7:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'佰'
+ACharToLarge(aTmpStr[2])+'拾'
+ACharToLarge(aTmpStr[3])+'万'
+ACharToLarge(aTmpStr[4])+'仟'
+ACharToLarge(aTmpStr[5])+'佰'
+ACharToLarge(aTmpStr[6])+'拾'
+ACharToLarge(aTmpStr[7])+'元'
+'零角零分';
end;
6:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'拾'
+ACharToLarge(aTmpStr[2])+'万'
+ACharToLarge(aTmpStr[3])+'仟'
+ACharToLarge(aTmpStr[4])+'佰'
+ACharToLarge(aTmpStr[5])+'拾'
+ACharToLarge(aTmpStr[6])+'元'
+'零角零分'; end;
5:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'万'
+ACharToLarge(aTmpStr[2])+'仟'
+ACharToLarge(aTmpStr[3])+'佰'
+ACharToLarge(aTmpStr[4])+'拾'
+ACharToLarge(aTmpStr[5])+'元'
+'零角零分';
end;
4:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'仟'
+ACharToLarge(aTmpStr[2])+'佰'
+ACharToLarge(aTmpStr[3])+'拾'
+ACharToLarge(aTmpStr[4])+'元'
+'零角零分';
end;
3:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'佰'
+ACharToLarge(aTmpStr[2])+'拾'
+ACharToLarge(aTmpStr[3])+'元'
+'零角零分';
end;
2:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'拾'
+ACharToLarge(aTmpStr[2])+'元'
+'零角零分';
end;
1:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'元'
+'零角零分';
end;
else
aResultStr:='';
end;
end
else
begin
case aLocation of
10:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'亿'
+ACharToLarge(aTmpStr[2])+'仟'
+ACharToLarge(aTmpStr[3])+'佰'
+ACharToLarge(aTmpStr[4])+'拾'
+ACharToLarge(aTmpStr[5])+'万'
+ACharToLarge(aTmpStr[6])+'仟'
+ACharToLarge(aTmpStr[7])+'佰'
+ACharToLarge(aTmpStr[8])+'拾'
+ACharToLarge(aTmpStr[9])+'元'
+ACharToLarge(aTmpStr[11])+'角'
+ACharToLarge(aTmpStr[12])+'分';
end;
9:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'仟'
+ACharToLarge(aTmpStr[2])+'佰'
+ACharToLarge(aTmpStr[3])+'拾'
+ACharToLarge(aTmpStr[4])+'万'
+ACharToLarge(aTmpStr[5])+'仟'
+ACharToLarge(aTmpStr[6])+'佰'
+ACharToLarge(aTmpStr[7])+'拾'
+ACharToLarge(aTmpStr[8])+'元'
+ACharToLarge(aTmpStr[10])+'角'
+ACharToLarge(aTmpStr[11])+'分';
end;
8:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'佰'
+ACharToLarge(aTmpStr[2])+'拾'
+ACharToLarge(aTmpStr[3])+'万'
+ACharToLarge(aTmpStr[4])+'仟'
+ACharToLarge(aTmpStr[5])+'佰'
+ACharToLarge(aTmpStr[6])+'拾'
+ACharToLarge(aTmpStr[7])+'元'
+ACharToLarge(aTmpStr[9])+'角'
+ACharToLarge(aTmpStr[10])+'分';
end;
7:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'拾'
+ACharToLarge(aTmpStr[2])+'万'
+ACharToLarge(aTmpStr[3])+'仟'
+ACharToLarge(aTmpStr[4])+'佰'
+ACharToLarge(aTmpStr[5])+'拾'
+ACharToLarge(aTmpStr[6])+'元'
+ACharToLarge(aTmpStr[8])+'角'
+ACharToLarge(aTmpStr[9])+'分';
end;
6:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'万'
+ACharToLarge(aTmpStr[2])+'仟'
+ACharToLarge(aTmpStr[3])+'佰'
+ACharToLarge(aTmpStr[4])+'拾'
+ACharToLarge(aTmpStr[5])+'元'
+ACharToLarge(aTmpStr[7])+'角'
+ACharToLarge(aTmpStr[8])+'分';
end;
5:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'仟'
+ACharToLarge(aTmpStr[2])+'佰'
+ACharToLarge(aTmpStr[3])+'拾'
+ACharToLarge(aTmpStr[4])+'元'
+ACharToLarge(aTmpStr[6])+'角'
+ACharToLarge(aTmpStr[7])+'分';
end;
4:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'佰'
+ACharToLarge(aTmpStr[2])+'拾'
+ACharToLarge(aTmpStr[3])+'元'
+ACharToLarge(aTmpStr[5])+'角'
+ACharToLarge(aTmpStr[6])+'分';
end;
3:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'拾'
+ACharToLarge(aTmpStr[2])+'元'
+ACharToLarge(aTmpStr[4])+'角'
+ACharToLarge(aTmpStr[5])+'分';
end;
2:begin
aResultStr:=aResultStr+ACharToLarge(aTmpStr[1])+'元'
+ACharToLarge(aTmpStr[3])+'角'
+ACharToLarge(aTmpStr[4])+'分';
end;
else
aResultStr:=''
end;
end;
Result:=aResultStr;
end;Function IntegerToStringEight(AInteger:integer):string;
var
aTmpStr:string;
aStringLength:integer;
begin
aTmpStr:=IntToStr(AInteger);
aStringLength:=Length(aTmpStr);
case aStringLength of
8:Result:=aTmpStr;
7:Result:='0'+aTmpStr;
6:Result:='00'+aTmpStr;
5:Result:='000'+aTmpStr;
4:Result:='0000'+aTmpStr;
3:Result:='00000'+aTmpStr;
2:Result:='000000'+aTmpStr;
1:Result:='0000000'+aTmpStr;
else
Result:='';
end;
end;end.
终于结束了。