public static XQt1532OutBlock[] ListFromQuery(XQt1532 query) { int count = query.GetBlockCount(XQt1532OutBlock.BlockName); List <XQt1532OutBlock> list = new List <XQt1532OutBlock>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1532OutBlock block = new XQt1532OutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.tmname = query.GetFieldData(block.GetBlockName(), "tmname", i).TrimEnd('?'); // char 36 block.avgdiff = query.GetFieldData(block.GetBlockName(), "avgdiff", i).ParseFloat("avgdiff"); // float 6.2 block.tmcode = query.GetFieldData(block.GetBlockName(), "tmcode", i).TrimEnd('?'); // char 4 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public XQt1532OutBlock[] GetBlocks() { XQt1532OutBlock[] instance = XQt1532OutBlock.ListFromQuery(this); return(instance); }