program ekko { www.merlyn.demon.co.uk >= 2005-09-20 } ; { Firstly, it copies StdIn (if waiting) to StdOut (to ^Z /EoF); after that ... each parameter number, 0..255 = $0..$FF is echoed as a character ; after a parameter starting "&", until one starting "#", the character '$' is prepended to every general parameter, to indicate Hexadecimal ; a parameter starting "^" is echoed as a control character ; a parameter starting "*" is echoed as spaces ; a parameter starting "'" is echoed without the quote ; 13 = CR, 10 = LF ; use 13 10 or ^M ^J for newline (no auto-CRLF) } { There is at least one other EKKO - From: "Norman L. DeForest" My EKKO command can be found here: http://www.chebucto.ns.ca/~af380/Tips.html#Tip011 } uses Dos ; var S : string ; J, K : integer ; Regs : Registers ; C : char ; const Buck : string [1] = '' ; BEGIN ; {$IFNDEF MSDOS} Fail! {$ENDIF} Regs.AH := $0B ; MsDos(Regs) { character - $FF ready, $00 not } ; if Regs.AL=$FF then while not EoF do begin Read(C) ; Write(C) end ; for K := 1 to ParamCount do begin S := ParamStr(K) ; case S[1] of '*' : Write('':Length(S)) ; '''' : Write(Copy(S, 2, 255)) ; '&' : Buck := '$' ; '#' : Buck := '' ; '^' : Write(char(Ord(S[2]) and $1F)) ; else begin Val(Buck+S, byte(C), J) ; if J<>0 then HALT(1) ; Write(C) end ; end {S[1]} ; end {K} ; END.