TIP: Click on subject to list as thread! ANSI
echo: delphi
to: CARL WARING
from: ERIC SCHREIBER
date: 1997-06-22 02:41:00
subject: Loading files with spaces in names

-=> Carl Waring wrote to Eric Schreiber <=- 
ES> Anyone know how to handle accepting long file names on the command line? 
CW> I belive that long filenames should be enclosed in double-quotes,
CW> speech marks, or whatever you call them. i.e. Shift+2. No doubt a
CW> proper programmer will answer this correctly soon :-)
Problem is, a *lot* of people have answered this, but I must have not been 
clear with my original question, since they've all provided pretty much the 
same answer that's not relevant to my problem.
Hmmm. The above sounds harsher than I intended it to, but at 2:30 in the 
morning I'm having trouble coming up with alternate phrasing. Standard 
apology applies.
Back to the problem...
I know that if I want to *FEED* a long file name with embedded spaces to 
another program I should enclose it in quotes - for example, at a DOS prompt 
I can type CD "Program Files" to change to that dir.
What I'm trying to discover is how to accept a long file name on the command 
line of MY program:
I've written a 16-bit text editor. When it's the associated program for a 
.TXT file, when I double click readme.txt in Explorer, readme.txt gets loaded 
into my editor, no sweat.
However, when I port that editor into 32-bit and associate .TXT files to the 
new 32-bit version, when I double click "Read Me Now.txt" in explorer, I get 
error "File not found: Read". My program is parsing paramstr(1) ('Read') as 
unrelated to paramstr(2) ('Me') etc.
It's since ocured to me to whip together a prog that will display to me the 
entire command line, so I can see exactly what Win95 is sending. Perhaps then 
I'll figure it out.
I guess what I'm looking for is someone to hand me code on a silver platter. 
I hate the 'original thinking' part of programming :-)
EEAS
eric@kobayashi.com          http://www.kobayashi.com/maru/
--- Blue Wave/DOS v2.21
---------------
* Origin: The Aircrash Bureau Chicago 773-278-1195 33.6 (1:115/327)

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™.