What should the trim function do? It seems to me that under gpc it removes trailing spaces from a string. Under Delphi it removes leading and trailing spaces. Unfortunately I don't have any Turbo Pascal documentation to hand (I assume trim is a Borlandism).