delphi - IF-ELSE with multiple IFs -


i'm trying multiple check of values can't work.

if derobmodel.houseproperties.intvalue['volumenorth'] = 1     ivol[2] := 1;   else   if derobmodel.houseproperties.intvalue['volumeeast'] = 1     ivol[2] := 1;   end   else   if derobmodel.houseproperties.intvalue['volumewest'] = 1   ivol[2]:=1;    end; 

i want check if "volumenorth" 1, , index ivol[2] going 1, otherwise if east 1 ivol[2] should 1, , if isn't there's check west , south (this isn't in code yet). if none of them 1 nothing should happen ivol[2]. how work?

thanks!

dmitry's answer right scenario. i'm advocate of using begin , end if statements, code clarity. helps understand program flow better.

if derobmodel.houseproperties.intvalue['volumenorth'] = 1 begin   ivol[2] := 1; end else if derobmodel.houseproperties.intvalue['volumeeast'] = 1 begin   ivol[2] := 1; end else if derobmodel.houseproperties.intvalue['volumewest'] = 1 begin   ivol[2]:=1; end; 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -