Delphi; ошибка Project Weather.exe raised exception class EAccessViolation with messa
Project Weather.exe raised exception class EAccessViolation with message 'Access violation at address 004A1807.Read of address 00000010'.Process stopped.Use Step or Run to continue.
кнопки OK.Help.
unit Pogoda2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ExtCtrls, StdCtrls,Sensors, Menus;
type
TForm2 = class(TForm)
outDate: TDateTimePicker;
outTime: TDateTimePicker;
Timer1: TTimer;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label12: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Shape1: TShape;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label13: TLabel;
ProgressBar1: TProgressBar;
Label14: TLabel;
Label15: TLabel;
Image1: TImage;
Image2: TImage;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
OpenDialog1: TOpenDialog;
N3: TMenuItem;
procedure Timer1Timer(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
Datch1: TWindDirection;
Datch2: TWindSpeedSensor;
Datch4: THumiditySensor;
Datch3: TTemperatureSensor;
Datch5: TPressureSensor;
Datch6: THistoricalSensor;
k:String;
St,St1,St2,St3,St4,St5: Array [1..1000]of string;
s,j,i1,i2,i,NStr,NCol:Integer;
F,F1,F2,F3,F4,F5:TextFile;
implementation
uses Pogoda3, Pogoda1, Pogoda4;
{$R *.dfm}
procedure TForm2.Timer1Timer(Sender: TObject);
begin
outDate.Date:=Date;
outTime.Time:=Time;
k:= TimeToStr(Time);
k:=K[7]+k[8];
s:=StrToInt(k);
if s mod 5 = 0 then
begin
AssignFile(F,'D:\time.txt');
Append(F);
Writeln(F,TimeToStr(outTime.Time));
Datch1.DelN;
Datch1.Napr;
Datch2.Speed;--------------------------------------------------------ошибка указывает на эту строчку
Datch3.Temp;
Datch4.Hym;
Datch5.Pres;
CloseFile(F);
CloseFile(F1);
CloseFile(F2);
CloseFile(F3);
CloseFile(F4);
CloseFile(F5);
end;
end;
procedure TForm2.N2Click(Sender: TObject);
begin
Form4.Show;
end;
procedure TForm2.N3Click(Sender: TObject);
begin
Form1.Close;
end;
end.
исходники программы:
http://www.fayloobmennik.net/1285923
У тебя произошло обращение к недоступному/несуществующему участку памяти(к примеру: int а[10]; а ты обратился к а[15] )
Datch2 = nil;