Got around it doing this:
if pos('10.1.68',getIPS.text)>0 then
pcipaddress := copy(getIPS.text,pos('10.1.68',getIPS.text),13)
else if pos('10.1.69',getIPS.text)>0 then
pcipaddress := copy(getIPS.text,pos('10.1.69',getIPS.text),13)
else if pos('10.1.70',getIPS.text)>0 then
pcipaddress := copy(getIPS.text,pos('10.1.70',getIPS.text),13);
pcsubpos := lastdelimiter('.',pcipaddress);
pcsubnet := copy(pcipaddress,1,pcsubpos-1) ;
pcdbipadd := pcsubnet+'.6' ;
PQConnection1.HostName := pcdbipadd;
It appears to work and the three sub nets are all we have in the office
Thanks
TimCS