- Timestamp:
- Sep 3, 2015, 1:32:33 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/linetime.lpr
r6 r7 34 34 TermString: string; 35 35 TermStringIndex: Integer; 36 procedure TermCheckString(Buffer: string); 36 37 function FindLineEnding(Buffer: string; var FoundLineEnding: string): Integer; 37 38 procedure WriteRaw(Text: string); … … 118 119 end; 119 120 121 procedure TMyApplication.TermCheckString(Buffer: string); 122 var 123 I: Integer; 124 begin 125 // Search for termination string 126 if TermString <> '' then 127 for I := 1 to Length(Buffer) do begin 128 if TermStringIndex > Length(TermString) then begin 129 Terminate; 130 Break; 131 end; 132 if Buffer[I] = TermString[TermStringIndex] then 133 Inc(TermStringIndex) 134 else TermStringIndex := 1; 135 end; 136 end; 137 120 138 function TMyApplication.FindLineEnding(Buffer: string; var FoundLineEnding: string): Integer; 121 139 const … … 161 179 procedure TMyApplication.PrintOutput(Output: string); 162 180 begin 181 TermCheckString(Output); 163 182 if NewLine then begin 164 183 if not FirstLine then begin … … 227 246 end; 228 247 229 // Search for termination string230 if TermString <> '' then231 for I := 1 to Length(Buffer) - 1 do begin232 if TermStringIndex > Length(TermString) then begin233 Terminate;234 Break;235 end;236 if Buffer[I] = TermString[TermStringIndex] then237 Inc(TermStringIndex)238 else TermStringIndex := 1;239 end;240 248 until P = 0; 241 249 PrintOutput(Buffer);
Note:
See TracChangeset
for help on using the changeset viewer.