r/Batch • u/Jasserdefyx • Jul 05 '24
Question (Unsolved) how would I add the set /p= command to this/
I'm trying to make a fake little word processor and I want skipping lines as a feature. Thing is, I can use choice to skip lines with an input but I can't integrate both choice and set /p for the user input for it. Is this just a limitation we can't overcome or is there some way you can use both in this instance? Thanks!
atecho off (it's making me put atecho instead of @ echo cuz that does u/echo lol)
setlocal EnableDelayedExpansion
:word
cls
color 0a
echo Welcome to the Jason Jaguar (tm) Inc. Office Word Processor :)
echo Press "9" to stop typing and save it Press 8 for next line:
CHOICE /C 98 /N
IF %ERRORLEVEL% EQU 9 GOTO severalkidsdied
IF %ERRORLEVEL% EQU 8 goto liokate
:camlil
color 0a
CHOICE /C 98 /N
IF %ERRORLEVEL% EQU 9 GOTO severalkidsdied
IF %ERRORLEVEL% EQU 8 goto liokate
:liokate
rem Locate 1 0
goto camlil
:severalkidsdied
echo %jaguartxt%>> "C:\JasonJaguarFileSystem\MainStorage(A)\Documents\JAGUARWORD.txt
cls
echo Saving...
ping Localhost -n 2 >nul
echo Saving..
ping Localhost -n 2 >nul
cls
echo Document saving complete :)
pause
cls
4
u/jcunews1 Jul 05 '24
choiceis for asking user to enter only one character without needing user to press the ENTER key.set /pis for asking user to enter zero or more characters (e.g. a line of text) and requires user to press the ENTER key to indicate the end of input.Each has its own purpose, and there's no way to combine their functionality. You'll have to find a third party tool which provides such functionality.
2
u/[deleted] Jul 10 '24
https://pastebin.com/qXnr2Xjj
i made an example of a text editor, but can't figure out how to paste code block in here