Onderstaande werkt hier zonder error. Wel heb ik wat meer code weg gehaald die er in mijn beleving niet toe doet. Door wat haakjes weg te halen kan je de sensor waarde beinvloeden. Kijk er eens naar.
Delphi Code:
unit Main;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
type
TMainForm = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainForm: TMainForm;
Stand :array[1..37] of string;
zichtbaar :array[1..37] of Byte;
Actie :integer;
Naam, Tekening :string;
Rechts, Onder :array[1..37] of Integer;
Teller :Byte;
Sensor, HSensor :array[1..6] of Boolean;
Bloktaak :array[1..40] of string;
BlokVast, BlokLos :array[1..40] of integer;
Blokactief :byte;
WBNaam :array[1..62] of string[5];
implementation
{$R *.dfm}
procedure TMainForm.FormCreate(Sender: TObject);
begin
{
Sensor[1] := true;
Sensor[2] := true;
Sensor[3] := true;
Sensor[4] := true;
Sensor[5] := true;
}
{
Sensor[1] := false;
Sensor[2] := false;
Sensor[3] := false;
Sensor[4] := false;
Sensor[5] := false;
}
If Sensor[1]=true then begin HSensor[1]:=true; end;
If Sensor[2]=true then begin HSensor[2]:=true; end;
If Sensor[3]=true then begin HSensor[3]:=true; end;
If Sensor[4]=true then begin HSensor[4]:=true; end;
If Sensor[5]=true then begin HSensor[5]:=true; end;
end;
end.
Bookmarks