function SCLen : integer;
var
  CRadius : integer; 
begin
  { 缩放参数 ARPAZoom (0.125,0.25,0.50,0.75,1.5,3,6,12,24,48,96) }
  case ARPAZoomNo of                 //0.125,0.25,0.50,0.75,1.5,3
  0,1,2,3,4,5 :
    CRadius := Radius;
  else                                //>=6
    CRadius := Round(Radius * 5/ARPAZoom[ARPAZoomNo]);
  end;  Result := Round(CRadius* SeaClutterLevel/64);
end;就是这个程序不知道为什么,单步运行的时候,为什么到了CRadius := Round(Radius * 5/ARPAZoom[ARPAZoomNo]);
这句还能运行,CRadius还有值,可是到了Result := Round(CRadius* SeaClutterLevel/64);result就没有值了,为什么最后一句没办法运行?
for i := 0 to 4095 do if i mod 2 = 0 then
  for j := SCLen +1 to MaxCycCount-1 do
  begin
      if NoiseLevel >= 62 then continue;
      Level := Round(NoiseLevel);
      Randomize;
      if J mod (Level+1) = 0 then
      begin
       if j mod 2  = 0 then SignTmp := 1 else SignTmp := -1;
        NoiseP.X := Round(OSCoP.X+(j+Random(50)*SignTmp)*CosV[I]);
        NoiseP.Y := Round(OSCoP.Y+(j+Random(50)*SignTmp)*SinV[I]);
        if ( NoiseP.X < 1000 ) and ( NoiseP.Y < 1000 ) and (TmpClutterData1[NoiseP.X,NoiseP.Y] = 0) and
           (Sqrt(Power(NoiseP.X-OSCoP.X,2) + Power(NoiseP.Y-OSCoP.Y,2)) < Radius*2) then
          TmpClutterData1[NoiseP.X,NoiseP.Y] := CL_N;
      end;
  end;   
接着运行这一块的时候,因为上面SCLen,没有值所以,SCLen就提示inaccessible value,是怎么回事呢?

解决方案 »

  1.   

    你那个Radius SeaClutterLevel这两个变量是什么类型,是什么值,你跟踪的时候,看看这两个的数值是什么。
    在Result := Round(CRadius* SeaClutterLevel/64);设个断点,然后看一CRadius, SeaClutterLevel这个是什么值,如果数值正常,你就把下面的语句改一下
    for j := SCLen +1 to MaxCycCount-1 do
    定义变量z,
    z := SCLen;改成:for j := z+1 to MaxCycCount-1 do并设置断点,看看z=多少。