auto adding brackets to my if statement
I'm using free-flow scripting and have a reasonably complex if statement being used to filter a whole bunch of criteria in a search form. It was all going along ok, until I added the tenth criteria. As soon as I did that, Deluge decided that I had the brackets all wrong and has added in 5 more sets of brackets and completely broken the logic.
So to the Deluge developers, please leave my brackets alone - I know what I am doing here.
My If Statement
if (((Item_Type_Rec = input_ItemType) || (input_ItemType = null)) && ((Item_Size_Rec = input_ItemSize) || (input_ItemSize = null)) && (State_Rec = input_State.toString()) && ((PostCode_Rec = input_PostCode) || (input_PostCode = null)) && (PU_Time >= ItemLendStartTime) && (PU_Time < ItemLendEndTime) && (ItemLendEndDateBoolean = 1))
Deluge auto re-write
if ((((((((Item_Type_Rec = input_ItemType) || (input_ItemType = null)) && ((Item_Size_Rec = input_ItemSize) || (input_ItemSize = null))) && (State_Rec = input_State.toString())) && ((PostCode_Rec = input_PostCode) || (input_PostCode = null))) && (PU_Time >= ItemLendStartTime)) && (PU_Time < ItemLendEndTime)) && (ItemLendEndDateBoolean = 1))
My fix - well it looks like I will just have to add in another nested if statement. Thanks Deluge!