Using Run on Program That Has Overlays Causes Incorrect Error

ID: Q93670


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0


SYMPTOMS

Using the Run statement repetitively to run a program that contains overlays can result in one of the following incorrect error messages:

Too many files
Input path for run-time module VBDRT10E.EXE:
The "Too many files" error occurs if the program was compiled with the BC.EXE /O (stand-alone) option. The "Input path for run-time module VBDRT10E.EXE:" error occurs if the program was compiled without the /O option by using the default run-time module instead.


WORKAROUND

Here are three ways you can work around the problem:

  • Compile the program without overlays


  • Run the program in the interpreter (VBDOS.EXE) instead of using the Run statement.


  • Call the assembly language procedure shown below before using the Run statement.



STATUS

Microsoft has confirmed this to be a bug in the Professional Edition of Microsoft Visual Basic version 1.0 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


MORE INFORMATION

Call Assembly Language Procedure to Work Around Problem

You can work around this problem by calling the following assembly language procedure before using the Run statement:

COP.ASM:
   .model medium, basic
   ; extern unsigned short __far __cdecl _movefpause
   extrn __movefpause:word
   ; extern void __far __cdecl _movepause( void );
   extrn __movepause:Far
   __MOVE_PAUSE_DISK    equ   2
   __MOVE_PAUSE_CACHE   equ   4
   .code
   CloseOverlayPause proc
      mov    ax,seg __movepause      ; seg for __movefpause
      mov    es,ax
      mov    bx,es:__movefpause      ; get flags to modify
      or     bx,__MOVE_PAUSE_DISK    ; closes EXE
      or     bx,__MOVE_PAUSE_CACHE   ; shutdown caches
      mov    es:__movefpause,bx      ; put 'em back
      call   __movepause             ; execute pause
      ret
   CloseOverlayPause endp
   end 
Use MASM and the following command to assemble the procedure:

   MASM COP.ASM; 
To apply the workaround to your program, add the following Declare to the beginning of each module that uses Run:

   Declare Sub CloseOverlayPause 
Use the following code to call the procedure before using Run:

   Sub sub1
      Print "In SUB1"
      Call CloseOverlayPause
      Run "MAIN"
   End Sub 
Use the following code to link the assembly language procedure into your program:

   LINK MAIN.OBJ COP.OBJ (SUB1.OBJ); 

Steps to Reproduce Problem



  1. Start VBDOS.EXE.


  2. Create a module named MAIN.BAS, and add the following code to it:
    
       Call sub1 


  3. Create a module named SUB1.BAS, and add the following code to it:
    
       Sub sub1
          Print "In SUB1"
          Run "MAIN"
       End Sub 


  4. Exit from VBDOS.EXE.


  5. Compile and link the modules using BC.EXE, LINK.EXE, and this code:
    
       BC /O MAIN.BAS;
       BC /O SUB1.BAS;
       LINK MAIN.OBJ (SUB1.OBJ); 


  6. Run the application MAIN.EXE. It eventually produces the "Too many files" error message.


  7. To reproduce the "Input path for run-time module VBDRT10E.EXE:" error, compile the same program without using the /O option.


Additional query words: VBmsdos buglist1.00 1.00 errmsg

Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.