News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Using spaces in a path with qeditor

Started by sinsi, March 17, 2008, 11:56:50 AM

Previous topic - Next topic

sinsi

This bugged me a bit, so I tried a few changes to the buildall.bat file and came up with the following - this might only work in XP, since it uses a batch file command that I've never seen before.

Change all %1 to %*

Apparently %* is all parameters (%1 to %255), and it seems to preserve spaces. Here's a link http://www.ss64.com/ntsyntax/parameters.html

Output from "Build All" menu command in qeditor

Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: C:\Documents and Settings\me\Desktop\smallwin\smallwin.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

Volume in drive C has no label.
Volume Serial Number is 98A2-152D

Directory of C:\Documents and Settings\me\Desktop\smallwin

21/01/2003  01:21 AM             3,464 smallwin.asm
17/03/2008  10:18 PM             2,048 smallwin.exe
12/03/2004  04:47 PM             2,569 smallwin.inc
17/03/2008  10:18 PM             2,048 smallwin.obj
               4 File(s)         10,129 bytes
               0 Dir(s)  244,980,862,976 bytes free
Press any key to continue . . .


Does this work for other windows versions?
Light travels faster than sound, that's why some people seem bright until you hear them.

jj2007

Your version choked for me, on XPSP2. I work with the set below, and have no problems with spaces, using "oBody" as an all-purpose file body variable (e.g. for checking if a file-specific rc file is there).
Here is a good reference for batch params: http://www.computerhope.com/call.htm

@echo off
title AsmBuild
%~d1
chdir %~dp1
set oBody=%~n1
echo.
echo *** Assemble, link and run %oBody% ***
echo.
if exist "%oBody%.obj" del "%oBody%.obj"
if exist "%oBody%.exe" del "%oBody%.exe"

if exist "%oBody%.rc" (
\masm32\bin\rc /fo rsrc.res "%oBody%.rc"
goto AssRun
)

if exist rsrc.rc \masm32\bin\rc rsrc.rc

:AssRun
if exist rsrc.res (\masm32\bin\cvtres /machine:ix86 rsrc.res)
\masm32\bin\ml /nologo /Fl /Sn /c /coff "%oBody%.asm"

if errorlevel 1 goto errasm

if not exist rsrc.obj goto nores

\masm32\bin\link /SUBSYSTEM:WINDOWS "%oBody%.obj" rsrc.obj

if errorlevel 1 goto errlink
goto LinkOk

:nores
\masm32\bin\link /SUBSYSTEM:WINDOWS "%oBody%.obj"
if errorlevel 1 goto errlink

:LinkOk
dir "%oBody%.*"

"%oBody%.exe"
goto TheEnd

:errlink
echo.
echo *** Link error ***
goto errtitle

:errasm
echo.
echo *** Assembly Error ***

:errtitle
title AB error
pause
goto TheEnd

:TheEnd
del "%oBody%.lst"