TIP: Click on subject to list as thread! ANSI
echo: delphi
to: ERIC SCHREIBER
from: CHRIS MANN
date: 1997-06-20 07:47:00
subject: Loading files with spaces in names

On Jun 11 17:36 97, Eric Schreiber of 1:115/327 wrote:
 ES> I have an MDI text editor that I'm porting from Delphi 1 to Delphi 3. 
 ES> The 16-bit version could handle loading an associated *.txt file when 
 ES> that file was double clicked in File Manager or Explorer. For 16-bit 
 ES> applications, file and directory names never have embedded spaces.
 ES> However, since the ported version is recognized as a 32-bit app, 
 ES> Win95 is sending it the unadulterated long file names when a file is 
 ES> double clicked in Explorer. My program parses in file name from the 
 ES> command line, and when it hits a space character it assumes that's 
 ES> the complete file name and gives me a 'file not found' error.
 ES> Anyone know how to handle accepting long file names on the command 
 ES> line? Is Win95 feeding the file names with some kind of delimiter?
 ES> Thanks in advance.
Try this out, it's a function from XTools or something like that. I used it 
with my editor to do what you are talking about with the Explorer.
function strCmdLine : string;
var
  i : integer;
begin
  Result := '';
  for i := 1 to ParamCount do
    Result := Result + ParamStr(i) + ' ';
    Delete(Result,Length(Result),1);
end;
Hope this helps you out...
Chris
--- Msgedsq 2.2e
---------------
* Origin: Esc1.71 - When you're old enough to drive the bus. (1:157/534.30)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.