sorry that was a bit soft off me i comment out the error messages. this is the function i have: procedure TfrmStandardConversion.SplitPND1D2D3(const suppnco: String; out D1S, D2S, D3S: Integer; out suppnc: String; out ErrorCode: Integer); var D1A, D2A, D3A: Integer; supp_pnA: String; begin ErrorCode:=0; //First we need to see if the var we are passed IS 19 long. if (Length(suppnco)=19) then begin supp_pnA := StringReplace(Copy(suppnco, 1, 6), ' ', '', [rfReplaceAll, rfIgnoreCase]); if (Length(supp_pnA) <> 6) then ErrorCode:=3; if (Length(StringReplace(Copy(suppnco, 9, 3), ' ', '', [rfReplaceAll, rfIgnoreCase])) = 0) then ErrorCode:=4; if (Length(StringReplace(Copy(suppnco, 13, 3), ' ', '', [rfReplaceAll, rfIgnoreCase])) = 0) then ErrorCode:=4; if (Length(StringReplace(Copy(suppnco, 17, 3), ' ', '', [rfReplaceAll, rfIgnoreCase])) = 0) then ErrorCode:=4; try D1A := StrToInt(Copy(suppnco, 9, 3)); except on Exception : EConvertError do ErrorCode:=2; end; try D2A := StrToInt(Copy(suppnco, 13, 3)); except on Exception : EConvertError do ErrorCode:=2; end; try D3A := StrToInt(Copy(suppnco, 17, 3)); except on Exception : EConvertError do ErrorCode:=2; end; if (ErrorCode = 0) then begin suppnc := supp_pnA; D1S := D1A; D2S := D2A; D3S := D3A; end; end else ErrorCode:=1; end; and i want to extract the three D1S, D2S, D3S and suppnc and i think i an getting stuck because of the contents of the parameters when i have called the function. do you know what i should put. thank you btw!
to err is to be human but to really foul things up you need a computer!