Home > Back-end >  DELPHI7 doesn't support FOR the DO IN a set function converts D7 can thank you
DELPHI7 doesn't support FOR the DO IN a set function converts D7 can thank you

Time:10-09

TYPE
TUserSayType=(us_All, us_Hear us_Whisper, us_Cry, us_Group, us_Guild, us_Sys, us_Custom, us_None);

TUserSaySet=set of TUserSayType;

Procedure TDrawScreen. ChangeTransferMsg (UserSaySet: TUserSaySet);
Var
I, i1: Integer;
UserSayType: TUserSayType;
The begin

For UserSayType in UserSaySet do
G_SayEffectIndex [UserSayType] :=False;
end;

Under DELPHI2007 engineering of the code is so but because DELPHI7 does not support FOR DO so TO help put IN FOR UserSayType IN UserSaySet DO TO D7 under the FOR I:=0 TO X DO this form

CodePudding user response:

 e: TUserSayType; 

For: e=us_All to us_None do
If e in UserSaySet then
G_SayEffectIndex [e] :=False;

CodePudding user response:

 procedure TForm1. FormCreate (Sender: TObject); 
TYPE
TUserSayType=(us_All, us_Hear us_Whisper, us_Cry, us_Group, us_Guild, us_Sys, us_Custom, us_None);
TUserSaySet=set of TUserSayType;
Var
VSet: TUserSaySet;
VType: TUserSayType;
NCounter: integer;
The begin
VSet:=[us_Whisper, us_Group us_Guild];

NCounter:=0;
For vType:=Low (TUserSayType) to High (TUserSayType) do
The begin
If vType in vSet then
Inc (nCounter);
end;
end;
  • Related