= POOL_SIZE THEN M_AddFlowRec := -1; RETURN; END_IF // Find a free slot in the pool FOR i := 0 TO (POOL_SIZE - 1) DO // If slot is free, set the flow recipe data IF (_astFlowRecPool[i].iProdIdx = -1) THEN _astFlowRecPool[i] := stFlowRecipe; _astFlowRecPool[i].iProdIdx := i; // Increment number of recipes in the pool _iFlowRecCnt := _iFlowRecCnt + 1; // Return index of the added flow recipe M_AddFlowRec := i; RETURN; END_IF END_FOR]]> (_astFlowRecPool[iCurrNodeIdx].uiNodeCnt - 1)) THEN M_CheckNextNodeIdx := FALSE; ELSE M_CheckNextNodeIdx := TRUE; END_IF]]> (POOL_SIZE - 1)) THEN M_CheckPoolBounds := FALSE; ELSE M_CheckPoolBounds := TRUE; END_IF]]> (_astFlowRecPool[iIdx].uiNodeCnt - 1)) THEN // If there is no next node set to -1 // to indicate, that this was the last node in the // flow recipe _astFlowRecPool[iIdx].iNextNode := -1; ELSE _astFlowRecPool[iIdx].iNextNode := _iNextNodeIdx; END_IF // Return success M_ReportResult := TRUE;]]>