解决方案 »
- DBGRIDEH双击事件中获取同行其他列单元格内容??????
- 高手帮帮忙。删除指定目录下的所有文件和文件夹,还有拷贝指定的目录到指定的位置
- 请指导
- Delphi中怎么取得运行时命令行后带的参数,如 C:\>test.exe C:\a.txt D:\ ?
- 如何做帮助文件?
- 设置word的页码!
- 怎样让WebService更灵活
- 现在做两层的东西,请问怎样用adoconnection怎样连接网络里其他电脑的MS SQL,可以用这东西连接的吗,请问如果可以
- 关于获取坐标的问题
- 在delphi 下怎样杀进程
- fastreport 怎样才能让页脚PageFooter只在第一页上显示
- delphi获得网页内容
Const
piSZCodeMax = 5000; //000001-005000
piCYCodeMax = 3000; //300001-303000
piSHCodeMax = 5000; //600000-605000
//piZSCodeMax = 1000; //880000-881000 //板块指数
piCodeBufCount = piSZCodeMax + piCYCodeMax + piSHCodeMax + {piZSCodeMax + }3;
Function CodeToBufIndex(Code : integer; var Index : Integer) : Boolean;
begin
Result := True;
if (Code>=1) and (Code<=piSZCodeMax) then Index := Code
else if (Code>=300001) and (Code<300000+piCYCodeMax) then Index := piSZCodeMax + Code - 300000
else if (Code>=600000) and (Code<600000+piSHCodeMax) then Index := piSZCodeMax + piCYCodeMax + Code - 600000
//else if (Code>=880000) and (Code<880000+piZSCodeMax) then Index := piSZCodeMax + piCYCodeMax + piSHCodeMax + Code - 880000
else if Code=999999 then Index := piCodeBufCount-1
else if Code=399001 then Index := piCodeBufCount-2
else if Code=399006 then Index := piCodeBufCount-3
else Result := False;
end;Function BufIndexToCode(Index : integer; var Code : Integer) : Boolean;
begin
Result := True;
if Index<=0 then Result := False
else if (Index<=piSZCodeMax) then Code := Index
else if (Index<piSZCodeMax+piCYCodeMax) then Code := Index + 300000 - piSZCodeMax
else if (Index<piSZCodeMax+piCYCodeMax+piSHCodeMax) then Code := Index + 600000-piSZCodeMax-piCYCodeMax
//else if (Index<piSZCodeMax+piCYCodeMax+piSHCodeMax+piZSCodeMax) then Code := Index + 880000 - piSZCodeMax - piCYCodeMax - piSHCodeMax
else if (Index=piCodeBufCount-1) then Code := 999999
else if (Index=piCodeBufCount-2) then Code := 399001
else if (Index=piCodeBufCount-3) then Code := 399006
else Result := False;
end;