Microsoft KB Archive/79027

= How to Suppress &quot;Insert Diskette&quot; on Single Floppy Systems =

Article ID: 79027

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q79027



SUMMARY
When using the CURDIR$ or DIR$ function, or the CHDRIVE statement in Basic Professional Development System (PDS) on a single floppy system, the MS-DOS message

Insert Diskette for Drive B: and press any key when ready

-or-

Insert Diskette for Drive A: and press any key when ready

will appear if you attempt to access a single floppy drive as both drives A and B in the same program. In many cases, this message is inconvenient because it clutters the output screen. This is an MS-DOS message that can be suppressed using the method below.

This information applies to Microsoft Basic PDS versions 7.0 and 7.1 for MS-DOS.



MORE INFORMATION
The above message will only appear when the program is running on a single floppy system, because MS-DOS allows that one floppy to be referenced as logical drive A or B. However, when you change the drive reference (such as by typing &quot;a:&quot; then &quot;b:&quot;, or by using any of the Basic functions that change from drive A or B to the other drive), MS-DOS prompts you with the message above. If a disk is already in the drive, press a key to continue the operation.

If you are using a user-interface screen or menu, you may want to suppress this message. To do so, you can call interrupt 11 hex to detect whether the system has only one floppy drive. After the call, bytes 6 and 7 of the ax register will contain a number that represents the number of floppy drives on the system.

If it is determined that only one floppy drive is present, you can call interrupt 21 with function 44 hex with subfunction 0F hex to set the current drive specification for the floppy. Doing this will suppress the MS-DOS message.

To run this program in the QBX.EXE environment, start with the following line, which will load the QBX.QLB Quick library:

qbx /l

Code Example
'$INCLUDE: 'QBX.BI' CONST TRUE = -1 CONST FALSE = 0

DIM InRegs AS RegType, OutRegs AS RegType DIM SingleFloppy AS INTEGER  'Flag to check system config. DIM Drive$

CALL INTERRUPT(&H11, InRegs, OutRegs) IF (OutRegs.ax AND 192) THEN 'Check bits 6 and 7: ' 0->1 floppy, 1->2 floppies. SingleFloppy = FALSE ELSE SingleFloppy = TRUE END IF 'Normal Code there, probably setting Drive$

'Then, if the system only has one single floppy, before 'using any drive or directory functions or statements, use 'interrupt 21 to set the drive to the needed specification. 'This will suppress the MS-DOS message. IF SingleFloppy THEN Temp$ = UCASE$(LEFT$(Drive$, 2)) SELECT CASE Temp$ CASE &quot;A:&quot; InRegs.ax = &H440F InRegs.bx = 1      'Set A: as active drive CALL INTERRUPT(&H21, InRegs, OutRegs) CASE &quot;B:&quot; InRegs.ax = &H440F InRegs.bx = 2      'Set B: as active drive CALL INTERRUPT(&H21, InRegs, OutRegs) END SELECT PRINT &quot;The current directory on &quot;; Temp$; &quot; is &quot;; PRINT CURDIR$(Temp$) END IF

Additional query words: BasicCom 7.00 7.10

Keywords: KB79027

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.