MS-DOS

Moderators: blip
Number of threads: 362
Number of posts: 872

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
DOS Variables question Posted by E-ternal on 13 Jul 2005 at 7:58 AM
Why doesnt this work? How can I store a value from errorlevel:


ECHO Settings Menu
ECHO ================
ECHO.
ECHO blah blah blah...?
ECHO.
ECHO
ECHO [1] Option 1
ECHO [2] Option 2
ECHO.
ECHO.
ECHO Enter your choice:

CHOICE /C:12 >NUL

IF ERRORLEVEL = 2 SET SRC = "2"
IF ERRORLEVEL = 1 SET SRC = "1"

ECHO You have entered %SRC% > A:\OUTPUT.TXT
Report
Re: DOS Variables question Posted by E-ternal on 13 Jul 2005 at 9:31 AM
OK it works in MS-DOS if I remove the spaces:

SET SRC=%ERRORLEVEL%

ECHO %SRC%


But...now it doesnt seem to work in PC-DOS damned. Anyone familar with variablea in IBM PC-DOS?



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.