{ GV> Hi Wim, Hi Greg... GV> It wouldn't be difficult to write Pos, Copy, Assign, etc., which GV> operate on an ARRAY OF CHAR -- using the ASCIIZ scheme, or a length GV> WORD (rather than length byte) at array elements [0] and [1]. As you can see in a other message has wim van der vegt written a complete unit with these functions :-) it was a 'little' bit reprogramming to implement these new functions but it was worth while GV> Greg_ Thanx for your answer, Wim here is the code : } Unit MyStr; INTERFACE Const maxlength = 512; nul = #00; cr = #13; lf = #10; sp = #32; Type indexrange = 0..maxlength; stringtype = Record length : indexrange; chars : Array[1..maxlength] Of char; End; Function Long_Length(s : stringtype) : indexrange; Procedure Long_Readln(Var f : text;var l : stringtype); Procedure Long_Write(Var f : text;var l : stringtype); Procedure Long_Writeln(Var f : text;var l : stringtype); Procedure Long_Copy(s : stringtype;Var d : stringtype; index,count : indexrange); Procedure Long_Concat(Var d : stringtype;s : String); IMPLEMENTATION {---------------------------------------------------------} { Author : Ir. G.W. van der Vegt } { Project : Longer strings } { Source : Pascal + Data Structures by Dale/Lilly } { ISBN 0-669-07239-7 } {---------------------------------------------------------} { Modified to give less errors and act more like TP's } { functions. Can be made more efficient by using move, } { moving the inc of length's out of the for loops and } { not using the Length function to calc the length but } { use the field in the record. etc. } {---------------------------------------------------------} { Because Turbo Pascal's Functions won't return records } { most of the Turbo Pascal String functions equivalents } { can only be procedures. } {---------------------------------------------------------} { The code hasn't been tested well yet so expect some } { errors to be in it. All I have detected are fixed. } { For testing set maxlength at 20 or 30. } {---------------------------------------------------------} Function Long_Length(s : stringtype) : indexrange; Begin Long_Length:=s.length; End; Procedure Long_Readln(Var f : text;var l : stringtype); Begin l.length:=0; Fillchar(l.chars,maxlength,sp); While NOT(Eoln(f) OR Eof(f)) AND (l.length