You are currently offline, waiting for your internet to reconnect

How to Suppress "Insert Diskette" on Single Floppy Systems

This article was previously published under Q79027
This article has been archived. It is offered "as is" and will no longer be updated.
When using the CURDIR$ or DIR$ function, or the CHDRIVE statement inBasic Professional Development System (PDS) on a single floppy system,the MS-DOS message
Insert Diskette for Drive B: and press any key when ready
Insert Diskette for Drive A: and press any key when ready
will appear if you attempt to access a single floppy drive as bothdrives A and B in the same program. In many cases, this message isinconvenient because it clutters the output screen. This is an MS-DOSmessage that can be suppressed using the method below.

This information applies to Microsoft Basic PDS versions 7.0 and 7.1for MS-DOS.
The above message will only appear when the program is running on asingle floppy system, because MS-DOS allows that one floppy to bereferenced as logical drive A or B. However, when you change the drivereference (such as by typing "a:" then "b:", or by using any of theBasic 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 thedrive, press a key to continue the operation.

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

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

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

Code Example

'$INCLUDE: 'QBX.BI'CONST TRUE = -1CONST FALSE = 0DIM InRegs AS RegType, OutRegs AS RegTypeDIM SingleFloppy AS INTEGER   'Flag to check system config.DIM Drive$CALL INTERRUPT(&H11, InRegs, OutRegs)IF ( AND 192) THEN  'Check bits 6 and 7:                              '  0->1 floppy, 1->2 floppies.                SingleFloppy = FALSEELSE        SingleFloppy = TRUEEND 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 "A:"       = &H440F                InRegs.bx = 1       'Set A: as active drive                CALL INTERRUPT(&H21, InRegs, OutRegs)          CASE "B:"       = &H440F                InRegs.bx = 2       'Set B: as active drive                CALL INTERRUPT(&H21, InRegs, OutRegs)     END SELECT     PRINT "The current directory on "; Temp$; " is ";     PRINT CURDIR$(Temp$)END IF				
BasicCom 7.00 7.10

Article ID: 79027 - Last Review: 10/07/2013 01:01:39 - Revision: 3.1

Microsoft BASIC Professional Development System 7.0, Microsoft BASIC Professional Development System 7.1

  • kbnosurvey kbarchive KB79027