www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2014/04/11/07:45:11

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: WE AT completely DOT invalid (Wolfgang Ehrhardt)
Newsgroups: comp.os.msdos.djgpp,comp.os.msdos.programmer
Subject: Re: Why does PROMPT accept 128 characters if the command line is only 126?
Date: Fri, 11 Apr 2014 11:25:23 GMT
Organization: Aioe.org NNTP Server
Lines: 42
Message-ID: <5347d104.18861296@news.aioe.org>
References: <op DOT xd4mshm76zenlw AT localhost>
NNTP-Posting-Host: 2H8GDv+gP2BXBhuPU9DKHA.user.speranza.aioe.org
X-Complaints-To: abuse AT aioe DOT org
X-Notice: Filtered by postfilter v. 0.8.2
X-Newsreader: Forte Free Agent 1.21/32.243
Bytes: 2215
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Thu, 10 Apr 2014 20:39:43 -0400, "Rod Pemberton"
<dont_use_email AT xnothavet DOT cqm> wrote:

>
>If the command line is 126 characters, why does PROMPT accept 128?
>
>In MS-DOS v7.10 (in real mode and Windows SE console), PROMPT will
>accept upto 128 characters for a new prompt, when using a single
>character prompt.  E.g.,
>
>   PROMPT $Q
>   PROMPT <...enter 128 characters...>
>
>RBIL says 128 bytes are available in the PSP, two of which are in-use.
>DJGPP says MAX_INPUT is 126 in limits.h.
>
>I'm hoping someone knows why this is off by two ...

Not the off by two, but: PROMPT accepts more than 128 characters in
Win98, only the command line interpreter limits the input (and adds a
space and a CR). If you prepare a batch file named lprompt.bat (with
all input on one line)

@prompt 12345678901234567890123456789012345678901234567890123456789
0123456789012345678901234567890123456789012345678901234567890123456789
01234567890123456789012345678901234567890

and execute it, you will see omething like this:

C:\>edit lprompt.bat

C:\>lprompt.bat

12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890dir /b lprompt.bat
LPROMPT.BAT

12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019