[SOLVED] To drop into DBMemo, filename is chopped (incomplete) lazarus / 16-Databases ---------------------------------------------------------------------- Elmug · 2012-07-03 09:38 Hi again, This is what I have now, but finding an issue (FileName is correct at DBMemo box, but not when copied to Edit1.Text box): Code: [Select]procedure TForm1.FormDropFiles(Sender: TObject; const FileName: array of String); var   i: Integer; begin    DBmemo1.Lines.Insert(0, FileName[i]);        {result of above line is: DBMemo correctly shows FileName, with drive and PATH}    Edit1.Text := DBMemo1.Lines[0];        {result of above line is: Edit1.Text (the filename) is incomplete, chopped off string. Starts correctly with    drive, folder, and ends in incomplete  folder name, as if the string did not fit the container}   {DBmemo1.Lines.LoadFromFile(Edit1.Text); }         //this is intent, but now commented out        // due to filename is CUT-OFF and if not commented out, error message: can't read  filename. end; I would appreciate help on why Edit1.Text string is incomplete, while the DBMemo1 box shows complete and correct filename, with drive, and all folders and subfolders in the path. Thanks! ---------------------------------------------------------------------- Knipfty · 2012-07-17 15:03 Can you show us the string before and after? You may be hitting a size limit, like 255. ---------------------------------------------------------------------- Elmug · 2012-07-25 08:37 Quote from: Knipfty on July 17, 2012, 05:03:16 pmCan you show us the string before and after? You may be hitting a size limit, like 255. Hi Knipfty, Thanks for replying. I came back to this older thread to say that  I found out since that when fileName(s) are dropped in Memo box, the built in methods try to guess some sort of formatting (probably since there are no ends of line), since what is dropped may be long chunks of text. I was just dropping one filename, though, and this happens. Well in this case, dropping filenames, complete with path, the "chopping" is not actually a chopping but a "formatting" that makes more than one line out of what I expected to be ONE single complet line. On the fact that a Memo is an array of lines, I was fetching index [zero] and thus getting an incomplete path\filename. So I had to use some code to resolve it. ---------------------------------------------------------------------- Leledumbo · 2012-07-25 11:15 What platform is this? On Windows, there could be a limitation of file path size, defined by MAX_PATH constant. ---------------------------------------------------------------------- Elmug · 2012-07-26 01:48 Quote from: Leledumbo on July 25, 2012, 01:15:29 pmWhat platform is this? On Windows, there could be a limitation of file path size, defined by MAX_PATH constant. Hi Leledumbo, The platform is Windows 7, 32 bit Lazarus. Since I verified the problem using rather short path names, in thinking the longpath\name could be the problem, or spaces in between filenames, and still the issue manifested, and since I did read somewhere documentation on the fact that formatting of what's dropped is tried to be "guessed" (?), I concluded that the problem was in THAT (in that formatting), and not on the length of the path. Also, the total Path\FileName WAS available in the Memo field, and that allowed resolving with basic string functions, rather than what would have been simpler, i.e., get from the memo the first line using array [index=zero]. Thanks for the suggestion. P.S. On really short and simple path names where no formatting seemed to occur, the array/index way was OK, but not when the path-name wa just a little longer.