All pastes #430513 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-04-09 01:21 UTC
rendered paste body
program LongTextBreakDownByRon;
{*******************************************************************************
function LongTextBreakDown(TheString):string;
By: Ron and Boreas
Description: Formats a long string so that it looks like the result of
DTM to text. Pretty much only useful for BlackList to Text
*******************************************************************************}

function LongTextBreakDown(TheString:string):array of string;
var iter:integer;
tmpstring:string;
begin
  tmpstring:=TheString;
  //a := '  BL_Rune_essence := LoadBlackListFromString('+chr(39)+'0 1 12 13 14 28 41 53 67 92 102 117 141 165 189 213 237 246 260 282 293 304 305 315 324 325 336 337'+chr(39)+');';
  if length(tmpstring) > 62 then
  begin
    setarraylength(result,iter+1);
    result[iter]:=copy(tmpstring, 1, 61)+chr(39)+' +';
    //WriteLn(copy(tmpstring, 1, 61)+chr(39)+' +');
    delete(tmpstring, 1, 61);
    while length(tmpstring) > 62 do
    begin
      iter:=iter+1;
      setarraylength(result,iter+1);
      result[iter]:='       '+chr(39)+copy(tmpstring, 1, 53)+chr(39)+' +';
      //WriteLn('       '+chr(39)+copy(tmpstring, 1, 62)+chr(39)+' +');
      delete(tmpstring, 1, 53);
    end;
    iter:=iter+1;
    setarraylength(result,iter+1);
    result[iter]:='       '+chr(39)+tmpstring;
    //WriteLn('       '+chr(39)+tmpstring);
    end else
    begin
      setarraylength(result,1);
      result[0]:=tmpstring;
    end;
end;
var a:string;
aos:array of string;
   i:integer;
begin
a := '  BL_Rune_essence := LoadBlackListFromString('+chr(39)+'0 1 12 13 14 28 41 53 67 92 102 117 141 165 189 213 237 246 260 282 293 304 305 315 324 325 336 337'+chr(39)+');';
aos:=LongTextBreakDown(a);
for i:=0 to getarraylength(aos)-1 do
writeln(aos[i]);
end.