I am trying to change these 3 integers in the following object without having to create a bunch of if...then statements. Hope you can tell what I am trying to do by the following code snipets. I just want to be able to get and/or change the value of DTCurrentorder, DWCurrentOrder and MGSCurrentOrder by taking 'CurrentOrder' and putting 'MGS', 'DT', or 'DW' on the beginning. Hope this makes sense.
TBranchOrder = class(TObject)
DTCurrentOrder : integer;
DWCurrentOrder : integer;
MGSCurrentOrder : integer;
OrderQty, Avail: integer;
CurrentBuyOutOrder, BuyOutItemNum, CurrentOrder, StockItemNum: ^Integer;
//intialize all to zero
BranchOrder.DTCurrentOrder := 0;
BranchOrder.DWCurrentOrder := 0;
BranchOrder.MGSCurrentOrder := 0;
// GetPartType returns either ?MGS?, ?DW?, or ?DT?
PartType := GetPartType;
CurrentOrder := BranchOrder.FieldAddress (PartType+'CurrentOrder');
if CurrentOrder <> nil then
CurrentOrder^ := 1;