Internet Direct (Indy) Version 9.0.1 Beta
TQueryResult.Add
Creates resource records from raw data found in a DNS response.

function Add(Answer: string; var APos: Integer): TResultRecord;
Parameters
Answer: string
Raw data for the values found in the DNS response.

var APos: Integer
Offset to data for the resource record

Returns
TResultRecord - Resource record created to represent DNS response data.

Description
Add is a TResultRecord function that creates instances of resource records based on raw data found in a DNS response.

Add extracts the values used for Name, TTL, RData, RDataLength, RecType, and RecClass in the TResultRecord return value. Add also insures that the proper TResultRecord descendant is created to represent the resource record based on the the value in RecType. Add can create instances of TResultRecord descendants like TARecord, TNSRecord, TMXRecord, TNAMERecord, TSOARecord, THINFORecord, TTextRecord, TWKSRecord, TPTRRecord, and TMINFORecord. When an unsupported resource record type is encountered, Add creates a generic TResultRecord instance.

Add also call the TResultRecord.Parse method to read RData values in the resource record into their property counterparts.

Add updates the value in APos to indicate when values for the resource record have been read and processed.

Use Items to access resource records created for the query result.