Forum > Linux

Linux programme - Pos worked, then later it did not

<< < (2/3) > >>

jamie:
He's been told countless times to not use the "TEXT" like this.

 :o

Thausand:
When know then easy, when not know difficult  ;D

@stephanos
See no-print character difficult. Then choice not use print character for see.

Same is when copy-paste text. You write this is text you have in program (have copy in post) but is no true. Then other person not can help find error.

You also have describe what happen but situation not reproduce for other.

Then not find answer when ask help.

TMemo have property Lines (default property) type TStrings and is act same TStringList (is ancestor type TStrings), they same.

When use property TMemo Text then stuff happen that not know (I not want know because no relevant). I want know characters for Line and no Text.

When TMemo.Lines then all line is individual store/access and (when all good) have no non-print character. Character stop when Line break and break line not store in Line. Then no require search non-print character and make solution more easy.


--- 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";}};} ---...var  index:integer;  songers:TStringList;  Path2musicfolder:string;  Song:string; Path2musicfolder:='/media/stephanos/Sport Go/Music';songer:=TStringList.Create; for index:=0 to Memo1.Lines.Count-1 dobegin  // 1st: Path2Mp3:=Alasdair Roberts/Farewell Sorrow/Farewell Sorrow.mp3  Path2Mp3:=Memo1.Lines[index];    // song  := '/media/stephanos/Sport Go/Music/Alasdair Roberts/Farewell Sorrow/Farewell Sorrow.mp3'  song:= ConcatPaths(Path2musicfolder, Path2Mp3);    // if want make clean begin/end. Is alert when name have space or valid non-print begin/end  song:=trim(song);   // add for songer, now have copy memo line  songer.Add(song);end; // now have use songerfor song in songer do var  p:string;begin  // have indicate #13 #10 when write  if song.contains(#13) or song.contains(#10) then p:='XXX ' else p := '';   // write terminal if can  writeln(p + ' ' + song);    // write memo for show  Memo1.Lines.Append(p + ' ' + song);end; songer.Free;... 
Can have other problem when unicode and problem path separator but is simple example for show how can make work. I not have all understand what explain do. Please have share work code when need help more.

I have make copy songer for lines TMemo but can have omit then use memo direct. I no understand explain and what is result want.

stephanos:
Dear cdbc and all

Spot on.  #13, not #10 – Solved
Thanks
Case closed, but another coming soon

Fred vS:

--- Quote from: stephanos on September 18, 2025, 08:59:58 pm ---Spot on.  #13, not #10 – Solved

--- End quote ---

Instead of #13 you may use lineending constant, it is cross-platform.

ccrause:

--- Quote from: Fred vS on September 19, 2025, 01:48:38 am ---
--- Quote from: stephanos on September 18, 2025, 08:59:58 pm ---Spot on.  #13, not #10 – Solved

--- End quote ---

Instead of #13 you may use lineending constant, it is cross-platform.

--- End quote ---
Since the OP is working with a TStrings decendant, rather use the linebreak property for internal consistency.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version