Forum > Beginners

Trouble with parseing(SOLVED)

<< < (2/2)

JLWest:
@bytebites

  ?  Variable Lgth is not initialised.

 Don't understand.

bytebites:
It has not defined value.

dseligo:
Try this:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure ParseForLengthDS(const AStoParse: String;  Asl: TStringList);var sInsert: String = '           ';    iSSize: Integer = 86;    iPos: Integer;    s2Parse: String;begin  s2Parse := AStoParse;  While s2Parse <> '' do begin    If Length(s2Parse) <= iSSize then begin      Asl.Append(s2Parse);      Exit;    end;     iPos := RPosEx(' ', s2Parse, iSSize);    If iPos > Length(sInsert) then begin      Asl.Append(Copy(s2Parse, 1, iPos - 1));      s2Parse := sInsert + Copy(s2Parse, iPos + 1, MaxInt);    end    else begin      // in case space is not found, cut at specific length      Asl.Append(Copy(s2Parse,1,iSSize));      s2Parse := sInsert + Copy(s2Parse, iSSize + 1, MaxInt);       // other option: try to find space past the specific length and cut there:      //iPos := PosEx(' ', s2Parse, iSSize);      //If iPos > 0 then begin      //  Asl.Append(Copy(s2Parse, 1, iPos - 1));      //  s2Parse := sInsert + Copy(s2Parse, iPos + 1, MaxInt);      //end      //else begin      //  Asl.Append(s2Parse);      //  Exit;      //end;    end;  end;end;

Navigation

[0] Message Index

[*] Previous page

Go to full version