Message-ID: <000b01c1671e$ab4cc720$027efea9@atlantis> From: "Matthias Paul" To: Subject: Re: DRDOS TIMEOUT, YESCHAR, NOCHAR , GETKEY, and ONERROR (Was: Re: DR-DOS + QEMM) Date: Wed, 7 Nov 2001 00:44:37 +0100 Organization: University of Technology, RWTH Aachen, Germany MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id fA6Nuej24001 Reply-To: opendos AT delorie DOT com On 2001-11-05, Robert Gilmore wrote: > OK I used the chain statement chain=config.sys and set com spec to > autoexec.bat and it is ok now,can use qemm optimize and if I want,I can > just remove the chain statement from dconfig.sys and revert back.so this > is better than I expected! If you are going to make the CHAIN= statement a permanent change, I suggest to improve it as follows: TIMEOUT=2,YESCHAR ; 2 second delay, use default system answer for YES ?CHAIN=CONFIG.SYS ; query user, if YES chain to QEMM-optimized config TIMEOUT=0,NOCHAR ; reset to original timeout defaults This will wait for two seconds to press [,N] to chain to CONFIG.SYS. If no key is pressed, YES is assumed as well because you changed the default query answer in the TIMEOUT= statement. Answers other than ´Y´ or ´N´ (and their equivalents, see below) will be discarded and will retrigger the timeout. or maybe better: TIMEOUT=2,NOCHAR ; 2 second delay, use default system answer for NO ?"Continue with old DR-DOS configuration? Press [Y,]" GOTO continue TIMEOUT=0 ; reset to original timeout defaults CHAIN=CONFIG.SYS ; chain to QEMM-OPTIMIZED configuration files :continue TIMEOUT=0 ; reset to original timeout defaults If for cosmetical reasons you don´t want the question to occur, you can alternatively code this as a hotkey (SPACE in this example) as follows: TIMEOUT=2 ; 2 second delay for Y/N queries, SWITCH=, and GETKEY= GETKEY ; get key character as errorlevel or wait until timeout TIMEOUT=0 ; reset to original timeout default of no timeout ONERROR<>32 CHAIN=CONFIG.SYS ; chain if not SPACE (ASCII code 20h) pressed or if you prefer to sense for *any* key: TIMEOUT=2 ECHO Press key to continue with old configuration... GETKEY TIMEOUT=0 ONERROR=1024 CHAIN=CONFIG.SYS ; 400h is the magic value for "timeout" Finally, if you prefer to press ´N´ for the old configuration, it might look as: TIMEOUT=2 ; 2 second delay for Y/N queries, SWITCH=, and GETKEY= GETKEY ; get keyboard scancode or wait until timeout occured TIMEOUT=0 ; reset to original timeout defaults of no timeout ONERROR<>78 ONERROR<>110 CHAIN=CONFIG.SYS ; 4Eh and 6Eh are for "N"/"n" Now a few reference notes on the syntax of these special CONFIG.SYS directives: The DR DOS 6.0+ TIMEOUT= syntax is: TIMEOUT=[seconds][[,]query_answer[[,]switch_answer [comments]]] The enhanced DR-DOS 7.02+ syntax is: TIMEOUT=[seconds][[,]query_answer][[,]switch_answer] [comments] TIMEOUT without any parameters will reset seconds to 0 and thereby disable any timeouts. Omitted other values will leave the corresponding setting as it is. Since DR DOS 7.02+ it is also possible to skip values using the otherwise optional ´,´ as separator, e.g. TIMEOUT=,,2 to set the switch_answer to ´2´ will work with 7.02+ but not with DR DOS 6.0. may either be x=1..65535 for a x second timeout or 0 to disable any timeouts (the boot default is: 0) specifies the ASCII code of default query answer (the boot time default is ´N´) or - since DR DOS 7.02+ - one of the special tokens "YESCHAR" or "NOCHAR". In the latter case, the currently active system setting for Yes or No characters will be used instead of immediate characters. These settings default to ´Y´ and ´N´ but can be changed with the Novell DOS 7+ YESCHAR=char directive and the DR-DOS 7.02+ NOCHAR=char directive. When changing YESCHAR= or NOCHAR= and the query answer is equal to one of them, the query answer will also be changed implicitly, so that these values do not fall apart any more, as long as only the YESCHAR/NOCHAR tokens (and not immediate characters) are used with TIMEOUT=. The given query answer is assumed on timeouts in any kind of Yes/No queries during CONFIG.SYS, either those explicitly invoked by using ?["query_text"] config_directive [=] ... or config_directive?["query_text"] [=] ... or implicitly in the normal F8 single-stepping mode or the new DR-DOS 7.02+ F7 trace-into-single-stepping mode. Depending on if the query answer matches the current YESCHAR= or NOCHAR= settings, and depending on if timeouts are currently running or not, the default answer is shown highlighted in the Yes/No queries like, for example, [,N] or [Y,], which will, of course, reflect the current Yes and No characters. Otherwise these queries will be displayed just as [Y,N] instead. DR-DOS 7.02+ also adds some alias keys: Pressing TAB will auto- matically select the default query answer, which is convenient if you often change between queries defaulting to Yes or No and want to have simple "no-brain" path through the wade of queries. This may also help international users until a keyboard driver is loaded, because the generated characters do not necessarily match the keycaps until this moment (for example, in Germany you´d have to press the Z-key to get a ´Y´). ENTER is always assumed to be an equivalent for pressing the Yes char, and SPACE is always assumed to be an alias for No, so you can easily navigate through the configuration file with a single hand and without a need to look at the keyboard. The function of the ESC key depends on the current mode of operation, in either of the single-stepping modes it will select the resume key (similar to ´R´) to continue with normal processing, otherwise it also selects the default query answer which is assumed to be the "safe" default. Timeouts can be temporarily disabled when entering the so called DIAG mode by toggling Scrollock to on (either by pressing the Scrollock key or by using the new SCROLLOCK=ON directive). The timeout will be retriggered when leaving DIAG mode again, but intentionally not when the previous timeout timed out in background while in DIAG mode; in this case you have to press the corresponding queries keys to come back in the normal flow of operation. One more difference between the old and the DR DOS 7.02+ query behaviour is that DR DOS 7.02+ will beep and discard any keys which do not classify as either Yes, No (or Resume) in these situations, while the older issues took them as No, which imposed quite some trouble to blind or otherwise disabled, as well as to international users when they accidently hit the wrong keys. Anyway, the old behaviour of taking any invalid input as No can be reactivated by placing a SWITCHES=/Y directive in the [D]CONFIG.SYS file. Error beeps can be disabled using SWITCHES=/B. is the ASCII code of the default answer for SWITCH= statements. The boot time default is ´1´. The specified value is not necessarily one that is valid for SWITCH=, as only ´1´..´9´ (and since DR-DOS 7.02+ also ´0´) are accepted by SWITCH= (given that many switch labels exist in a SWITCH= command). Wrong keys will get discarded by the SWITCH= directive and will re-trigger the timeout. The syntax of the DR DOS 6.0+ GETKEY directive is simply: GETKEY [=] [comments] This directive waits for a keypress which produces a character and then takes the ASCII code of the pressed key as config errorlevel. If no key is pressed but a timeout has timed out, the errorlevel will be set to 1024. (Yes, the config errorlevel is 16-bit in contrast to the standard errorlevel which is only 8 bits wide.) The config errorlevel is also set by a number of other directives (including ERROR [errorlevel], RETURN [errorlevel]), and in particular will reflect the success or error conditions after INSTALL= or DEVICE= statements. (For details on this see NWDOSTIP.TXT in my MPDOSTIP.ZIP archive.) What´s interesting here is that the errorlevel can be probed with the DR DOS 6.0+ ONERROR= directive, the full syntax is: ONERROR [=|>|<|<>|>=|<=|=>|=<|==] value directive [params] where value ranges between 0 and 65535. If no relation is specified ONERROR assumes = (in contrast to the COMMAND.COM "IF ERRORLEVEL [relation] value" command, which assumes >= in this situation). If the condition is true, the given directive is executed with params. This can be any other [D]CONFIG.SYS directive, including ONERROR itself. If the directive is omitted, execution continues in the next line. Hope it helps, Matthias -- Matthias Paul, Ubierstrasse 28, D-50321 Bruehl, Germany ; http://www.uni-bonn.de/~uzs180/mpdokeng.html; http://mpaul.drdos.org