0 Members and 1 Guest are viewing this topic.
procedure ActivateServer();var b: string; i: integer;begin b:= ReadFile('MyFile.txt'); for i:= 1 to length(b) do begin WriteLn(b[i] + '**'); end;end;
u
function IXSplit(SOURCE: string; Delimiter: string): array of string;var i, x, d: integer; s, b: string;begin d:= length(Delimiter); i:= 1; SetArrayLength(Result, 0); while (i <= length(SOURCE)) do begin s:= Copy(SOURCE, i, d); if (s = Delimiter) then begin SetArrayLength(Result, x + 1); Result[x]:= b; Inc(i, d); Inc(x, 1); b:= ''; end else begin b:= b + Copy(s, 1, 1); WriteLn(b); Inc(i, 1); end; end; if (b <> '') then begin SetArrayLength(Result, x + 1); Result[x]:= b; end;end;procedure ActivateServer();var b: string; a: array of string;begin b:= ReadFile('MyFile.txt'); a:= IXSplit(b, ' ');end;
gimmemore ofcourse jacuzzi goodbye
It's ending with two chars, 13 and 10 (carriage return + newline). Looks like that's where your issues are. Does it work with Explode?
file := ReadFile('filewhatever');file := copy(file, 0, length(file)-2);
function ReadFromFile(File_Name: string): string;begin Result:= ReadFile(File_Name); Result:= Copy(Result, 0, length(Result) - 2);end;