 Microsoft PASCAL Compiler
 =============================================================================


 1. Restoring Remapped Interrupt Vectors

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR53039
 Last Modified: 23-FEB-1988    ArticleIdent: Q11709

 Problem:
    When you define interrupt service routines using Microsoft Pascal
 Version 3.3x under MS-DOS, the interrupt vector will not always be
 restored to its original value after program termination.

 Response:
    Pascal will not allow you to automatically restore remapped interrupt
 vectors. If you want to remap interrupt vectors, you will have to use
 DOS functions 25H and 35H to both change and explicitly restore the
 vectors.


 2. Pascal 3.32: Reading Unlocked Records after Locked Records

 Product Version(s): 3.32
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist3.32 ptr62966
 Last Modified: 17-MAR-1988    ArticleIdent: Q27205

 Problem:
    If I lock a range of records in a data file over a network, a
 second user attempting to read these records will get read error 11
 (protected file or record) as expected. However, if the second user
 consecutively reads locked records and then unlocked records, he will
 still get read errors attempting to read the unlocked records.
    For example, if records number two and three are locked and records
 four and five are unlocked, a second user reading records two and
 three will get read errors as expected. If the second user then
 attempts to read unlocked record numbers four and then five, he will
 still get read errors.

 Response:
    This is a verified problem with Pascal Version 3.32. It will be
 corrected in a future release of Pascal.
    To work around the problem, you must read the unlocked records in
 non-consecutive order after reading locked records.
    If you read the last locked record whose record number is N, the
 next attempted read of any unlocked record other than number N+1 will
 succeed. After reading locked record number N, attempting to read
 unlocked record number N+1 will fail, and consecutively reading
 unlocked record numbers N+2, N+3, N+4 and so on will also fail.
    One method to avoid this problem would be to re-attempt reading a
 record after trapping a read error. If the record is unlocked, the
 second read attempt will succeed.
    Depending on which records are locked in the file, other methods to
 avoid this problem may include resetting the file before reading
 unlocked records, or skipping one or more records before the next
 read.


 3. STACK Entry in MS-DOS and XENIX

 Product Version(s): 3.30 3.31
 Operating System:   XENIX
 Flags: ENDUSER | TAR55715 docerr
 Last Modified: 26-SEP-1988    ArticleIdent: Q11816

 Question:

 Page 79 of the XENIX "Microsoft Pascal Compiler User's Guide" displays
 a memory map. For the STACK entry, it says that this is provided for
 compatibility with MS-DOS. But under XENIX, the STACK is reserved by
 it and not in DGROUP. However, when you use the -F option to set the
 stack, the effect is as if the stack is in DGROUP. For example,
 setting the stack bigger makes the heap smaller (I get out of heap
 errors), and making the stack smaller makes the errors go away. Does
 the -F option not only affect the XENIX Stack but also the DOS
 compatibility stack?

 Response:

 The information on page 79 is incorrect. Both DOS and XENIX place
 the stack in DGROUP. The documentation insinuates that there are two
 stacks; however, there only is one. Thus, the heap is reduced when the
 stack size is increased.


 4. Flushing I/O buffers

 Product Version(s):
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR56140
 Last Modified: 25-FEB-1988    ArticleIdent: Q11872

 Product: PASCAL 3.31

 Question:
    I have a large application written in MS-Pascal and I would like to force
 the flushing of the I/O buffer. The file is open in DIRECT mode and is a
 binary file.  Is there any way to do this short of closing and reopening the
 file?

 Response:
    At this time, there is no way to flush the I/O buffer without closing the
 file.



 5. Use of the /STACK Linker Switch

 Product Version(s): 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR56601
 Last Modified: 23-FEB-1988    ArticleIdent: Q11963

 Question:
    I am using Version 3.2 of Microsoft Pascal and having problems with
 stack overflow. I use the /STACK linker switch to increase the size of
 the stack and everything seems to be fine but the documentation in
 both the 3.2 and 3.3 manuals says not to use the /STACK switch. Am I
 likely to have a problem with this? If so, what can I do?

 Response:
    In the 3.2 version, it is possible for a program to cause the stack
 size to increase or decrease. Setting a stack size with the linker
 switch and then having that size changed by a program could cause
 unpredictable results. This is the reason that you should not use the
 /STACK switch.
    In Version 3.3x, the stack size is fixed by the compiler so
 changing the stack size when linking is acceptable. You will find more
 information on the /STACK linker switch in the README.DOC file that
 accompanies the 3.31 version of the product.


 6. Symbol Defined More than Once Linking with FORTRAN Library

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR56929
 Last Modified:  3-OCT-1988    ArticleIdent: Q11984

 Question:

 In the process of adding a Pascal language-user interface to our
 FORTRAN language system, a run-time library compatibility problem has
 surfaced. Any time we search both run-time libraries during a link, a
 "Symbol defined more than once: `SUBSQQ'" error is reported in the
 second run-time library searched.

 This is both an operational problem (our MAKEs terminate at the error)
 and a potential run-time problem. The only run-time problem we know
 about is when the FORTRAN substring is used (i.e.,  TEST(I:I)=' ') and
 the Pascal library is searched first. This will generally lock up a
 system at run-time.

 We would like to know the following:

 1. Is there a fix for the libraries?

 2. Is there a potential Pascal run-time problem when we link the
    FORTRAN library first to solve the FORTRAN substring crash?

 Response:

 No. You are not likely to have a problem in using the executable that
 you created.

 For the first problem, with the MAKE file, you should use conditional
 execution based on whether or not you receive certain error levels.

 With regards to the library problem, the information that you sent
 would suggest that you have a FORTRAN main program that calls Pascal
 routines that, for example, provide a user interface to your system.
 But there is something in the structure of your program that tangles
 the linker, which is NOT your fault.

 If you look at the contents of the FORTRAN and Pascal libraries using
 the "LIB" utility, you can see that the function SUBSQQ is present in
 both PASCAL.LIB and FORTRAN.LIB. You can see that the object module
 that contains the SUBSQQ function in the Pascal library contains many
 other entry points, in contrast to the FORTRAN object module
 containing SUBSQQ, which only has three entry points.

 PASCAL.LIB:

 sets              Offset: 000101d0H  Code and data size: 4c5H
   ADDSQQ            CEQSQQ            CLESQQ            CLTSQQ
   MIN               MULSQQ            O3ESQQ            SETSQQ
  *SUBSQQ*           T3OSQQ            Z3RSQQ

 FORTRAN.LIB:

 fstl              Offset: 0000fb00H  Code and data size: 19eH
   FCPSQQ            FSTLQQ            SUBSQQ

 An entry point is not necessarily a function. For example, in the
 FORTRAN library module containing SUBSQQ, FCPSQQ is actually a module
 name, while SUBSQQ is a procedure and FSTLQQ a function.

 Your program uses at least one entry point contained in both of these
 two modules. The entry point does not necessarily have to be SUBSQQ.

 For example, if you link the Pascal library First, then the FORTRAN
 library, and if your program generates calls to ADDSQQ and FSTLQQ, the
 linker will first pull in the "sets" module from the PASCAL.LIB to
 resolve the reference to ADDSQQ. Then it would have to pull in the
 "fstl" module from the FORTRAN.LIB to resolve the reference to FSTLQQ.
 Then it will check all of its entry points for duplicates. The linker
 would find that now it has duplicates of the SUBSQQ procedure, and
 generate a message that you have pulled in two (possibly different)
 versions of SUBSQQ.

 This process should not generate a fatal error, and you should be able
 to proceed. If it is fatal and hangs your machine, try switching your
 link order.

 Because you are using two Microsoft compilers, and because you are
 using the same version number of two particularly compatible compilers
 (they share the same source code for many routines), the process
 should work properly.

 The SUBSQQ procedure is identical in the FORTRAN and
 Pascal Version 3.31.

 You should proceed with the executable that you created by linking in
 FORTRAN first and then PASCAL. You should not have any problems.


 7. ANDRQQ Should Return REAL8

 Product Version(s): 3.31 3.32
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR54013 buglist3.31 fixlist3.32
 Last Modified:  3-OCT-1988    ArticleIdent: Q12391

 Function andrqq() returns a REAL4 value instead of a REAL8 value when
 the parameter is an arithmetic expression and it has been linked with
 DECMATH.LIB.

 y and z should be the same, but y is only accurate to seven digits.

 Microsoft has confirmed this to be a problem in Version 3.31. This
 problem was corrected in Version 3.32.

 The following code demonstrates the problem:

     {$decmath+}
    var w,x:real8;
         y,z:real8;
    function andrqq(consts a:real8):real8;extern;
        w:=12345678.1234;
        x:=1234567812.34;
        y:=andrqq((w*100));
        z:=andrqq(x);


 8. Compiling in Parent Directories

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR51090 buglist3.30 buglist3.31 fixlist3.32
 Last Modified: 22-FEB-1988    ArticleIdent: Q12393

 Problem:
    PAS1 and FORTRAN's FOR1 do not accept the .. (parent directory)
 path designator. For example, if THIS.PAS and THAT.FOR are in my
 parent directory and PAS1.EXE and FOR1.EXE are in the parent's
 subdirectory, PAS1 ..\THIS and FOR1 ..\THAT generate error messages.
 Note: LINK version 3.x and the C compiler driver CL do accept
 the .. path designator.

 Response:
    This problem was corrected in Version 3.32.


 9. Bad code generated for ADS assignment in Version 3.31

 Product Version(s):
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR57668
 Last Modified: 25-FEB-1988    ArticleIdent: Q12396

 Subject:   Bad code generated for ADS assignment

 Product: PASCAL 3.31

 Problem:
    Bad code is generated when assigning a element of ADS record to the offset
 of an ADS variable.  This problem occurs in versions 3.30 and 3.31.

 Response:
    This problem is corrected in the version 3.32 release.

 EXAMPLE PROGRAM:

 program temp(input, output);

   type
     boxg_rec = record
       next : word;
       case btype : word of
         1   : (l_lit    : word);
         2   : (d_handle : word);
       {end case}
     end{record};

     boxg_ary = array [1..10] of boxg_rec;

   var
     boxgary_ads : ads of boxg_ary;
     i           : integer;

 begin
   boxgary_ads^[i].next := (ads boxgary_ads^[i+1]).r;
 end.

 3.30 and 3.31 produces the following code - for the assignment;

   REPZ
   STOSB

 3.20 produces this code.

   MOV       AX,0006H
   MUL       I
   LES       BX,BOXGAR
   ADD       BX,AX
   ADD       AX,FFFAH
   MOV       DX,BX
   LES       BX,BOXGAR
   ADD       BX,AX
   MOV       ES:[BX],DX


 10. BRTEQQ and Windows Development

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR51995 buglist3.30 buglist3.31 fixlist3.32
 Last Modified: 23-FEB-1988    ArticleIdent: Q12397

 Problem:
    In Pascal.lib, the routine BRTEQQ accepts one parameter but ends
 with a RETF instead of a RETF 2. When running under Windows, this
 causes the routine EQCLQQ to jump back into the middle of itself when
 it does a RET to the epilogue code. We have tried to patch BRTEQQ but
 LINK4 will not produce an EXE file if there is a "variable already
 declared" error. Looking at BRTEQQ in general, it will not behave
 correctly with the Windows stack structure.

 Response:
    This problem was corrected in Version 3.32.


 11. Pascal Has No Append Mode for Sequential Files

 Product Version(s): 3.1x 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  4-APR-1988    ArticleIdent: Q28288

    Pascal has no append mode for text and other sequential files. To
 add data to an existing sequential file, you must create a new
 sequential file with the Rewrite procedure. Then, use the Reset
 procedure to open your existing file, read the data, and write it to
 the newly created file. Once your old file's data has been written to
 the new file, you may write additional data to the new file.
    The DOS Copy command may be used to append files together, as in
 the following command:

 copy file1 + file2

    Please note that you can append to direct access files by use of
 the Reset procedure. This procedure is documented on Page 266 of the
 Version 3.32 "Microsoft Pascal Compiler Reference" manual.


 12. Error Accessing the I/O Addresses

 Product Version(s): 3.3x 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 26-SEP-1988    ArticleIdent: Q29805

 The port attribute does not allow Pascal programs to access I/O
 addresses as documented at the top of Section 11.5.3 on Page 142 of
 the "Microsoft Pascal Compiler Reference Manual."

 The port attribute is designed to behave like the origin attribute, as
 stated in Appendix B.2 "Implementation Restrictions" of the "Microsoft
 Pascal Compiler User's Guide."

 Both the origin and port attributes direct the compiler to locate a
 variable at a specified memory address.


 13. File Sharing Mode Fails in Version 3.31

 Product Version(s): 3.31 3.32
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR53822 buglist3.31 fixlist3.32
 Last Modified:  3-OCT-1988    ArticleIdent: Q12400

 Reading and writing a file with file-sharing mode set will not work
 correctly under Version 3.31 of Pascal.

 If the mode of the file is set to sm_DENYNONE, it will read up to the
 583rd byte of the record, then go back and read from the beginning
 instead of reading the rest of the file. The problem does not appear
 if the file sharing is not set. It does not matter if SHARE.EXE is
 loaded or not.

 This problem occurs when the share modes are sm_DENYWR, sm_DENYRD, and
 sm_DENYNONE. It appears to work correctly under sm_COMPAT and
 sm_DENYRW.

 The sample program below writes 26 30-character strings in a 780-byte
 direct-access record. Each of the 26 strings is filled with a
 different letter of the alphabet.

 The following code demonstrates this problem:

 program testit(input,output);
 type test_rec=record
               line:array[1..26] of string(30);
               end;

 var
   i,j,k:integer;
   go_again:char;
   test:test_rec;
   test_file:file of test_rec;

 begin
   assign(test_file,'testfile');
   test_file.mode:=direct;
   for i:=1 to 4 do begin
     for j:=1 to 26 do
       for k:=1 to 30 do
         test.line[j][k]:=chr(j +96);
     test_file.share:=sm_DENYRW;
     rewrite(test_file);
     seek(test_file,i);
     test_file^:=test;
     put(test_file);
     close(test_file);

     test_file.share:=sm_DENYNONE;
     reset(test_file);
     seek(test_file,i);
     get(test_file);
     test:=test_file^;
     close(test_file);

     writeln(output);
     writeln(output,'Record : ',i:2);
     writeln(output);
     for j:=1 to 13 do begin
       write(output,'  ',j:2,' : ',test.line[j]);
       writeln(output,'   ',(j+13):2, ' : ',test.line[j+13]);
     end;
     writeln(output);
     write(output,'enter a key to go to next record --> ');
     readln(iniput,go_again);
   end;  {for i:=1 to 4}
 end.


 14. READs and WRITEs to Binary File Cause Crash in Version 3.31

 Product Version(s): 3.31 3.32
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR52819 buglist3.31 fixlist3.32
 Last Modified:  3-OCT-1988    ArticleIdent: Q12402

 The program below uses READs and WRITEs to a binary sequential file.
 It crashes the system in Version 3.31, but works properly in Version
 3.30. If GETs and PUTs are used instead, the program executes
 successfully. According to the standard, it is legal to use READs and
 WRITEs on a binary sequential file.

 Microsoft has confirmed this to be a problem in Version 3.31. This
 problem was corrected in Version 3.32.

 The following code demonstrates this problem:

 {$LINE+}
 program test(input,output);
 TYPE BUFF=ARRAY[0..511] OF INTEGER;

 VAR  BFILE:FILE OF BUFF;
      FNAME:LSTRING(80);
      DATA:BUFF;

      I:INTEGER;
 BEGIN
      FNAME:='CU.DAT';
      ASSIGN(BFILE,FNAME);
      REWRITE(BFILE);
      FOR I:=0 TO 511 DO
       DATA[I]:=I;
      WRITE(BFILE,DATA);
      CLOSE(BFILE);

      RESET(BFILE);
      FOR I:=0 TO 511 DO
       DATA[I]:=0;
      READ(BFILE,DATA);
      FOR I:=0 TO 511 DO
       WRITELN(DATA[I]);
      CLOSE(BFILE);
 END.


 15. Compiler and Heap Management Error Messages

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR52075 buglist3.31 fixlist3.32
 Last Modified:  3-OCT-1988    ArticleIdent: Q19725

 Question:

 The compiler behaves very inconsistently. When trying to compile a
 file, for example xx.PAS, "pas1 xx;" sometimes works correctly, but
 "pas1 xx,,list;" gives "Error: compiler pointer to disposed var."

 Changing the name of the listing file, "pas1 xx,,lis;" sometimes works
 properly. This problem occurs when compiling exactly the same source
 file; different results are produced by changing the invocation line.
 The different error messages are as follows:

       "Error: Compiler Invalid Pointer Range"
       "Null Pointer Assignment"
       "Compiler Pointer To Disposed Var"

 Response:

 Microsoft has confirmed this to be a problem in Version 3.31. This
 problem was corrected in Version 3.32.


 16. Windows Development for 80386 Requires Pascal Version 3.32+

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR58979
 Last Modified: 29-FEB-1988    ArticleIdent: Q19931

 Problem:
    My Windows application written in Pascal runs correctly on my 80286
 machine, but crashes on my 80386 machine.

 Response:
    You must compile Windows applications with the Pascal Version 3.32
 (or higher) compiler and libraries in order to run the application on an
 80386 machine.


 17. Floating-Point Libraries for Windows

 Product Version(s): 3.3x 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR59216
 Last Modified:  3-OCT-1988    ArticleIdent: Q19940

 Problem:

 I am having trouble getting my Windows application to link without
 errors. It is a Pascal program and I am using floating-point
 calculations. I am specifying the following libraries to the linker
 and I am receiving unresolved externals such as "_fpmath" and
 "_fptaskdata":

 paslibw pascal math llibc /nod

 Response:

 You need to include the following as your linker library:

 altmath paslibw pascal mlibc libh/NOD

 The altmath should be linked first to override the Pascal library that
 would disable the floating point. Also, with Pascal Versions 3.x, only
 the alternate math package is supported in Windows.


 18. Duplicate Code Generated for a Function Call

 Product Version(s): 3.32 4.00 | 4.00
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | TAR61145 buglist3.32 buglist4.00
 Last Modified: 18-AUG-1988    ArticleIdent: Q22514

 Problem:
    Under certain circumstances, the startup code and call to a
 user-defined function is followed by an exact duplicate of the startup
 code and function call, i.e., the function is called twice.
    This process rarely occurs, but it has been reported to happen when
 a function call is made as one of the arguments to another function or
 procedure call.

 Response:
    Microsoft has confirmed this to be a problem in Versions 3.32 and
 4.00. We are researching this problem and will post new information as
 it becomes available.
    You can work around the problem by using a temporary variable to
 receive the result of the function call, and then use the temporary
 variable within expressions.


 19. Comparing Floating-Point Numbers

 Product Version(s): 3.13 3.20 3.3x 4.00
 Operating System:   MS-DOS OS/2
 Flags: ENDUSER | TAR61353
 Last Modified: 29-SEP-1988    ArticleIdent: Q22589

 Question:

 It seems that comparing a VAR and a CONST produces a condition
 resulting in FALSE while the two values are equal. The following
 program is an example:

    PROGRAM RE(INPUT,OUTPUT)
    CONST
    H=199.33;
    VAR R:REAL4.
    BEGIN
    R:=H;
    WRITELN(R);
    IF R=H THEN WRITELN('OK');
    END.

 Executing this program never gives the equality between R and H. Is
 this problem due to a difference between the internal format
 representation?

 Response:

 First, real constants use eight bytes. Because the decimal fraction .33
 cannot be exactly represented in binary, the eight-byte constant will
 have more significant digits than the four-byte variable, making the
 comparison between them false.

 Second, be aware of the way real numbers are internally represented in
 a computer. Because these numbers are stored in a binary
 floating-point format, it is impossible to represent all decimal real
 numbers exactly, and a conversion from binary to decimal may result in
 some degree of inaccuracy.

 Because the conversion process is not always exact, conditional tests,
 rounding or truncating routines, and conversions are not always
 reliable. Therefore, we recommend that if they are used, they be used
 with caution.

 Do not compare floating-point numbers for equality due to the
 conversion problems. Instead, compare a floating-point number to a
 range of values. For example, to compare a single-precision
 floating-point variable "x" to 1.0, the following expression could be
 used:

 if ((x <= 1.001) AND (x >= 0.999)) then
    writeln('x = 1.0');

 If you would like a more detailed description of the floating-point
 format, we recommend that you refer to the following articles:

 1. A three-part series on real-number representations in "PC Tech
    Journal" running in the October, November, and December 1984 issues

 2. An article titled "Arithmetic On Your PC" by Peter Rice in the
    March 1985 issue of "BYTE" magazine


 20. No Unique Serial Number on Registration Card

 Product Version(s): 3.13 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 18-FEB-1988    ArticleIdent: Q22738

 Question:
    I am trying to fill out the registration card, but am
 unable to access the 16-digit serial number that you ask
 for. I am following the instructions, but no serial number
 appears in the right-hand corner. What am I doing wrong?

 Response:
    There is no unique serial number for this product. The
 instructions you are referring to pertain to Microsoft Word
 users only. You should skip this part of the registration
 card, fill out the rest, and send it in.


 21. Sending Output to the Printer

 Product Version(s): 3.13 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-OCT-1988    ArticleIdent: Q22829

 Question:

 How do I output data from my Pascal program to the printer?

 Response:

 You may access the printer by treating it as a file with one of the
 following system names:

 1. Prn
 2. Lpt1
 3. Lpt2

 The following example sends output to the printer:

    PROGRAM EXAMPLE(INPUT,OUTPUT);
     VAR F:TEXT;
     BEGIN
      ASSIGN(F,'PRN');
      REWRITE(F);
      WRITELN(F,'OUTPUT NOW GOES TO THE PRINTER');
      CLOSE(F);
     END.

 The ASSIGN statement associates the TEXT file variable F with the
 system file PRN. The REWRITE statement opens the printer for output,
 and the WRITELN statement sends output to the file F, which is the
 printer.

 It should be noted that the system name you use is dependent upon your
 particular system, and you may have to experiment to see which one
 works for you. If you have a serial printer attached to your
 communications port, you should use the MS-DOS MODE command to tell
 the operating system to send printer output to the communications port
 instead of to the regular printer port.


 22. Pascal Constants and Concatenation Operator

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-OCT-1988    ArticleIdent: Q23439

 Question:

 Is there a way to indicate in the source file the continuation of a
 line when declaring a constant that is longer than 80 characters? If
 so, what would the continuation character be?

 Response:

 There is no continuation character; however, you may use the string
 concatenation operator (*) with string constants to declare a constant
 longer than 80 characters. The following is an example:

    const a = 'hello'
          b = ' there'
          c = a * b
          { c = 'hello there'}

 This information is documented in Section 10.6 (Pages 125-127) in the
 "Microsoft Pascal Compiler for the MS-DOS Operating System Reference
 Manual" for Version 3.32.


 23. Stack and Heap Growth

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 26-SEP-1988    ArticleIdent: Q23693

 Problem:

 Section 10.3.2 (Page 116) in the "Microsoft Pascal Compiler User's
 Guide" states that the stack grows down and the heap grows up and that
 they "grow toward each other." However, according to the memory model
 in the README file, the stack would have to grow up and the heap down
 for them to grow toward each other.

 Response:

 In MS-DOS Pascal Versions 3.3x, the stack and heap do grow apart. They
 grow toward each other in Version 3.20. The error in the documentation
 is a result of incomplete changes in the documentation from Versions
 3.2 to 3.3x.


 24. Units and Interfaces Versus Modules

 Product Version(s): 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 18-FEB-1988    ArticleIdent: Q23666

 Question:
    What is the advantage of using units and interfaces over
 modules?

 Response:
    The purpose of units in Microsoft Pascal is to allow
 programmers to port programs written in UCSD Pascal to
 Microsoft Pascal more easily. We recommend the use of
 modules over units. Modules are more straightforward,
 clearer, and easier to use.


 25. Error 2033 in Pascal Compiler 3.32

 Product Version(s): 3.32
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR62947 buglist3.32 fixlist4.00
 Last Modified: 18-AUG-1988    ArticleIdent: Q23616

    Version 3.32 of the Pascal compiler generates the "2033 Invalid
 Pointer Range" error for the code segment below.
    Note that Pascal Version 3.31 runs correctly without any errors.
    Microsoft has confirmed this to be a problem in Version 3.32. This
 problem was corrected in Pascal Version 4.00.

    The following is the sample code segment:

    {$debug-}
    program test(input,output);

      var
        config_name : lstring(20);

      procedure get_config;
        var
          config_file  : file of integer;
        begin
          assign(config_file,config_name);
          close(config_file);
        end;{get_config}

     procedure copy_screen;
        type
          video_screen = ads of array[0..16383] of byte;
        var
          plane0,plane1 : video_screen;
        begin{copy_screen}
          plane0.s:=16#b800;
          plane0.r:=0;
          plane1.s:=16#b800;
          plane1.r:=16#4000;
          plane1^ := plane0^
        end;{copy_screen}
    {-------------------------------------------------------}

      begin
        config_name := 'config.mcb';
        copy_screen;
    {$debug+}
        get_config;
      end.



 26. Linking DOS2PAS.LIB and MS-DOS Version 2.00

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 26-SEP-1988    ArticleIdent: Q23697

 Problem:

 Page 35 in the "Microsoft Pascal Compiler User's Guide" discusses how
 linking with the DOS2PAS.LIB file will cause your program to use the
 MS-DOS Version 2.00 file system. I cannot find this .LIB file on any
 of my disks.

 Response:

 This file is included only in MS-DOS Pascal Compiler Version 3.20. It
 is not included with Versions 3.3x. The user's guide is incorrect.


 27. Determining Available Memory

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified:  4-NOV-1988    ArticleIdent: Q23698

 Question:

 The example on Page 164 in the "Microsoft Pascal Compiler User's
 Guide" does not work correctly. How can my Pascal program determine
 how much memory is available?

 Response:

 The example on Page 164 only applies to Version 3.20 of the Microsoft
 Pascal Compiler. The documentation is in error; in Version 3.20,
 CESXQQ:2 contains the upper memory limit. However, in Version 3.3x,
 CESXQQ:2 contains the top of DGROUP.

 There is no way to determine how much memory is available directly
 from a Pascal Version 3.3x program. However, you may link in an
 assembly routine that makes a call to DOS with the Setblock function
 call (Function 4A).

 An example of a program that returns available memory is available as
 an application note called "V 3.3x Available Memory." This application
 note is available by contacting Microsoft Product Support Services at
 (206) 454-2030.


 28. Overlaying Data with the Overlay Linker

 Product Version(s): 3.13 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 18-FEB-1988    ArticleIdent: Q23755

 Question:
    How do I overlay data using the overlay linker?

 Response:
    Microsoft Linker only allows the overlaying of code, so
 it cannot be used to overlay data. There are third-party
 linkers that work with Microsoft products to allow the
 overlaying of data.


 29. No Implementation of SHL, SHR, and ISR Operators

 Product Version(s): 3.11 3.13 3.20 3.3x 4.00 | 4.00
 Operating System:   MS-DOS                   | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 18-AUG-1988    ArticleIdent: Q23758

 Question:
    Page 6 in the "Microsoft Pascal Compiler Reference" manual states
 that SHL, SHR, and ISR are not implemented features; however, Page 151
 in Section 12.1 implies that these operators are available. Which part
 of the manual is correct?

 Response:
    Section 12.1 of the "Microsoft Pascal Compiler Reference" manual is
 incorrect. Microsoft Pascal Compilers Versions 3.11 to 4.00 (Version
 4.00 being the most recent version) do not implement the SHL, SHR, and
 ISR operators. This information is also in the "Microsoft Pascal
 Compiler User's Guide" in Appendix B.3 under "Unimplemented Features."


 30. PAS3 Generates File Access Errors

 Product Version(s): 3.1x 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 18-FEB-1988    ArticleIdent: Q23877

 Question:
    Why does pass three generate the error message "File
 access error in file PASIBF.OID", and an error code such as
 1032"?

 Response:
    The purpose of PAS3 is to generate a code file in which
 the Pascal source code has been translated into assembly
 code. When PAS3 is run, it looks for two files it assumes
 were created by PAS2. These two files are PASIBF.OID and
 PASIBF.TMP. PAS2 will create these files only if you
 requested a code file when you ran PAS1.
    PAS1 requests the names of four files: the source,
 object, listing, and code files. In order to run PAS3, you
 must explicitly give the code file a name. If you use the
 default (type ENTER), it assumes you do not want a code
 file; thus, running PAS3 will generate the file access
 error.
    More information on this topic can be found in Section
 3.2 of the "Microsoft Pascal Compiler User's Guide."


 31. Clearing Screen and Locating Cursor

 Product Version(s): 3.1x 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-OCT-1988    ArticleIdent: Q23884

 Question:

 How do I clear the screen and locate the cursor?

 Response:

 Microsoft Pascal does not directly support operations such as clearing
 the screen and locating the cursor. This is because these operations
 are machine dependent and Microsoft compilers are designed to support
 a variety of MS-DOS machines.

 There are several ways to perform these machine-dependent operations.
 One is to call assembly-language routines that you or someone else has
 written. There are several excellent third-party graphics packages
 available for Microsoft compilers.

 Another method is to use ANSI or VT52 escape sequences. To use these,
 you must have either the ANSI or the VT52 screen driver installed. For
 example, if a computer has ANSI.SYS on its system disk, and the
 CONFIG.SYS file contains the file DEVICE=ANSI.SYS, that computer has
 the ANSI driver installed.

 The ANSI escape sequence for clearing the screen is "{esc}[2J".
 Therefore, to clear the screen in Pascal with the ANSI driver
 installed, execute the following procedure:

    Procedure ClearScreen;         {uses ESC 2 J to clear the screen and}
    Var  line:lstring(4);          {move the cursor to the home position}
    Begin
      line[1] := chr(27);          {escape character}
      line[2] := '[';
      line[3] := '2';
      line[4] := 'J';
      line[0] := chr(4);           {number of characters}
      Write(line)
    End;                           {ClearScreen}


 32. Fixup Overflow Error While Linking

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 18-AUG-1988    ArticleIdent: Q23888

 Problem:
    I am linking my Pascal Version 3.32 program with an assembler
 module; I am following the instructions on Page 98 in the "Microsoft
 Pascal Compiler User's Guide." However, the linker is generating the
 error message "Fixup overflow..."

 Response:
    There are several probable sources for this problem, as follows:

    1. The documentation on Page 98 of the Pascal user's guide is
       incorrect. The guide shows the correct interface to assembly for
       Version 3.20, not for Version 3.3x. Version 3.3x uses a different
       memory model than does Version 3.20; as a result, you need a
       slightly different interface. The correct way to use an assembler
       module with Pascal is given in Appendix A of the user's guide, in
       Section A.12. If you are using the correct interface to your
       assembly code, your problem may lie elsewhere.
    2. Other causes of this error are described in the Pascal user's
       guide in the error messages section. Specifically, this part of
       the manual contains a section of linker error messages, in which
       there is a Fixup Overflow entry.
    3. If a segment is larger than 64K bytes (Point 1 under the Fixup
       Overflow entry), the typical reason is that the global data from
       all object files has been accumulated into the default data
       segment (Dgroup). The solution in this case is to declare ADS OF
       arrays. You then can keep arrays out of the default data segment
       by allocating them on the long heap with the function ALLMQQ or
       GETMQQ, using the ADS variables to keep track of the addresses
       where the arrays are located. See the user's guide under "Long
       Heap Allocation."
    4. If a code segment exceeds 64K bytes, you will have to break up
       the respective source file. A map file with a code segment larger
       than FFFF hexidecimal indicates this condition. If a map file
       cannot be created, link a single-object file by itself. Assuming
       there is less than 64K bytes of data declared in the object's
       source-code file, a Fixup Overflow for a single-object file
       indicates that the code exceeds 64K bytes. (Generally, you also
       will see numerous unresolved reference errors, which you may
       ignore for the purpose of this test.)


 33. Inconsistency in Truncating Numeric Constants

 Product Version(s): 3.31 3.32
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist3.32
 Last Modified:  5-MAY-1988    ArticleIdent: Q24062

 Problem:
    The compiler seems to be inconsistent in truncating numeric
 constants longer than 31 characters. Appendix B.2 in the "Pascal
 User's Guide" states that numeric constants can have up to 31
 characters and, like identifiers, numeric constants longer than 31
 characters are truncated.
    However, declaring a constant with this property does not cause
 Pas1 to generate warning message 104 "number too long - truncated." In
 fact, the constant is not truncated.
    This is inconsistent with Appendix B.2.

 Response:
    This problem is under review and will be considered for inclusion
 in a future release.


 34. Stack-Overflow Error

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-OCT-1988    ArticleIdent: Q24251

 Question:

 What is causing the error message "Stack Overflow" in my program? Can
 I work around it?

 Response:

 The usual source of this error is the allocation of too much space to
 variables in the 64K default data segment, especially large arrays. To
 avoid this problem, declare the arrays as ADS arrays and move them out
 of the default data segment. To move them out, allocate the arrays on
 the long heap with the function ALLMQQ or GETMQQ (these functions are
 described in the "Microsoft Pascal Compiler for the MS-DOS Operating
 System User's Guide").

 Another source of this error is having too many local variables in
 procedures and functions. These variables are allocated on the stack,
 which by default has a size of 2K. If there are too many of them, they
 will overflow the stack.

 To correct this problem, increase the stack size just prior to run
 time by using the EXEMOD utility (this utility comes with the
 compiler). At the DOS prompt, enter a line similar to the following:

 EXEMOD FOO.EXE /STACK <size of the stack>

 The size of the stack must be entered as a hex number between 0 and
 FFFF, inclusive. (Due to some overhead, the maximum stack size for a
 program is actually around FFE0 hex.) This number represents the
 number of bytes that will be reserved for the stack. For efficiency,
 increase the size of the stack by increments of 1K or 2K at a time,
 until a suitable stack size is found. It is not necessary to create
 more stack space than is needed.


 35. "256 VAR or CONST Parameter Types Not Identical" Error

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist3.32 fixlist4.00
 Last Modified: 26-SEP-1988    ArticleIdent: Q32409

 In Pascal Version 3.32, you can pass an lstring variable by
 reference (using VAR or VARS) to a function or procedure whose
 corresponding formal parameter is declared as a longer lstring type.
 This process allows the lstring to be overwritten in the function or
 procedure without detection, resulting in corruption of data declared
 after the lstring.

 In Pascal Version 4.00, this problem is detected by the compiler,
 resulting in the "256 VAR or CONST Parameter Types Not Identical"
 error. The following program demonstrates a way to work around this
 type checking. Note that passing lstrings of a long type to a
 procedure whose formal lstring parameter is of a shorter type
 generates the error.

 The program below is used to pass varying length lstrings by
 reference to a procedure.

 The lstring super type should be used for the procedure's formal
 parameter declaration to avoid the "256  VAR or CONST Parameters Not
 Identical" error when passing VAR(S) lstring arguments whose types are
 of variable lengths.

 Variables of the lstring super type cannot be assigned to directly, so
 a maximum-length local lstring (255) is loaded with characters, and
 the length of the local lstring is assigned the length of the lstring
 variable. The local lstring then is copied into the lstring variable
 by the copystr procedure.

 With Pascal Version 3.30, there is a problem with passing lstrings
 by reference (VAR or VARS). If a variable of a short lstring type was
 passed by VAR(S) to a procedure or function whose corresponding formal
 parameter was a longer lstring type, the actual short lstring could be
 overwritten without detection, corrupting data declared after the
 shorter lstring.

 This problem was corrected in Pascal Version 4.00; however, numerous
 programs depend on this Pascal Version 3.30 problem. The following
 program provides the same function, but avoids the possible data
 corruption:

 program test_variable_len_lstr_arg(input,output);
     var  global_ls : lstring(10);

     procedure Proc(var ls_parm : LSTRING);
         var local_ls : lstring(255);
     begin
       {make assignment to local lstring,
       and set it's length to the parameter lstring
       }
         local_ls := 'xxxxxxxxxxxxxxxxx';
         local_ls.len := ls_parm.len;
       {copy local lstring into global lstring}
         copystr(local_ls,ls_parm);
         writeln;
         write('In procedure.');
         writeln(' After copying local lstring to global lstring parameter,');
         write('local lstring = ', local_ls, ', ');
         writeln('lstring parameter = ', ls_parm)
     end;

 begin
     global_ls := 'original';
     writeln;
     writeln('In main, global lstring = ', global_ls);
     writeln('Call procedure, passing lstring by reference (var).');
     Proc(global_ls);
     writeln;
     writeln('Retured to main, global lstring = ', global_ls)
 end.


 36. Seek Subroutine Will Not Seek to Same Record Twice

 Product Version(s): 3.31 3.32
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist3.32
 Last Modified:  5-MAY-1988    ArticleIdent: Q24422

 Problem:
    The Seek subroutine does not work correctly if one attempts to seek
 to the same record more than once. The only way to seek to a record
 that already has been "visited" is to perform a Reset on the file.

 Response:
    Microsoft is researching this problem and will post new information
 as it becomes available.
    Use the following method to work around the problem:

    1. Open the file.
    2. Seek to the desired record.
    3. Reset the file.
    4. Seek to the record again.


 37. Trapping Run-Time File System Errors

 Product Version(s): 3.1x 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-OCT-1988    ArticleIdent: Q25361

 Question:

 Is it possible to trap run-time file-system errors?

 Response:

 You can trap run-time file-system errors by using the
 TRAP flag, as in the following sample program:

 program file_error_trapping(input,output);
   var
     myfile: text;
   begin
     myfile.trap:=true;           {turns on error trapping}
     assign(myfile,'foo.dat');
     reset(myfile);               {if the file does not
                                   exist then myfile.errs
     if myfile.errs = 10 then      will be set to 10 }
     begin
       writeln('myfile.errs = ', myfile.errs);
       writeln('file not found');
       writeln('it will be created ');
       myfile.errs = 0;           {set myfile.errs back to 0}
       rewrite(myfile);
       writeln(myfile, 'this is a test');
       close(myfile);
       writeln(' file foo.dat has been created');
     end;
 end.

 MYFILE.TRAP initially is set to false. If an I/O error occurs, the
 program will abort. If MYFILE.TRAP is set to true, then error trapping
 for file MYFILE will be turned on. If an I/O error occurs, the value
 in MYFILE.ERRS will be set to the appropriate error-code number, and
 the attempted file operation will be ignored. At this point, you
 should examine the error and write an error-trapping routine.

 Note: once MYFILE.ERRS is set, it does not automatically get set back
 to 0 once the error routine has been executed. Therefore, MYFILE.ERRS
 should be set to 0 to assure that I/O operations are not ignored.


 38. Change to MSINSTALL for XENIX Pascal

 Product Version(s):
 Operating System:   XENIX
 Flags: enduser |
 Last Modified: 24-FEB-1988    ArticleIdent: Q10280

 PRODUCT:  PASCAL/3.30

 DESCRIPTION:
 Filenames in Pascal, Fortran, and C are the same in the same directory.
 The libraries have the same names as the C libraries but different content.
 This means to us that you cannot have Pascal, C, and Fortran installed at
 the same time !

 MICROSOFT RESPONSE:

 We named these files with the same names because they are exactly the same
 files.  The FORTRAN and Pascal runtimes needed portions of the C runtimes,
 so we included them as is.  There should be no problem copying these all on
 1 directory as long as the user copies the latest ones over the older ones.

 Because of possible confusion, we have rewritten the install program
 (msinstall) to do checking for the file creation dates.  What the compiler
 does now is warn the user that if there are old versions of the libraries,
 it WILL NOT write over these libraries.  It writes these libraries (if they
 are present) out to temporary files.  Then it checks to see if there are
 temporary files (i.e. there were libraries present before msinstall was
 invoked) and if they are present, it copies these original libraries back
 to the filenames that the compiler looks for.

 If the user later wants to use the new libraries, the install program can
 be run again, after the original libraries are renamed to different
 filenames. Please note that these C libraries ARE necessary for Pascal and
 FORTRAN now. You can indeed have C, Pascal, and FORTRAN on one system.
 Indeed, you can have different versions of each of these products on the
 same machine also.

 If you want to have different versions of the same product on the same
 machine, you may do one of the following:

 (1) Alter the msinstall program.  The msinstall program first checks to see
 if there are current C libraries.  If there are C libraries already
 existing on the system, msinstall will rename all of these copies of the
 libraries.  It then checks to see if there are these old library files. If
 there are old library files, it copies these files back into the original
 names, which are the filenames that the compiler searches for.  What you
 can do is delete the section of the msinstall program that copies the old
 library files back to the original filenames.  This would mean that then
 the msinstall program will backup your library files, and then install the
 new versions of these files.  This would be very simple to do.

 (2) Alter the cl driver.  Create a driver that would look for the filenames
 of the old library files instead of the new files.  Then you could use
 multiple versions on your machine, invoking the newest version with the cl
 driver and the older version with your altered driver.  This would be more
 complicated and would require a programmer with more skill, but it is
 possible.

 If any users have additional questions about the installation procedure, we
 would suggest that they first read the msinstall program to see what it
 does, and then contact Microsoft OEM customer support with specific
 questions.


 39. XENIX Pascal/FORTRAN cl Driver

 Product Version(s):
 Operating System:   XENIX
 Flags: enduser |
 Last Modified: 24-FEB-1988    ArticleIdent: Q10283

 PRODUCT:  PASCAL/3.30 Beta

 Question:
 The Pascal driver has the same filename as the Fortran driver (CL) which
 means to us that two compilers cannot be installed on the same system at
 the same time.

 Response:
 The CL driver is exactly the same for Microsoft Fortran as it is for
 Pascal.  This driver can link Fortran and Pascal programs. The driver
 checks the extension of the file. An extension of "f" for FORTRAN or
 "p" for Pascal will determine which compiler is used.


 40. Documentation on Command Line Switches is Incorrect

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 18-AUG-1988    ArticleIdent: Q10285

 Question:
    Concerning Table 18.6, "Command Line Switches" on Page 347 of the
 "Microsoft Pascal Reference" manual for Version 3.20, and Table 5.2,
 "Pass One Compiler Switches," on Page 51 of the "Microsoft Pascal
 Compiler User's Guide;" which one of the two lists is correct?
    Concerning the switch /L; does this refer to the SYMDEB debugger
 that comes with Microsoft Macro Assembler, or the DOS Debug?

 Response:
    Table 18.6, on Page 347 of the Pascal reference manual is
 correct.
    The debugger is SYMDEB. Debug does not detect line numbers.


 41. Example of Using VECTIN Procedure

 Product Version(s):
 Operating System:   MS-DOS
 Flags: enduser |
 Last Modified: 24-FEB-1988    ArticleIdent: Q10286

 PRODUCT:  PASCAL/3.20

 Question:
 Please give me an example of how to use the VECTIN procedure.

 Response:

 program EXAMPLE(input,output);

 {******************************************************************
 NOTE: THIS PROGRAM USES THE VECTIN PROCEDURE ALONG WITH THE DISBIN
 AND ENABIN PROCEDURES.  IT IS INTENDED TO ILLUSTRATE IMPLEMENTING A
 SUBSTITUTE DEFAULT DIVIDE BY ZERO ERROR HANDLER.  WHEN THE PROGRAM
 RECEIVES A DIVIDE BY ZERO, IT EXECUTES THE PROCEDURE "WORLD" INSTEAD
 OF THE NORMAL INTERRUPT 0 PROCEDURE.
 *******************************************************************}

 {******************************************************************
 ********** (1) DECLARE VARIABLES AND EXTERNAL PROCEDURES **********
 *******************************************************************}

 var
      HELLO : word;
      VAR1, VAR2, ZERO : integer;

 procedure disbin; extern;
 procedure enabin; extern;
 PROCEDURE VECTIN(HELLO:word;procedure world[interrupt,public]);extern;
 PROCEDURE PTYUQQ (W:word;x:adsmem);extern;

 {******************************************************************
 ***** (2) THIS IS THE PROCEDURE EXECUTED INSTEAD OF THE    ********
 *****     NORMAL INTERRUPT 0 PROCEDURE                     ********
 *******************************************************************}

 procedure world[interrupt,public];
         begin
                 {NOTE: WHEN THIS "WORLD" PROCEDURE IS EXECUTED,
                  INSTEAD OF EXECUTING THE NORMAL PROCEDURE, THE
                  FOLLOWING MESSAGE WILL BE PRINTED}

                 writeln ('Yea, verily, the vectin procedure worked.');
                 write ('Instead of executing the normal divide by zero');
                 writeln(' interrupt, a procedure ');
                 writeln('printing this message was executed instead.');
         End;

 Begin

 {******************************************************************
 ***** (3) THESE EXPLANATORY NOTES WILL BE PRINTED WHEN YOU     ****
 *****     EXECUTE THIS PROGRAM.  THEN IT WILL PROMPT YOU FOR   ****
 *****     THE INTERRUPT VECTOR NUMBER THAT YOU WANT TO REPLACE ****
 *******************************************************************}

 writeln(' ');
 WRITELN('NOTE:  Please enter the interrupt vector number "0" below.');
 writeln(' ');
 WRITELN('EXPLANATION: This is because this program causes a divide by
 zero,');
 writeln(' and interrupt vector type 0 is the divide error exception
 handler.');
 writeln('If you alter this program to do something else besides a divide');
 writeln(' by zero,you could use this program to try altering other
 interrupt');
 writeln(' vectors.  You can try entering other interrupt numbers into
 this');
 writeln(' program as it is, but the program will not execute the VECTIN');
 writeln(' procedure if you do.');
 write('Please enter an interrupt vector number  -->');
         read(hello);

 {******************************************************************
 ***** (4) FIRST YOU HAVE TO DISABLE INTERRUPTS USING DISBIN.     **
 *****     YOU THEN REPLACE THE EXISTING DIVIDE BY ZERO INTERRUPT **
 *****     HANDLER WITH YOUR PREFERRED PROCEDURE USING VECTIN.    **
 *****     YOU THEN ENABLE INTERRUPTS AGAIN, USING ENABIN.        **
 *******************************************************************
 ***** IMPORTANT NOTE: THIS IS A SIMPLE PROGRAM AND DOES NOT SAVE **
 ***** THE ORIGINAL ZERO INTERRUPT HANDLER                        **
 *******************************************************************}

         DISBIN;
         VECTIN(hello,world);
         ENABIN;

 {******************************************************************
 ***** (5) THIS PERFORMS A DIVIDE BY ZERO, WHICH WILL CAUSE THE ****
 *****     "world" PROCEDURE TO BE EXECUTED.                    ****
 *******************************************************************}

         VAR1 := 1;
         WRITELN('VAR1 := 1');
         ZERO := 0;
         WRITELN('ZERO := 0');
         writeln('var1 / zero = ...');
         writeln(' ');
         VAR2 := var1 div zero;
 End.


 42. VECTIN Procedure

 Product Version(s): 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-FEB-1988    ArticleIdent: Q10288

 Question:
    The Microsoft Pascal reference manual, Version 3.20,
 Page 271, says (concerning the VECTIN procedure) to see
 Appendix B, "Version Specifics," in the Microsoft Pascal
 Compiler user's guide for information regarding
 implementation. However, there is no notation in Appendix B
 regarding implementation.
    Do we need to make an adaptation to have the VECTIN
 procedure work properly? Explain the statement "...the
 meaning of [argument] V varies with target machine".

 Response:
    "Implementation" as it is used in Appendix B refers to
 this version of Pascal. So, "implementation additions"
 means additions to the previous implementation, i.e.,
 changes to Microsoft Pascal Version 3.20 which were not
 included in Version 3.13. In Appendix B, there is a great
 deal of information regarding this implementation.
    No adaptation is necessary to get VECTIN to work. It
 either works or it does not, and in Versions 3.20 to 3.32
 it does work.
    "The effect of these procedures and the meaning of V
 varies with the target machine," simply means that
 interrupt vectors are hardware specific. The effect of
 changing the interrupt vector 2 on an IBM Personal Computer
 could be extremely different from the effect of changing
 interrupt vector 2 on the Siemens PC, and you need to know
 what the difference is to use this VECTIN procedure.


 43. GTYUQQ Function Reads One Character Less Than Maximum

 Product Version(s): 3.13 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist3.13 buglist3.20 fixlist3.30
 Last Modified: 19-FEB-1988    ArticleIdent: Q10358

 Problem:
    The GTYUQQ function will only read characters up to one
 less than the maximum specified. For example, if the
 maximum specified was 10 then the GTYUQQ function will only
 read up to nine characters.

 Response:
    This problem was corrected in Version 3.30.


 44. Altering the Stack Size

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q10377

 Question:

 How can I adjust the size of a program's run-time stack with Pascal
 Version 3.3x?

 Response:

 You may use the /STACK linker option using the following command:

 link /STACK:<number> <object_file_name>;

 The <number> will be the decimal number of bytes for the size of the
 program's stack; <number> should be greater than 0 and less than
 64,000.

 Try to keep the stack size between 2000 and 30,000 bytes. A stack of
 64,000 could interfere with near-heap allocation, which also occurs in
 the same 64K default data segment. (The note of warning in the
 "Microsoft Pascal Compiler User's Guide" concerning the /STACK linker
 switch applied to Pascal Version 3.20, and is no longer a problem in
 Versions 3.3x.)

 Alternately, the EXEMOD utility can be used to change the stack
 size of a program after it has been linked, as in the following:

 exemod <exe_name> /stack <hex_number>

 The <exe_name> is the name of your executable file; <hex_number>
 specifies the hexadecimal number of bytes in the stack.


 45. Byte Comparison Causes PAS2 of Pascal Version 3.20 to Hang

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR17016 buglist3.20 fixlist3.30
 Last Modified:  3-OCT-1988    ArticleIdent: Q10378

 Problem:

 This problem involves byte comparisons and common subexpressions,
 i.e., if one of the elements of the comparison ends up in an index
 register because of an earlier subexpression, PAS2 would infinitely
 loop. The following program hangs in PAS2:

 SHORT EXAMPLE CODE:

    PROGRAM TEST(INPUT,OUTPUT);
    CONST UC_A=ORD('A');
    UC_Z=ORD('Z');
    VAR BUFF : ARRAY[0..255] OF CHAR;
    I, N : INTEGER;
    BEGIN
    FOR I:=UC_A TO UC_Z DO
    IF BUFF[I] <> CHR(I) THEN
    N:=SUCC(N);
    IF I<>N THEN
    N:=SUCC(N)
    END.

 Response:

 If an ORD function is added to the buff[i] in the comparison, the
 program compiles.

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.


 46. Calling Functions with Var Parameters

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR15705 buglist3.20 fixlist3.30
 Last Modified:  3-OCT-1988    ArticleIdent: Q10379

 Problem:

 The program shown below exhibits a problem when calling transcendental
 functions with var parameters. The address is improperly set for the
 argument that was defined as a formal reference (var) parameter.

 The following is a short code example:

    program fu(output);
    var  X : real8;

    PROCEDURE A1(VAR T: real8);
    begin
       T := exp(T)
    end;

    begin
       X := 1.0;
       A1(X);
       writeln('X = ',X)
    end.

 Response:

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.


 47. Searching for $INCLUDE Files

 Product Version(s): 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR17161
 Last Modified: 19-FEB-1988    ArticleIdent: Q10380

 Question:
    Can Version 3.20 of the Microsoft Pascal compiler use
 the $INCLUDE metacommand to bring in text from other
 directories? We cannot get this procedure to work properly
 and we do not want all of our interfaces in the same
 directory where the program is being written.

 Response:
    No, the Version 3.20 compiler uses the DOS Version 1.x
 compatible file system (i.e., no hierarchical file
 structure). Hence, the compiler can only find files that
 reside in the current directory.
    However, in Pascal Version 3.3x you are able to use path
 names because the compiler uses the DOS Version 2.x file
 system which does support non-root directories.


 48. Must Use readln to Read End of Text Line

 Product Version(s): 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-OCT-1988    ArticleIdent: Q10381

 Question:

 The file READ.PAS is an example of a program that uses a read
 statement to input the value of an lstring variable. The program loops
 indefinitely after the first value is read and written. Replacing the
 read with a readln causes the program to run as I would expect. Why
 does this occur?

 Is the read statement unable to read past the end of a line of text
 when reading an lstring value? This problem also occurs with string
 variables. The following READ.PAS program is an example:

    program read_lstring(input,output);
    VAR s : lstring(6);
    begin
    repeat
    write('enter string > ');
    read(s);
    writeln(s)
    until (s = 'bye');
    end.

 Response:

 You must use readln to read past the end-of-line marker for a text
 file. The files INPUT and OUTPUT, declared in the program statement,
 are text files.

 INPUT and OUTPUT are wholly distinct as far as Pascal is concerned.
 Thus, the fact that an intervening writeln (or two) may have advanced
 the line on the console device has no effect on the reads.

 All reads will take their data from the 80 character INPUT file buffer
 until there is an intervening readln. Because read(s), where "s" is an
 lstring variable, is satisfied with null input, you can have
 infinitely many consecutive read(s)s.

 Note: using readln (and writeln) only applies to text files. Other
 files defined by the type statement "file of <type>;" do not have
 end-of-line markers to be read/written by readln/writeln.


 49. Var Formal Parameters Ignore String Lengths

 Product Version(s): 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR15372
 Last Modified:  3-OCT-1988    ArticleIdent: Q10382

 Question:

 Why does PAS1 fail to detect the type mismatch between
 formal and actual lstring parameters of different lengths
 in the following code?

    PROGRAM TEST_LSTRINGS(INPUT,OUTPUT);
    TYPE
    LONGTYPE=LSTRING(200);
    SHORTTYPE=LSTRING(10);
    VAR
    SHORTSTR:SHORTTYPE;

    PROCEDURE DUMMY(VAR LONG:LONGTYPE);
    VAR LOCLONG:LONGTYPE;
    BEGIN
    LOCLONG:='1234';
    LONG:=LOCLONG;
    END;

    BEGIN {MAIN}
    DUMMY(SHORTSTR);
    END.

 Response:

 Because the formal parameter of procedure dummy is declared to be of
 type lstring (200), a type-mismatch error might be expected when dummy
 is called with the actual parameter shortstr, which is a lstring of
 length 10.

 However, type checking in this case is explicitly disabled (and has
 been for a long time, through many releases). Passing strings and
 lstrings by reference using var or vars ignores the string lengths. As
 a result, you are given the flexibility of using the same function or
 procedure to process strings of different lengths.


 50. Error 312 when Using the Variable Plm

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR02497 buglist3.20 fixlist3.30
 Last Modified:  3-OCT-1988    ArticleIdent: Q10384

 The declaration of plm causes pas1 to emit a compile-time error 312
 "identifier expected."

 The following is a short example code:

    program test(input,output);
    var PLM:integer;
    begin
    end.

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.

 In Version 3.20, plm was used as a procedure attribute to specify
 calling conventions and was incorrectly treated as a reserved word. In
 Version 3.30, plm may be redefined.


 51. Goto with {$line+} Gives Error 293

 Product Version(s): 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR17029
 Last Modified: 30-SEP-1988    ArticleIdent: Q10386

 According to Page 171 of the "Microsoft Pascal Compiler for the MS-DOS
 Operating System Reference Manual," a goto from a procedure to a
 higher-level procedure is permitted, although it is considered
 harmful.

 However, the code below generates the "error 293 - Goto invalid"
 message at compile time. If the {$line+} metacommand is removed, then
 the message is not generated.

 This error message occurs because if debugging is on (invoked by
 {$line+}), a procedure entry and exit code is generated. The exit code
 is bypassed by the goto, and from then on error recovery is corrupted.

 The following is a short code example:

    {$LINE+}
    PROGRAM TEST(INPUT,OUTPUT);
    LABEL 99;

    PROCEDURE A;
    BEGIN
    GOTO 99;
    END;

    BEGIN {MAIN}
    A;
    99:WRITELN('AT LABEL 99');
    END.


 52. Heap Space Not Freed When a File is Closed

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR15365 buglist3.20 fixlist3.30
 Last Modified: 19-FEB-1988    ArticleIdent: Q10387

 Problem:
    The "assign" statement allocates file information on the
 heap. When the file is closed, the space allocated is not
 returned to the heap. When a "dispose" is used to close the
 file, the space allocated for the file information is
 returned to the heap.

 Response:
    This problem was corrected in Version 3.30.


 53. The High-Ordered Word Is Zeroed Out

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR50048 buglist3.20 fixlist3.30
 Last Modified: 30-SEP-1988    ArticleIdent: Q10388

 In the program below, improper code is generated for the multiply.
 After the multiply is performed, the high-order word is zeroed-out,
 indicating that the compiler is trying to do an unsigned coercion
 before assigning the value to a 4-byte integer.

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.

 The following is a short example code:

    program fu;
    VAR X : INTEGER4;
    W : WORD;
    BEGIN
    W := 50;
    X := W * 10000;
    END.


 54. References Off to Windows Procedure Variable in Version 3.20

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR09596 buglist3.20 fixlist3.30
 Last Modified: 20-OCT-1988    ArticleIdent: Q10389

 There is a problem in the following code with the statement "D31 := n
 + x". When attempting to reference a nested variable (x) of a Windows
 procedure, the offset of "x" is off by 2 bytes due to the Windows
 entry sequence that pushes DS before allocating local memory.

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.

 The following is a short example code:

     {$stackseg+}
     module death;
     type
        deaths_head=record
          X,Y:integer;
          DATA:lstring(255);
          end;

     PROCEDURE D1(D:deaths_head)[public,windows];
     begin
       D.X:=d.y;
     end;

     procedure d2[public,windows];
     VAR DX:deaths_head;
     begin
       d1(dx);
     end;

     procedure d3[public,windows];
     VAR X:integer;
         FUNCTION D31(N:integer):integer;
         begin
            D31:=n+x;
         end;
     begin
       X:=5;
       X:=d31(10);
     end;
     end. {module death}


 55. Laddok Does Not Prevent Overflows

 Product Version(s): 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR05457
 Last Modified: 30-SEP-1988    ArticleIdent: Q10390

 Problem:

 The no-overflow addition function for integer4 numbers (laddok) does
 not handle adding 1 to the maximum positive integer4 number
 (2,147,483,647). The program crashes when this procedure is attempted.
 The correct result for laddok(2147483647,1) is the minimum negative
 integer4 number (-2,147,483,647). The calculation laddok(2147483647,2)
 does produce the result -2,147,483,647. The following is a short
 example code:

    program RollOver(input, output);
    VAR k: integer4;
    FUNCTION LADDOK(A, B: integer4; var c: integer4): boolean; extern;
    begin
    writeln('Rollover Test');
    writeln;

    if laddok(2147483647, 2, k) then
    WRITE('NO OVERFLOW: ')
    else
    WRITE('OVERFLOW: ');
    writeln('Result = ',k);

    if laddok(2147483647, 1, k) then
    WRITE('NO OVERFLOW: ')
    else
    WRITE('OVERFLOW: ');
    writeln('Result = ',k)
    end.

 Response:

 The behavior of the example program is entirely correct; your
 diagnosis is incorrect.

 The result of laddok(2147483647,1,k) is 16#80000000, which is not a
 valid integer4 value. Laddok permits you to carry out this add without
 getting a fatal run-time error. However, there is no way to keep
 write/writeln from discovering that variable "k" has this invalid
 value in the subsequent "writeln('Result = ',k);". It is this attempt
 to write out the illegal value that is causing the run-time error. You
 can get the same error by setting "k := 16#80000000" and then trying a
 "write(k)".


 56. lmulok Allows Overflow, but Gives No Message

 Product Version(s): 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR50110 docerr
 Last Modified: 18-AUG-1988    ArticleIdent: Q10393

 Problem:
    The program fragment below demonstrates a problem with the lmulok
 function. The value the function returns is correct. However, if you
 try to write out the value of the product when lmulok returns false,
 you get a data-format error at run time.
    The following is an example of input that causes the error:

    first integer4 >2000000
    second integer4 >2000000

    Notice that the multiplication is done without any errors, but
 writing out the product causes a data format error.
    Also, note that the behavior of lmulok is specified in the
 reference manual. I examined the example with SYMDEB and found that
 whenever the multiplication overflows, lmulok sets the value of the
 product to 16#80000000, i.e., (unsigned) 2^31. Of course, 16#80000000
 is not a legal integer4 value.
    The following is a short example code:

    program xx(input,output);
    VAR I,J,PRODUCT : integer4;
    X : integer;
    RESULT : boolean;
    FUNCTION LMULOK(A,B:integer4; var c:integer4) : boolean; extern;
    begin
    writeln;
    write('first integer4 >');
    readln(i);
    write('second integer4 >');
    readln(j);
    RESULT := lmulok(i,j,product);
    WRITELN(I:20,j:20);
    writeln(product);
    WRITELN('RESULT = ',RESULT:5)
    end.

 Response:
    This problem is the result of a documentation error on Page 240 of
 the Version 3.32 "Microsoft Pascal Compiler Reference Manual."
    The routine lmulok is the routine ultimately called to perform the
 multiplication in any integer4 product, e.g. the code generated for I
 := J * K;, where I,J,K:integer4, will invoke lmulok. You are given
 access to this routine so you can perform an integer4 multiplication,
 which overflows without having the program abort with a fatal run-time
 error.
    The value of the product is well defined only in the case where the
 product does not overflow, i.e., the return value of lmulok is true.
 This process occurs because the overflow condition is generally
 detected before the multiplication is complete and computation ceases
 as soon as the overflow is detected. The documentation indicates that
 the product is always computed and returned; this is clearly
 incorrect.


 57. Out of Memory Error in PAS2

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR17019 buglist3.20 fixlist3.30
 Last Modified: 20-OCT-1988    ArticleIdent: Q10395

 The following example yields an out-of-memory error in PAS2 of the
 compiler. If buff_ads is declared to be of adr type rather than ads
 type, the program will then compile the code below.

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.

 The following code demonstrates the problem:

    program test(input, output);
    type
    buff_rec = record
    BUFF1_PTR:adrmem;
    end;
    var
    BUFF_ADS:ads of buff_rec;
    BUFF1:lstring(50);
    BUFF2:lstring(50);
    LOC:word;
    TMP_ADR:adrmem;
    begin
    with buff_ads^ do
    begin
    BUFF1:='1234it worked!';
    LOC:=5;
    BUFF1_PTR:=adr buff1;
    TMP_ADR:=adr buff1_ptr^[loc];
    movel(adr buff1_ptr^[loc],adr buff2[1],10);
    movel(tmp_adr,adr buff2[1],10);
    BUFF2[0]:=chr(10);
    writeln;
    writeln('********p3582');
    writeln;
    writeln(buff2);
    end;
    end.


 58. PAS1 Loops Infinitely if Too Many Errors

 Product Version(s): 3.13 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR07491 buglist3.13 buglist3.20 fixlist3.30
 Last Modified: 16-DEC-1987    ArticleIdent: Q10396

 Problem:
    Under Version 3.13 of the Pascal compiler, when the
 number of syntax errors encountered by PAS1 exceeds the
 amount specified with the $errors metacommand, PAS1 loops
 infinitely. Under Version 3.20, PAS1 emits the error
 message "error count exceeded - compiler cannot continue"
 repeatedly until the compiler runs out of memory.

 Response:
    This behavior was caused because the procedure called
 when the number of errors overflows ("panic") attempts to
 flush the listing file by successively calling the lexer.
 Since the lexer can generate errors, rampant recursion is
 triggered. The Pascal front end (PAS1) was changed to avoid
 this recursion in Version 3.30.


 59. Problem with Assigning the Chr of a Trunc

 Product Version(s): 3.13 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR15705 buglist3.20 fixlist3.30
 Last Modified: 16-DEC-1987    ArticleIdent: Q10397

 Problem:
    Assigning the chr of a trunc generates a two byte value
 overwriting the target string. The following is a short
 example code:

    program b(input,output);

    procedure b1;
    var
    I: integer;
    S: string(8);
    begin {b1}
    S := 'QQQQQQQQ';
    FOR I := 1 to 8 do
    begin
    S[I] := chr(trunc(80.0));
    WRITELN('I = ',I:0,' s = ',s)
    end
    end; {b1}

    begin {b}
    b1
    end. {b}

 \.BODYTEXT
 Response:
    PAS2 was performing an optimization which was
 eliminating the coercion node on assignment trees.
    This problem was corrected in Version 3.30.


 60. Problem Passing Function as CONST Parameter in Version 3.20

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR17011 buglist3.20 fixlist3.30
 Last Modified: 30-SEP-1988    ArticleIdent: Q10398

 The examples below exhibit two problems trying to pass functions as
 CONST parameters. In the first example when the function F is enclosed
 in a parenthesis in the "copystr" call, it appears as if F is invoked
 twice. When the parenthesis is omitted as in the second example, PAS1
 emits a compile time error 227 - Invalid address of Function.

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.

 The example code as is as follows:

 Example 1

     PROGRAM PAREN(INPUT,OUTPUT);
        TYPE LSTR_80=LSTRING(80);
        VAR  B_STRING:STRING(4);

        FUNCTION F:LSTR_80;
           BEGIN
            WRITELN('INSIDE FUNCTION F');
            F:='1234';
           END;

     BEGIN {MAIN}
       COPYSTR((F),B_STRING);
       WRITELN(B_STRING);
     END.

 Example 2

     PROGRAM PAREN(INPUT,OUTPUT);
        TYPE LSTR_80=LSTRING(80);
        VAR  B_STRING:STRING(4);

        FUNCTION F:LSTR_80;
           BEGIN
            WRITELN('INSIDE FUNCTION F');
            F:='1234';
           END;

     BEGIN {MAIN}
       COPYSTR(F,B_STRING);
       WRITELN(B_STRING);
     END.


 61. Problems Using NULE6

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR17162
 Last Modified: 16-DEC-1987    ArticleIdent: Q10399

 Question:
    When we link in the modules NULE6 and NULF with our MS
 Pascal programs, we get an error at link time specifying
 that certain "QQ" symbols are defined twice. How can we
 eliminate unneeded error checking and file routines so that
 we can reduce the size of the program? What other types
 of routines also can be eliminated to reduce this size?

 Response:
    Please refer to the discussion in the user's guide
 (Section 8.5).
    Your unexpected need for NULE6.OBJ may be caused by the
 use of initialized units (see paragraph 2 of subsection
 8.5.2).


 62. Problems with Segmented Address Types

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR50072 buglist3.20 fixlist3.30
 Last Modified: 20-OCT-1988    ArticleIdent: Q10401

 There is a problem with address types and long-heap allocation. The
 code below contains the constant declaration "const newnil=ptr(0,0)"
 and uses it in an if statement. The program should execute the else
 part of the if statement and print out that "t^.nest^.back" and t are
 equal. However, instead of executing the else part of the if statement
 (so it would think the addresses are different), the program prints
 out that the addresses are the same.

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.

 The following is the short sample code:

    program test(input,output);
    type ptr = ads of word;
    p_somestruct = ads of somestruct;
    somestruct = record
    NEXT:p_somestruct;
    BACK:p_somestruct;
    end;
    const newnil = ptr(0,0);
    VAR t : p_somestruct;

    FUNCTION GETMQQ(WANTS : word) : adsmem; extern;

    begin
    t := getmqq(sizeof(t^));
    t^.next := getmqq(sizeof(t^.next^));
    t^.next^.back := t;
    if t^.next <> newnil then
    if t^.next^.back <> t then
    begin
    writeln('test says T^.NEXT^.BACK and T are not equal, BUT...');
    writeln('T^.NEXT^.BACK=',T^.NEXT^.BACK.S,T^.NEXT^.BACK.R);
    WRITELN('T =',t.s,t.r);
    end
    else
    writeln('T^.NEXT^.BACK and T are equal');
    end.


 63. Linking in DOS2PAS.LIB Versus PASCAL.LIB

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR17027
 Last Modified: 30-SEP-1988    ArticleIdent: Q10402

 Question:

 When the following program is linked with the DOS2PAS.LIB, it behaves
 differently than when linked with just the PASCAL.LIB (which has the
 DOS Version 1.x I/O package).

 When linked with the DOS Versions 2.x I/O package DOS2PAS.LIB, the
 program seems to lag one character behind. When the "f.mode :=
 terminal;" is omitted, similar behavior is experienced. What is the
 difference between terminal I/O and sequential binary mode?

 The following is a short example code:

    PROGRAM xx(input,output);
    VAR C : char;
    F : file of char;
    BEGIN
    assign(f,'con');
    F.MODE := terminal;
    reset(f);
    writeln('end program with an "@"');
    while c<>'@' do begin
    read(f,c);
    if (c <> chr(0)) then begin
    write(c);
    writeln(ord(c))
    end
    end
    END.

 Response:

 No corrective action needs to be taken. The test programs are geared
 to DOS Version 1.25. DOS Version 1.25 uses a polling model for console
 I/O. If no input is in the queue DOS returns a 0. Thus, the line "if
 chr(c) <> 0" skips over calls that returned no input. DOS Versions
 2.0x use a different method, e.g. wait for input. Because the test is
 geared for DOS Version 1.25, the DOS Version 2.00 release always seems
 to be one character behind.

 For information about the difference between terminal and sequential
 mode, see Section 8.4 of the "Microsoft Pascal Compiler Reference
 Manual."

 Note: in the Version 3.30 release, only the DOS Versions 2.x I/O
 interface will be supported.


 64. Nil Not Equal to Zero

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR17028 buglist3.20 fixlist3.30
 Last Modified: 30-SEP-1988    ArticleIdent: Q10403

 Question:

 Super array pointers allocate words to hold the upper bound of the
 allocated type. In the following program, the word following the
 pointer holds the upper bound. When nil is assigned to pointer, the
 value of 0 is assigned to the pointer, and 2 is assigned to the upper
 bound portion. Why is 2 assigned and why not 0 also?

 The following is the short example code:

    program test(input,output);
    type hundred=lstring(99);
    supar =super array[1..*] of hundred;
    VAR POINTER:^supar;
    Y :word;
    begin
    POINTER:=nil;
    Y:=sizeof(pointer^,20);
    writeln('size returned =',y);
    end.

 Response:

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.


 65. Local Record Passed Incorrectly with {$stackseg+}

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR09596 buglist3.20 fixlist3.30
 Last Modified: 20-OCT-1988    ArticleIdent: Q10405

 There are problems with a string move when the source and target are
 both on the stack. Incorrect code is generated for passing a stack
 item as a value parameter with the {$stackseg+} metacommand in effect.
 The problem occurs at the procedure call statement "d1(dx)", and
 involves a string move where the source and target are both on the
 stack. The code generated assumes that both source and target are
 resident in dgroup (ds relative).

 This assumption is false when $stackseg is enabled.

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.

 The following is a short example program:

    {$stackseg+}
    module death;
    type
    deaths_head=record
    X,Y:integer;
    DATA:lstring(255);
    end;

    PROCEDURE D1(D:deaths_head)[public,windows];
    begin
    D.X:=d.y;
    end;

    procedure d2[public,windows];
    VAR DX:deaths_head;
    begin
    d1(dx);
    end;

    procedure d3[public,windows];
    VAR X:integer;
    FUNCTION D31(N:integer):integer;
    begin
    D31:=n+x;
    end;
    begin
    X:=5;
    X:=d31(10);
    end;
    end.


 66. Redirected Input File Causes Run-Time Hang

 Product Version(s): 3.13 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 30-SEP-1988    ArticleIdent: Q10406

 Problem:

 Using the ::N notation to write an integer causes a run-time error. We
 used the ::N notation to write an integer with a radix other than 2,
 8, 10, or 16. This procedure causes a data-format error in the file
 USER at run time.

 The following is sample code:

    program wformats(input,output);
    var
    I:integer;
    begin
    I:=32;
    WRITELN(I::3);
    end.

 Response:

 MS-DOS does not return an end-of-file from a redirected input file
 when it runs out of text; DOS just hangs. This problem has nothing to
 do with Pascal.

 Put a ^Z (CTRL+Z), or chr(26) in the file and it will work
 properly.


 67. Referencing Origin from Other Module or Unit

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR17015 buglist3.20 fixlist3.30
 Last Modified: 30-SEP-1988    ArticleIdent: Q10408

 Problem:

 In the following examples, I am trying to reference variables with the
 origin (segmented address) attribute across compilation modules.
 However, both fail to pass the origin. In the first example, I attempt
 to use the unit/interface method; in the second example, I am
 trying to reference the origin via modules with public/external
 variables. The only way that I can successfully reference origin
 variables across compilation units is to declare the variables with
 matching-origin attributes in each compilation unit.

 The following is a short sample code:

 Example 1

    {$INCLUDE: 'yu.int'}
    program x(input,output);
    uses y;
    begin
    I := 13;
    subcall;
    WRITELN('FROM MAIN PROGRAM I, J AND K ARE: ', i:8, j:8, k:8);
    end.

    {$INCLUDE: 'yu.int'}
    implementation of y;
    procedure subcall;
    begin
    J := 33;
    WRITELN('USING SUBCALL: i, j and k are: ', i:8, j:8, k:8);
    end;

    begin
    K := 53;
    end.

    interface;
    unit y(i, j, k, subcall);
    var
    I[ ORIGIN 16#6000 : 16#0000 ] : integer;
    J [ ORIGIN 16#6001 : 16#0000 ] : integer;
    K [ ORIGIN 16#6002 : 16#0000 ] : integer;
    procedure subcall;
    begin
    end;

 Example2

    program x(input,output);
    VAR [EXTERN] I, J, K : integer;
    procedure subcall;extern;
    begin
    I := 13;
    subcall;
    WRITELN('FROM MAIN PROGRAM I, J AND K ARE: ', i:8, j:8, k:8);
    end. {program x}

    module y;

    VAR I [PUBLIC,ORIGIN 16#6000:0000] : integer;
    J [PUBLIC,ORIGIN 16#6001:0000] : integer;
    K [PUBLIC,ORIGIN 16#6002:0000] : integer;

    procedure subcall;
    begin
    J := 33;
    K := 53;
    WRITELN('USING SUBCALL: i, j and k are: ', i:8, j:8, k:8);
    end;

    end. {module y}

 Response:

 The above examples actually constitute two completely separate
 problems.

 In Example 1, the variables are being allocated when the interface
 was processed. They then were reallocated when the implementation was
 processed and the origin forgotten.

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.

 In Example 2, external variables are assumed to be in "ds"; there
 is no way, in the examples, to indicate that they are origined (this
 cannot work correctly). Versions 3.3x of the compiler will not allow
 specification of origin and extern on the same object. However, simply
 making them static will work properly because the actual address is
 being explicitly specified.

 If you want to access origined variables using the unit/interface
 route, it is suggested that all origined variables be declared as such
 in each module with matching allocation specifications. This procedure
 can be easily accomplished by using the $include file facility.


 68. Unresolved External: avlgqq

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR50138 buglist3.20 fixlist3.30
 Last Modified: 30-SEP-1988    ArticleIdent: Q10409

 Problem:

 The following program compiles successfully, but generates the
 unresolved external "avlgqq" at link time. The following is a short
 example code:

    PROGRAM TEST(INPUT,OUTPUT);
    TYPE RTYPE=(TYPE1,TYPE2);
    RECTYPE=RECORD
    CASE T:RTYPE OF
    TYPE1:(UDEF:INTEGER);
    TYPE2:(FID:REAL);
    END;
    VAR ADS_REC:ADS OF RECTYPE;
    PTR_REC:^RECTYPE;
    BEGIN
    NEW(PTR_REC);
    PTR_REC^:=ADS_REC^;
    END.

 Response:

 The avlgqq external is a routine to move a variable number of bytes
 from a segmented address to the heap. It appears that there has not
 actually been such a routine in the library for quite a while. An
 avlgqq routine has now been written and placed in the PASCAL.LIB for
 Versions 3.30 and later.

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.


 69. sizeof Ignores Upper Bound of Super Array

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR17010 buglist3.20 fixlist3.30
 Last Modified:  4-OCT-1988    ArticleIdent: Q10410

 Problem:

 When discussing the sizeof statement, the "Microsoft Pascal Compiler
 for the MS-DOS Operating System Reference Manual" states that "if the
 variable is a super array, the second form, which gives upper bounds,
 must be used."

 In the example program below, the second parameter of the sizeof call
 is ignored. The upper bound of the allocated pointer is stored in the
 second word of the pointer value. When the sizeof function is invoked,
 the value stored in the second word of the super array pointer is used
 to calculate the size of the super array pointer. However, when the
 second parameter is omitted from the sizeof call, PAS1 emits a compile
 time error 233 "invalid procedure or function parameter."

 The following is the short example code:

    program test(input,output);
    type hundred=lstring(99);
    supar =super array[1..*] of hundred;
    VAR POINTER:^supar;
    Y :word;
    begin
    new(pointer,20);
    Y:=sizeof(pointer^,10);
    writeln('size returned =',y);
    end.

 Response:

 This behavior has been changed by adding the ability to use the short
 form of sizeof on a short array pointer. The long form now returns the
 length calculated purely from the values specified in the sizeof call,
 and ignores the fields in the pointer. The short form uses only the
 pointer fields.

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.

 Note: a feature, sizeof(p^), has been added where p is a pointer to a
 super array. Now, this is a valid expression but it is the
 programmer's responsibility to ensure that p^ has been allocated. Also
 note that if p = pointer to a one-dimensional super array then
 sizeof(p^, 10) depends only on the underlying type of the super array
 and 10. Whether or not p^ has been allocated is irrelevant.


 70. Warning for Label Following Hex Number

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR50109 buglist3.20 fixlist3.30
 Last Modified: 30-SEP-1988    ArticleIdent: Q10412

 Problem:

 The following program fragment contains an example of an integer label
 following a hex number (16#30). This causes the PAS1 compiler message
 "Warning 280 Invalid Integer Label" to be generated. If any statement
 is included between the two statements, no warning statement is
 generated.

 The following is a short example code:

    program xx(input,output);
    label 10;
    VAR dummy,HEXNUM : word;

    PROCEDURE HEY(VAR OOPS : word); extern;

    begin
    HEXNUM := 16#30;
    10: HEY(dummy);
    if (dummy<>0) then goto 10;
    end.

 Response:

 In the case above, a flag remains set that indicates the
 number 10 is in hex radix. Because the hex radix is not legal
 in numeric labels, a warning is emitted.

 Microsoft has confirmed this to be a problem in Version 3.20. This
 problem was corrected in Version 3.30.


 71. Working Around Lack of MARKAS and RELEAS

 Product Version(s): 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 23-FEB-1988    ArticleIdent: Q10413

 Question:
    The MARKAS and RELEASE procedures do not function correctly in
 Version 3.20, and will not be included in 3.3x versions. We have got a
 workaround for our product that uses the ALLMQQ and FREMQQ procedures
 instead. Do these procedures work correctly, and will they be
 supported in future releases of Microsoft Pascal?

 Response:
    Yes the ALLMQQ and FREMQQ procedures do work in 3.3x, and we do
 plan to provide support for them in the future.
    It is entirely possible to use ALLMQQ/FREMQQ to implement some sort
 of heap management. However, if these could be used to easily
 implement the functional equivalent of MARKAS and RELEAS then we would
 still be supporting MARKAS and RELEAS in 3.3x (i.e., these function
 were dropped because it was determined that they did not work
 correctly and there was no good way to make them work correctly with
 our heap implementation). You should review the heap management used
 in Version 3.3x to see what effects this may have on your particular
 implementation.


 72. ".R" Field in ADS Variable Incorrectly Assigned

 Product Version(s): 3.30 3.31
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR51446 buglist3.30 fixlist3.31
 Last Modified: 30-SEP-1988    ArticleIdent: Q10813

 With MS-DOS Pascal Version 3.30, the ".R" field of an ADS variable can
 be incorrectly assigned. The assignment is incorrect if it is made as
 follows:

 (ADS OF RECORD TYPE)^.FIELD.R:=(ads of record type).r
 (ADS OF RECORD TYPE)^.FIELD.S:=(ads of record type).s

 If a temporary ADS variable is used to hold the address of the
 allocated memory, the assignment is made correctly.

 Microsoft has confirmed this to be a problem in Version 3.30. This
 problem was corrected in Version 3.31.


 73. Programming the Mouse with Pascal

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR51499
 Last Modified: 16-DEC-1987    ArticleIdent: Q10842

 Question:
    Are there any plans to support programming the mouse
 with Pascal?

 Response:
    There are no plans for including mouse specific
 instructions within the Microsoft implementation of
 Pascal.
    However, regarding making calls from a Pascal program to
 the mouse, that is possible and documented in the
 "Microsoft Mouse Programmer's Reference Guide" in the
 section "Making Calls From High-Level Languages". The mouse
 manual also contains information on making mouse system
 calls from BASIC and Assembly.


 74. Example Using the POSITN Function

 Product Version(s): 3.13 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR21065
 Last Modified: 30-SEP-1988    ArticleIdent: Q10853

 Question:

 I am trying to use the POSITN procedure without success. Could you
 give me an example that uses POSITN?

 Response:

 POSITN is an intrinsic function.

 The following example program demonstrates the use of the POSITN
 function:

    program position_ex(output);
    VAR     I        : integer;
            PAT      : string(3);
            S        : string(7);
            position : INTEGER;
    begin
       PAT:='pat';
       S:= 'pattern';
       I:= 1;
       position :=POSITN(PAT,S,I);
       WRITELN('POSITION=',position);
    end.

 The output was:    POSITION=             1


 75. {INTEGER:4} Not Supported in Versions 3.3x

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR21447 docerr
 Last Modified: 18-AUG-1988    ArticleIdent: Q10861

 Problem:
    It is not clear whether the metacommand {$INTEGER:4} is still
 supported within PASCAL Version 3.3x. Page 318 in the "Microsoft
 Pascal Compiler Reference Manual" mentions this command, saying that
 you can use values 2 or 4 as arguments for the $integer metacommand.
    The index on Page 388 tells you that metacommand $integer is
 described on Pages 317 and 318. However, Table 18.2 on Page 317 does
 not show the metacommand.
    If you use {$integer:4}, the compiler gives you the following
 warning:

    Warning 116 Meta Value Out Of Range Skipped

    The Microsoft Pascal Compiler User's Guide states on Page 230 that
 only 2 is allowed as an argument for the $integer metacommand;
 {$INTEGER:4} will be ignored, producing errors in programs using this
 format.

 Response:
    {$INTEGER:4} is not supported in Versions 3.3x. These are
 documentation errors; only {$INTEGER:2} is supported.
    The documentation probably should not mention the metacommand because
 variables declared as type "integer" are two-byte integers, making the
 allowed form of this metacommand, {$integer:2}, redundant.


 76. VALUE Section Not Allowed with $ROM

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR21824 docerr
 Last Modified: 26-SEP-1988    ArticleIdent: Q10862

 Pages 317 and 318 of the Pascal Reference Manual incorrectly state
 that using the $ROM metacommand in conjunction with the VALUE section
 results in a compiler warning; however, the metacommand, actually
 gives error message 347, "Cannot Use Value Section with ROM Memory."

 The manual should state that when you have a VALUE section in a
 program using the {$ROM+} metacommand, you will receive an error
 message.

 The following sample code demonstrates the problem:

 {$rom+}
 program xx;
 VAR   I :  integer;
 VALUE I := 1;
 begin
 end.


 77. Printing a File Containing CTRL+Z Characters

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR21449
 Last Modified: 30-SEP-1988    ArticleIdent: Q10868

 Question:

 Printing fails when attempting to print out hexadecimal character 1A
 (CTRL+Z) with the following command:

 writeln(prn,chr(26));

 If written to the printer, you get "Error 1028 device full in file
 PRN". We used the following assignment to print CTRL+Z:

    VAR prn : text;
    begin
    assign(prn,'prn');
    rewrite(prn);
    writeln(prn,chr(26));

 Is this problem occurring because chr(26) is the end-of-file marker
 (CTRL+Z)? Can you eliminate this problem by using write or writeln?

 Response:

 This problem occurs because of the DOS interpretation of CTRL+Z, which
 is chr(26). When DOS is processing a file and encounters a CTRL++Z
 character, it interprets the CTRL+Z character as an
 end-of-file (EOF) marker.

 In your example, you are sending a file containing the CTRL+Z
 character to the printer. DOS interprets the character as the end of
 the file, causing anything after the CTRL+Z not to be printed. Pascal
 recognizes that it was not able to print out all that it should have
 and interprets that to mean that the printer was full. This behavior
 causes the "device full" error.

 The filename PRN is reserved by DOS for the printer device. Read,
 readln, write, and writeln all read/write data to/from textfiles. When
 you write a line to PRN (printer device) using writeln, you are trying
 to write a line of a textfile to the printer, as in the following
 example:

 writeln(prn,chr(26));

 Textfiles are files of type text and always have an ASCII structure.
 Because DOS always interprets CTRL+Z characters in ASCII files as
 EOF markers, DOS interprets this CTRL+Z as the EOF marker and quits.

 Thus, in Pascal and FORTRAN you cannot send CTRL+Z to either standard
 output (filename OUTPUT) or to the printer (filename PRN). If you
 were instead trying to send output to a binary file (FILE OF <type>),
 DOS would allow you to send a CTRL+Z.

 Do the following to work around this behavior of DOS:

 1. Ensure that your output contains only printable ASCII characters
    (this is the recommended method).

 2. Trap errors on output (PRN.TRAP := true) and then decide what to
    do when an error occurs, e.g. try to print a CTRL+Z. If
    you were using some other filename reserved by DOS (such as USER)
    with OUTPUT), you should write an assembler or MS-C routine to check
    that standard input/output has been redirected.

 3. Direct output to a file instead of to the printer or standard
    output. (Please note that this does not resolve your specific problem
    in which the objective is to print the CTRL+Z character at the
    printer device.)

 4. One other possibility is to put all of your data/characters into
    a binary (FILE OF <type>) file. This is a workaround for the DOS
    interpretation of a CTRL+Z character because DOS does not do any
    interpretation of a binary file; DOS only sends it on to the printer.
    Be careful if you use the binary-file approach because the compiler
    and DOS interpret the information contained in a binary file
    differently.

 In general, do the following:

 1. Make sure that output contains only printable ASCII characters.
    In particular, do not try to write a CTRL+Z to a TEXT file, i.e.,
    do not send a CTRL+Z to OUPUT, PRN, USER, etc.

 2. If you still want to be able to send a CTRL+Z to output, you
    must redirect output to a binary file or check for the CTRL+Z using
    error trapping.


 78. GETUQQ and PUTUQQ Fail Due to Buffered I/O

 Product Version(s): 3.3x
 Operating System:   Pascal
 Flags: ENDUSER | TAR21169
 Last Modified:  4-APR-1988    ArticleIdent: Q10880

 Question:
    There appears to be a problem with using getuqq() and seek()
 together on direct files. In each of the examples below, getuqq()
 appears to be returning values from the wrong position in the file
 after the first, or first few, seeks. The examples all work correctly
 with Version 3.20 (I linked with dos2pas.lib).
    Also, with the first two examples, calling rpsuqq() before each
 seek appears to solve the problem. However, the third example still
 malfunctions in this case.

 EXAMPLE 1:
 ----------
 {* This simple example was devised request to demonstrate the problem in
  * using seek() and getuqq() together in the case of a simple direct
  * file of char. If, instead of getuqq(), get() is used to fetch bytes from
  * the file, the program works correctly. The file sktst.dat is 28 bytes long
  * and consists of the characters 'A' through 'Z' followed by a carriage
  * return and line feed.
  *}
 program sktst(input, output);
 FUNCTION GETUQQ(VAR FFILE: fcbfqq; len: word; dst: adsmem): word; extern;
 VAR     I: word;
         C: char;
         F: file of char;
 begin
         F.MODE := direct;
         assign(f, 'sktst.dat');
         reset(f);
         FOR I := 10 downto 1 do begin
                 writeln;
                 writeln('i = ', i);
                 seek(f, i);
                 if getuqq(f, 1, ads c) <> 0 then
                         writeln('error! - getuqq failed!')
                 else if ord(c) <> (ord(i) + 64) then
                         writeln('error! - c = ', c)
                 else
                         writeln('correct character found');
         end
 end.

 CONTENTS OF SKTST.DAT:
 ---------------------
 ABCDEFGHIJKLMNOPQRSTUVWXYZ<cr><lf>

 ---------------------------------------------------------------------------

 EXAMPLE 2:
 ----------
 program bug (input,output);
 FUNCTION GETUQQ(VAR F : fcbfqq;
                  LEN : word;
                  DST : adsmem ) : word ; extern;
 const
   length = 6+2;
 VAR
   I : word;
   MSG : lstring(length);
   MSGFILE : file of char;
 Begin
   MSGFILE.MODE := direct;
   assign(msgfile,'bug.dat');
   reset(msgfile);
   if msgfile.errs = 0 then
     FOR I := 0 to 3 do begin
       seek(msgfile,length*i + 1);
       MSG.LEN := length - 2;
       if getuqq(msgfile,msg.len,ads msg[1]) <> 0 then
         MSG.LEN := 0;
       WRITELN(I:2,' ',msg);
     end;
 end.

 CONTENTS OF BUG.DAT:
 -------------------
 line 0<cr><lf>
 line 1<cr><lf>
 line 2<cr><lf>
 line 3<cr><lf>
 ^Z

 ---------------------------------------------------------------------------

 EXAMPLE 3:
 ----------
 {$INCLUDE:'finkxu'}
 {$INCLUDE:'finu'}
 program test(input,output);
 uses filuqq;
 uses filkqq;
 type    rec=record
                 I:integer;
                 S:string(230);
              end;
 VAR     DREC:rec;
         F:file of rec;
         I,IOSTATUS:word;
 begin
         writeln('size of drec=',sizeof(drec));
         F.MODE:=direct;
         assign(f,'this.dat');
         rewrite(f);
         FOR I:=1 to 10 do
          begin
           DREC.I:=ord(i);
           seek(f,i);
           IOSTATUS:=putuqq(f,sizeof(drec),ads drec);
          end;
         writeln('after for loop, i=',i);
         seek(f,1);
         FOR I:=1 to 10 do
          begin
            seek(f,i);
           IOSTATUS:=getuqq(f,sizeof(drec),ads drec);
           WRITELN('GETTING RECORD ',I:1,'. I=',drec.i:1);
          end;
         close(f);
 end.

 ---------------------------------------------------------------------------

 Response:
    In Version 3.3x, I/O to DIRECT files is buffered. This change was
 made to increase performance but, unfortunately, as a result of this
 change, it is no longer feasible to use the UNIT U functions GETUQQ()
 and PUTUQQ(). The only way to correct this is to take the buffering
 back out. This will not be done because we feel that the resulting
 degradation in performance would be more of a problem than the loss of
 use of these UNIT U routines.
    The loss of functionality to users resulting from this problem is
 minimal. GETUQQ()/PUTUQQ() is used to read/write strings of WHOLE
 records to a DIRECT file, starting at some record position, from/to a
 buffer. For this purpose, it is easy to build procedures using the
 intrinsics GET(), PUT(), and SEEK() to do the job. Furthermore, for
 small record lengths (small compared to the buffer size, 512) it is
 likely that such procedures would perform much better (i.e., faster)
 than using GETUQQ() and PUTUQQ() did in 3.20. The following MODULE
 illustrates one way you could implement procedures with equivalent
 functionality for most applications. (No claim is made that this is
 the best possible way.)

 -----------------------------------------------------------------------------
 {$INCLUDE: 'finkxu'}
 module io_recs [];
 uses filkqq;

 {* Procedure ERROR_CHECK checks for three possible error conditions in   *}
 {* in the parameters passed to GET_RECORDS() or PUT_RECORDS() and ABORTS *}
 {* the program if any of these are found. The parameter PROC_FLAG        *}
 {* identifies the procedure which called ERROR_CHECK, PROC_FLAG = 1 for  *}
 {* GET_RECORDS() and PROC_FLAG = 2 for PUT_RECORDS().                    *}

 PROCEDURE ERROR_CHECK(VAR F: fcbfqq; position: integer4; count: word;
 BUFF_ADS: adsmem; proc_flag: word);

 begin
    if f.cmod <> direct then
       abort('ERROR - FILE NOT OPENED FOR DIRECT ACCESS', 10000,
       proc_flag)
    else if count = 0 then
       abort('ERROR - I/O OF 0 RECORDS REQUESTED', 10001, proc_flag)
    else if (bylong(0, buff_ads.r) + bylong(0, count)*bylong(0, f.size))
    >= 65536 then
       abort('ERROR - BUFFER CANNOT SPAN SEGMENTS', 10002, proc_flag)
 end; { error_check }

 {* Procedure GET_RECORDS() copies COUNT records from file F, starting at *}
 {* record POSITION, to the buffer whose address is DESTINATION.          *}

 PROCEDURE GET_RECORDS (VAR F: fcbfqq; position: integer4; count: word;
 DESTINATION: adsmem) [public];

 VAR   I: word;
       CURR_DEST: adsmem;

 begin
    {error_check(f, position, count, destination, 1);}
    CURR_DEST := destination;
    seek(f, position);
    FOR I := 1 to count do begin
       get(f);
       movesl(ads (f^), curr_dest, f.size);
       CURR_DEST.R := curr_dest.r + f.size
    end { end of for }
 end; { get_records }

 {* Procedure PUT_RECORDS() copies COUNT records from the buffer whose    *}
 {* address is SOURCE to the file F, starting at record POSITION.         *}

 PROCEDURE PUT_RECORDS (VAR F: fcbfqq; position: integer4; count: word;
 SOURCE: adsmem) [public];

 VAR   I: word;
       CURR_SRC: adsmem;

 begin
    {error_check(f, position, count, source, 2);}
    CURR_SRC := source;
    seek(f, position);
    FOR I := 1 to count do begin
       movesl(curr_src, ads (f^), f.size);
       CURR_SRC.R := curr_src.r + f.size;
       put(f)
    end { end of for }
 end; { put_records }

 end.


 79. PAS2 Does Not Set the DOS ERRORLEVEL in Version 3.30

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR51089 buglist3.30 fixlist3.31
 Last Modified: 24-FEB-1988    ArticleIdent: Q10940

 Question:
    According to the documentation (Pascal user's guide, Page 134),
 "The compiler supplies an exit status (to MS-DOS Versions 2.0 and
 later) that can be accessed via the IF ERRORLEVEL N batch command...".
    Unfortunately, in the case of PAS2.EXE running out of memory, it
 does not do this.

 Response:
    This problem was present in Version 3.30 of the compiler. There is
 a module called mis2 that contains error handling routines that
 interface with the Pascal run-time routines in the compiler. It was
 not properly setting the doseqq cell. This problem was corrected in
 Version 3.31.


 80. MIN Is an Undocumented Function

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR51923
 Last Modified: 30-SEP-1988    ArticleIdent: Q10992

 Question:

 In a program we declare the global variable "MIN". When we link the
 program we get a "symbol defined twice" error message. Is there a
 procedure MIN that is used by the compiler?

 Response:

 It is not a reserved word, but it is an undocumented function defined
 in the library. The library function min() does just what you would
 expect; it returns the minimum of its two arguments. However, the
 argument type and return type are WORD rather than INTEGER. Thus, the
 following declaration should be made:

 FUNCTION MIN(I,J: word): integer; extern;

 There is no function MAX() defined in the library.


 81. $mathck and Integer2 Expressions

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR21809
 Last Modified:  4-OCT-1988    ArticleIdent: Q11000

 Problem:

 Page 61 of the "Microsoft Pascal Reference Manual" describes how
 integer2 variables will be changed within a formula to integer4 if the
 result will be out of integer2's value range. However, if you use the
 metacommand $mathck as described on Page 323, this does not work
 correctly. The program will terminate with the error message "out of
 integer space."

 The following example code demonstrates this problem:

     { changing to INTEGER4 as described in Pascal reference manual }
     { on Page 61 is not done when mathck+ is set }

     { $mathck+ }
     {$line+}
     program p_f01(output);
     VAR L:integer4;
         I1:integer4;
         I: integer;
     begin
     writeln('no error message using only INTEGER4 variables');
     I1:= 1000;
     L:= I1*I1;
     writeln('1000*1000 = ',L);
     writeln;
     writeln('using INTEGER2 variables in expression, result assigned to ');
     writeln('a variable of typ INTEGER4');
     I:=1000;
     L:=I*I;     { will stop with error message right here }
     writeln('1000*1000 = ',l)
     end.

 Response:

 {$Mathck+} only tells you what the compiler finds. It evaluates the
 right-hand side as an integer2 expression, and finds that it cannot
 fit the result into an integer2 variable. More explicitly, it
 evaluates the right-hand side, determines that I is integer2,
 calculates the result, and then determines that the result is not
 integer2 and gives you an overflow error.

 The conversion of the result to an integer4, which happens if you
 delete the {$mathck+} metacommand, occurs at the assignment statement,
 not at the calculation of a result. But $mathck keeps a closer eye on
 the intermediate results, notes that the results do not fit into a
 variable of the type of those variables on the right-hand side, so it
 overflows and gives the error, never making it to the assignment that
 would have resolved the problem.

 To work around this problem, you can multiply the expression on the
 right-hand side by an integer4 1. The compiler will then evaluate the
 results of the right-hand side as an integer4 rather than integer2 and
 so $mathck+ will not give you an error.

 The following is an example:

     {$mathck+}
     {$line+}

     program test(output);
     VAR L4, I4, J4:integer4;
                  I:integer ;
     begin
          I4:= 1000;
          L4:= I4*I4;
          J4:= 1;
          writeln('1000*1000 = ',L4);
          I:=1000;
          L4:=J4*I*I;
          writeln('1000*1000 = ',L4)
     end.

 This code produces the following results:

 1000*1000 =        1000000
 1000*1000 =        1000000

 Note: you need to place the J4 at the beginning of the right-hand
 expression. The statement L4:=I*I*J4; results in the same error. That
 is because at the evaluation stage, it will evaluate it according to
 the type of the first (left-most) variable that it finds.


 82. Decimal Fractions Suffer Binary Round-off

 Product Version(s): 3.13 3.20 3.3x 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR21448
 Last Modified: 29-SEP-1988    ArticleIdent: Q11001

 Problem:

 The following bankers rounding described in the "Microsoft Pascal
 User's Guide" on Page 165 does not work correctly:

 trunc(4.5)   result is 4         correct
 trunc(207.5) result is 207       should be 208

 This problem occurs with PASCAL.LIB and ALTMATH.LIB.

 Response:

 This is not a bug. Certain rational decimal numbers are not precisely
 representable in binary. As a result, the representation of a fraction
 may actually be slightly less than the fraction. Therefore, when the
 TRUNC function is performed, the result may be unexpected. When real
 numbers are decoded, the number is rounded to ensure correct results.

 The following example also illustrates this problem. When you use real
 numbers, performing a loop that adds 0.1 each time and then uses
 TRUNC, the results will be off eventually. In this example it becomes
 inaccurate after five increments of the loop. It becomes inaccurate
 because it truncates to 4.00 when it should have returned
 5.00.

 The following sample code demonstrates the problem:

     PROGRAM DEGTST(INPUT,OUTPUT);
     VAR PRTF:TEXT;
         I,J,DEG,TMP1:REAL;
     BEGIN
       ASSIGN(PRTF,'PRN');
       REWRITE(PRTF);
         TMP1:=4.5;
       REPEAT
         I:=TRUNC(TMP1);
         DEG:=TMP1 * 100.0;
         J:=TRUNC(DEG);
         WRITELN(PRTF,'I',I:3:2,' TMP1 ',TMP1,'DEG',DEG,' J',J:3:2);
         TMP1:= TMP1 + 0.1;
       UNTIL TMP1>6.0
     END.

 In your particular case, the following program illustrates the
 problem:

     PROGRAM TEST(OUTPUT);
     VAR I1 , I2: INTEGER;
     BEGIN
             I1:=TRUNC(4.5);
             I2:=TRUNC(207.5);
             WRITELN(I1);
             WRITELN(I2)
     END.

 If you check, the number 207.5 is indeed not precisely representable
 using binary arithmetic. It is in fact somewhat less than 207.5 in
 binary arithmetic. Thus, when you truncate it, the number returned will
 be 207.


 83. Clarification of Enumerated Type's Size

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR21431
 Last Modified:  4-OCT-1988    ArticleIdent: Q11067

 Problem:

 There is an example in the "Microsoft Pascal Compiler Reference
 Manual" for the RETYPE procedure. If the example is followed exactly,
 the following warning message is given upon compiling:

 Warning 248 size not identical.

 Response:

 Because the enumerated type in question has only three values (COLOR =
 (RED, GREEN, BLUE)), values of this type are stored in one byte. This
 explains why the warning error occurs when the integer constant is
 RETYPEd as a COLOR. If the enumerated type COLOR had been defined to
 have more than 255 values, then values of type COLOR would be stored
 in a word (two bytes) and the warning error would not occur.


 84. VALUE Is a Reserved Word

 Product Version(s): 3.13 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR52108
 Last Modified: 30-SEP-1988    ArticleIdent: Q11077

 Question:

 What is wrong with the following Pascal program?

     program pem(input,output,em,errors);
     type
       idclass=  (types,konst,qvars,stcnst,field,carrbnd,proc,func);
       where=    (blck,rec,wrec);
       nameinfo=record
         CASE OCCUR:where of
           REC: (linker: integer);
         end;

         identifier=record
           CASE KLASS:idclass of
      KONST  : (value  :  integer);
         end;
     begin
     end.

 Response:

 The only change necessary is to rename your variable "value" because
 "value" is a reserved word (see Page 373 of the "Microsoft Pascal
 Version 3.32 Reference" manual, in Appendix E, "Summary of Microsoft
 Pascal Reserved Words").

 The error messages that you receive when you run PAS1 are confusing.
 Here is a summary of the process used in debugging your program:

 If you examine the line that causes the error for anomalies, the first
 thing to check is the syntax of a similar (successful) piece of code.

 There is an example in the manual of a very similar piece of code. On
 Page 79 of the Pascal Version 3.32 reference manual, in Section 7.3.1,
 "Variant Records", the example of the record "FOO" is very similar.
 After consulting this example, the only obvious difference is that
 there are no semicolons at the end of the line preceding the end
 statement. That should not create these errors, however, and indeed
 changing that does not do anything.

 Because the format of the line is correct, you have to look for
 something else. The variable "value" is a possible cause of error
 because it is a general name that might be used by the compiler for
 something else. Looking in the appendix concerning Pascal reserved
 words, you will find VALUE. Changing VALUE to a non-reserved word
 results in successful compilation.


 85. GTYUQQ, PTYUQQ Equivalent to BLOCKHEAD, BLOCKWRITE

 Product Version(s): 3.30 3.31 3.32
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR52369 docerr
 Last Modified: 18-AUG-1988    ArticleIdent: Q11095

 Question:
    On Page 368 of the "Microsoft Pascal Compiler Reference Manual"
 ("Differences between MS-Pascal and UCSD Pascal") it makes reference
 to two functions, GETUQQ and PUTUQQ, as being equivalent to the UCSD
 functions BLOCKREAD and BLOCKWRITE. This is the only reference to
 these functions and there is no description of their use. Are these
 functions available? Is this a documentation problem?

 Response:
    This is a documentation error. The correct functions are GTYUQQ
 (Page 238 in the Pascal reference manual) and PTYUQQ (Page 249 of the
 same manual).


 86. PAGE(file) Incorrectly Sends Extra Line Feed in Version 3.31

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR52568 buglist3.31 fixlist3.32
 Last Modified: 24-FEB-1988    ArticleIdent: Q11122

 Problem:
    If PAGE(file) is used with the file assigned to logical devices
 "prn" or "lpt1", the printer will correctly do a form feed to advance
 the page.
    However, an extra line feed also is being sent to the printer,
 resulting in the printer not being at the top of the form, but at the
 top of the form plus one line.
    The main problem is that if the printer is turned off after the
 program does a form feed, the next time the printer is turned on, the
 page will be off by one or more lines and the problem will compound
 each time the printer is turned off and on again.

 Response:
    This is a known problem in our Pascal Version 3.31 compiler. This
 problem was corrected in Version 3.32.


 87. XENIX Intermediate Code Incompatibility

 Product Version(s): 3.30
 Operating System:   XENIX
 Flags: enduser |
 Last Modified: 22-FEB-1988    ArticleIdent: Q11140

 Question:
    Do Microsoft's compilers use the same intermediate code format as
 that specified by AT&T? Under System V, AT&T has their own type of
 Cmerge project where compilers such as the portable C compiler and the
 portable FORTRAN compiler use the same code generator.

 Response:
    No, Microsoft's compilers do not use the same intermediate code
 format as that specified by AT&T.
    To create the same intermediate code from one compiler to another,
 a detailed knowledge of the compiler internals is necessary. This is
 possible only if you have written the compiler, or if you have the
 source code and access to someone who built it.
    In our case, we have intermediate code compatibility within our own
 products, but not relative to AT&T.
    Intermediate code compatibility is not possible because our XENIX
 compilers are similar to our DOS compilers, without the DOS trimmings
 and instead with some XENIX trimmings. This makes us incompatible with
 AT&T, because our DOS compilers were built for intermediate code
 compatibility between MS-DOS PASCAL and FORTRAN (PAS2 is the same for
 both compilers).


 88. Table of Limitations of Various Linker Versions

 Product Version(s): 3.30
 Operating System:   MS-DOS
 Flags: enduser |
 Last Modified: 22-FEB-1988    ArticleIdent: Q11171

 Question:
    Apparently, there was a 384K limitation on the Pascal Version 3.2
 Linker. Is this still valid on Version 3.31? Are there any other
 limitations that are no longer valid? This applies to all versions of
 DOS and of the Linker.

 Response:
    Please see the application note in the MS-DOS FORTRAN database that
 deals with this subject. This application note is a table that
 summarizes the Linker limitations for all versions of the Linker and
 several versions of FORTRAN, Pascal, MASM, and C.


 89. Using the Long and Short Heap Together

 Product Version(s): 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR52789
 Last Modified: 23-FEB-1988    ArticleIdent: Q11218

 Question:
    Is there any reason why the long heap and the short heap cannot be
 used together? I cannot find any reference to this in our manuals. The
 Convergent Technology Pascal compiler which is our Pascal only differs
 in one place when referring to the heap. It says that you cannot mix
 the two because the short heap requires contiguous memory and using
 the long heap will fragment memory causing the machine to crash. Is
 this true? I thought the short heap was constrained to the default
 data segment and the long heap took you out into the rest of memory.

 Response:
    There is no reason why you can't use both the long and short heaps
 with Microsoft DOS Pascal. The compiler itself uses both of them.
    The Convergent Technology version of the compiler has a different
 heap management system, and that is why it gives that warning.


 90. Determining and Setting the Stack's Size

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR52656
 Last Modified: 22-FEB-1988    ArticleIdent: Q11220

 Question:
    How do you determine the optimum stack size for a program, besides
 using a trial and error method?
    How can we set the stack size?

 Response:
    There is no direct and simple method to determine the needed stack
 size. To get an estimate, do the following:

    1. Figure out the sequence of calls to functions made by the
 program.
    2. From this, estimate the approximate size of your stack, using
 the $symtab metacommand.
    3. Add a fudge factor of 10 percent plus 250 bytes.

    You may set the size of your program's stack at link time using the
 /STACK switch. You may also use the /STACK option of the EXEMOD
 utility. Note that the linker's stack switch accepts a decimal value
 for the stack size, where the stack size stipulated using EXEMOD is in
 hexadecimal.


 91. Stack Sizes for 3.20 to 3.3x

 Product Version(s): 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR52656 docerr
 Last Modified: 18-AUG-1988    ArticleIdent: Q11221

 Question:
    We are using Pascal Version 3.20, and we are trying to upgrade to
 Pascal Version 3.30. ".EXE" files created using the Pascal Compiler
 Version 3.30 and linker (Version 3.02), crash when run, due to stack
 overflow. We are not using any compiler or linker switches, and we are
 using Pascal.lib and Math.lib.
    Why does the documentation give conflicting information about using
 the /STACK switch of the Linker to increase the stack size? Page 66 of
 the "Microsoft Pascal Compiler User's Guide" warns you not to use the
 /STACK linker switch, and Page 155 of Appendix A warns you only to use
 the /STACK linker switch with programs compiled with Pascal
 Compiler Version 3.30 or later. Which of these two warnings is correct?

 Response:
    Page 155 of Appendix A is correct: the linker stack switch should
 only be used with Pascal Version 3.30 or later. Earlier versions
 allocated unused stack space for the near heap, causing problems if
 the /Stack switch was used.


 92. DGROUP too Large in Pascal

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# S880909-3
 Last Modified: 26-SEP-1988    ArticleIdent: Q35482

 If your DGROUP is running out of space, dynamically allocate some of
 your variables using ALLMQQ(). Pascal does not allow you to push your
 stack out of DGROUP. There is no data threshold switch (/Gt in C) for
 Pascal, so you cannot automatically push the data out of DGROUP like
 you can in C.


 93. Direct file I/O Unreliable in DOS or XENIX Pascal 3.30

 Product Version(s):
 Operating System:   XENIX
 Flags: enduser |
 Last Modified: 24-FEB-1988    ArticleIdent: Q11263

 PRODUCT: Pascal/3.30
 Problem:
 If you open a DIRECT file, write to it, close it, open it again, SEEK to
 one of the records you had previously written to, and attempt to PUT a new
 value into that record, then this new value will not be placed there and
 the directory length of the file is incorrect.
 Response:
 This problem exists in both Xenix and DOS Pascal.

 A work-around for MS-DOS is available on request; user either links with
 FILF.OBJ or replaces PASCAL.LIB with PASNEW.LIB.

 Theoretically the fix under DOS 3.X is to open the file under any sharing
 mode other than sm_compat or sm_denyrw to prevent Pascal from buffering the
 file, however this may not be practical under MS-NET.

 The problem does not occur if you do not close the file, i.e. you can open
 a file, place values in the records and then seek to individual records and
 write to them a second time to replace the previous value as often as you
 wish until you first close the file.

 PROGRAMMING WORK-AROUND:  First SEEK to record 256 and GET it before
 SEEKing to the record you want to write to.

 This problem was corrected in DOS Pascal version 3.31.


 94. Creating .INI Files

 Product Version(s): 3.31
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 24-FEB-1988    ArticleIdent: Q11412

 Question:
    I am very impressed with the file initialization that Windows uses
 (i.e., the concept of the .INI file). I would like to incorporate this
 concept into my project (HTLV-III screening) application, so that it
 will be more consistent with the Microsoft setup. Will Microsoft
 consider releasing more technical information about the setup?

 Response:
    There is no detailed technical information available at this time.
 However, the basic ideas are straightforward: you set an environment
 variable that contains the directory name where the .INI file is
 located. Your program accesses this .INI file to find the
 user-specified parameters that customize the installation. The .INI
 file can contain information for more than one product. This is done
 by using keywords, contained in brackets, e.g. [KEYWORD], followed by
 the switches and information needed by that program.
    With respect to specific implementation, here are brief
 descriptions of some helpers that we have created for internal use to
 process .INI files (we cannot give you our tools, but it should be
 fairly simple to create your own):

    1. A routine that checks the environment variables (this routine
 can be coded in C; there is a GETENV function that can be used to
 determine the environment variables) and then searches for the .INI
 file at the appropriate location.
    2. A routine that opens the .INI file and searches for the KEYWORD.
    3. A routine to process the information contained after the
 keyword. One way to do this is to give the program a pointer to a
 matrix that contains the fields, possible field values (you need
 default values), and attributes of those values (e.g. the value must
 be a character string, or if that value is "20," a certain switch is
 set).


 95. Decode Will Not Accept Leading Blanks in Version 3.31

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR53149 buglist3.31 fixlist3.32
 Last Modified: 30-SEP-1988    ArticleIdent: Q11496

 Question:

 After converting from Pascal Version 3.30 to Version 3.31, the library
 function decode behaves differently. In earlier versions, leading
 blanks were acceptable for decode to work. In Version 3.31, the
 leading blanks must be removed. The following is an example:

     var
        RESULT: lstring(7);
        TOT   : real;

 begin
   RESULT:= '   12.97';   ! Worked before 3.31
   RESULT:= '12.97';      ! Works with 3.31
   RESULT:= '12.97   ';   ! Also OK with 3.31
   eval(decode(result,tot));

 Will this restriction be corrected? Old applications are no longer
 compatible.

 Response:

 Microsoft has confirmed this to be a problem in Version 3.31. This
 problem was corrected in Version 3.32.


 96. Using VAR in a Parameter List

 Product Version(s): 3.x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR52916
 Last Modified: 24-MAR-1988    ArticleIdent: Q11494

 Problem:
    In the following code (an excerpt from a larger program) the
 parameter list contains a variable "Table". All other procedures in
 the program that use Table use the parameter "VAR TABLE:TableArray",
 but in this example, the PrintTable procedure declares it
 "TABLE:TableArray".
    The program hangs because of this error. If you replace the
 parameter with "VAR TABLE:TableArray" the program works correctly. We
 think that the compiler should issue an error message in this
 instance.

 Response:
    The behavior of the Microsoft Pascal compiler is correct. In the
 program you used, the procedure PrintTable contains a parameter list.
 One of the parameters passed to PrintTable is "TABLE: TableArray;" and
 your claim is that the program did not use the parameter "VAR
 TABLE:TableArray".
    In Pascal, you can pass parameters to procedures by reference
 (using VAR, or VARS between Modules or Units) or by value (by
 default). If you use "TABLE:TableArray", you pass the parameter by
 value, while "VAR TABLE:TableArray" passes it by reference. Both
 methods are valid. Sometimes you may want to pass an array to a
 procedure by value, and that is correct Pascal usage. In your program,
 using the array in such a way hangs your program. But since both
 instances (passing arrays by reference and passing them by value) are
 correct Pascal usage, this is not an error on the part of the compiler
 but rather a logic error that the user is responsible for. The
 following is a short code excerpt:

 {---------------------------------------------------------------------------}
 {Search table for word if found increment count else call InsertWord.       }
 {---------------------------------------------------------------------------}

 PROCEDURE SEARCHTABLE (VAR TABLE: TableArray;        {<--Used correctly}
                    VAR TABLESIZE: integer;
                             WORD: String ;
          VAR FIRST, LAST, MIDDLE: integer);

 var
      FOUND: boolean; {Check to see if word is found}

 begin {SearchTable}
 FIRST:= 1;
 LAST:= TableSize;
 FOUND:= false;
 while (Last >= First) and (not Found) do
      begin {while}
      MIDDLE:= (First + Last) div 2;
      if Word < Table [Middle].Word then
              LAST:= Middle - 1
      else
      if Word > Table [Middle].Word then
              FIRST:= Middle + 1
      else
              begin {else}
              TABLE [MIDDLE].COUNT:= Table [Middle].Count + 1;
              FOUND:= true;
              end; {else}
      end; {while}
 if (Last < First) and (not Found) then
      InsertWord (Table, TableSize, First, Word);
 end; {SearchTable}

 {---------------------------------------------------------------------------}
 {Print the contents of Table to the screen.                                 }
 {---------------------------------------------------------------------------}

 PROCEDURE PRINTTABLE (TABLE: TableArray;             {<-- Correct usage but }
                    WordCount,                         {   incorrect logic  }
                   SENTCOUNT: integer);

 var
      TABLET: integer; {Loop control variable in for loop}

 begin {PrintTable}
 writeln;
 WRITELN ('CONTENTS OF: ',FileName);
 WRITELN ('TOTAL SENTENCES: ',SentCount:1);
 WRITELN ('TOTAL UNIQ WORDS: ',TableSize:1);
 WRITELN ('TOTAL WORDS: ',WordCount:1);
 writeln;
 FOR TABLET:= 1 to TableSize do
      WRITELN (TABLE [TABLET].WORD,TABLE [TABLET].COUNT:1);
 end; {PrintTable}


 97. Adding FORTRAN Library Routines to Pascal

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR53709
 Last Modified: 23-FEB-1988    ArticleIdent: Q11503

 Question:
    Can developers put FORTRAN Version 3.3x library routines into the
 Pascal Version 3.3x library?

 Response:
    Yes, it is possible to break up the FORTRAN Version 3.3x libraries
 into object modules that can be used by Pascal (using the LIB
 utility). This is tricky at best, and we do not support it.
    We do not guarantee forward compatibility if you do this.


 98. Problems with the Ads of an Array

 Product Version(s): 3.31
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist3.31 fixlist4.00
 Last Modified:  4-OCT-1988    ArticleIdent: Q11585

 Under the following conditions, incrementing the index by one fails:

 1. A field of a record is an ads of an array.
 2. Another field is the index to the array.
 3. The array is allocated on the long heap.
 4. The record is passed by VARS and the array is referenced.

 The program adstest2.PAS (below) demonstrates this behavior. The
 record variable BUFFER is passed to Procedure Increment by VARS. The
 statement labeled "instruction 1" references the elements of the
 array. "Instruction 2" increments the array's index (BUFFER.CUR).
 However, BUFFER.CUR is not being incremented, as can be seen by
 running the program. "Instruction 3" prints the unincremented index.
 Microsoft is researching this problem and will post new information as
 it becomes available.

 Microsoft has confirmed this to be a problem in Version 3.31. This
 problem was corrected in Version 4.00.

 The following notes apply:

 1. Delete the statement labeled "Instruction 1" and the program
    works successfully (see adstest3.PAS).

 2. Use BUFFER as a global variable rather than passing it to
    Procedure Increment by VARS, and the program works successfully
    (see adstest1.PAS).

 3. adstest2.PAS works successfully under Pascal Version 3.20.

 The following are short example codes:

 Short Example Code: adstest1.pas

     program test(input,output);
     type    ads_table=ads of array[1..32766] of char;
             buffer_typ=record
                             TABLE_ADS:ads_table;
                             CUR:integer;
                             FINISH:integer;
                        end;

     const   size=200;

     VAR     BUFFER:buffer_typ;
             CH:char;

     FUNCTION ALLMQQ(WANTS:word):adsmem;extern;

     procedure initialize_buffer;
     begin
             BUFFER.TABLE_ADS:=allmqq(size);
             BUFFER.FINISH:=size;
             BUFFER.CUR:=1;
     end;

     procedure increment;
     begin
       repeat
             CH:=buffer.table_ads^[buffer.cur];     {instruction 1}
             BUFFER.CUR:=buffer.cur + 1;            {instruction 2}
             WRITELN('BUFFER.CUR = ',BUFFER.CUR:1); {instruction 3}
       until (buffer.cur > buffer.finish);
     end;

     begin {main}
             initialize_buffer;
             increment;
     end.

 Short Example Code:  adstest2.pas

     program test(input,output);
     type    ads_table=ads of array[1..32766] of char;
             buffer_typ=record
                             TABLE_ADS:ads_table;
                             CUR:integer;
                             FINISH:integer;
                        end;

     const   size=200;

     VAR     BUFFER:buffer_typ;
             CH:char;

     FUNCTION ALLMQQ(WANTS:word):adsmem;extern;

     procedure initialize_buffer;
     begin
             BUFFER.TABLE_ADS:=allmqq(size);
             BUFFER.FINISH:=size;
             BUFFER.CUR:=1;
     end;

     PROCEDURE INCREMENT(VARS BUFFER:buffer_typ);
     begin
       repeat
             CH:=buffer.table_ads^[buffer.cur];     {instruction 1}
             BUFFER.CUR:=buffer.cur + 1;            {instruction 2}
             WRITELN('BUFFER.CUR = ',BUFFER.CUR:1); {instruction 3}
       until (buffer.cur > buffer.finish);
     end;

     begin {main}
             initialize_buffer;
             increment(buffer);
     end.

 Short Example Code: adstest3.pas

     program test(input,output);
     type    ads_table=ads of array[1..32766] of char;
             buffer_typ=record
                             TABLE_ADS:ads_table;
                             CUR:integer;
                             FINISH:integer;
                        end;

     const   size=200;

     VAR     BUFFER:buffer_typ;
             CH:char;

     FUNCTION ALLMQQ(WANTS:word):adsmem;extern;

     procedure initialize_buffer;
     begin
             BUFFER.TABLE_ADS:=allmqq(size);
             BUFFER.FINISH:=size;
             BUFFER.CUR:=1;
     end;

     PROCEDURE INCREMENT(VARS BUFFER:buffer_typ);
     begin
       repeat
             BUFFER.CUR:=buffer.cur + 1;            {instruction 2}
             WRITELN('BUFFER.CUR = ',BUFFER.CUR:1); {instruction 3}
       until (buffer.cur > buffer.finish);
     end;

     begin {main}
             initialize_buffer;
             increment(buffer);
     end.


 99. PASIBF.OID and PASIBF.TMP in XENIX Pascal

 Product Version(s): 3.30 3.31
 Operating System:   XENIX
 Flags: ENDUSER |
 Last Modified:  4-OCT-1988    ArticleIdent: Q11592

 Problem:

 When I use the cl driver with the -c option as follows, the files
 PASIBF.OID and PASIBF.TMP are left in the current working directory:

 cl -c dummy.c

 These are the intermediate files from PAS2 to PAS3 so that an object
 file listing can be made.

 Although I have not asked for an object files listing, cl still
 creates them.

 Response:

 Microsoft has confirmed this to be a problem in Versions 3.30 and 3.31.

 To work around this problem, delete your temporary files.


 100. Run-Time Library Compatibility with FORTRAN

 Product Version(s): 3.13 3.20 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR53708
 Last Modified: 23-FEB-1988    ArticleIdent: Q11501

 Question:
    Are the REAL functions from the Microsoft FORTRAN Run-Time Library
 compatible with the Pascal DECMATH.LIB Library? How about the other
 Pascal libraries?

 Response:
    No, the Pascal DECMATH Library is not compatible with the FORTRAN
 Run-Time Library. However, the regular Pascal Version 3.3x Run-Time
 Library is compatible with the FORTRAN 3.3x Run-Time Library.


 101. Limit on Nesting Units or Include Files

 Product Version(s): 3.3x
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR53861 docerr
 Last Modified: 23-FEB-1988    ArticleIdent: Q11582

 Problem:
    The manual does not say that there is a limit on the number of
 units or $include files one can nest in Pascal.
    If you nest units six levels deep, the compiler will give a warning
 118: too many file levels, followed by error 366: unit identifier
 expected skip to. From the sample program, if you nest up to five
 levels the compiler will not give the warning message. It seems that
 there is a limit on how many levels one can do.

 Response:
    There is an undocumented limit of five levels of nesting for units
 and include files. This documentation omission will be corrected in a
 future release.


 102. Extra Line Feeds with WRITE in Version 3.31

 Product Version(s): 3.31 3.32
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR54481 buglist3.31 fixlist3.32
 Last Modified: 30-SEP-1988    ArticleIdent: Q11679

 Problem:

 Pascal Version 3.31 I/O seems to be behaving incorrectly. Line feeds
 are inserted when they should not be. If I use the following
 statements a carriage return is executed, but not a line feed:

     WRITE('ENTER A NUMBER');
     READLN;
     READ(F);

 As a result, the output is (and should be) overwriting the previous
 output. If the above statements are executed a second time, however, a
 line feed is inserted in the first write statement.

 Below is a copy of a program that duplicates the problem. This program
 works correctly in Version 3.20. However, in Version 3.31, if you
 execute the following program more than once you will see the line
 feed being inserted incorrectly with the first write statement:

     program test2(input,output);
     var
      num:integer;
      rnum:real;
      letter:char;

     begin
       write('enter a number (integer):');
       read(num);
       write('enter a real number: ');
       readln;
       read(rnum);
       write('enter a char:');
       readln;
       read(letter);
       writeln('The number is: ',num:3);
       writeln('the letter is: ',letter);
       writeln('the real number is:',rnum:5:2);
     end.

 Response:

 Microsoft has confirmed this to be a problem in Version 3.31. This
 problem was corrected in Version 3.32.


 103. Pascal Library Function Hdluqq Obtains Integer File Handles

 Product Version(s): 3.1x 3.20 3.3x 4.00 | 4.00
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 18-AUG-1988    ArticleIdent: Q32085

    To determine the integer file handle for a file opened in Pascal,
 you can use the Pascal library function Hdluqq as the following
 program demonstrates.
    On Page 386, under "Functions" in the index of the "Microsoft
 Pascal Compiler Reference" manual (Version 4.00), "HDLUQQ" is listed,
 but there is no documentation on this function in this manual.
 However, the "HDLUQQ" function is actually documented in the
 "Microsoft Pascal Compiler User's Guide" (Versions 3.20 to 4.00) on
 Page 133, Section 10.5.1.

    The following program uses the Pascal library function HDLUQQ to
 obtain the integer files handle of the files opened by the Rewrite or
 Reset functions. This program will work in both DOS and OS/2, although
 the respective operating systems do not open the file handle numbers
 in the same manner.
    Pascal only uses File Control Block stream files, and has no direct
 file I/O functions, so accessing the file handle is of little value in
 Pascal; however, the file handle could be passed to a Microsoft C or
 Macro Assembler routine.

 }

 program GetFileHandleWith_HDLUQQ(input,output);
     var
         f1, f2     : text; {File variables; for sequential text files here.}
         filehandle : integer;

     {Predeclare the Pascal library function Hdluqq. Hdluqq returns
      a 2-byte integer file handle for the stream file variable
      passed by reference to Hdluqq as an argument. Note that stream
      files use File Control Blocks, hence the name of the parameter
      below.
     }
     function Hdluqq (var FCBvariable : text) : integer; extern;

 begin
     {In DOS, the first available file handle should be 5. In OS/2, it
     ordinarily is file handle 3. Close the file to make the file
     handle available again.
     }
     assign(f1,'file1');
     rewrite(f1);
     filehandle := Hdluqq(f1);
     writeln;
     writeln('File handle for first  user-opened file = ',filehandle:3);
     writeln('Close this file and make its file handle available for reuse.');
     writeln;
     close(f1);

     {Open a second file. Note that file is not closed until the program's
     end.
     {
     assign(f2,'file2');
     rewrite(f2);
     filehandle := Hdluqq(f2);
     writeln('File handle for second user-opened file = ',filehandle:3);
     writeln;

     {Get the file handle for an existing file opened by reset.}
     reset(f1);
     filehandle := Hdluqq(f1);
     writeln('File handle for reopened first file     = ',filehandle:3);
     writeln;
     writeln('Good-bye.');
     close(f1);

     close(f2)
 end.


 104. Math Errors on 80286 and 80386 with Pascal Versions 3.13, 3.20

 Product Version(s): 3.13 3.20
 Operating System:   MS-DOS
 Flags: ENDUSER | appnote
 Last Modified:  4-NOV-1988    ArticleIdent: Q32093

 If you perform floating-point math calculations on 80286 or 80386
 machines with Pascal Versions 3.13 or 3.20 emulators or 87 math
 libraries, the computer hangs or returns incorrect answers.

 The same program that generates correct floating-point results on 8088
 or 8086 machines, such as the IBM PC/XT, will not work correctly on
 80286s, such as the IBM PC/AT (IBM AT), or 80386s, such as the Compaq
 Deskpro 386 or the IBM PS/2 Model 80.

 This problem occurs because the libraries provided with the Pascal
 compiler Versions 3.13 and 3.20 do not recognize the absence of an
 80287 or 80387 math coprocessor when run on 80286 or 80386 processors;
 these chips were created after Pascal Versions 3.13 and 3.20.

 For Pascal Version 3.20, but not for Pascal Version 3.13, this problem
 can be avoided by adding the following SET command to your
 environment, either by entering it at the operating system prompt or
 by first running a batch file that contains the SET command as
 follows:

    SET NO87=8087 SUPPRESSED

 For Pascal Versions 3.13 and 3.20, the problem can be corrected with
 an application note available from Microsoft Product Support Services
 by calling (206) 454-2030.


 105. File Access Error In <file>.PAS; Code 1140; Status 110

 Product Version(s): 4.00   |4.00
 Operating System:   MS-DOS |OS/2
 Flags: ENDUSER | MS-DOS OS/2 docerr
 Last Modified:  2-DEC-1988    ArticleIdent: Q32251

    When PAS1 or PL of the Pascal Version 4.00 compiler cannot locate a
 file it is looking for, it issues the following undocumented error
 message:

    File Access Error In <filename>.PAS; Code 1140; Status 110
    Compiler Cannot Continue

    PAS3 can issue a similar message, as follows:

    File access error in file pasibf.sgt, error code 1140

    While not documented, these error message indicate the cause of the
 problem: a file name was referenced, but the compiler cannot find the
 file. With the earlier Pascal Version 3.32, the equivalent PAS1 error
 message was as follows:

    File access error in file <name>.PAS; Code : 1032; Status : 2

    With Pascal Version 3.32, the equivalent PAS3 error message was as
 follows:

    File access error in file PASIBF.OID, error code 1032

    The following three types of files being searched for by the
 compiler may result in the error:

    1. The source (.PAS) file could not be found by PAS1 or PL, either
       in the current working directory (by default), or by the path
       specified. A user typographical error, an incorrectly specified
       path, or nonexistent file is the typical cause of this error.
       Under DOS, it could be due to running out of file handles which
       could be corrected by adding the line "FILES=20" to the
       CONFIG.SYS file, and rebooting the computer. Interference from
       terminate but stay resident in memory software (TSR) could also
       be a problem under DOS.
    2. An include file indicated by the $include metacommand could not
       be found, either in the current working directory, with the
       specified path, or in the directory(s) specified by the compiler
       option /I<include_file_directory> or the SET INCLUDE=
       environment variable. Under DOS, it could also be due to running
       out of file handles as mentioned above.
    3. A compiler created symbol file was expected, but not found.
       There are two primary reasons for this:
       a. You ran PAS3 without first explicitly specifying that you
          wanted a .COD file in PAS1. PAS3 is looking for the compiler
          intermediate symbol files PASIBF.OID or PASIBF.SGT.
       b. Using the /Zi or /Zd compiler switch for CodeView debugging
          information with PAS1;, /Zi is a PL option and not a PAS1
          option. (Use the /Z option for CodeView information with
          PAS1.) If /Zi is incorrectly used with PAS1, the resulting
          error message is as follows:

          File Access Error In File i.PAS; Code : 1140; Status : 2


 106. Compiler Switches Used with PL Versus PAS1

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | MS-DOS OS/2 docerr
 Last Modified: 30-SEP-1988    ArticleIdent: Q32252

 The PL compiler-linker driver uses different compiler switches or
 options than those used when invoking PAS1 of the compiler separately.

 The PL driver uses a modified form of the PAS1 compiler switches or
 options. A PAS1 option consists of a forward slash (/) followed by a
 single capital letter and the source filename, such as "PAS1 /D
 myfile.pas". The PL form of the same option is generally "PL /Pd
 myfile.pas". Note that the PL form of the PAS1 switch is "/P",
 followed by the PAS1 option letter in lowercase.

 Several exceptions to this general rule are documented on Pages
 Update-18 and Update-19 in the "Microsoft Pascal 4.0 Update." Also see
 Pages Update-20 to Update-27 for additional PL options not available
 with PAS1.


 107. Pascal 4.00 README.DOC: Filenames under OS/2

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33268

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 File Names under OS/2

 Although DOS ignores any characters beyond the first eight in file and
 path names, OS/2 does not and instead reports an error. If you are
 using old batch or make files for OS/2 development, you may need to
 modify the files so that only eight characters and an extension are
 used in file and path names.


 108. PL Driver Uses /Zi Switch; PAS1 Uses /Z

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | MS-DOS OS/2 docerr
 Last Modified: 18-AUG-1988    ArticleIdent: Q32256

 Problem:
    I am trying to compile a Pascal source-code file with the option to
 allow me to debug my program with CodeView. However, when I issue the
 following command:

    PAS1 /Zi myfile.pas;

 I get the following compiler error message for the file "i.PAS", even
 though I am not using "i.PAS":

    File Access Error In i.PAS; Code 1140; Status 110
    Compiler Cannot Continue

 Response:
    The "/Zi" compiler option is intended to be used only with the PL
 compiler-linker driver. When using PAS1, the equivalent switch is
 "/Z". The correct syntax would be one of the following:

          PAS1 /Z  myfile;

          PL   /Zi myfile.pas

    These options are documented in Table 2.1 on Page Update-19 of the
 "Microsoft Pascal 4.0 Update." Please note that the CodeView option
 under PL is incorrectly documented in the table as "/Z:" (/Z with a
 colon). The correct PL option for including CodeView information is
 "/Zi" (/Z followed by the lowercase letter "i").


 109. Building LIBPASE.LIB Using the Library Manager

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 20-OCT-1988    ArticleIdent: Q34925

 To build the combined emulator math Pascal library LIBPASE.LIB for DOS
 (which may be named LIBPASER.LIB if using both DOS and OS/2 without
 specifying the DOS mode library for the default), the component
 libraries below must be combined using LIB Version 3.11, the Library
 Manager.

 The component libraries listed below should be placed in the current
 working directory. The PATH environment variable should be set so
 LIB.EXE is in the path. The Library Manager should be run from the
 directory that contains the component libraries.

 The syntax is as follows:

 LIB LIBPASE.LIB

 Library does not exist.  Create? (y/n) y

 OPERATIONS: +PARTIAL.LIB +ENTX6L.OBJ +DOS30P.LIB&
             +IEEEMATH.LIB +EMR.LIB

 LIST FILE:  <Enter>

 OUTPUT LIBRARY:  <Enter>

 At this point, the Library Manager combines the component libraries
 into the combined library LIBPASE.LIB for DOS.

 For the combined emulator math library for OS/2 (named LIBPASEP.LIB if
 the default library naming convention was not requested for OS/2), the
 commands to LIB are as follows:

 LIB LIBPASEP.LIB

 Library does not exist.  Create? (y/n) y

 OPERATIONS: +PARTIAL.LIB +5ENTX6L.OBJ +DOS50P.LIB&
             +DOSCALLS.LIB+IEEEMATH.LIB +EM.LIB

 LIST FILE:  <Enter>

 OUTPUT LIBRARY:  <Enter>


 110. Defining Constants with /D and $IFDECL Metacommand

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | MS-DOS OS/2 docerr
 Last Modified: 29-SEP-1988    ArticleIdent: Q32454

 Pascal Version 4.00 now provides the /D compiler command-line option
 for defining constants (but not variables) with values of integer,
 real, or single quotation-mark delimited strings of up to 76
 characters.

 This information is documented in the "Microsoft Pascal 4.0 Update" on
 Pages Update-21 and Update-22.

 There is also the new {$ifdecl <constant> $then} and associated
 {$else} and {$end} metacommands that provide conditional compilation
 of source code based on whether the <constant> has been previously
 defined at the command line with the /D option. The documentation for
 these metacommands is on Pages Update-35 and Update-36. (Constants
 defined in the CONST section of the source file are not used for the
 conditional compilation metacommands.)

 With the /D compiler option, no value needs to be explicitly assigned
 to the constant to use with {$if <constant> $then}. The default
 constant value will be the integer 1. Do not include spaces in a
 /D<constant> or /D<constant>=<value> option string.

 Remember the dollar sign before "$then" in the {$if <constant> $then}
 metacommand. Leaving the "$" off of "$then" results in Warning 122
 Invalid Metacommand Skipped.

 Note that the value assigned to the constant with /D can be redefined
 later, such as when compiling an assignment to the same constant in
 the CONST section of the source file. The /D option defines constants
 first, then assignments may be made in the CONST section of source
 code. The last definition of a constant will be the one used for later
 calculations and output.


 111. Using Exponentiation Functions Prsrqq and Prdrqq

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 26-SEP-1988    ArticleIdent: Q32455

 The functions prsrqq and prdrqq perform exponentiation on single- or
 double-precision floating-point numbers respectively.

 The definitions of these functions are incorrectly documented on
 Page 249 of the "Microsoft Pascal 4.0 Compiler Reference Manual." The
 parameters for both functions must be defined as VARS, not as value
 parameters as documented.

 The program below demonstrates the use of the Pascal library functions
 that perform exponentiation for floating-point bases and exponents.

 Function prsrqq performs exponentiation on real4 values; function
 prdrqq performs exponentiation on real8 values. The purpose of each
 function is to raise the first argument "a" to the "b" power, or a**b.

 Note that both prsrqq and prdrqq must be declared extern, and the
 parameters must be declared with VARS. The documentation on Page 249
 of the "Microsoft Pascal 4.0 Compiler Reference Manual" is incorrect
 in defining the parameters as being passed by value. Defining the
 parameters as passed by value will result in function return values of
 0.0, 1.0, or #INF (Infinite).

 Defining the parameters passed to prsrqq by VAR (not VARS) also
 results in 0.0. Defining the parameters passed to prdrqq by VAR
 results in the run-time error "Error: negative REAL to REAL Power"
 "Error Code 2133"

 The following program demonstrates the use of the prsrqq and prdrqq
 functions:

 program Exponentiation_Functions(input,output);
 var a4,b4,r4 : real4;  {operands, return value for prsrqq function call}
     a8,b8,r8 : real8;  {operands, return value for prdrqq function call}

 function prsrqq (vars a,b: real4): real4; extern; {Single precision a**b}
 function prdrqq (vars a,b: real8): real8; extern; {Double precision a**b}

 begin {main}
     a4 := 2.5;
     b4 := 3.0;
     r4 := prsrqq(a4,b4);

     a8 := 3.1415927;
     b8 := 2.0;
     r8 := prdrqq(a8,b8);

     writeln;
     writeln('Single precision prsrqq of 2.5       ** 3.0 = ',r4);
     writeln('Double precision prdrqq of 3.1415927 ** 2.0 = ',r8)
 end.  {main}


 112. Substitutes for Unimplemented SHL, SHR Operators

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q32456

 The unsigned left- and right-shift operators Shift Left (SHL) and
 Shift Right (SHR) have never been implemented in Microsoft Pascal.
 They are referred to in several areas of the "Microsoft Pascal 4.0
 Compiler User's Guide" and the "Microsoft Pascal 4.0 Compiler
 Reference" manual, including Appendix B.3 "Unimplemented Features" on
 Page 166 of the "Microsoft Pascal 4.0 Compiler User's Guide."

 The program below demonstrates user-defined procedures that can be
 used instead of SHL and SHR. Note that the names SHL and SHR are
 reserved by the compiler, so the procedures used to replace them
 cannot use the names SHL or SHR.

 The program below demonstrates simple substitutes for the
 unimplemented unsigned SHL and SHR operators.

 No range checking of initial values or the results of calculations is
 performed.

 The value being shifted is a 16-bit word. Digits shifted beyond the
 range of the word are dropped. Zero fill is used.

 While not implemented, SHL and SHR are compiler reserved words so the
 substitute procedures have the names "mySHL" and "mySHR".

 The following is a sample program:

 program SHL_SHR_Substitutes(input,output);
 var w   : word;     {word to shift left or right     }
     n,i : integer;  {shift positions: + left, - right}

 {Using integer2 math, raise 2 to the Nth power. Return word.}
 function Int_2toNth(n : integer) : word;
     var i   : integer;
         sum : word;
     begin
         sum := 1;
         for i := 1 to n do
             sum := wrd(sum + sum);
         Int_2toNth := sum
     end;

 {Shift word logical left (unsigned) the equivalent of n binary digits.}
 procedure mySHL(var w : word; n : integer);
     begin
         w := wrd(w * Int_2toNth(n))
     end;

 {Shift word logical right (unsigned) the equivalent of n binary digits.}
 procedure mySHR(var w : word; n : integer);
     begin
         w := wrd(w DIV Int_2toNth(abs(n)))
     end;

 begin         {begin main}
     writeln;
     writeln;
     writeln('Demonstration of substitutes for SHL and SHR.');
     writeln;
     write('Enter word to operate on              : ');
     readln(w);
     writeln;
     write('Enter digits to shift ("-" for right) : ');
     readln(n);
     writeln;
     if n < 0 then
         mySHR(w,n)
     else
         mySHL(w,n);
     writeln('Result = ',w:5)
 end.          {end main}


 113. Incorrect Pascal Compiler Option for CodeView in README.DOC

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 18-AUG-1988    ArticleIdent: Q32722

    The README.DOC file on the Microsoft Pascal Version 4.00 Compiler
 distribution disk labeled "Setup and Compiler" has the following
 errors:
    In the section titled "Microsoft Codeview Debugger," in the
 subsection "Microsoft Pascal Programs," the sentence for correcting
 the compiler options is itself incorrect. The option for including
 CodeView symbolic information when compiling with PAS1 is "/Z", not
 "/Zz" as stated in the README text, and not "/Zi" as printed in the
 Microsoft CodeView and Utilities manual. Both /Zi and /Zz are options
 for the PL compiler-linker driver only.


 114. Linker Error L4051: "Cannot Find Library"

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q32792

    When linking modules compiled under older versions of the Pascal
 compiler, it is common to receive the linker error message L4051:
 "Library not found." This is because the multiple libraries used with
 Versions 3.32 and prior have been combined into single library for
 Version 4.00.
    The old component library names are embedded into the .OBJ files of
 modules compiled with Pascal Versions 3.32 and prior. To avoid the
 linker error, use the /NOD option (or /NODEFAULTLIBRARYSEARCH) at link
 time and specify the libraries to be used as in the following:

 link /NOD my.obj, my.exe, my.map, libpaser.lib;



 115. PACKING.LST for Pascal Compiler Version 4.00

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 20-OCT-1988    ArticleIdent: Q33216

 The following article was taken from the PACKING.LST file for Pascal
 Version 4.00.

 PACKING.LST for Microsoft(R) Pascal Compiler Version 4.0 (C) Copyright
 1987, 1988 Microsoft Corporation

 Documentation

 There are six manuals:

 Microsoft Pascal Compiler Version 4.0 Update
 Microsoft Pascal Compiler User's Guide
 Microsoft Pascal Compiler Reference
 Microsoft Mixed-Language Programming Guide
 Microsoft CodeView(R) and Utilities manual
 Microsoft Editor User's Guide

 The package also includes a quick reference guide and templates:

 Microsoft Pascal Compiler Quick Reference Guide
 Two function-key templates for the Microsoft CodeView debugger

 Disks

 The Microsoft Pascal compiler is distributed on nine 5- 1/4" disks or
 four 3-1/2" disks. The 3-1/2" disks are not included in this package.
 To obtain 3-1/2" disks, telephone Microsoft Consumer Response at
 1-800-426-9400 (in Washington and Alaska, call 206-882-8088). Please
 have your manuals handy when you call. The following two lists
 describe the layout of the 5-1/4" disks and show how the contents of
 the 5-1/4" disks are combined to make up the 3-1/2" disks.

 5-1/4" Disk Layout

 Disk 1 of 9: Setup and Compiler

 README        DOC    Information made available after manuals
                      were printed
 PACKING       LST    Packing-list file (this file)
 SETUP         EXE    Pascal SETUP program
 87            EXE    80x87 Coprocessor presence detector
 BIND          EXE    Operating System/2 BIND
 ECH           EXE    Character echoing utility used by Microsoft
                      Editor
 EXP           EXE    Expunge utility (used with RM)
 ERROUT        EXE    STDERR Redirection Utility
 EXEHDR        EXE    EXE Header Utility
 EXEMOD        EXE    EXE File Header Utility
 EXEPACK       EXE    EXE File Compression Utility
 IMPLIB        EXE    Import Library Manager
 SETENV        EXE    Environment Expansion Utility

 (13 files)

 Disk 2 of 9: Utilities

 PAS1  EXE    Pascal compiler, Pass 1
 PAS2  EXE    Pascal compiler, Pass 2
 PAS3  EXE    Pascal compiler, Pass 3
 MAKE  EXE    Program Maintenance Utility

 (4 files)

 Disk 3 of 9: Examples

 LINK  EXE    Segmented-Executable Linker
 PL    EXE    Pascal/Link driver
 RM    EXE    File removing utility
 FINK         Unit F/U file definitions
 FINKXU       Unit F/U file definitions
 FINU         Unit F/U file definitions
 CLOCK INT    Time/date definitions
 INTRP INT    Interrupt definitions
 PASEXEC  INC Demo include file for demoexec.pas
 PORT  INT    INPORT OUTPORT definitions
 BSE   INT    OS/2 API definitions
 BSEDOS INT   OS/2 API definitions
 BSEERR INT   OS/2 API definitions
 BSESUB INT   OS/2 API definitions
 OS2   INT    OS/2 API definitions
 OS2DEF INT   OS/2 API definitions
 DEMOEXEC PAS Pascal demo program
 PRIMES   PAS Pascal demo program
 SORTDEMO PAS Pascal sort demo program
 MAKESORT BAT Pascal sort demo program makefile (DOS)
 MAKESORT CMD Pascal sort demo program makefile (OS/2)
 EMOEM ASM    MASM source to modify 87.LIB for
              non-IBM(R) compatibles
 ENTX6L ASM   Pascal startup source
 ENTXSTUB ASM Pascal startup source stub for OS/2

 (24 Files)

 Disk 4 of 9: Library 1

 UNDEL         EXE    File undeletion utility (used with RM)
 LVARSTCK OBJ  Variable heap support
 APILMR        OBJ    Binder helper
 ENTX6L        OBJ    MS-DOS  Pascal startup
 5ENTX6L  OBJ  MS OS/2 Pascal startup
 ENTX6W   OBJ  MS-DOS  Pascal startup Windows
 5ENTX6W  OBJ  MS OS/2 Pascal startup Windows
 API   LIB     OS/2 API interface
 DOS30P LIB    DOS helper library used during library build
 DOS50P LIB    OS/2 helper library used during library build
 EMR   LIB     Emulator library (DOS)
 EM    LIB     Emulator library (OS/2)
 87R   LIB     8087/80287 math library (DOS)
 87    LIB     8087/80287 math library (OS/2)
 CEXEC LIB     SPAWN/EXEC support for DOS only
 DOSCALLS LIB  API definitions
 PASLIBW  LIB  Windows startup for Pascal (Only for 2.03 SDK)
 WIN87EM  LIB  Windows Emulator math      (Only for 2.03 SDK)
 MAKELIB  BAT  Alternate Library build batch file (DOS)

 (19 Files)

 Disk 5 of 9: Library 2

 LIB   EXE    Library manager
 EXEC  EXE    Utility used only by ILINK
 ILINK EXE    Incremental linker
 NULF  OBJ    Runtime file i/o stub
 NULE6 OBJ    Math stub
 PARTIAL  LIB Helper library used during library build
 ALTMATH  LIB Large-model alternate-math library
 DECMATH  LIB Large-model decimal math library
 IEEEMATH LIB IEEE math library
 8087  LIB    8087/80287 math library (model independent)
 MAKELIB  BAT Alternate Library build batch file (DOS)
 MAKELIB2 BAT Alternate Library build batch file (DOS) part 2.

 (12 Files)

 Disk 6 of 9: Microsoft CodeView(R) for MS-DOS

 CV    EXE    Microsoft CodeView debugger
 CV    HLP    Help file for the Microsoft CodeView debugger
 CVPACK EXE   Debugging information packing utility
 MOUSE  COM   Mouse driver

 (4 Files)

 Disk 7 of 9: Microsoft CodeView(R) for MS OS/2

 CVP   EXE    Microsoft OS/2 CodeView debugger
 CVP   HLP    Help file for the Microsoft CodeView debugger

 (2 Files)

 Disk 8 of 9: Microsoft Editor

 CALLTREE EXE Produces book-mark files for C and ASM programs
 M     EXE    Microsoft Editor (MS-DOS)
 MEP   EXE    Microsoft Editor (MS OS/2)
 MEGREP EXE   Pattern finding utility (GREP)
 BRIEF INI    Brief editor key definitions
 EPSILON  INI Epsilon editor key definitions
 QUICK INI    Quick product editor key definitions
 WS    DLL    WordStar key emulation
 WS    ZXT    WordStar key emulation
 EXT   DOC    -
 EXT   H      -
 EXTHDR OBJ   - Files used to create user Editor macros
 EXTHDRP  OBJ -
 SKEL  C      -
 SKEL  DEF    -

 (15 Files)

 Disk 9 of 9: Startup Source Code

 DOS       <DIR>
 OS2       <DIR>
 PATCH32   <DIR>
 BRKCTL   INC
 CHKSTK   ASM
 CHKSUM   ASM
 CMACROS  INC
 CRT0FP   ASM
 FMSGHDR  ASM
 MAKEFILE
 MSDOS    H
 MSDOS    INC
 NULBODY  C
 README   DOC
 REGISTER
 SETARGV  ASM
 STARTUP  BAT
 VERSION  INC
 WILD  C

 (16 Files)

 \DOS Subdirectory

 CRT0  ASM
 CRT0DAT  ASM
 CRT0MSG  ASM
 EXECMSG  ASM
 NMSGHDR  ASM
 NULBODY  LNK
 STDALLOC ASM
 STDARGV  ASM
 STDENVP  ASM

 (9 Files)

 \OS2 Subdirectory

 CRT0  ASM
 CRT0DAT  ASM
 CRT0MSG  ASM
 EXECMSG  ASM
 NMSGHDR  ASM
 NULBODY  LNK
 STDALLOC ASM
 STDARGV  ASM
 STDENVP  ASM

 (9 Files)

 \PATCH32 Subdirectory

 PATCH87  DOC
 PATCH87  EXE
 SETRHS   EXE
 RMRHS    EXE
 STKPAT   BAT
 STKPAT   SCR
 PTRACE87 PAT
 PATCH320 DOC
 OS2PATCH EXE
 OS2PATCH DOC

 (10 Files)

 3-1/2" Disk Layout

 The four 3-1/2" disks combine the 5-1/4" disks as follows:

 Disk 1:  Setup, Compiler, and Utilities
 Disk 2:  Examples and Library
 Disk 3:  Microsoft CodeView(R) for MS-DOS and OS/2
 Disk 4:  Microsoft Editor and Startup Source Code


 116. Pascal 4.00 README.DOC: Introduction to README.DOC

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33235

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 README.DOC (C) Copyright Microsoft(R) Corporation, 1987, 1988

 This file contains information about Version 4.0 of the Microsoft
 Pascal compiler, libraries, and utilities. Microsoft updates its
 documentation when it is reprinted, so you may find that some of the
 information in this on-line file has already been included in your
 manuals.

 NOTE

 Current information about low-level implementation details can be
 found in the Microsoft Mixed-Language Programming Guide and the
 Microsoft CodeView(R) and Utilities manual. These manuals take
 precedence over sections in older manuals.


 117. Pascal 4.00 README.DOC: Reporting Compiler

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33236

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 README.DOC (C) Copyright Microsoft(R) Corporation, 1987, 1988

 Reporting Compiler Problems

 When reporting problems with the compiler, please first reduce the
 program causing the problem to the smallest program that causes the
 error. Also, please provide Microsoft Corporation with the following
 information to help in tracking down the problem:

 The compiler version number (from the logo that appears on the
 screen when you invoke the compiler using the PL command).

 The version of DOS you are running (use the DOS VER command).

 Your system configuration (which machine, total memory, total free
 memory at compiler execution time).

 The command line used in the compilation.

 All object files/libraries used to link, if necessary. You need not
 provide standard object files/libraries, but please state which ones
 you are using.

 Providing this information will help us solve your problem quickly.


 118. The Correct Syntax for Forward Referencing a Function

 Product Version(s): 3.3x 4.00 | 4.00
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33397

 Question:
    What is the correct syntax for forward referencing a function in
 Pascal? Forward referencing is necessary if you are doing a recursive
 routine of the following form:

 subrt A
     call B        (* Notice B is undefined at this point *)

 subrt B
     call A

 BEGIN (* Main program *)
     call A
 END.

 Response:
    Below is a sample program that contains the structure described
 above. Pascal must know about all items before it uses them, which is
 why it is necessary to use the "forward" keyword.
    The following is a sample program:

 program rec (input, output) ;

 var
     a: integer ;

 (* Forward Reference *)
 function RecurB ( a:integer ):integer ; forward ;

 (*--------------------------------------------------------*)

 function RecurA ( a:integer ):integer ;

 begin
     if a = 1 then
         return
     else
         RecurA := RecurB ( a ) ;
 end ;

 (*--------------------------------------------------------*)

 (* Note Commented parameter list will avoid a warning     **
 ** about the forward declaration already being made       *)

 function RecurB (* ( a:integer ):integer *) ;

 begin
     RecurB := RecurA ( a-1 )  ;
 end ;

 (*--------------------------------------------------------*)

 BEGIN (* Main program *)
     a := RecurA ( 5 ) ;
     write (' a = ',a ) ;
 END.


 119. Pascal 4.00 README.DOC: General Notes

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33238

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 README.DOC (C) Copyright Microsoft(R) Corporation, 1987, 1988

 General Notes

 SETUP

 Using the SETUP program is optional. You may want to copy the compiler
 files to your disk and use the MAKELIB program on the Pascal Library 1
 Disk (rather than SETUP) to create the required libraries.

 If you set up for dual-mode operation, remember that you must use
 either the /Lr (real mode) or /Lp (protected mode) switch on the PL
 command line.

 You can use the SETUP program to create additional libraries by
 using the /L option. When you run SETUP with the /L option, SETUP
 only takes you through the questions required to create a library.


 120. Pascal 4.00 README.DOC: OS/2 Systems Support

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33239

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 README.DOC (C) Copyright Microsoft(R) Corporation, 1987, 1988

 OS/2 Systems Support

 PASCAL 4.0 now supports OS/2. The compiler runs under both OS/2 and
 DOS, and applications may be linked to run under either OS/2 or DOS.
 You may bind an OS/2 program so it runs under either protected-mode
 OS/2 or real-mode OS/2 and DOS. Chapter 2 of the update tells you how
 to set up for both operating systems. Creating both protected-mode
 and bound programs is described in Chapter 3, "OS/2 Systems Support,"
 of the update.


 121. Pascal 4.00 README.DOC: Floating-Point Operations

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33269

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Floating-Point Operations under MS-DOS 3.2
    This information is important only if your system has ALL of the
 following characteristics:

    1. You use Microsoft DOS (MS-DOS) version 3.20.
    2. You boot from a hard disk drive.
    3. Your system has a math coprocessor (for instance, an 8087 chip).
    4. You run programs that use floating-point math.

    For systems that satisfy all of the preceding conditions, you may
 be able to eliminate floating-point math problems by installing a
 small patch in DOS. If you are not sure whether you need the patch,
 perform the following steps:

    1. Copy the program PATCH87.EXE (included on the distribution disks)
       to the root directory of your hard disk drive.
    2. Reboot your system from the hard disk and DO NOT PERFORM ANY FLOPPY-
       DISK OPERATIONS after rebooting. It is very important that you avoid
       floppy-disk I/O after rebooting, since that will affect the
       reliability of the diagnostic test that you are about to perform.
    3. If necessary, use the CD command to move to the root directory
       of your hard disk drive.
    4. Run the PATCH87.EXE program by entering this command at the DOS
       prompt:

       PATCH87

    5. The program performs a diagnostic test on your system to determine
       whether it needs the DOS patch, and, if the patch is needed,
       whether it can be performed successfully. If the program tells you
       that you need to install the DOS patch, and that it can be done,
       follow the procedure described in the next section.

    NOTE: The floating-point problem has been eliminated in versions
 of MS-DOS higher than 3.20. This includes MS-DOS versions 3.21 and
 3.30.
    If you performed the preceding test and determined that you should
 install the DOS patch on your system, perform the following steps:

    1. Format a blank floppy disk. (Do NOT use the /s formatting option to
       transfer system files to the disk.)
    2. Use the SYS command to copy IO.SYS and MSDOS.SYS from the root
       directory of your hard disk to the new floppy disk. For instance,
       if you boot from drive C:, you would enter the following commands:

       C:
       SYS A:

    3. Use the COPY command to copy COMMAND.COM and SYS.COM to the same
       floppy disk.
    4. Use the COPY command to copy the program PATCH87.EXE (included in this
       release) to the same floppy disk.
    5. Change the current drive and directory to the floppy disk, by entering
       the following command:

       A:

    7. Install the DOS patch by entering the following command:

       PATCH87 /F

     WARNING: If you experience any disk errors during steps 2 through
 7, do NOT proceed with step 8. Reboot from your hard disk and repeat
 the entire process.
    8. If you have not experienced any errors, use the SYS command to
       transfer the files IO.SYS and MSDOS.SYS from the floppy disk back
       to your hard disk. For instance, if the boot directory of your system
       is the root directory of drive C:, you would enter the following
       command at the DOS prompt:

       A:
       SYS C:
    9. The DOS patch has been installed. Reboot the system.



 122. Pascal 4.00 README.DOC: Setting Error Level

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33276

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 README.DOC (C) Copyright Microsoft(R) Corporation, 1987, 1988
 Setting Error Level
    The PL driver includes a switch, /w, that sets the error- return
 threshold at which PL stops execution. For example, the following
 command line compiles AVERAGES.PAS with an error return threshold of 1
 (the colon (:) is optional):

    PL /w:1 AVERAGES.PAS

    Compiler warning errors are in the range 1-3.  Compiler hard errors
 are greater than 3.  If the compiler returns an error GREATER than the
 threshold you specify, PL terminates.  The default level is 3.  That
 is, PL terminates only for hard errors, not warnings. The previous
 example causes PL to terminate if there is a warning message.



 123. Pascal 4.00 README.DOC: INCLUDE

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33277

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 INCLUDE
    By default, PL looks for include files in the directory specified
 by the INCLUDE environment variable. You must set this variable: SETUP
 does not create a default setting in the NEW-VARS.BAT file.



 124. Pascal 4.00 README.DOC: Stack Size

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33278

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Stack Size
    Pascal programs compiled for use under OS/2 have 256 fewer bytes
 allocated to the stack.  The 256 bytes are reserved to provide for
 OS/2's additional stack use.



 125. Pascal 4.00 README.DOC: LMULOK

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33279

   The following information was taken from the Pascal Version 4.00
 README.DOC file.

 LMULOK
    Results calculated when an overflow occurs (LMULOK returns FALSE)
 may be inaccurate because the calculation halts when the overflow is
 detected.



 126. Pascal 4.00 README.DOC: $rom Metacommand

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33280

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 $rom Metacommand
    The $rom metacommand generates an error when used with a VALUE
 section.



 127. Pascal 4.00 README.DOC: Making OS/2 Function Calls

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 30-SEP-1988    ArticleIdent: Q33281

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Making OS/2 Function Calls

 Pascal Version 4.0 includes header files containing function,
 procedure, and data declarations for OS/2 function calls. The
 demonstration program SORTDEMO.PAS shows a use of the header files and
 contains numerous examples of OS/2 function calls. The main header
 file is OS2.INT, which in turn uses several other header files. See
 the PACKING.LST file for the location of the header files and of the
 SORTDEMO.PAS program.

 Your program only needs to include the OS2.INT file: OS2.INT
 automatically includes the other files.

 By defining specific constants you can include some or all of the
 various declarations. These constants are described at the beginning
 of each header file. For example, the following fragment would include
 only the KBD and VIO definitions:

 CONST
         INCL_KBD = 1;
         INCL_VIO = 1;
         INCL_NOCOM = 1;  (* Do not include default
 declarations. *)

 (* $include:'os2.int' *)

 The names in the header files match the names used in the OS/2
 manuals. See the MS OS/2 1.0 Programmer's Reference for detailed
 information about each function.

 Because the Pascal run-time routines are not reentrant, OS/2 functions
 involving multiple threads or requiring reentrancy cannot be safely
 called from Pascal without extensive additional programming. (You may
 write your own reentrant libraries, or you may use semaphores to
 control library access--these are both advanced techniques which
 Microsoft does not support.) Definitions for these functions are
 included for completeness and for the advanced programmer. The OS/2
 functions that use multiple threads or require reentrancy include the
 following:

 DOSCREATETHREAD
 DOSRESUMETHREAD
 DOSSUSPENDTHREAD
 DOSSETSIGHANDLER
 DOSSETVEC
 DOSMONOPEN
 DOSMONCLOSE
 DOSMONREAD
 DOSMONWRITE
 DOSMONREG


 128. Pascal 4.00 README.DOC: New Error Message

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33282

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 New Error Message 380 - Stack or var with SS <> DS
    An attempt is being made to address a stack variable with adr or ^
 when $windows+ or $stackseg+ is set. These metacommands make SS not
 equal to DS so short addresses (adr or ^) cannot completely reference
 stack variable parameters.



 129. Pascal 4.00 README.DOC: CodeView Using the 7 Command

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33283

   The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Using the 7 Command in Protected Mode
    If you are using OS/2 protected mode and have a math coprocessor,
 then you need to use a patch before you can use the CVP 7 command. To
 apply the patch, use the OS2PATCH.EXE and PTRACE87.PAT files that come
 on the same disk that CVP.EXE is on. You also need to locate the
 PATCH.EXE file that comes with OS/2 and make sure that this file is in
 a directory listed in your PATH environment variable. Then follow
 these steps:

    1. Change the current drive and directory to the root directory of
       the boot disk. (If the boot disk is a floppy, make sure it is
       inserted in the drive you used to boot from.)

    2. Give the following command line at the DOS prompt:

    OS2PATCH /A PTRACE87.PAT

    Note that you may need to give the complete path names for the
 OS2PATCH.EXE and for the PTRACE87.PAT file. You do not need to give a
 path name for the OS2PATCH.EXE file if you have placed this file in a
 directory listed in your PATH environment variable.



 130. Pascal 4.00 README.DOC: Note for Window Developers

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | appnote SP0284
 Last Modified: 14-DEC-1990    ArticleIdent: Q33284

 The following information was taken from the Microsoft Pascal version
 4.00 README.DOC file. To obtain the updated versions of WIN87EM.EXE
 and WIN87EM.LIB mentioned below, contact Microsoft Product Support
 Services and ask for the application note (number SP0284) "Updated
 WIN87EM.* for Pascal Version 4.00". Please specify which disk size you
 would like, 5.25-inch or 3.5-inch.

 Excerpt from Pascal 4.00 README.DOC
 -----------------------------------

 Note for Windows Developers

 The STACK segment is no longer defined in object files produced by the
 Pascal compiler. It has also been removed from all of the run-time
 modules except ENTX6L.

 This was done to facilitate user declaration of stack size for
 Windows.

 The STACK segment is defined in the module ENTX6L for MS-DOS and
 5ENTX6L for OS/2.

 SETUP builds a library containing (5)ENTX6L (non-Windows) or (5)ENTX6W
 (Windows).

 Applications linking with the Pascal library containing (5)ENTX6W in
 place of (5)ENTX6L must specify stack size with the /STACK: link
 switch or in a .DEF file. (If this is not done, the application will
 get a zero size stack).

 If your Windows programs use the emulator library (LIBPASE.LIB), you
 need to make a modified version of PASLIBW.LIB using updated versions
 of WIN87EM.EXE and WIN87EM.LIB. Call Microsoft Product Support to get
 the updated files. To create the modified library, use the LIB utility
 by typing the following command:

    lib paslibw-noemstar+win87em.lib,,paslibwe.lib

 This command creates a library, PASLIBWE.LIB, to use instead of
 PASLIBW.LIB for applications linking with the emulator library,
 LIBPASE.LIB.


 131. Pascal 4.00 README.DOC: Corrections to the Update

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 26-SEP-1988    ArticleIdent: Q33285

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Corrections to the Update

 p. 8 In Section 1.5.2, \PWORK should be \WORK.

 p. 9 If you use SETUP to install Pascal in a subdirectory, SETUP
 places the files mentioned in Section 1.5.3, "Environment Variable and
 Configuration Files," in the WORK directory under the specified
 subdirectory.

 p. 16 The line reading

 @PROG=PL /Lr AVERAGES.PAS

 should read

 PL /Lr AVERAGES.PAS

 p. 53 The correct name of the LVARSTK.OBJ file mentioned in  6.4.3 is
 LVARSTCK.OBJ.

 p. 63 The use of "module" in Section 7.3, "Program Module,"is
 misleading. Windows development using multiple Pascal source files
 requires the use of units, not modules. Pascal units generate the
 implementation and interface code required under Windows; modules do
 not. See pp. 300-311, "Units," in the Pascal Language Reference Manual
 for information about Pascal units.


 132. Pascal 4.00 README.DOC: Notes on CodeView and Utilities

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33286

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Notes on CodeView and Utilities

 The Mouse Driver

 If you will be using the Microsoft Mouse with the Microsoft CodeView
 debugger you must have Version 6.0 or later of the Microsoft Mouse. If
 you do not, use the version of the MOUSE.COM driver provided in this
 package. Copy MOUSE.COM to the appropriate mouse directory. When you
 are ready to use the mouse, type

 mouse

 at the DOS command level. If you want to install the mouse driver
 automatically every time you reboot, insert the "mouse" command in
 your AUTOEXEC.BAT file.

 Note that in earlier releases of Microsoft C, both the MOUSE.SYS and
 the MOUSE.COM driver were provided. If you have been using an earlier
 version of the MOUSE.SYS driver, delete the following line from your
 CONFIG.SYS file:

 device=\<directory>\mouse.sys

 where <directory> is the directory where the earlier mouse driver
 resides.


 133. Pascal 4.00 README.DOC: CodeView New Command-Line Option

 Product Version(s):
 Operating System:   4.00   | 4.00
 Flags: MS-DOS | OS/2
 Last Modified: 26-SEP-1988    ArticleIdent: Q33287
 ENDUSER |

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Microsoft CodeView Debugger New Command-Line Option

 If you have an IBM Personal System/2, then you can use the /50
 command-line option to start the CodeView debugger in 50- line mode.

 Note that you must be in 25-line mode to effectively use either the
 /43 or /50 command-line option.


 134. Pascal 4.00 README.DOC: CodeView CONFIG.SYS

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33288

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 CONFIG.SYS Setting for CVP
    To run the protected-mode CodeView debugger (CVP.EXE), you must
 have the following line in your CONFIG.SYS or CONFIG.OS2 file:

    IOPL=YES



 135. Pascal 4.00 README.DOC: Using Real-Mode Debugger

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33289

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Using the Real-Mode Debugger in the Compatibility Box
    When running the real-mode CodeView debugger in the DOS 3.x
 compatibility box, start the debugger with the /S command- line
 option. Otherwise, the mouse pointer will not appear.


 136. Pascal 4.00 README.DOC: Using Real-Mode with BIND

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 22-AUG-1988    ArticleIdent: Q33433

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Using the CodeView Debugger with BIND
    The real-mode CodeView debugger cannot debug bound (dual- mode)
 applications. However, the protected-mode CodeView debugger, CVP, can
 debug bound applications.


 137. Pascal 4.00 README.DOC: Stack Trace Command

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 22-AUG-1988    ArticleIdent: Q33434

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Stack Trace Command
    In order for the Stack Trace command (or the Calls menu) to work
 reliably, you need to execute to at least the beginning of the main
 function or procedure, and the current module should have full
 CodeView information (a module has full CodeView information if
 compiled or assembled with /Zi).



 138. Pascal 4.00 README.DOC: Error Messages in Pascal

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 22-AUG-1988    ArticleIdent: Q33435

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Error Messages
    The error message "? cannot display" indicates that the Display
 Expression command (?) has been passed a valid symbol that it cannot
 display. In previous versions of the debugger, structures and records
 could not be displayed. With current version of the debugger, only
 enumerated types cannot be displayed.
    The error message "Expression not a memory address" occurs when the
 Tracepoint command is given without a symbol that evaluates to a
 single memory address. For example, the commands "TP?1" and "TP?a+b"
 each produce this error message. The proper way to put a tracepoint
 on the word at address 1 is with the command "TPW 1".
    The error message "Function call before 'main'" occurs when you
 attempt to evaluate a program-defined function before you have entered
 the main function. Execute to at least to the beginning of the main
 function before attempting to evaluate program-defined functions.
    The error message "Bad emulator info" occurs when CodeView cannot
 read data from the floating-point emulator.
    The error message "Floating point not loaded" has a special meaning
 for CVP (in addition to the explanation given in the CodeView and
 Utilities manual). Each thread has its own floating-point emulator.
 This message is issued when the current thread has not initialized its
 own emulator.


 139. Pascal 4.00 README.DOC: Pascal Programs: PAS1 /Zz TEST;

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 19-AUG-1988    ArticleIdent: Q33436

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Microsoft Pascal Programs
    The Pascal example on pg. 61 of the Microsoft CodeView and
 Utilities manual should read

         PAS1 /Zz TEST;

 rather than

         PAS1 /Zi TEST;



 140. Pascal 4.00 README.DOC: Exit Codes for Utilities: LINK

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 22-AUG-1988    ArticleIdent: Q33437

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Exit Codes for Utilities
    The exit codes for LINK and the utilities in the Microsoft CodeView
 and Utilities manual should appear as follows:

 LINK    Code    Meaning

         0       No error.

         2       Program error--something was wrong with the commands
                 or files input to the linker.

         4       System error. The linker ran out of space on output
                 files was unable to reopen the temporary file
                 experienced an internal error was interrupted by the user.



 141. Pascal 4.00 README.DOC: LIB, EXEPACK, EXEMOD, MAKE, SETENV

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 22-AUG-1988    ArticleIdent: Q33438

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 LIB, EXEPACK, EXEMOD, MAKE, and SETENV

         Code    Meaning

         0       No error.

         2       Program error--something was wrong with the
                 commands or files input to the utility.

         4       System error.The utility ran out of memory, was
                 interrupted by the user, or experienced an
                 internal error.



 142. Pascal 4.00 README.DOC: New LINK Error Messages

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 22-AUG-1988    ArticleIdent: Q33440

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 New LINK Error Messages
 L1003   /QUICKLIB, /EXEPACK incompatible
    You cannot link with both the /QU option and the /E option.

 L1006   <option-text>: stack size exceeds 65535 bytes
    The value given as a parameter to the /STACKSIZE option
 exceeds the maximum allowed.

 L1063   out of memory for CodeView information
    The linker was given too many object files with debug information,
 and the linker ran out of space to store it.  Reduce the number of
 object files that have debug information.

 L1115   /QUICKLIB, overlays incompatible
    You specified overlays and used the /QUICKLIB option. These cannot
 be used together.

 L2013   LIDATA record too large
    An LIDATA record contained more than 512 bytes.  This is probably a
 compiler error.

 L2024   <name>: special symbol already defined
    Your program defined a symbol name that is already used by the
 linker for one of its own low-level symbols.  (For example, the linker
 generates special symbols used in overlay support and other
 operations.) Choose another name for the symbol in order to avoid
 conflict.

 L2025   <segmentname>: segment with > 1 class name not
 allowed with /INC
    Your program defined a segment more than once, giving the segment
 different class names.  Different class names for the same segment are
 not allowed when you link with the /INCREMENTAL option. Normally, this
 error should never appear unless you are programming with MASM. For
 example, if you give the two MASM statements

 _BSS segment 'BSS'

 and

 _BSS segment 'DATA'

 then the statements have the effect of declaring two distinct
 segments. ILINK does not support this situation, so it is disallowed
 when the /INCREMENTAL option is used.

 L2041   stack plus data exceed 64K
    The total of near data and requested stack size exceeds 64K, and
 the program will not run correctly.  Reduce the stack size. The linker
 only checks for this condition if /DOSSEG is enabled, which is done
 automatically in the library startup module.

 L2043   Quick Library support module missing
    When creating a Quick library, you did not link with the required
 QUICKLIB.OBJ module.

 L2044   <name> : symbol multiply defined, use /NOE
    The linker found what it interprets as a public-symbol
 redefinition, probably because you have redefined a symbol that is
 defined in a library.  Relink with the /NOEXTDICTIONARY (/NOE) option.
 If error L2025 results for the same symbol, then you have a genuine
 symbol-redefinition error.

 L4003   intersegment self-relative fixup at <offset> in
 segment <name>
         pos: <offset> Record type: 9C target external '<name>'
    The linker found an intersegment self-relative fixup. This error
 may be caused by compiling a small-model program with the /NT option.

 L4034   more than 239 overlay segments; extra put in root
    Your program designated more than the limit of 239 segments to go
 in overlays.  Starting with the 234th segment, they are assigned to
 the root (that is, the permanently resident portion of the program).



 143. Pascal 4.00 README.DOC: LIB New Option

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33441

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Microsoft Library Manager (LIB)
 New Option
    There is a new option for LIB:  /NOIGNORECASE (abbreviated as
 /NOI). This option tells LIB to not ignore case when comparing
 symbols. names. By default, LIB ignores case. Multiple symbols that
 are the same except for case can be put in the same library. An
 example of this is: "_Open" and "_open". Normally you could notadd
 both these symbols to the same library.
    Note that if a library is built with /NOI, the library is
 internally "marked" to indicate /NOI. All libraries built with
 earlier versions of LIB are not marked.
    If you combine multiple libraries, and any one of them is marked
 /NOI, then /NOI is assumed for the output library.
    In addition, LIB also supports the option /IGNORECASE (/I), which is
 completely analogous to /NOIGNORECASE. /I is the default. The only
 reason to use it would be if you have an existing library marked /NOI
 that you wanted to combine with other libraries which were not marked,
 and have the output library be not marked. If you don't use
 /IGNORECASE, the output is marked /NOI (see above).


 144. Pascal 4.00 README.DOC: Changed LIB Error Message

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33442

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Changed LIB Error Messages
    Warning messages U4152, U4155, and U4157-U4159 for LIB are now
 nonfatal error messages U2152, U2155, and U2157-U2159, respectively.
    Warning message U4151 has been changed to read as follows:

    U4151   '<name>' : symbol defined in module <name>,
 redefinition ignored



 145. Pascal 4.00 README.DOC: MAKE Minus Sign in Description Files

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33443

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Microsoft Program Maintenance Utility (MAKE)
 Minus Sign in Description File
     The documentation is in error when it says that a minus sign at
 the beginning of a description block causes errors to be ignored
 (CodeView and Utilities manual, p. 311).  The minus sign cannot be
 used.



 146. Pascal 4.00 README.DOC: MAKE New Error Message

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33444

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Inference Rules
    You cannot have inference rules in both the TOOLS.INI and the
 description file that use both the same inextension and outextension.
 For example, you cannot place the following inference rule in the
 TOOLS.INI file:

         .c.obj:
                 cl /c /Zi /Od $*.c

 while also placing the following line in the description
 file:

         .c.obj:
                 cl /Ot $*.c

    However, you may define the same macro in both the TOOLS.INI and
 the description file.  In such cases, the definition in the TOOLS.INI
 file takes precedence.  You may avoid this problem by copying the
 TOOLS.INI to the same directory as your make file and modifying the
 make section.


 147. Pascal 4.00 README.DOC: MAKE Backslash

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33445

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Backslash (\) as Continuation Character
    Note that MAKE considers a backslash immediately followed by a
 new-linecharacter to be a continuation character.  When it finds this
 combinationin a description file, MAKE concatenates the line
 immediately followingthe combination with the line where the
 combination appears.If you define a macro that ends in a backslash,
 make sure that you put aspace after the terminating backslash.For
 example, if you want to definemacros for the path C:\SRC\BIN and
 C:\SRC\LIB, you must use the formatillustrated
 below:BINPATH=C:\SRC\BIN\


 148. Pascal 4.00 README.DOC: STDERR Redirection Utility

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-AUG-1988    ArticleIdent: Q33446

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Microsoft STDERR Redirection Utility (ERROUT)
    The ERROUT utility does not accept batch files. To redirect
 standard-error output from a batch file, you must enter a command of
 the following form:

         ERROUT COMMAND /c <batchcommand>

    If no /f option is given, then ERROUT redirects standard- error
 output to the standard-output device.


 149. Pascal 4.00 README.DOC: C Naming Conventions

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33494

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Mixed-Language Programming C Naming Conventions
    C recognizes the first 31 characters of a symbolic name.



 150. Pascal 4.00 README.DOC: Pascal Function Fact

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33495

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Pascal Function Fact
    The following line in the Pascal function Fact on pages 30, 44, and
 57 in the Mixed-Language Programming Guide is incorrect:

    Fact := Fact * n;

    The line should read as follows:

    Fact := result(Fact) * n;



 151. Pascal 4.00 README.DOC: Mixed-Language Accessing Parameter

 Product Version(s): 4.00   | 4.00
 Operating System:   MMS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33496

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Enhanced Error Handling Accessing Parameters on the Stack
    In Section 6.1.5 of the Microsoft Mixed Languages Programming
 Guide, the instruction

    mov     bx, [bp+6]

 loads the argument into the BX register rather than the BP
 register.



 152. Pascal 4.00 PATCH87.DOC: Patching MS-DOS Version 3.20

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33554

    The following information was taken from the Pascal Version 4.00
 PATCH87.DOC file.

 PATCH87.DOC File
 Notes on patching MS-DOS(R) Version 3.20 (C) Copyright Microsoft
 Corporation, 1988
    Version 3.20 of MS-DOS(R) contains a bug that can cause unexpected
 results in programs that use floating-point math. This file explains
 how to eliminate that problem by using PATCH87.EXE, a program included
 in this release.
    Note that IBM(R) PC-DOS 3.20 contains another, different
 floating-point bug. The README.DOC file for this release tells you
 where to find more information about installing a patch for that bug.
 If you use any version of DOS 3.20 other than IBM PC-DOS 3.20 or
 MS-DOS 3.20, contact your hardware manufacturer to determine whether
 the problem exists in your version.

 Do I Need to Use This Program?
    You do not need to read any further unless your system has ALL of
 the following characteristics:

    1. You use MS-DOS version 3.20.
    2. You boot from a hard-disk drive.
    3. Your system has a math coprocessor (for instance,
       an 8087 chip).
    4. You run programs that use floating-point math.

    For systems that satisfy all of the preceding conditions, you may
 be able to eliminate floating-point math problems by installing a
 small patch in DOS. If you are not sure whether you need the patch,
 perform the following steps:

    1. Copy the program PATCH87.EXE (included in this release) to the
       root directory of your hard-disk drive.
    2. Reboot your system from the hard disk and DO NOT PERFORM ANY
       FLOPPY-DISK OPERATIONS after rebooting. It is very important
       that you avoid floppy-disk I/O after rebooting, since that will
       affect the reliability of the diagnostic test that you are about
       to perform.
    3. If necessary, use the CD command to move to the root directory
       of your hard-disk drive.
    4. Run the PATCH87.EXE program by entering this command at the DOS
       prompt:

       PATCH87

          The program performs a diagnostic test on your system to
       determine whether it needs the DOS patch, and, if the patch is
       needed, whether it can be performed successfully.

    5. Follow the procedure described in the next section if the
       program tells you that you need to install the DOS patch, and that
       it can be done.

       NOTE: The floating-point problem has been eliminated in versions
       of MS-DOS higher than 3.20. This includes MS-DOS versions 3.21 and
       3.30.

 If You Need to Install the Patch
    If you performed the preceding test and determined that you should
 install the DOS patch on your system, perform the following steps:

    1. Format a blank floppy disk. (Do NOT use the /s formatting
       option to transfer system files to the disk.)
    2. Use the SYS command to copy IO.SYS and MSDOS.SYS from the root
       directory of your hard disk to the new floppy disk. For instance,
       if you boot from drive C:, you would enter the following commands:

       C:
       SYS A:

    3. Use the COPY command to copy COMMAND.COM and SYS.COM to the same
       floppy disk.
    4. Use the COPY command to copy the program PATCH87.EXE (included
       in this release) to the same floppy disk.
    5. Change the current drive and directory to the floppy disk, by
       entering the following command:

       A:

    7. Install the DOS patch by entering the following
       command:

       PATCH87 /F

          WARNING: If you experience any disk errors during steps 2
       through 7, do NOT proceed with step 8. Reboot from your hard
       disk and repeat the entire process.

    8. If you have not experienced any errors, use the SYS command to
       transfer the files IO.SYS and MSDOS.SYS from the floppy disk back
       to your hard disk. For instance, if the boot directory of your
       system is the root directory of drive C:, you would enter the
       following command at the DOS prompt:

       A:
       SYS C:

       This installs the DOS patch.
    9. Reboot the system.


 153. Pascal 4.00 README.DOC: Mixed-Language BASIC

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33498

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 BASIC Return Values
    BASIC functions use the FORTRAN/Pascal conventions, rather than the
 C conventions, for receiving return values.



 154. Pascal 4.00 README.DOC: Passing C Strings to BASIC

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33499

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Passing C Strings to BASIC
    In Section 8.4.3 of the Microsoft Mixed Languages Programming
 Guide, in the example illustrating how C passes string arguments to
 BASIC functions, the sd_len field should be declared as shown below:

    int sd_len



 155. Pascal 4.00 README.DOC: Mixed-Language BASIC Array

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33500

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 BASIC Array Declarations
    The sample BASIC array declaration in Table 9.1 of the Microsoft
 Mixed Language Guide should read

    DIM x(c-1, r-1)



 156. Pascal 4.00 README.DOC: Linking Mixed-Language Programs

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33501

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Linking Mixed-Language Programs

 This section explains how to link Microsoft C modules with modules
 created by other Microsoft languages. The discussions assume that you
 are linking with the Microsoft Segmented-Executable Linker, LINK.
 (This is the version of LINK provided with Version 5.10 of the
 Microsoft C Optimizing Compiler and this version of Pascal.)

 To link object modules created using the Microsoft C Optimizing
 Compiler, Version 5.10, with those created using the Microsoft FORTRAN
 Optimizing Compiler Version 4.00 or 4.01, you must create a special
 version of each of the FORTRAN libraries you intend to use. Create one
 FORTRAN library to correspond to each C library you are using; that
 is, create a FORTRAN library that supports the same
 memory-model/math-option combination as the corresponding C library.
 Be sure that you choose the "C compatibility" option when you build
 each FORTRAN library.

 Next, use the SETUP program provided with Microsoft C, Version 5.10,
 to create all the combined C 5.10 libraries that you will need. SETUP
 creates a subdirectory named \MIXLANG under the C 5.10 base directory.

 Place the FORTRAN libraries you have created in this directory. Then
 make the \MIXLANG directory the current directory and run F4COMPAT,
 which brings the FORTRAN libraries up to date and makes them
 compatible with C 5.10. F4COMPAT takes two arguments: one specifying
 the memory model and one specifying the floating-point-math package
 that the library supports. For example,

 F4COMPAT L 7

 makes a C 5.10-compatible version of LLIBFOR7.LIB. Once the libraries
 are built, use the following LINK command line to link the appropriate
 C library with the FORTRAN library that you converted in the previous
 example:

 LINK /NOE objs,,,LLIBC7.LIB LLIBFOR7.LIB;

 The LINK command lines for other memory models and floating-point math
 packages are similar. Note that the C library must be given first on
 the command line. Specify the \MIXLANG subdirectory either in the LIB
 environment variable or on the LINK command line so that the linker
 can find the FORTRAN library. Use only large- and medium-model
 libraries. Huge-model programs use large-model libraries.

 To link other combinations of language libraries, the BASIC libraries
 (either BCOM40 or BRUN40) should be listed first on the LINK command
 line, since the main program must be written in BASIC. Other wise, the
 C 5.1 library should be listed first. (Or, if you are using C 4.0 with
 FORTRAN 4.0 or later, the FORTRAN library should be listed first.) For
 best results, using large-memory-model C is suggested.


 157. Pascal 4.00 README.DOC: BIND Utility Specifying Libraries

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33502

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 The BIND Utility

 Specifying Libraries

 You need to include DOSCALLS.LIB on the BIND command line. If
 DOSCALLS.LIB is not in the current directory, you must give the
 complete path name to DOSCALLS.LIB.

 BIND automatically searches for API.LIB by looking in directories
 listed in the LIB environment variable. However, if API.LIB is
 specified on the command line, then BIND does not check the LIB
 environment variable; instead, you need to give the complete path
 name.

 For example, the following command line successfully uses BIND, if
 API.LIB is located in a directory listed in the LIB environment
 variable:

 BIND MYPROG.EXE \LIB\DOSCALLS.LIB


 158. Pascal 4.00 README.DOC: Using BIND with Packed Files

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33503

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Using BIND with Packed Files
    The version of BIND released with this package does not work with
 files that have been linked with the /EXEPACK linker option.



 159. Pascal 4.00 README.DOC: Running Bound Files with DOS 2.1

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33504

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Running Bound Files with DOS 2.1

 A dual-mode executable file produced with BIND can be run in both DOS
 3.x and DOS 2.x environments. However, if you change the name of an
 executable file produced by BIND, then it will not run under DOS 2.1.


 160. Pascal 4.00 README.DOC: Mix-Language Linking with MASM Files

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33505

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Linking with MASM Files
    If you are linking C modules with modules created by the Microsoft
 Macro Assembler, either assemble the MASM modules with the /MX option
 to preserve case sensitivity in these modules; or, use the LINK
 command to link in a separate step, and do NOT specify the /NOI linker
 option.


 161. Pascal 4.00 README.DOC: Editor and Linking

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33534

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Linking Extensions in Protected Mode
    To link C extension modules in protected mode, link with the object
 file EXTHDRP.OBJ, instead of the real-mode header EXTHDR.OBJ.


 162. Pascal 4.00 README.DOC: Incremental Linker Fatal

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33535

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 The Microsoft Incremental Linker (ILINK)
    ILINK Fatal Error Messages

    .sym seek error
    .sym read error

    The .SYM file is corrupted. Do a full link. If the error
 persists, contact Microsoft.

    .sym write error

    The disk is full or the .SYM file already exists with the READONLY
 attribute.

    map for segment <name> exceeds 64K

    The symbolic information associated with the given segment exceeds
 64K bytes, which is more than ILINK can handle.

    can't ilink library <name>

    You tried to incrementally link an altered library. ILINK does not
 link .LIB files but only .OBJ files. Use a full link instead.

    .obj close error

    The operating system returned an error when ILINK attempted to
 close one of the .OBJ files. Do a full link. If the error persists,
 contact Microsoft.

    too many LNAMES in <modname>

    An object module has more than 255 LNAME records.

    too many SEGDEFs in <modname>

    The given object module has more than 100 SEGDEF records.

    too many GRPDEFs in <modname>

    The given object module has more than 10 GRPDEF records.

    symbol <name> multiply defined

    The given symbol is defined more than once.

    #3

    Please report this error to Microsoft.

    Out of Memory

    ILINK ran out of memory for processing the input. If you are
 running ILINK under MAKE, try running it from the shell. Otherwise, do
 a full link.

    could not run exec

    ILINK was unable to find the file EXEC.EXE, which should be placed
 somewhere in the search path or in the current directory.

    .exe file too big, change alignment

    The segment sector alignment value in the .EXE file is too small to
 express the size of one of the segments.  Do a full link and increase
 the alignment value with the /ALIGNMENT option to LINK.

    .ilk seek error

    The .ILK file is corrupted. Do a full link. If the error
 persists, contact Microsoft.

    Too many defined segments

    ILINK has a limit of 255 defined segments, which are segments
 defined in an object module as opposed to an executable segment.
 Reduce the number of segments if you want to use ILINK.

    too many library files

    ILINK has a limit of 32 runtime libraries (.LIB files). Reduce the
 number of libraries.

    too many modules

    ILINK has a limit of 1204 modules in a program. Reduce the number
 of modules.

    .ilk write error

    The disk is full, or else ILINK cannot write to the .SYM file
 because a .SYM file currently exists and has the READONLY attribute.

    file <name> does not exist

    ILINK was unable to open the given file. The file named was in the
 file list in the .ILK file.

    seek error on library

    A .LIB file was corrupted. Do a full link and check your .LIB
 files.

    library close error

    The operating system returned an error when ILINK attempted to
 close one of the .LIB files. Do a full link. If the error persists,
 contact Microsoft.

    error closing EXE file

    The operating system returned an error when ILINK attempted to
 close the .EXE file. Do a full link. If the error persists, contact
 Microsoft.

    Invalid module reference <module>

    The program makes a dynamic link reference to a dynamic link
 module which is not represented in the .EXE file.

    could not update time on <filename>

    The operating system returned an error when ILINK attempted to
 update the time on the given file.  Possibly the file had the READONLY
 attribute set.

    invalid flag <flag> only one -e command allowed

    The ILINK command syntax is incorrect.

    User Abort

    The user issued CTRL+C or CTRL+BREAK.

    file <name> write protected

    The .EXE, .ILK, or .SYM file needed to be updated and has the
 READONLY attribute. Change attribute to READWRITE.

    file <name> missing

    One of the .OBJ files specified on the command line is missing.

    file <name> invalid .OBJ format
    file <name> has invalid <recordtype> record

    The given .OBJ file has an invalid format or one that is not
 recognized by ILINK.  This may have been caused by a compiler or
 assembler.

    file <module> was not full linked

    An .OBJ file was specified as input to ILINK, which was not in the
 list of files in the original full link.

    LOBYTE seg-relative fixups not supported

    This error message should occur only with MASM files. See the
 Microsoft Macro Assembler 5.0 Programmer's Guide. This type of object
 module is not supported by ILINK.

    <number> undefined symbols

    The given number of symbols were referred to in fixups but never
 publicly defined in the program.



 163. Pascal 4.00 README.DOC: Incremental Linker

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33536

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Incremental Violations (ILINK errors)
    These errors cause a full link to occur if the -e option is used
 and -i is not used, else they are fatal errors:

    symbol <name> deleted

    A symbol was deleted from an incrementally-linked module.

    <modname> contains new SEGMENT

    A segment was added to the program.

    <modname> contains changed segment <name>

    The segment contribution (code or data which the module
 contributes to a segment) changed for the given module: it contributed
 to a segment it didn't previously contribute to, or a contribution was
 removed.

    <modname>'s segment <name> grew too big

    The given segment grew beyond the padding for the given module.

    <modname> contains new GROUP <name>

    A new group was defined, via the GROUP directive in assembly
 language or via the /ND C compiler option.

    <modname> redefines group <name> to include <name>

    The members of the given group changed.

    symbol <name> changed

    The given data symbol was moved.

    can't add new communal data symbol <name>

    A new communal data symbol was added as an uninitialized variable
 in C or with the COMM feature in MASM.

    communal variable <name> grew too big

    The given communal variable changed size too much.

    invalid symbol type for <name>

    A symbol which was previously code became data, or vice versa.

    too many COMDEFS
    too many EXTDEFS

    The limit on the total of COMDEF records (communal data variables)
 and EXTDEF records (external references) is 2000.

    invalid CodeView information in .EXE file

    The CodeView information found is invalid.

    <name> contains new CodeView symbolic info

    A module previously compiled without -Zi was compiled with -Zi.

    <name> contains new linnum info

    A module previously compiled without -Zi or -Zd was compiled with
 -Zi or -Zd.

    <name> contains new public CV info

    New information on public-symbol addresses was added.

    invalid .exe file

    The .EXE file is invalid. Make sure you are using an up-to-date
 linker. If the error persists, contact Microsoft.

    invalid .ilk file
    .ilk read error
    .ilk seek error

    The .ILK file is invalid.  Make sure you are using an up-to-date
 linker. If the error persists, contact Microsoft.

    .SYM/.ILK mismatch

    The .SYM and .ILK files are out of sync. Make sure you are using
 an up-to-date linker.  If the error persists, contact Microsoft.

    <libname> has changed

    The given library has changed.

    can't link 64K-length segments

    ILINK cannot handle segments greater than 65,535 bytes long.

    can't link iterated segments

    ILINK cannot handle programs linked with /EXEPACK.

    Entry table expansion not implemented

    The program call tree changed in such a way that ILINK could not
 handle it.

    file <name> does not exist

    The .EXE, .SYM, or .ILK files are missing.

    <name> has changed

    The given library module name has changed.


 164. Pascal 4.00 README.DOC: Incremental Linker Warning

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33537

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 ILINK Warning Messages

 Fixup frame relative to an (as yet) undefined symbol - assuming ok

 See documentation for LINK error messages L4001 and L4002, in the
 Microsoft CodeView and Utilities manual.

 <name> contains TYPEDEFs - ignored
 <name> contains BLKDEFs - ignored

 The .OBJ file contains records no longer supported by Microsoft
 language compilers.

 old .EXE free information lost

 The free list in the .EXE file has been corrupted. The free list keeps
 track of "holes" of free space in the EXE file. These holes are made
 available when segments are moved to new locations.

 file <name> has no useful contribution

 The given module makes no contribution to any segment.

 Main entry point moved

 The program starting address changed. You may want to consider doing a
 full link.


 165. Passing Pascal Function or Procedure Pointers to C Function

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 18-AUG-1988    ArticleIdent: Q33705

    Microsoft Pascal has the procedure and function address types
 adsproc and adsfunc for use in mixed-language programming. Pascal
 cannot call a procedure or function by their pointers; however, C can,
 as the following corrected and modified example of Page 141 of the
 "Microsoft Pascal 4.0 Compiler User's Guide" shows.

    The C module must be compiled for medium or large model with either
 the /AM or /AL compiler switches, respectively. The linker options
 /NOE and /NOD should be used, and the C library should be linked in
 first to prevent multiple-symbol definition errors.
    Pascal only can obtain the address of external functions or
 procedures using the ads operator. In Pascal, the ads operator will
 not obtain the address of a procedure or function within the current
 modules.
    Below is the main Pascal program module. It contains the corrected
 version of the Pascal user's guide example for addressing procedures and
 functions.
    The example passes procedure and function pointers obtained by the
 ads operator to the C function. C then calls the procedure and
 function by their pointers.
    Note that Pascal cannot call a routine by its pointer. Pascal can
 obtain the address of an external routine, but it cannot obtain the
 address of a routine within the current module with the ads or adr
 operators, so the routines must be declared "extern" here and reside
 in a different module.
    You must link with /NOE and /NOD options, and first specify C
 run-time library to prevent multiple-symbol definition linker
 errors.
    The following is the main Pascal program module:

 {Originally was "program p(output);". Could formally include "input" for
  readln in function pfunc, but not actually required in this example.}

 program p(input,output);

     {Routines must be external for Pascal to obtain the addresses}
     procedure pproc(i : integer); extern;
     function  pfunc : integer; extern;

     {This procedure declaration requires ";" here v}
     procedure cproc(ap: adsproc; af: adsfunc ) [c]; extern;

 begin {begin main Pascal program p}
     cproc( ads pproc, ads pfunc); {originally missing ads operators}
 end.  {end main Pascal program p}

 {--------- External Pascal Module Defining Procedure and Function ----------}

 { From corrected and modified example in "Microsoft Pascal 4.0 Compiler
   User's Guide" Page 141. The routines below cannot be in the same module
   that uses the ads operator to obtain their addresses.
 }

 module SecondPascalModule;

 procedure pproc( i : integer );
 begin
     writeln('In Pascal procedure pproc within second Pascal module.');
     writeln('Pascal proc integer = ', i );
 end;

 function pfunc : integer;
 var
     i : integer;
 begin
     write('Please Enter an integer for the function return value : ');
     readln( i );
     writeln;
     pfunc := i;
 end;

 end. {SecondPascalModule}

 {-------- C Function to Receive Pointers and Call Pascal Routines by them --}

 /* C function cproc called by Pascal main program. printf the address of the
  Pascal procedure and function from the second Pascal module, then call them
  by their function pointers. Note that the Pascal procedure pproc has one
  integer argument of 7 in this example, while the Pascal function pfunc has
  no arguments but returns an integer.

  Compile this with /AM or /AL. Link with /NOE /NOD and specify the
  C libraries first to avoid multiple symbol definitions.
 */

 #include <stdio.h>

 /* Prototype for function cproc. Do not specify argument to pproc here. */
 void cproc( void (pascal * pproc)(), int (pascal * pfunc)() );

 void cproc (void(pascal * pproc)(), int(pascal * pfunc)()) {
     int ReturnCode;

     printf("\nIn cproc(); address of pproc at %p, pfunc at %p\n",pproc,pfunc)
     printf("\nExecute the Pascal procedure:\n");
     (*pproc)(7);
     printf("\nExecute the Pascal function :\n");
     ReturnCode = (*pfunc)();
     printf("Integer Entered in Pascal function was %d. Bye!\n",ReturnCode);
     }


 166. Pascal 4.00 README.DOC: Installing Editor

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33539

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Microsoft Editor
 Installing the Editor
    The Pascal SETUP program installs the Microsoft Editor on your hard
 disk if you request it during setup.


 167. Pascal 4.00 README.DOC: Editor Keystroke

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33540

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Keystroke Configurations
    Some of the keystroke configurations listed in Table A.2 of the
 Microsoft Editor User's Guide may need to be changed.
    In the Quick/WordStar(R) configuration, the Sinsert function is
 assigned to ALT+INS, not CTRL+INS.
    In the BRIEF(R) configuration, the Plines function is assigned to
 ALT+D, and the Refresh function is assigned to CTRL+].
    In the EPSILON(TM) configuration, the Ppage function is assigned to
 PGDN, and the Sdelete function is assigned to DEL and CTRL+D.



 168. Pascal 4.00 README.DOC: Editor Compile Function

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33541

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 The Compile Function

 The commands

 Arg streamarg Compile
 Arg textarg Compile

 each use the command specified by the extmake:text switch.

 The editor does not check the extension of the file name given as an
 argument, but instead uses the "text" extension. The streamarg or
 textarg replaces a %s in the command. These commands are typically
 used to invoke MAKE.


 169. Pascal 4.00 README.DOC: Editor Setfile Function

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33542

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 The Setfile Function
    The commands that use Setfile, along with a streamarg or textarg,
 accept a variety of input: either the name of a file, a file name with
 a wild-card character (* or ?), the name of a directory, or the name
 of a disk drive. File names can also include environment variables,
 such as $INIT. If the streamarg or textarg is a directory name, then
 the editor changes the current directory. If the argument is a drive
 name, then the editor changes the current drive. Environment variables
 are translated into directories to be searched for a file. For
 example, the following macro directs the editor to search the $INIT
 environment variable in order to find the tools.ini file:

    tools.ini := Arg "$INIT:tools.ini" Setfile



 170. Pascal 4.00 README.DOC: Editor and Entering Strings in Macros

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33543

 The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Entering Strings in Macros

 When you enter a text argument directly, no characters have special
 meaning (except when the argument is interpreted as a regular
 expression). However, when you enter text as part of a macro, then
 strings inside of quotes are interpreted according to the C string
 format. This format uses a backslash followed by double quotes (\")
 to represent double quotes and it uses two backslashes (\\) to
 represent a single backslash. Therefore, to find the next occurrence
 of the string

 She wrote, "Here is a backslash: \ "

 you could use the following macro definition:

 findit := Arg "She wrote, \"Here is a backslash: \\ \""
 Psearch

 Note that to indicate a backslash for a regular expression that is
 also part of a macro definition, you must use four consecutive
 backslashes.


 171. Pascal 4.00 README.DOC: Editor and Using Text Switches

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33544

    The following information was taken from the Pascal
 Version 4.00 README.DOC file.

 Using Text Switches
    The text switches extmake and readonly each take a special kind of
 syntax that allows you to specify drive, file name, base name, or file
 extension. The syntax consists of the characters:

    %|<letters>F

 where <letters> consists of any of the following: "p" for path, "d"
 for drive, "f" for file base name, or "e" for file extension. For
 example, if you are editing the file c:\dir1\sample.c, and you make
 the following switch assignment:

    extmake:c cl /Fod:%|pfF %|dfeF

 then each time you give the command <Arg><Compile>, the editor
 performs the following system-level command:

 cl /Fod:\dir1\sample c:sample.c

    The expression "%s" is equivalent to "%|feF" except that the former
 only works once, whereas the latter can appear any number of times in
 the extmake switch assignment. The expression "%|F" is equivalent to
 "%|dpfeF".



 172. Pascal 4.00 README.DOC: Editor and the Filetab Switch

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33545

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 The Filetab Switch
    The filetab switch is a numeric switch that determines how the
 editor translates tabs when loading a file into memory.  The value of
 the switch gives the number of spaces associated with each tab column.
 For example, the setting "filetab:4" assumes a tab column every 4
 positions on each line.  Every time the editor finds a tab character
 in a file, it loads the buffer with the number of spaces necessary to
 get to the next tab column.  Depending on the value of the entab
 switch, the editor also uses the filetab switch to determine how to
 convert spaces into tabs when writing to a file.  The default value of
 filetab is 8.



 173. Pascal 4.00 README.DOC: Editor and Linking Extensions

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33546

    The following information was taken from the Pascal Version 4.00
 README.DOC file.

 Linking Extensions in Protected Mode
    To link C extension modules in protected mode, link with the object
 file EXTHDRP.OBJ, instead of the real-mode header EXTHDR.OBJ.


 174. PL /S And /link Options Together Result in LINK Error L1004

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist4.00
 Last Modified: 18-AUG-1988    ArticleIdent: Q33708

    A Pascal Version 4.00 command line using both the /S (Stack size)
 and /link options, such as

    PL /S500 hello.pas /link

 will result in bad input for the following linker's .MAP file prompt
 and linker error:

    LINK: fatal error L1004: STACK:500HHELLO.PAS: invalid numeric value

    Microsoft has confirmed this to be a problem in Version 4.00. We
 are researching this problem and will post new information as it
 becomes available.

    The bad input at the .MAP prompt will consist of ASCII character 2
 (a dark smiley face on the screen of IBM PCs and compatibles) followed
 by an extra copy of the first non-blank character following "/S500".
 The link error message does not display the ASCII 2.
    Note that with the above PL command line, the first non-blank
 character following the /S string is the "h" in "hello.pas", which is
 doubled in both the .MAP file prompt and the link error message. If a
 blank had occurred between "/S" and "500", the "5" would have been
 doubled following ASCII 2 at the .MAP prompt.
    To work around this problem, do not use /S and /link together. Use
 the linker switch /ST:<stack_size_in_decimal> either after /link or
 when linking separately. Or you may use the EXEMOD utility with its
 /Stack <stack_size_in_hex> option on a successfully linked .EXE file.


 175. Pascal 4.00 PATCH320.DOC: Patching IBM PC-DOS Version 3.20

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33555

    The following information was taken from the Pascal Version 4.00
 PATCH320.DOC file.

 PATCH320.DOC File
 Notes on patching IBM(R) PC-DOS Version 3.20 (C) Copyright Microsoft
 Corporation, 1988
    Version 3.20 of IBM(R) PC-DOS contains a bug that can cause
 unexpected results in programs that generate floating-point
 exceptions. This file explains how to install a small patch in DOS to
 eliminate the problem.
    It is especially important to install this patch if you wish to use
 the C run-time routine signal with the SIGFPE parameter, since that
 routine does not work correctly in the unpatched version of IBM PC-DOS
 3.20. IBM Corporation also supplies a patch to eliminate this problem.
    Note that MS-DOS(R) Version 3.20 contains another, different
 floating-point bug. The README.DOC file for this release tells you
 where to find more information about installing a patch for that bug.
 If you use any version of DOS 3.20 other than IBM PC-DOS 3.20 or
 MS-DOS 3.20, contact your hardware manufacturer to determine whether
 the problem exists in your version.
    You can install the DOS patch for IBM PC-DOS 3.20 by following
 these steps:

    1. Format a blank floppy disk. (Do NOT use the /s formatting
       option to transfer system files to the disk.)
    2. Use the SYS command to copy the files IBMDOS.COM and IBMBIO.COM
       to the new disk. For example, if you boot from drive C:, you could
       use these commands:

       C:
       SYS A:

    3. Use the COPY command to copy the files COMMAND.COM, SYS.COM,
       and DEBUG.COM to the new disk.
    4. Use the COPY command to copy the files STKPAT.BAT, STKPAT.SCR,
       RMRHS.EXE, and SETRHS.EXE from the \PATCH directory of your
       hard-disk drive to the new disk.
    5. Reboot your system from the floppy disk that you
       prepared in steps 1-4.
    6. Run the STKPAT.BAT file to patch the IBMBIO.COM file on the new
       disk.
    7. Use the SYS command to transfer the patch from the floppy
       disk other Version 3.20 disk. For example, if you normally
       boot from drive C:, you would enter these commands to transfer
       the patched DOS to your hard-disk drive:

       to any A:
       SYS C:

       This installs the patch.
    8. Reboot your system as you normally do.


 176. Pascal 4.00 OS2PATCH.DOC: Patching Microsoft OS/2

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33556

    The following information was taken from the Pascal Version 4.00
 OS2PATCH.DOC file.

 OS2PATCH.DOC File
 Information on a Patch for Microsoft Operating
 System/2 (MS(R) OS/2) Version 1.0 (C) Copyright Microsoft Corporation,
 1987, 1988
    This file describes the procedure for installing a patch in
 Microsoft(R) Operating System/2 OS/2 (MS(R) OS/2) Version 1.0 so that
 you can use the 7 command of the Microsoft CodeView(R) debugger in
 OS/2 protected mode.
    If you are using protected mode in OS/2 Version 1.0, and you have a
 math coprocessor, then you need to use a patch before you can use the
 CVP 7 command in CodeView. To apply the patch, use the OS2PATCH.EXE
 and PTRACE87.PAT files that come on the same disk that CVP.EXE is on.
 You also need to locate the PATCH.EXE file that comes with OS/2 and
 make sure that this file is in a directory listed in your PATH
 environment variable. Then follow these steps:

    1. Change the current drive and directory to the root directory of
       the boot disk. (If the boot disk is a floppy, make sure that it
       is inserted in the drive that you boot from.)
    2. Give the following command line at the DOS prompt:

       OS2PATCH /A PTRACE87.PAT

    You may need to give the complete path names for OS2PATCH.EXE and
 the PTRACE87.PAT file. You do not need to give a path name for the
 OS2PATCH.EXE file if you have placed this file in a directory listed
 in your PATH environment variable.


 177. Pascal 4.00 Startup Source Code README.DOC

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33557

    The following information was taken from the Pascal Version 4.00
 Startup Source Code README.DOC.

 C Runtime Library Startup Sources
    The directory \startup and its subdirectories contain the files
 necessary for building the startup portion of the C runtime library.
 The \startup directory contains the startup source files, the include
 include files, the batch file and the make file used to build the
 startup object files.  The subdirectories of \startup contain OS
 specific sources.
    The startup object files can be built by invoking startup.bat from
 within the \startup directory.  This batch file assumes the following:

    1. make.exe, link.exec, the C compiler, and the assembler must be
 in the execution path. MASM 5.0 and C 5.0 or later are required to
 build the startup sources.
    2. doscalls.lib must be in the directory specified by the LIB
 environment variable.
    Startup will create four memory model specific subdirectories
 (i.e., S, M, C, and L) and place the appropriate object files there.
 Under each memory model subdirectory, startup creates two addition
 subdirectories OS2 and DOS where OS specific objects reside.
    The include files stdio.h and ctype.h are required for building the
 startup source file wild.c but are not included on the \startup
 directory because they exist on the directory containing the standard
 include files. A make variable called CINC controls where the makefile
 looks for these include files. STARTUP.BAT sets CINC to the current
 value of the INCLUDE environment variable. This variable should be
 set to the location of the C include files. CINC can also be set in
 the makefile if you wish to run the makefile separately.
    The message "<cEnd - nogen>" is generated when some of the assembly
 language source files are assembled. This message is expected and is
 totally benign.
    The startup batch file requires as arguments a list of capital
 letters describing the memory models you wish to build. For example,
 "startup S L" will build the small and large model startup objects.
 Startup will then link the objects with a sample C program called
 nulbody.c (consisting of a null main functions) to produce
 nulbody.exe. [Invoking startup.bat with no arguments will give usage
 information.]
    Note: startup sources written in assembly language have been
 edited with tabstops set to 8. Startup sources written in C have been
 edited with tabstops set to 4.
    The following files are contained in the \startup directory:

    Startup source files (OS independent):

    chkstk.asm
    chksum.asm
    crt0fp.asm
    setargv.asm
    wild.c

    Startup source files (OS specific):
    crt0.asm
    crt0dat.asm
    crt0msg.asm
    execmsg.asm
    nmsghdr.asm
    stdalloc.asm
    stdenvp.asm
    stdargv.asm

    Startup include files:
    brkctl.inc
    cmacros.inc
    msdos.inc
    register.h
    msdos.h
    version.inc

    File count files:
    _file.c
    file2.h

    Make and batch files:

    startup.bat:   invokes make file to build objs and link
                   to null program
    makefile:      contains rules for building startup sources
    nulbody.c:     null c program
    nulbody.lnk:   link script for linking null program

    Documentation:

    readme.doc:    information about \startup directory
                   structure and contents

   End


 178. Glockenspiel Turbo Pascal to C Translator Source Code

 Product Version(s): 3.30 3.31 3.32 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 18-AUG-1988    ArticleIdent: Q33563

    The Irish company Glockenspiel writes the Turbo Pascal to C
 Translator. If you are interested in obtaining the source code, please
 contact Glockenspiel.
    The following is the address and phone number:

    19 Belvedere Place
    Dublin 1

    011-353-1-364515



 179. Pascal 4.00 Compiler Error 380 "Stack or var with SS <> DS"

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 26-SEP-1988    ArticleIdent: Q33721

 The Pascal Version 4.00 compiler may issue the following undocumented
 compiler error message:

 Error 380 - Stack or var with SS <> DS

 This error is not listed in the "Microsoft Pascal 4.0 Compiler User's
 Guide"; however, it is noted in the Pascal Version 4.00 README.DOC
 file.

 The the error occurs when attempting to address a stack or near-heap
 variable with the adr or ^ operators when the $windows+ or $stackseg+
 metacommands or equivalent compiler switches are set. The $windows+
 and $stackseg+ metacommands set SS <> DS (Stack Segment not equal to
 Data Segment), and require that the far address (or long address that
 consists of the segment and offset) be obtained for addressing stack
 and near-heap variables.

 The ads operator may be used for addressing data items with both
 the segment and offset as indicated in Pages 73-76 of the Pascal
 user's guide.

 The adr operator is used for obtaining offset addresses only of data
 items within the default data segment or Dgroup. The carrot "^"
 operator is for defining and dereferencing pointers to data items
 allocated on the near (or short) heap within Dgroup by means of the
 New function. Both of these operators assume SS = DS.

 The $windows+ metacommand is equivalent to the PL switch /Pw or the
 PAS1 switch /W, and has the effect of adding initialization and
 cleanup code to Windows applications written in Pascal.


 180. Debug Information Exceeding Segment Bounds, Link Error L1103

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist4.00 SR# G880727-1846
 Last Modified: 18-AUG-1988    ArticleIdent: Q33899

 Problem:
    When compiling and linking my large program, which nearly fills the
 64K-byte default data segment with defined data, I receive the linker
 error L1103: "attempt to access data outside segment bounds." Extended
 run-time debugging information has been added to my program by the
 metacommand $debug+, or the PL switch /Pd, or the PAS1 switch /D.
    To avoid error L1103, I do not include extended run-time debugging
 information when the default data segment is almost full.

 Response:
    The linker error L1103 occurs because the extended run-time
 debugging information is added to the 64K default data segment, or
 Dgroup. The addition of this debugging information increases the
 size of Dgroup, which is readily noticeable in the map file. If Dgroup
 is nearly filled with defined data, the debugging information can
 increase the size of Dgroup beyond 64K, which causes linker error
 L1103.
    Microsoft has confirmed this to be a problem in Version 4.00. We
 are researching this problem and will post new information as it
 becomes available.
    The $debug+ metacommand is described in the "Microsoft Pascal 4.0
 Compiler Reference Manual" section 18.2 "Debugging and Error Handling."
 The addition of this debugging information provides the source code
 filename, routine name or main program module name, and line number
 for run-time error messages.
    If you would like to debug programs that have nearly 64K of defined
 data, use the /Zi CodeView information option, which does not store
 any information in Dgroup. This process allows you to use CodeView to
 debug your program without running into any linker problems. Note that
 the CodeView information PL switch /Zi (or PAS1 /Z) is incompatible
 with the extended run-time debugging PL switch /Pd (or PAS1 /D); do
 not compile with both /Zi and /Pd, or /Z and /D.


 181. Check Sum Errors in Pascal Libraries

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q34362

    Check Sum errors are generated when a simple Pascal program is
 linked with PLINK86 Version 2.01.
    Microsoft is researching this problem, and will post more
 information as it becomes available.
    The errors occur in the following modules which were reported to
 be associated with PLINK86:

    filf.pas
    strf.pas
    misoe.pas

    These errors occur when using either libpase.lib or libpas7.lib.


 182. PL /FPi Option Is for Coprocessor Math

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q33710

 The PL compiler-linker driver option /FPi is for using coprocessor
 math and linking with the combined library LIBPAS7.LIB. The default
 math option is /FPe for emulator math, which will call the library
 LIBPASE.LIB. In C or FORTRAN, /FPi is used for emulator math; /FPi87
 is used for coprocessor math.

 If you are accustomed to Microsoft C or FORTRAN, you may inadvertently
 use /FPi for specifying emulator math with Pascal. If LIBPAS7.LIB is
 not present in the current working directory or a directory specified
 by the LIB environment variable, the linker will issue the following
 warning and prompt:

 LINK: warning L4051: LIBPAS7.LIB: cannot find library
 Enter new file spec:

 Either entering the existing library name LIBPASE or recompiling
 without /FPi allows you to link to the emulator-math library. If you
 do link with LIBPAS7.LIB, your program will require a 80x87
 coprocessor to run correctly.

 Note that if you set up for dual-mode (DOS or OS/2 rear mode, and
 OS/2 protected mode), the actual names for the emulator-math combined
 libraries may be LIBPASER.LIB for real mode or LIBPASEP.LIB for
 protected mode.


 183. PAS1 Switch /Xsymbol Is Not Handled Correctly

 Product Version(s): 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist4.00
 Last Modified: 26-SEP-1988    ArticleIdent: Q34935

 Passing the /Xsymbol[=value] switch to PAS1 of the Microsoft
 Pascal Version 4.00 compiler generates a "Line invalid" error.
 This problem only occurs when /X switch precedes the filename.

 For example, if the following is used,

 pas1 /Xabc filename;

 the following error is generated because the filename is not being
 read by pas1:

 Line invalid: ';', start again.
 Source filename [.PAS] :

 Microsoft has confirmed this to be a problem in Version 4.00. We are
 researching this problem and will post new information as it becomes
 available.

 If one or more switches follows the /Xsymbol, it works correctly.

 The following is an example:

 pas1 /Xabc /N filename;

 Also, placing the /X switch after the filename works properly, as
 follows:

 pas1 filename /Xabc ;

 In addition, you can use the PL driver as an alternative (/D switch),
 as follows:

 "pl /Dabc filename.pas"


 184. File Error Trapping when Using lm_lock

 Product Version(s): 3.20 4.00 | 4.00
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q34971

 In Pascal, the procedure locking() and the TYPE lockmodes have been
 defined to allow you to lock a specific range of records in a DIRECT
 mode file, as follows:

 TYPE            lockmodes = (lm_unlck,lm_lock,lm_nblck,lm_rick,
                 lm_nbrick);

 PROCEDURE locking(VAR f: FCBFQQ; MODE: lockmodes;
                   M,N : INTEGER4);

 When a process is using the lm_lock value of lockmodes in the
 procedure locking (as described on Page 146 of the "Microsoft Pascal
 4.0 Compiler User's Guide"), and it encounters a locked record, it
 will wait for 10 seconds before returning a run-time file-system error
 #16.

 This error is not documented and can be described as a Record
 Locked - share error. The run-time file-system errors are described on
 Pages 257-258 of the user's guide.


 185. Pascal File System Explained

 Product Version(s): 3.32 4.00 | 4.00
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q35136

 The following information explains the Pascal file system.

 The Pascal file system is similar to, but not compatible with,
 buffered stream files in C. There is a File Control Block (FCB) with a
 file buffer allocated in the near heap when the file is opened. All
 I/O goes from/to the file buffer to the DOS device buffer.

 To flush a file buffer in Pascal, use the CLOSE procedure, or end the
 program normally. There is no buffer flushing routine. Because a
 Pascal FCB has a different record format than a C FILE * struct, you
 cannot use C run-time library routines to try flushing a Pascal FCB.

 Sequential files in Pascal allow reading only if opened by Reset, or
 writing only if opened by Rewrite; however they do not allow both
 reading and writing. Direct files may be both read and written.

 Sequential is the default file mode unless the file mode is explicitly
 specified as in the following:

 FileVar.Mode := direct;

 The following code fragment demonstrates how to setup file error
 trapping for handling I/O errors within your program rather than
 exiting to the operating system:

 var  f : text;
 begin
         assign(f,'afile');
         f.trap := true;
         f.errs := 0;

 After every file I/O operation, you can check f.errs for a non-0
 value. Errors 1-15 are document prior to error 1000 in the back of the
 "Microsoft Pascal Compiler User's Guide." Undocumented error 16
 usually indicates a network file or record sharing violation has
 occurred. Pascal automatically reads the first record of a file when
 it is opened, so do not lock the first record of a file if you want
 other processes to be able to access any records in the file.

 Make sure you reassign zero to f.errs after handling a file error so
 you can detect any future errors.


 186. Calling DOS Interrupt 21 Hex Functions from Pascal

 Product Version(s): 3.3x 4.00 | 4.00
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q35165

 In Pascal, you may call a subset of the DOS interrupt 21 hex functions
 by means of the DOSXQQ function. DOSXQQ is documented on Pages 161-162
 in Appendix B.1 of the "Microsoft Pascal Compiler User's Guide."

 The DOSXQQ function is documented as passing a byte to the AH register
 and an additional argument to the DX register. The return value from
 DOSXQQ is a byte that corresponds to the DOS function value returned
 in the AL register. By defining the public variables CRCXQQ and CRDXQQ
 as EXTERN, you may use these variables to view the contents of the CX
 and DX registers, respectively, after the DOSXQQ call. CRCXQQ also may
 be used to load CX prior to the DOSXQQ call.


 187. Correction to Page 120 of the Pascal 4.0 Reference Manual

 Product Version(s): 5.10   | 5.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 19-AUG-1988    ArticleIdent: Q34578

 The bottom of Page 120 of the "Microsoft Pascal 4.0 Compiler Reference
 Manual" states the following:

 -1..50000   Invalid : becomes 65535..50000 (i.e., -1 is treated as
             65536)

 When converted to a two-byte unsigned word, -1 is treated as 65535
 instead of 65536.

 In addition, the Pascal compiler will issue "Warning 199 Integer Type
 Not Compatible With Word Type" and error "275 Invalid Range" if the
 above range is specified for a type or variable.

 Pascal does not allow integer4 subranges to be specified as constants.
 The 50000 upper bound of the subrange exceeds the maximum signed
 two-byte integer of 32767, so it is converted to an unsigned two-byte
 word type. The unsigned word equivalent of -1 is 65535; consequently
 the subrange -1..50000 apparently would be treated as 65535..50000.
 However, because Pascal does not allow a range to be specified from a
 high value to a lower value, the invalid range error results.


 188. Directory Listing for Pascal 3.32 Distribution Disks

 Product Version(s): 3.32
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q35299

 The following is a listing of the directories for each of the
 Microsoft Pascal Version 3.32 Compiler distribution disks (5.25-inch disks).
 The information is the resulting output when the DOS command "dir" is
 performed on each directory and subdirectory.

 A line of colons (:::::) separates each disk; subdirectories are
 listed below their parent directory. The first line of each disk
 description is the name of the disk as it is printed on the label.

 The following is a listing of directories for Pascal Version 3.32
 distribution disks:

 Disk 1 of 2  --

 Volume in drive A is DISK 1
 Directory of  A:\

 PAS1     EXE    98284  11-20-86   4:39p
 PAS2     EXE   114760  11-20-86   4:35p
 PAS3     EXE    28310  11-20-86   4:36p
 LINK     EXE    48471   6-12-86   3:04p
 README   DOC    26972  11-20-86   5:34p
 CODEVIEW DOC     2375  11-20-86   5:26p
 LIB      EXE    29359   6-25-86   5:38p
         7 File(s)     10240 bytes free

 :::::::::::::::::::::::::::::::::::::::

 Disk 2 of 2  --

  Volume in drive A is DISK 2
  Directory of  A:\

 MATH     LIB    40960  10-31-86   6:58p
 ALTMATH  LIB    39936  10-31-86   6:59p
 DECMATH  LIB    28160  10-31-86   6:59p
 8087     LIB    29696  10-31-86   6:59p
 PASEXEC  INC     4406  11-03-86   7:03p
 DEMOEXEC PAS     1211  11-04-86  12:31p
 FINU             5482   1-25-85   4:22p
 NULE6    OBJ      586   1-25-85   4:23p
 FINK             3472   1-25-85   4:22p
 FINKXU           4361   1-25-85   4:22p
 LVARSTCK OBJ      442   3-04-85   5:54p
 SORT     PAS     2097  12-10-83  12:11p
 PRIMES   PAS      770  12-10-83  12:11p
 EXEPACK  EXE    11684   3-29-86   8:22a
 EXEMOD   EXE    11034  10-01-85   3:29p
 EMOEM    ASM    11485   9-02-85  12:24p
 CEXEC    LIB    13824  10-29-86   3:09a
 87       EXE     4680   9-16-86   4:00p
 87       DOC      921  11-04-86  12:46p
 PASCAL   LIB    93696  11-19-86   7:17p
        20 File(s)     44032 bytes free


 189. Directory Listing for Pascal 4.00 Distribution Disks

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1988    ArticleIdent: Q35300

 Below is a listing of the directories for each of the Microsoft Pascal
 Version 4.00 Compiler distribution disks (5.25-inch disks). The
 information is the resulting output when the DOS command "dir" is
 performed on each directory and subdirectory.

 A line of colons (:::::) separates each disk, and subdirectories are
 listed below their parent directory. The first line of each disk
 description is the name of the disk as it is printed on the label.
 Information in parentheses is supplemental and not contained on the
 disk label.

 The following is a listing of directories of the Pascal Version 4.00
 distribution disks:

 (Disk 1 of 9)  -  Setup and Compiler

  Volume in drive A is SETUP
  Directory of  A:\

 README   DOC    48065   4-29-88   9:30a
 PACKING  LST     6520   4-27-88  10:31a
 SETUP    EXE    81181   4-22-88   2:27p
 87       EXE     8798   7-23-87   1:34p
 BIND     EXE    36946  10-26-87   4:01p
 ECH      EXE    19351  11-16-87  10:22a
 EXP      EXE    32220  11-17-87   3:38p
 ERROUT   EXE    10729  11-09-87   4:42p
 EXEHDR   EXE    29942   1-14-88   8:44p
 EXEMOD   EXE    12336  11-09-87   4:42p
 EXEPACK  EXE    14803   8-20-87   4:02p
 IMPLIB   EXE    30166   1-29-88  10:23a
 SETENV   EXE    10870  11-09-87   4:43p
        13 File(s)     13312 bytes free

 :::::::::::::::::::::::::::::::::::::::

 (Disk 2 of 9)  -  Utilities

  Volume in drive A is UTILITIES
  Directory of  A:\

 PAS1     EXE   139623   4-21-88  10:05p
 PAS2     EXE   131199   4-21-88  10:05p
 PAS3     EXE    40401   4-21-88  10:06p
 MAKE     EXE    38613   1-29-88  10:26a
         4 File(s)     10240 bytes free

 :::::::::::::::::::::::::::::::::::::::

 (Disk 3 of 9)  -  Examples

  Volume in drive A is EXAMPLES
  Directory of  A:\

 LINK     EXE   117001   2-23-88   5:07p
 PL       EXE    31861   3-25-88  10:29a
 RM       EXE    24884  11-16-87  10:20a
 FINK             3472   1-25-85   4:22p
 FINKXU           4331   8-27-87   4:09p
 FINU             5482   1-25-85   4:22p
 CLOCK    INT      308   5-15-87   4:15p
 INTRP    INT      225   5-15-87   4:15p
 PASEXEC  INC     4450   5-14-87   6:00p
 PORT     INT      129   5-15-87   4:15p
 BSE      INT     1062   1-15-88   8:46p
 BSEERR   INT    18185   1-15-88   8:46p
 BSESUB   INT    20490   2-05-88   6:15p
 OS2      INT      716   1-15-88   8:46p
 OS2DEF   INT     1835   1-22-88   9:31a
 BSEDOS   INT    39921   2-12-88   6:43p
 DEMOEXEC PAS     1211  10-29-86   2:55a
 PRIMES   PAS      634   3-06-87   2:38p
 SORTDEMO PAS    27342   2-02-88  10:31a
 MAKESORT BAT     1326   2-11-88  10:06a
 MAKESORT CMD     1313   2-19-88   7:52p
 EMOEM    ASM    12125  10-22-87   6:46p
 ENTX6L   ASM    10863  12-16-87   2:46a
 ENTXSTUB ASM      394  10-06-87   7:01p
        24 File(s)     18432 bytes free

 :::::::::::::::::::::::::::::::::::::::

 (Disk 4 of 9)  -  Libraries 1

  Volume in drive A is LIBRARY-1
  Directory of  A:\

 UNDEL    EXE    30046  11-16-87  10:24a
 LVARSTCK OBJ      487   2-09-88   1:28p
 APILMR   OBJ      105  10-15-87   6:01p
 ENTX6L   OBJ     1357   3-09-88  10:54p
 5ENTX6L  OBJ     1320   3-09-88  10:54p
 ENTX6W   OBJ     1339   3-09-88  10:55p
 5ENTX6W  OBJ     1302   3-09-88  10:55p
 API      LIB    81408  12-11-87   1:51p
 DOS30P   LIB    26919   4-21-88   9:31p
 DOS50P   LIB    25443   4-21-88   9:31p
 EMR      LIB    16409   1-14-88   4:33p
 EM       LIB    16921   1-14-88   4:33p
 87R      LIB     4121   1-14-88   4:33p
 87       LIB     4121   1-14-88   4:33p
 CEXEC    LIB    14089   4-21-88   9:12p
 DOSCALLS LIB    29184   1-07-88  11:34a
 PASLIBW  LIB    82441   4-21-88   9:32p
 WIN87EM  LIB     1055  10-03-87   6:17p
 MAKELIB  BAT     3148   3-09-88  10:44p
        19 File(s)      8192 bytes free

 :::::::::::::::::::::::::::::::::::::::

 (Disk 5 of 9)  -  Libraries

  Volume in drive A is LIBRARY-2
  Directory of  A:\

 LIB      EXE    49661   2-09-88  10:53a
 EXEC     EXE     9299  12-29-87  10:25a
 ILINK    EXE    88929   2-03-88  10:30a
 NULF     OBJ      957   1-06-87   3:42p
 NULE6    OBJ      586   1-25-85   4:23p
 PARTIAL  LIB    56763   4-21-88   9:31p
 ALTMATH  LIB    41989   1-14-88   3:55p
 DECMATH  LIB    27969   1-14-88   3:55p
 IEEEMATH LIB    24847   1-14-88   3:54p
 8087     LIB    24849   1-14-88   3:54p
 MAKELIB  BAT     3148   3-09-88  10:44p
 MAKELIB2 BAT     3846   3-09-88  10:48p
        12 File(s)     22528 bytes free

 :::::::::::::::::::::::::::::::::::::::

 (Disk 6 of 9)  -  Microsoft CodeView for MS-DOS

  Volume in drive A is CODEVIEW
  Directory of  A:\

 CV       EXE   263890   3-09-88   1:54a
 CV       HLP    22444   1-12-88   4:57p
 CVPACK   EXE    49400   3-01-88  12:07a
 MOUSE    COM    14551   3-06-88   9:41a
         4 File(s)     10240 bytes free

 :::::::::::::::::::::::::::::::::::::::

 (Disk 7 of 9)  -  Microsoft CodeView for MS OS/2

  Volume in drive A is CODEVIEWOS2
  Directory of  A:\

 CVP      EXE   233249   3-09-88   1:56a
 CVP      HLP    22444   1-12-88   4:57p
         2 File(s)    106496 bytes free

 :::::::::::::::::::::::::::::::::::::::

 (Disk 8 of 9)  -  Microsoft Editor

  Volume in drive A is EDITOR
  Directory of  A:\

 CALLTREE EXE    31233  12-29-87   4:03p
 M        EXE    94821   2-02-88   5:35p
 MEP      EXE    97063   2-02-88   5:36p
 MEGREP   EXE    31915  11-16-87  10:23a
 BRIEF    INI     2094   1-14-88  10:38p
 EPSILON  INI      978   1-14-88  10:42p
 QUICK    INI     1058   1-14-88  10:51p
 WS       DLL     2609  12-15-87   5:14p
 WS       ZXT     2084  12-15-87   5:14p
 EXT      DOC    15877   1-07-88  11:25a
 EXT      H       8730  12-15-87   4:06p
 EXTHDR   OBJ     1893  12-15-87   5:13p
 EXTHDRP  OBJ     2021  12-15-87   5:14p
 SKEL     C       2457  10-23-87   9:29a
 SKEL     DEF      211  12-14-87   3:08p
        15 File(s)     59392 bytes free

 :::::::::::::::::::::::::::::::::::::::

 (Disk 9 of 9)  -  Startup Source Code

  Volume in drive A is STARTUP
  Directory of  A:\

 DOS          <DIR>      4-22-88   2:16p
 OS2          <DIR>      4-22-88   2:16p
 PATCH32      <DIR>      4-22-88   2:16p
 BRKCTL   INC      784   2-09-88  10:08p
 CHKSTK   ASM     2044   2-21-88   6:54p
 CHKSUM   ASM     3524   2-09-88  10:09p
 CMACROS  INC    12066   2-09-88  10:08p
 CRT0FP   ASM     2223   2-09-88  10:09p
 FMSGHDR  ASM     2429   2-09-88  10:09p
 MAKEFILE         4148   2-21-88   6:50p
 MSDOS    H       6849   2-09-88  10:10p
 MSDOS    INC     6181   2-21-88   6:53p
 NULBODY  C         13   2-09-88  10:10p
 README   DOC     3199   1-27-88   4:57p
 REGISTER H        922   2-09-88  10:10p
 SETARGV  ASM      971   2-09-88  10:09p
 STARTUP  BAT     1663   1-27-88   4:57p
 VERSION  INC      503   2-09-88  10:08p
 WILD     C       7182   2-09-88  10:09p
 FILE2    H       1027   2-09-88  10:10p
 _FILE    C       1691   2-09-88  10:09p
        21 File(s)    158720 bytes free

  Volume in drive A is STARTUP
  Directory of  A:\DOS

 .            <DIR>      4-22-88   2:16p
 ..           <DIR>      4-22-88   2:16p
 CRT0     ASM     7612   2-09-88  10:09p
 CRT0DAT  ASM    14175   2-09-88  10:09p
 CRT0MSG  ASM     2840   2-09-88  10:09p
 EXECMSG  ASM     1337   2-09-88  10:09p
 NMSGHDR  ASM     3010   2-24-88   3:37p
 NULBODY  LNK      149   2-21-88   6:51p
 STDALLOC ASM     2825   2-09-88  10:09p
 STDARGV  ASM    13852   2-09-88  10:09p
 STDENVP  ASM     3780   2-21-88   6:54p
        11 File(s)    158720 bytes free

  Volume in drive A is STARTUP
  Directory of  A:\OS2

 .            <DIR>      4-22-88   2:16p
 ..           <DIR>      4-22-88   2:16p
 CRT0     ASM    10312   2-21-88   6:54p
 CRT0DAT  ASM    10496   2-09-88  10:09p
 CRT0MSG  ASM     2891   2-09-88  10:09p
 EXECMSG  ASM     2231   2-17-88   8:49a
 NMSGHDR  ASM     3486   2-09-88  10:10p
 NULBODY  LNK      168   2-21-88   6:51p
 STDALLOC ASM     3245   2-09-88  10:10p
 STDARGV  ASM    13623   2-09-88  10:10p
 STDENVP  ASM     5362   2-21-88   6:54p
        11 File(s)    158720 bytes free

  Volume in drive A is STARTUP
  Directory of  A:\PATCH32

 .            <DIR>      4-22-88   2:16p
 ..           <DIR>      4-22-88   2:16p
 PATCH87  DOC     3937   2-19-88   4:30p
 PATCH87  EXE     4206   1-29-88   2:30p
 SETRHS   EXE      543   6-29-86   4:00a
 RMRHS    EXE      543   6-29-86   4:00a
 STKPAT   BAT       94   6-29-86   4:00a
 STKPAT   SCR       30   6-29-86   4:00a
 PTRACE87 PAT      188   1-06-88  10:57p
 PATCH320 DOC     2169   2-19-88   4:29p
 OS2PATCH EXE     1069   1-19-88   4:29p
 OS2PATCH DOC     1401   2-19-88   4:28p
        12 File(s)    158720 bytes free


 190. Example of File I/O and Writing to Printer in Pascal

 Product Version(s): 3.1x 3.20 3.3x 4.00 | 4.00
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER | appnote
 Last Modified: 26-SEP-1988    ArticleIdent: Q35557

 The following is an example of simple file I/O, and writing to the
 printer in Pascal.

 The following is a sample program:

 {Program to demonstrate file and device I/O.

  First, perform console I/O by prompting user for keyboard input
  and sending input to screen.

  Then do same to and from a text file named "test.txt".

  Finally, open the printer and send a user-specified string to it.

  Text files are terminated by an End Of Line marker (a line feed),
  which must be written and read by writeln and readln instead of
  read and write.
 }

 program IO(input,output);
   var filevar : text;
       str     : lstring(80);

 begin
   {perform simple console string I/O}
   writeln;
   writeln('Input string of 80 or fewer characters : ');
   readln(str);
   writeln;
   writeln('String was : ',str);

   {create file "test.txt", and perform string I/O}
   assign(filevar, 'test.txt');  {assign name to file variable}
   rewrite(filevar);             {open new file for writing}
   writeln;
   writeln('Input string to write and read from file :');
   readln(str);
   writeln(filevar, str);   {write string to file}
   reset(filevar);          {reset file pointer to beginning of file}
   readln(filevar, str);    {read string & then display it}
   writeln('String was : ',str);
   close(filevar);          {close file, flushing file buffer, and
                             making filevar reusable}

   {open printer device and write string to it}
   assign(filevar, 'prn');  {"prn" is name of printer}
   rewrite(filevar);
   writeln;
   writeln('Input string to send to printer :');
   readln(str);
   writeln(filevar, str);
   close(filevar);

   writeln;
   writeln('Program completed. Good-bye.')
 end.


 191. Example of Allocating Memory on the far/long Heap in Pascal

 Product Version(s): 3.3x 4.00 | 4.00
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 26-DEC-1990    ArticleIdent: Q35561

 The following is an example of dynamically allocating memory on the
 far (or long) heap in Pascal. This information applies to Microsoft
 Pascal Compiler versions 3.3x and 4.00 for MS-DOS, and version 4.00
 for MS-DOS and MS OS/2.

 The following is a program to show far (or long) heap allocation
 routines:

 {First allocate a maximum size block of 65,516 bytes. Assign values to
  the first bytes by an assignment statement and the fillsc procedure
  and display the memory contents on the screen.

  Allocate 64K byte blocks, then allocate 4K blocks until
  there are no more blocks of memory. Then free the blocks.

  The function allmqq is used to allocate blocks of memory, and
  returns a segment:offset "ads" type pointer. The function fremqq
  is used to free the blocks. An ads type has a ".s" field for the
  segment pointed to, and a ".r" type for the offset. If ".r" = 0,
  there is insufficient memory available for the request.
  If ".r" = 1, memory is corrupted.

  Unlike their counterparts getmqq and dismqq, allmqq and fremqq
  do not display error messages, so error checking is done within
  the program.

  Like the equivalent large-memory model C run-time library function
  malloc(), allmqq will first allocate blocks in the far/long heap
  above the default data segment (or Dgroup) until it is exhausted,
  then it will allocate blocks from the near heap in the default
  data segment.

  The NEW and DISPOSE routines can be used to allocate memory within
  the 64K byte or smaller default data segment too, though these are
  not demonstrated here. NEW and DISPOSE do not allocate memory on
  the far/long heap.

  For more information on far heap allocation, see pages 73-76 of the
  "Microsoft Pascal Compiler User's Guide," and the alphabetical
  listing of routines in the "Microsoft Pascal Compiler Reference
  Manual."
 }

 program AllocHeapMemory(input,output);
   const maxsize = 65516; {max size of far heap allocation block}
   type  bigptr_type   = ads of array [wrd(1)..wrd(maxsize)] of byte;
         smallptr_type = ads of array [1..4096] of byte;
   var   bigptr        : bigptr_type;           {pointer to 64K block}
         smallptr      : smallptr_type;         {pointer to 4K  block}
         {define arrays of pointers}
         arrbigptr     : array [1..50]   of bigptr_type;
         arrsmallptr   : array [1..1000] of smallptr_type;
         retcode       : word;            {return code from fremqq   }
         bigallocs,                       {number of big  allocations}
         smallallocs,                     {number of small allocs    }
         i             : integer;         {index to array of pointers}
         goodsmallptrs,                   {to indicate errors from   }
         goodbigptrs   : boolean;         {  freeing blocks          }

   {far heap allocation and free routines}
   function allmqq(allocsize : word)   : adsmem; extern; {alloc block}
   function fremqq(ptr       : adsmem) : word;   extern; {free  block}

 begin
   writeln;
   writeln('Allocate and free a single block on far/long heap:');
   bigptr := allmqq(sizeof(bigptr^));
   if (bigptr.r = 0) then
     writeln('Far heap allocation failed due to lack of memory.')
   else
     if (bigptr.r = 1) then
       writeln('Far heap allocation failed due to corrupted memory')
     else
       begin
         write('Segment:Offset of pointer to allocated block is ');
         writeln(bigptr.s:5, ':', bigptr.r:-5);
         {free block}
         retcode := fremqq(bigptr);
         if (retcode = 1) then
           writeln('Error freeing far pointer.')
       end;

   writeln;
   writeln('Begin allocation of 65516 byte blocks in far heap.');
   writeln;
   writeln('Display address of blocks allocated:');
   i := 1;
   bigallocs := 0;
   arrbigptr[i] := allmqq(sizeof(arrbigptr[i]^));
   while (arrbigptr[i].r <> 0) do
     begin
       write('Segment:Offset = ');
       writeln(arrbigptr[i].s:5, ':', arrbigptr[i].r:-5);
       bigallocs := bigallocs + 1;
       i := i + 1;
       arrbigptr[i] := allmqq(sizeof(arrbigptr[i]^))
     end;

   writeln;
   writeln('No more large blocks available in far heap.');
   writeln('Allocate 4K blocks -- notice that near heap is used');
   writeln('after far heap is exhausted as shown by pointers to');
   writeln('blocks in lower memory');
   writeln;
   writeln('Display address of blocks allocated:');
   i := 1;
   smallallocs := 0;
   arrsmallptr[i] := allmqq(sizeof(arrsmallptr[i]^));
   while (arrsmallptr[i].r <> 0) do
     begin
       write('Segment:Offset = ', arrsmallptr[i].s:5, ':');
       writeln(arrsmallptr[i].r:-5);
       smallallocs := smallallocs + 1;
       i := i + 1;
       arrsmallptr[i] := allmqq(sizeof(arrsmallptr[i]^))
     end;

   writeln;
   writeln('Far and near heap allocated. Now free blocks:');
   goodbigptrs := true;
   {free large blocks in far/long heap}
   for i := 1 to bigallocs do
     begin
       retcode := fremqq(arrbigptr[i]);
       if (retcode <> 0) then
         begin
           goodbigptrs := false;
           write('Bad pointer segment:offset at ');
           writeln(arrbigptr[i].s:5, ':', arrbigptr[i].r:-5)
         end
     end; {for}
   if (goodbigptrs) then
     writeln('Large blocks freed without error.');

   {free small blocks in far and near heap}
   goodsmallptrs := true;
   for i := 1 to smallallocs do
     begin
       retcode := fremqq(arrsmallptr[i]);
       if (retcode <> 0) then
         begin
           goodsmallptrs := false;
           write('Bad pointer segment:offset at ');
           writeln(arrsmallptr[i].s:5, ':', arrsmallptr[i].r:-5)
         end
     end; {for}
   if (goodsmallptrs) then
     writeln('Small blocks freed without error.');

   writeln;
   writeln('Program completed. Good-bye.')
 end.


 192. Pascal 4.00 TMP Varible Setting Causes "Line invalid" Error

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist4.00
 Last Modified: 26-SEP-1988    ArticleIdent: Q35813

 The TMP environment variable set to C:\C\TMP causes the pl driver to
 fail when one or more options other than /c is given.

 The following is an example:

 pl /Zi /Pd foo.pas

 The result is as follows:

 Line invalid: 'junk', start again.
 Source filename [.PAS] :

 Microsoft has confirmed this to be a problem in Version 4.00. We are
 researching this problem and will post new information as it becomes
 available.

 The workaround to this problem is to change the TMP variable setting.


 193. The Standards to which MS Pascal Conforms

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-OCT-1988    ArticleIdent: Q36802

 The ISO standard ISO 7185 for Pascal has two levels, 0 and 1. Level 0
 is identical to the ANSI/IEEE Pascal standard. Pascal Version 4.00
 supports the ANSI/IEEE Pascal standard, so Microsoft also supports ISO
 level 0.

 Note: level 1 of ISO is level 0 plus conformant array parameters.



 194. Pascal Versions 3.3x and Later Support Linker /STACK Switch

 Product Version(s): 3.2x 3.3x 4.00 | 4.00
 Operating System:   MS-DOS         | 4.00
 Flags: ENDUSER | s_link
 Last Modified: 24-OCT-1988    ArticleIdent: Q37207

 Microsoft Pascal, Versions 3.2x, do not support the linker switch
 /STACK for changing the stack size at link time. This option is
 supported in Versions 3.3x and later.

 In Versions 3.2x, a program was set to provide a variable size stack.
 Setting a stack size with the linker switch, and then having that size
 changed by a program, could cause unpredictable results. For this
 reason, you should not use the /STACK switch. This information is
 documented in the note at the bottom of Page 66 in the "Microsoft
 Pascal User's Guide" for Versions 3.2x and later.

 In Versions 3.3x and later, the stack size is fixed by the compiler.
 Therefore, changing stack size when linking is safe. The documentation
 note on Page 66 in the user's guide for Versions 3.3x and 4.00 is
 outdated. You will find more information on the /STACK linker switch
 in the README.DOC file that comes with Versions 3.3x and on Page 270
 in the "Microsoft CodeView and Utilities" manual that comes with
 Version 4.00.


 195. Error R6009 Not Enough Space for Environment in Pascal

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# S881020-4
 Last Modified: 12-FEB-1990    ArticleIdent: Q37217

 Question:

 I receive the following error at run time (or as I walk through the
 startup code in CodeView):

    R6009  not enough space for environment

 How can I remove this error?

 Response:

 The startup code loads the environment strings into the near heap.
 This behavior may cause the program to run out of heap space if you
 have a large amount of data or if your stack is large. Essentially,
 you are running out of space in DGROUP. To correct this problem,
 insert the following two procedures into the same module that defines
 the main program:

    procedure _setargv [public, c];
    begin
    end;

    procedure _setenvp [public, c];
    begin
    end;

 You will need to link with the /NOE option so that you do not get
 multiple definitions of these two routines.

 Note: This is basically a Pascal translation of the procedure
 described on Page 131 of the "Microsoft C Optimizing Compiler User's
 Guide" for Versions 5.00 and 5.10.


 196. Determining Available Memory

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified:  8-NOV-1988    ArticleIdent: Q37610

 Page Update-45 (section 5.3) of the "Microsoft Pascal Compiler for MS
 OS/2 and MS-DOS Operating System Version 4.0 Update" manual
 incorrectly states the following:

    FREECT(0) * 2 - MEMAVL returns the number of free bytes in the
    heap itself.

 This should read as follows:

    FREECT(0) * 2 returns the number of free bytes in the heap
    itself.


 197. Using packed Type Has No Effect on Variable's Storage.

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | sizeof
 Last Modified: 23-NOV-1988    ArticleIdent: Q38165

 In Microsoft Pascal, packed type will not affect storage of the
 variables with the packed type. This is specified in the "Microsoft
 Pascal Compiler User's Guide." (See section 9.2 Internal Representation
 of Data Type.) Therefore, the "sizeof" function will return unpacked
 size. The following is an example:

 Type
     packed_type = packed array [1..9] of byte ;
     unpacked_type = array [1..9] of byte ;
 var
     var1 : packed_type ;
     var2 : unpacked_type ;

 'var1' and 'var2' both occupy 10 bytes in memory.

 In Microsoft, storage of variables is word aligned.

 A component of a packed structure cannot be passed as a reference
 parameter unless the structure is of a string type. Therefore,
 following usage of sizeof function is illegal.

 The following is an example:

 var
     var_arr: packed array [1..10] of unpacked_type ;
 begin
     sizeof (var1[1]) ;
 end.


 198. Pascal Version 4.00 Can't Watch lstring in CodeView

 Product Version(s): 4.00    | 4.00
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER | s_CodeView
 Last Modified: 23-NOV-1988    ArticleIdent: Q38300

 The Microsoft CodeView debugger Version 2.20 does not allow watching a
 lstring variable directly. The command "w ? lstr_var" responds with a
 "?CANNOT DISPLAY" message. The workaround is to use the "wa a l10".
 This is the watch ASCII expression at address lstr_var with a length
 of 10.

 The "w ? lstr_var" instruction was not implemented in CodeView Version
 2.20.


 199. CodeView Does Not Watch Non-Zero Based Arrays Correctly

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | S_Codeview
 Last Modified:  2-MAR-1989    ArticleIdent: Q40382

 Problem:

 I have written a program that defines an array with a non-zero base.
 The following is an example:

    data : array[2..5] of integer;

 In CodeView, I do not see the correct values when I set a watch on
 elements of this array.

 Response:

 This is a problem with the symbolic information generated by the Pascal
 compiler. Given the information passed to it, CodeView determines that
 all Pascal arrays have a base of zero -- even when they don't.

 A workaround to this problem is to adjust for this miscalculation by
 offsetting the index of any watched array so that its effective base
 is zero. For example, given the array defined above, you would
 actually set a watch on data[1] to watch data[3]. To watch data[x],
 set a watch on data[x-2].


 200. "Unresolved Externals" from DOSCALLS.LIB under OS/2.

 Product Version(s): 4.00
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 23-NOV-1988    ArticleIdent: Q38357

 When compiling and linking in protected mode under OS/2 and using any
 systems calls, it is necessary to use the /Lp switch to bring in the
 library DOSCALLS.LIB. Attempting to use routines from DOSCALLS.LIB
 without using the /Lp switch results in the error "L2029: unresolved
 externals." This error occurs because the linker only brings in the
 standard Pascal library when you do not specify the /Lp switch. An
 alternate solution is to link separately, and specify both
 LIBPASEP.LIB and DOSCALLS.LIB on the link line.

 For example, to compile and link the file "EXAMPLE.PAS" for OS/2
 protected mode, use one of the following commands:

    PL /Lp EXAMPLE.PAS

    PL /c EXAMPLES.PAS
    LINK EXAMPLES.OBJ,,,LIBPASEP.LIB DOSCALLS.LIB


 201. Enumerated Types Input/Output as String Is Not Implemented

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 14-FEB-1991    ArticleIdent: Q38393

 The sample program below uses the write format P::1 described on page
 284 of the "Microsoft Pascal Reference Manual" to output an enumerated
 type variable as a string. The program generates the following
 run-time error:

    ? Error: Data format error in file USER
      Error Code 1125

 The reading and writing of enumerated types is not possible in
 Microsoft Pascal. This limitation is explained in the "Microsoft
 Pascal User's Guide," Appendix B.3, "Unimplemented Features."

 The following is a sample program:

 (* Sample program *)
 program enumtype (input, output) ;
 type
     enumtype = (abc, xyz) ;
 var
     evar : enumtype ;

 begin
     evar := abc ;
     writeln(evar::1) ;  (* attempt to output 'abc' *)


 202. Error 133 Type Size Overflow with /Zi or /Z.

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 28-NOV-1988    ArticleIdent: Q38474

 Page 231 of the "Microsoft Pascal User's Guide" defines the "133 Type
 Size Overflow" error as follows:

    "The data type declared implies a structure bigger than the maximum
    of 65534 bytes"

 Pascal does not support data structures larger than 64K. However, this
 error sometimes occurs only when a program is compiled with the
 CodeView switches /Zi (for the PL driver) or /Z (for the PAS1 driver).
 This behavior occurs when a reference is made to a data structure that
 exceeds 64K in size, but the structure is never initialized and no
 memory allocation is made in the code.

 For example, the following line of code compiles with no errors if the
 CodeView switch is not used; however, it generates "133 Type Size
 Overflow" if the /Z or /Zi switch is used:

    XPTR:   ADS OF ARRAY [0..37500] OF REAL;

 This error occurs even if no allocation or initialization of the array
 occurs. If the structure itself is declared as follows, or if an
 attempt is made in the program to allocate memory for the array, the
 error occurs at compile time, regardless of the combination of
 command-line switches used:

    X : ARRAY [0..37500] OF REAL;

 Apparently, using the /Zi or /Z switch causes the compiler to check
 the referenced data type more closely, and detect the error before the
 allocation is actually made.


 203. Printing Formfeeds in Pascal

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  2-MAR-1989    ArticleIdent: Q40078

 Problem:

 I'm sending output to my printer in Pascal. When my application is
 finished, I send a form feed to reset the page, but when I close the
 printer file, I get an extra line feed. The following code produces
 the problem:

     program printage(output);

     var filevar : text;

     begin

         assign(filevar, 'prn');
         rewrite(filevar);

         writeln(filevar, 'This is the first line!');
         write(filevar, chr(12));

         close(filevar)

     end.

 Response:

 By default, Pascal's file system uses records ending with LF. When
 the printer file from the Pascal source above is closed, a linefeed
 is appended to the file automatically to terminate the record that has
 been started, i.e., the single formfeed character.

 A simple solution to this situation is to not close the printer file.
 Normal files are closed by the exit code, but device files are handled
 differently, and will not have any unfinished records terminated.


 204. Printf() Example Is Wrong in Mixed-Language Guide

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr s_c h_fortran h_masm
 Last Modified:  7-MAR-1990    ArticleIdent: Q58178

 The sample program TEST on Page 135 of the "Microsoft Mixed-Language
 Programming Guide" is incorrect, not only in syntax but also in its
 functionality.

 The program is presented to demonstrate the use of the VARYING
 attribute, which allows you to call functions from the C run-time
 library with a different number of arguments each time. This is
 demonstrated in this case by calling the C run-time function printf()
 directly from Pascal.

 However, the TYPE declaration and the three assignment statements in
 the main program body are syntactically incorrect. Replace the colon
 (:) in the "TYPE stype30 : string(30)" statement with an equal sign
 (=), and replace each of the equal signs in the assignment statements
 with Pascal assignment operators (:=).

 After correcting the syntax errors, the program still will not work.
 When linked with the large model C run-time library LLIBCE.LIB, it
 will return an incomplete string under DOS and will cause a
 protection violation under OS/2.

 For this program to work correctly, the argument(s) passed to printf()
 must be ADS pointers of type ADSMEM. ADSMEM is a predefined address
 type, which is equivalent to a far pointer type in C. When the ADS
 pointer type is used, the full segment:offset addresses of the strings
 are passed. The following is the corrected version of the program:

 Code Example
 ------------

 program Test(input,output);
 type
         stype30 = string(30);

 var
         str1 : string(30);
         str2 : string(10);
         n    : integer;

 procedure printf (s1 : ADSMEM) [C, VARYING]; extern;
 begin
         str1 :='This is %s string, number %d.' * chr(0);
         str2 :='formatted' * chr(0);
         n := 1;
         printf(ADS str1, ADS str2, n);
 end.

 This code runs correctly under DOS and OS/2. The output is as follows:

    This is formatted string, number 1.


 205. Using a function to set the offset of a ptr is unreliable

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | pointers offset
 Last Modified:  2-MAR-1989    ArticleIdent: Q40483

 The use of a function to change the offset of a pointer does not
 always work reliably. If used within a decision structure, such a
 function does not return the expected value. However, if assigned to a
 pointer, and then used within a similar decision structure, the
 function returns the proper offset. Although the function returns the
 expected offset when assigned to a pointer, it does not actually alter
 the offset of the pointer within the function.

 The following code sample exhibits this performance:

 PROGRAM pointertest(output);

 TYPE
   ptrtyp = ADS OF WORD;

 FUNCTION get_ptr : ptrtyp;
 {  This function will return an offset of 1, however get_ptr.R will
    never actually be set to 1 }
 Begin
   get_ptr.R := 1;
 End;

 VAR
   ptr : ptrtyp;

 BEGIN
   if get_ptr.R = 0 then     ! Because get_ptr never actually sets
                             ! the offset to 1, this comparison fails;
     writeln ('Returned 0')
   else
     writeln ('It worked!');
   writeln;
   ptr := get_ptr;           ! however, because get_ptr returns a
                             ! proper value, the following decision
   if ptr.R = 0 then         ! structure fuctions as expected.
     writeln ('Improper operation')
   else
     writeln ('This should work properly.');
 END.


 206. Example on Page 16 of Pascal Utilities Manual Is Incorrect

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified:  2-MAR-1989    ArticleIdent: Q41221

 The example on Page 16 of the "Microsoft Pascal 4.0 Compiler Microsoft
 CodeView and Utilities and Microsoft Editor" manual is incorrect. The
 command line: PL /Zi /c TEST does not produce an object file because
 no .PAS extension was given. To work around the problem, add the .PAS
 extension.


 207. Include Files Not Handled as Documentation Describes

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 28-MAR-1989    ArticleIdent: Q42238

 Page Update-34 of the "Microsoft Pascal 4.0 Compiler User's Guide" states
 the following:

    When you use the $INCLUDE metacommand, the compiler looks for the
    specified file in this order:

    1. The specified directory, if you give a complete path name

    2. The current working directory

    3. Each directory listed in the INCLUDE environment variable

    For example, suppose that your source file contains the following
    metacommand:

        $INCLUDE \PAS\IAS

     In addition, the INCLUDE environment variable is set as below:

        C:\INC;C:\PAS\INC

     In this case, the compiler attempts to find the file IAS by
     searching directories in this order:

     1. The \PAS option on the current drive

     2. The current working directory

     3. The \INC option on drive C

     4. The \PAS\INC option on drive C

 There are a couple of problems with these statements.

 First, the proper syntax for an INCLUDE metacommand is as follows:

    { $INCLUDE: '\PAS\IAS' }

 Second, the specified directories is NOT searched. Because \PAS\INC
 fully qualifies the include file pathname, it only is found if INC is
 in the PAS directory immediately off the root. In the four cases
 above, the filespec actually searched for will be as follows:

 1. \PAS\IAS                     (This is correct)

 2. \PAS\IAS                     (Not starting at CWD)

 3. \INC\\PAS\IAS                (Violates DOS pathname spec)

 4. \PAS\INC\\PAS\IAS            (Violates DOS pathname spec)

 The directories would be properly searched if the include file IAS was
 not fully qualified.


 208. SORTDEMO Needs to Be Bound in Order to Run in DOS

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  6-APR-1989    ArticleIdent: Q42944

 Question:

 Why do I get the following message from the Pascal compiler while
 trying to compile SORTDEMO.PAS in DOS?

    File Access Error In os2.int; code: 1140; Status: 110
    Compiler cannot continue

 Response:

 In order to be able to run SORTDEMO.PAS in DOS, you must BIND it. You
 will not have the necessary files to compile and BIND SORTDEMO if you
 set up for DOS only.

 OS2.INT is the include file that SORTDEMO.PAS uses. If you have not
 set up the Pascal compiler for OS/2, the OS2.INT file will not be
 copied to the hard disk during setup. Therefore, the compiler will not
 be able to open this file and will generate the error mentioned above.


 209. fremqq Fails to Free Memory Block

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS-2
 Flags: ENDUSER |
 Last Modified: 28-MAR-1989    ArticleIdent: Q42765

 The following PASCAL program will not produce correct results under
 DOS, and causes a GP fault in OS/2. The program allocates a block of
 memory using the allmqq function, and then frees it using fremqq.

 Under DOS, the memory is never really freed, even though the fremqq
 returns a 0, indicating the free was successful. In OS/2 protect mode,
 a GP fault is generated immediately upon execution of the program.

 To prevent the problem, change the following statement:

     IF (ads0 <> ads out_im[1])
        THEN ww := fremqq (ads0);

 to the following:

     IF (ads0 <> ads out_im[1])
        THEN BEGIN
                 IF TRUE THEN ;
                 ww := fremqq (ads0);
             END;

 Also, a "WRITELN(' ');" statement will work in place of the dummy IF
 statement, as well. A "WRITE;" will NOT work. Also, installing the
 PASCAL 4.00 lstring patch has no effect.

 Microsoft has confirmed this to be a problem in Pascal Version 4.00.
 We are researching the problem and will post new information as it
 becomes available.

 The complete program is as follows:

 PROGRAM memtest (INPUT, OUTPUT);

 FUNCTION allmqq (wants : WORD) : adsmem ; EXTERNAL;
 FUNCTION fremqq (block : adsmem) : WORD ; EXTERNAL;

 VAR [PUBLIC]
     out_im : LSTRING (128);

 PROCEDURE insert_bchrec2 (CONST bytes : INTEGER4) [PUBLIC];

 VAR
    ads0     : adsmem;
    ww       : WORD;

 VAR [STATIC]
    buffersize : WORD;
    VALUE buffersize := 65408;

 BEGIN
     ads0.r := 0;

     WHILE ((buffersize >=128) AND (ads0.r <= 1)) DO
         BEGIN
             ads0 := allmqq(buffersize);
             IF (ads0.r <= 1)
                THEN buffersize := buffersize - 128;
         END;

     IF (ads0 <> ads out_im[1])
         THEN ww := fremqq (ads0);

     WRITELN (buffersize:1, ',',ads0.s:1,',',ads0.r:1,',',ww:1);

 END;

 BEGIN
     FOR VAR ii := 1 TO 50 DO
         BEGIN
             WRITE (ii:3,': ');
             insert_bchrec2(0);
         END
 END.



 210. Prsrqq() and Prdrqq() prototypes not documented correctly

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist4.00
 Last Modified:  6-APR-1989    ArticleIdent: Q43044

 Prsrqq() and prdrqq(), as documented on Page 249 of the Version 4.00
 "Microsoft Pascal Compiler Reference Manual," should return the first
 argument to the power of the second argument. When compiled, linked,
 and run, the code below generates a general protection fault in OS/2
 and, in DOS, generates the following error message:

 ? Error : negative REAL to REAL power
   Error Code 2133

 To correct the problem you must change the function prototype
 from:

 function prsrqq(a,b:REAL4):REAL4;EXTERN;

 to:

 function prsrqq(consts a,b:REAL4):REAL4;EXTERN;



 211. Pascal: Bad Code Produced by Union of Sets

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist4.00
 Last Modified:  3-MAY-1989    ArticleIdent: Q43509

 The Microsoft Pascal Version 4.00 Compiler will generate incorrect
 code for the line containing the union and assignment in the program
 fragment below. The problem will arise only if the sets that are
 unioned contain less than 16 elements and the set receiving the union
 has greater than 16 elements.

     TYPE
         SSet = SET OF 1..8;     (* Must have fewer than 16 elements. *)
         LSet = SET OF 1..16;    (* Must have 16 or more elements.    *)

     VAR
         Set1  : SSet;
         Set2  : SSet;
         Union : LSet;

     BEGIN
         Set1 := [1..3];
         Set2 := [5..7];

         Union := Set1 + Set2;   (* Trouble right here! *)
     END.

 The union in this example is done properly in a single register, but
 its assignment to a variable requiring more than a word is incorrect.
 Under DOS, this will create an inaccurate assignment. Under OS/2, the
 assignment also will be inaccurate and may cause a GP fault.

 A pair of temporary variables that are the same size as the variable
 receiving the union can be used to work around the problem. First,
 assign the two smaller sets to the temporary variables, then use the
 temporary variables in the union.

 Microsoft has confirmed this to be a problem in Version 4.00. We are
 researching this problem and will post new information as it becomes
 available.


 212. Setup Fails When Installing Libraries for Windows Programming

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist4.00
 Last Modified:  3-MAY-1989    ArticleIdent: Q43973

 If the Pascal 4.00 Setup program is invoked with the /L switch to
 install libraries, and you select "Remove stack segment for Windows
 compatibility", Setup will fail. Setup will ask for the Libraries 1
 disk, and upon copying the six necessary files, it will ask again for
 the same disk. Whether you remove the disk, or try other disks, Setup
 continues to ask for the Libraries 1 disk.

 The workaround is to install the libraries without Windows
 compatibility, and make the changes manually. After building the
 library, copy the file ENTX6W.OBJ from the disk marked "Libraries 1"
 into your LIB directory. Change to your LIB directory, and type "LIB
 LIBPASE.LIB". The LIB utility will start and prompt you with the
 following:

    Operations:

 Type "-ENT6L.OBJ+ENTX6W" at this prompt, and press ENTER. Press ENTER
 twice more after this. LIB will convert your library for use with
 Windows programming.

 Microsoft is researching this problem and will post new information as
 it becomes available.


 213. Pascal Runs Out of Memory Compiling a Unit

 Product Version(s): 4.00  | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | SR# G890725-23266 buglist4.00
 Last Modified: 26-SEP-1989    ArticleIdent: Q47743

 When compiling the following Pascal unit with the command line

    pl /c /Zi newbits.pas

 the error "Error:  Compiler Out Of Memory" occurs.

 To work around the problem, use one of the following command lines:

    pl /c newbits.pas
    pl /c /Zd newbits.pas

 Including the /Zd option gives line number information that will help
 make debugging in CodeView a little easier.

 The following is the source code for the unit that demonstrates the
 problem:

 *** FILE NEWBITS.PAS ***

 {$include: 'newbits.INT'}
 {$message: 'newbits.PAS'}

 implementation of newbits;

 {$message: '1'}

 var MACHT2_TABEL: array [bit_NR] of Byte;

 {$message: '2'}

 function MACHT2;

 {$message: '3'}

 begin
 {$message: '4'}
   MACHT2:=MACHT2_TABEL[exponent];
 {$MESSAGE: '5'}
 end; {MACHT2}

 {$MESSAGE: '6'}

 procedure SET_BIT {var B:byte; BN:BIT_NR; STATUS:SWITCH};

 begin if not (status = bit_status(b,bn)) then
       begin case status of
              off: B:= B and not macht2_tabel[BN];
              on : B:= B or macht2_tabel[bn]
             end
       end
 end; {setbit}

 function BIT_STATUS {b:byte; BN:BIT_NR):switch};

 begin if (b and macht2_tabel[bn]) = 0 then bit_status := off
                                       else BIT_STATUS := on
 end; {bit_status}

 {$message: '7'}

 {$message: '8'}
 begin {newbits}
       macht2_tabel[0] :=    1;
       macht2_tabel[1] :=    2;
       macht2_tabel[2] :=    4;
       macht2_tabel[3] :=    8;
       macht2_tabel[4] :=   16;
       macht2_tabel[5] :=   32;
       macht2_tabel[6] :=   64;
       macht2_tabel[7] :=  128;

       Nil_adr.R:= 16#0000;

       NIL_ads.S:= 16#0000;
       NIL_ADS.S:= 16#ffff
 end. {newbits}

 *** FILE NEWBITS.INT ***

 {$message: 'newbits.int'}

 interface;

 unit newbits(MAX_BIT_NR,
               SWITCH, OFF, ON,
               BIT_NR,
               SEG_ADDRESS, REL_ADDRESS,
               NIL_ADR, NIL_ADS,
               MACHT2,
               SET_BIT, BIT_STATUS);

 const MAX_BIT_NR = 7;

 type SWITCH = (OFF,ON);

      BIT_NR = 0..MAX_BIT_NR;

      SEG_ADDRESS = ADS OF SEG_ADDRESS;
      REL_ADDRESS = ADS OF REL_ADDRESS;

 var NIL_ADR: REL_ADDRESS;
     NIL_ADS: SEG_ADDRESS;

 function macht2(exponent:BIT_NR):BYTE ;

 procedure SET_BIT(VAR B:BYTE; BN:BIT_NR; STATUS:SWITCH);

 FUNCTION BIT_STATUS(B:BYTE; BN:BIT_NR):SWITCH;

 BEGIN {newbits}
 END; {newbits}


 214. Add Path to Data Filename for Pascal Debugging with CVP2.2

 Product Version(s): 4.00
 Operating System:   OS/2
 Flags: ENDUSER | S_CodeView
 Last Modified: 19-MAY-1989    ArticleIdent: Q44032

 The version of CodeView Protect (CVP) mode that comes with Pascal 4.00
 (i.e., CVP 2.20) does not know where the current working directory is
 located as a result of using the DosStartSession API from OS/2 Version
 1.00, which did not provide this information. With OS/2 Version 1.10's
 DosStartSession, the path of the current working directory would be
 known, but CVP Version 2.20 does not make use of it. Later versions of
 CVP provided with the OS/2 Software Development Kit, such as CVP
 Version 2.30 from OS/2 SDK Version 1.06, do not support Pascal Version
 4.00.

 If you have access to a second monitor the problem goes away with
 the /2 option.

 The following example allows the current working directory, or any
 other path on the current drive, to be defined with the compiler
 option /Ddatafilename=<path>, where <path> is the path to the data
 file to be opened.

 Note: A colon cannot be used in the defined constant for <path>,
 although another symbol could be used and replaced in the {$ifdecl}
 block within the program.

 This program allows the data file's path to be coded into the .EXE so
 that it may be found when debugging the program with CVP 2.20.

 {   Program to prepend path to data filename using compile line
     defined constant "datafilepath", using /Ddatafilepath=\path...
     (Note that path cannot include a colon for a drive letter.)

     This program helps overcome a limitation of CVP 2.20 for Pascal 4.00
     under either OS/2 1.00 or 1.10 of not knowing where the current
     working directory is located, especially if the current directory
     contains the data file in question. An alternative would be to
     hard code the path in the data filename, or debug with all files
     in the root directory of the boot drive.
 }

 program FilePathName(input,output);
 var filevar  : text;          {data text file variable}
     filename,                 {optionally fully qualified file name}
     data     : lstring(80);   {for data to read from file}

 begin
     filename := 'foo';

     {$ifdecl datafilepath $then}
         insert ('\', filename, 1); {insert path in front of file name}
         insert (datafilepath, filename, 1);
     {$end}

     writeln('filename = ',filename);

     {assign file name to file variable, open, read from & close file}
     assign(filevar,filename);
     reset(filevar);
     readln(filevar,data);
     writeln('read file, data = ',data);
     close(filevar);
 end.


 215. Different ADR Types and Different ADS Types Not Compatible

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 25-MAY-1989    ArticleIdent: Q44561

 Pascal is ordinarily a strongly typed language, but for ADR or ADS
 address types, Pascal assures only that they are both ADR or both ADS.
 However, Page 108 of the "Microsoft Pascal Reference Manual" for the
 Microsoft Pascal Compiler Version 4.00 is incorrect when stating the
 following:

    ...If P1 is type ADR OF STRING(200) and P2 is any ADR OF type, the
    assignment P1^:=P2^ generates fast code with no range checking.
    Although this capability is not safe, operating systems and other
    software sometimes require it.

 This statement is not correct. Address types can be assigned to each
 other regardless of the data type they point to as long as they are
 both ADR or ADS address types; however, the data they refer to with
 the caret (^) may not be freely assigned to a different type.

 For the address variables P1 and P2 above, assigning one address type
 to another as in the following statement would be correct:

    P1 := P2;  (* ADR := ADR is correct *)

 As with other incompatible data-type assignments in Pascal, a
 data-type conversion function must be used before the assignment is
 made. For the data types referred to by P1 and P2, a correct
 assignment would be as follows:

    P1^[1] := chr(P2^);

 P1^[1] is a single char element of the string referred to by P1, and
 the Pascal chr function converts the data type referred to by P2 to
 the char type that is compatible with a string element.

 The following program demonstrates the ADS OF type incompatibility and
 the associated error message (also produced for ADR OF types):

  program main(input,output);
  var
     p1 : ads of string(200);
     p2 : ads of word;
  begin
     p1^ := p2^;
  end.

 Microsoft (R) Pascal Compiler
 Version 4.00
 (C) Copyright Microsoft Corp 1987-1988. All rights reserved.
     11      9       p1^ := p2^;
             9   -------------^201 Types Not Assignment Compatible
  Pass One     1 Errors Detected.


 216. Program Fails to Receive First Character of Arguments

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 26-SEP-1989    ArticleIdent: Q47817

 When passing command-line arguments into a Pascal program, the first
 character of the first argument is lost if a space is not used as the
 delimiter. Pascal has built-in routines for reading and parsing
 command line arguments. These routines ignore the first character of
 the argument tail (usually the space delimiter).

 This problem appears to be an oversight of the Pascal start-up code.
 The start-up code parses the argument tail with the assumption that
 the first character is always a space. This works in most cases
 because options are usually separated from the program name with a
 space character. However, to pass arguments into a program without
 using the space delimiter. The "/" delimiter is an example that
 exhibits the problem.

 Another way this problem can occur is by spawning or execing the
 Pascal program from within another application. Arguments that are
 passed with spawn/exec are specified in an argument list. This
 argument list does not normally have a space as the first character.
 The arguments begin without any delimiter, and therefore, Pascal loses
 the first character of the first argument.

 Microsoft is researching this problem and will post new information as
 it becomes available.


 217. Additional Explanations of File System Errors 1030 to 1048

 Product Version(s): 3.30 3.31 3.32 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 18-SEP-1989    ArticleIdent: Q45181

 The following are additional potential or actual explanations for the
 list of file-related run-time errors in Appendix F.4.1, Pages 259-60,
 of the Version 4.00 "Microsoft Pascal Compiler for the MS-DOS
 Operating System User's Guide":

    Error                 Potential or Actual Cause
    -----                 -------------------------

    1030 File system      Misc., see paragraphs below
    1031 Operation        Current user is not owner
    1032 File not found   No such file or directory
    1033 File not found   No such process
    1034 File system      Interrupted system call
    1035 Protected file   Input/Output error
    1036 File system      No such device
    1037 File system      Argument/assignment too long
    1038 File system      Executable file format error
    1039 File system      Bad file number
    1040 File system      No child process
    1041 Data format      No more processes
    1042 File system      Not enough space
    1043 Data format      Permission denied
    1044 File system      Bad address
    1045 Unknown device   Block device required
    1046 File system      Device busy
    1047 File system      File exists
    1048 File system      Cross-device link

 Note: The above explanations may not be completely accurate for every
 occurrence of their associated error, but they are usually correct.

 Run-time error 1030 can occur for a variety of reasons. It is a
 nonspecific file-handling error that does not fit exactly with any
 one of above categories each time it occurs. However, it does occur
 for one or more of the reasons listed above, or because of not having
 enough file handles in DOS.

 The number of file handles can be increased from the default of 8 to
 20 or more, for many implementations of DOS Versions 3.3x and 4.x,
 with the "FILES=" statement followed by a specified number of file
 handles in the root directory file CONFIG.SYS.


 218. Accessing PSP and Command-Line Arguments in Pascal

 Product Version(s): 3.30 3.31 3.32 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified:  7-JUN-1989    ArticleIdent: Q45197

 The Pascal public variable "cesxqq" provides the Program Segment
 Prefix (PSP) of the application and is equivalent to the Microsoft C
 variable "_psp". The Version 4.00 "Microsoft Pascal Compiler for the
 MS-DOS Operating System User's Guide" documents "cesxqq" on Page 163.

 Please note that the information regarding "cesxqq" on Page 164 of the
 above manual is entirely correct. Its use of the variable "LOMADS"
 gives only an approximate value for the beginning of the available far
 (or long) heap. Its use of the variable "HIMADS" appears incorrect due
 to the light print of the caret "^" following "MSDATA" in the
 statement that should appear as in the following:

    HIMADS.S := MSDATA^ ;

 The following is a program demonstrating the use of "cesxqq":

 {   This program uses Pascal's public variable "cesxqq" to find
     the segment containing its Program Segment Prefix under DOS.
     Cesxqq is equivalent to the _psp variable in Microsoft C.

     Due to Pascal's data-type checking, two pointers to
     different data types are used, even though the pointers will
     all point to the PSP's segment.

     PSP offset 128 contains a copy of the program's command
     line arguments. Note: This will be blank unless command line
     arguments are given when the program is invoked.

     PSP offset 2 contains the last segment allocated from DOS
     for this program, which is the top of the near heap.

     For additional information on the PSP, please consult a DOS
     programmer's reference.
 }

 Program GetPointerToPSPsSegment(input,output);
 var PtrCmdLn : ads of lstring(128);  {Far pointer to command line}
     PtrAllocTop : ads of word; {Pointer to last allocated segment}

     cesxqq [extern] : word; {Segment value of Program Segment Prefix}

 begin
     PtrCmdLn.s    := cesxqq; {PSP's segment assigned to ptr's .Segment}
     PtrAllocTop.s := cesxqq;
     PtrCmdLn.r    := 128; {PSP's offset 128 has copy of command line}
     PtrAllocTop.r := 2;   {PSP's offset 2 contains top allocated seg}
     writeln;
     writeln('Command line of program         = ',PtrCmdLn^);
     writeln('Last segment allocated from DOS = ',PtrAllocTop^:6)
 end.


 219. Passing Arguments into a Pascal Program

 Product Version(s): 3.30 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 26-SEP-1989    ArticleIdent: Q47818

 Microsoft Pascal provides an easy method to pass command-line
 arguments into a Pascal program. One of the functions of the Pascal
 start-up code is to parse the command line for arguments. These
 arguments are then passed into the program just as if they were being
 passed in as parameters, their associated names appearing on the
 PROGRAM line. The parameter types should be specified in the global
 variable section of the program. This is documented starting on Page
 295 of the "Microsoft Pascal 4.00 Reference Manual."

 The parameters "input" and "output" receive special treatment by the
 start-up code and therefore should not be declared in the variable
 section. They should, however, be included in the parameter list.

 Each argument must be of simple type (INTEGER, REAL, etc.) or of
 STRING, LSTRING, or FILE type. All type checking/conversion is
 performed by the start-up code. If arguments are not specified on the
 command line or if the arguments are of the wrong type, you will be
 prompted for the correct argument(s).

 The following program demonstrates the use of command-line arguments:

 PROGRAM Add(input, output, i1, i2, txt);

 VAR
   txt : LSTRING(20);
   i1,
   i2  : INTEGER;

 BEGIN
   writeln(txt,': ',i1+i2);
 END.

 Program execution appears as follows:

 c:\>add 5 10 the sum is
 the sum is:         15


 220. At Sign (@) Same As Caret (^)

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-SEP-1989    ArticleIdent: Q46171

 For keyboards that do not have the caret key (^), the "at" sign (@)
 may be substituted. These symbols are synonymous and will generate
 identical code. The caret sign is used in referencing a file or
 pointer variable.

 The following program demonstrates the use of this symbol:

 PROGRAM foooo (input,output);

 VAR
   f : file of integer;
   x : @integer;        { same as x : ^integer; }

 BEGIN
   new (x);
   x@ := 87;            { same as x^ := 87; }

   assign (f, 'data');
   rewrite (f);

   f@ := x@;            { same as f^ := x^; }
   put (f);
 END.


 221. Accessing Variables Declared in a Pascal Interface File

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 26-SEP-1989    ArticleIdent: Q48280

 Question:

 I am trying to access variables that I have declared in a Microsoft
 Pascal Version 4.00 interface file. Pages 142 and 306 of the
 "Microsoft Pascal Reference Manual," imply that variables declared in
 an interface file are automatically given the PUBLIC attribute. Does
 this mean that I can declare the variables in my interface file,
 include that interface file in my main and implementation files, and
 with the USES statement in my main file I will then have access to
 those variables? When I try to do this I receive compiler errors in
 both the main and implementation files, indicating that the variable
 is an unknown symbol.

 Response:

 The documentation is incorrect in this case. The only way to make
 variables declared in an interface file global and accessible to the
 main and implementation files is to include the variables in the
 constituent list along with the procedures and functions.

 The following code gives an example of declaring a function and a
 variable in an interface file and the usage of the implementation
 file:

 Interface File
 --------------

 INTERFACE;
 UNIT TESTUNIT (known,n);  { variable and function in the constituent list }
 VAR  n : INTEGER;         { variable to be made global }
 FUNCTION known : BOOLEAN; { function to be made global }
 BEGIN
 { BEGIN implies initialization code in the implementation file }
 END;

 Implementation File
 -------------------

 {$INCLUDE:'INTER'}
 IMPLEMENTATION OF TESTUNIT;

 FUNCTION known; { note that parameters and attributes are NOT listed again }
 BEGIN
     known := TRUE;
 END;

 { initialization code }
 BEGIN
     n := 10;
 END.

 Main File
 ---------

 {$INCLUDE:'INTER'}
 PROGRAM test(input,output);
 USES TESTUNIT (known,n);

 BEGIN
     if (n = 10) then          { n is declared in the interface file and }
         writeln('10')         { initialized in the implementation file }
     else
         writeln('unknown');
     if known then             { known is also from the interface and }
         writeln('known')      { implementation files }
     else
         writeln('unknown');
 END.

 This is compiled by the following:

    pl mainprogram.pas implementation.pas

 When the program is run, the following is output to the screen:

    10
    known

 More information on using Units and Interfaces can be found in the
 "Microsoft Pascal Reference Manual" starting on Page 300. Additional
 information on "Units and Interfaces: Examples" is available as an
 application note and can be requested by calling the the Microsoft
 Product Support at (206) 454-2030.


 222. The /Fl Switch Is Not Recognized in the Environment Variable

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1989    ArticleIdent: Q48841

 To produce a source listing for your program with the Microsoft C Compiler,
 you can specify the /Fs switch in the CL environment variable.
 However, if you try to specify the /Fl switch with Pascal Version 4.00
 in the PL environment variable, the compiler just ignores the switch.

 PL's /Fl switch does not behave the same as CL's /Fs switch. The PL
 driver ignores the /Fl switch if it is specified in the PL environment
 variable. Another difference is that the /Fl applies only to the first
 Pascal source file that follows the option. It must be used once for
 each source file that you want listed. The /Fs switch for the CL
 driver creates source listings for all source files.

 The following command produces a source listing for test1.pas only:

    PL /Fl test1.pas test2.pas

 To produce a source listing for both source files, give the following
 command:

    PL /Fl test1.pas /Fl test2.pas


 223. Long Strings Displayed Incorrectly in Debug Window

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 10-OCT-1989    ArticleIdent: Q49115

 If a string is so long that it cannot be displayed in the
 255-character line allowed in the debug window, the string is
 truncated. QuickPascal should place ellipses (...) at the end of a
 truncated string to make it clear that the line was truncated.

 To reproduce this problem, use the following code and follow the steps
 outlined below:

 Code Example
 ------------

 program longexamp;

 var longchar: string[255];

 begin
    longchar := 'This is information being put into a string to ';
    longchar := longchar + 'test Quick Pascal handling long ';
    longchar := longchar + 'strings.  Information could also be ';
    longchar := longchar + 'put into the string using a for next ';
    longchar := longchar + 'loop.  This method is being used, ';
    longchar := longchar + 'however, for simplicity.  The rest ';
    longchar := longchar + 'of this text is merely useless filler ';
    longchar := longchar + 'material of no consequence.  ';
 end.

 Use the following steps to reproduce this problem:

 1. Put a watch on the string longchar using the debug watch window.

 2. Move to the watch window using the F6 key.

 3. Using the arrow keys, place the cursor on the line containing
    "longchar".

 4. Press the END key to move the cursor to the end of the string.

    Note that the line is truncated without ellipses.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 224. "USER" Is Not a Valid Filename

 Product Version(s): 3.20 3.3x 4.00 | 4.00
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER |
 Last Modified: 30-NOV-1989    ArticleIdent: Q49570

 Microsoft Pascal does not open a file if the filename is called
 "USER". The word USER is a special filename that Microsoft Pascal
 recognizes for reading from the keyboard and writing to the screen.

 This is documented on Page 45, Section 5.2, of the "Microsoft Pascal
 Compiler User's Guide".

 The following code demonstrates this feature in Microsoft Pascal:

 program File_test;

 var fh : Text;

 Begin
     assign (fh, 'USER.TXT');
     rewrite (fh);
     writeln (fh, 'This is a test file');
     close (fh);
 End.

 When you run this program, the string 'This is a test file' is printed
 to the screen. The file USER.TXT is not created because USER is a
 special filename that Microsoft Pascal uses to write to the screen.


 225. PASCAL.LIB Does Not Exist in Pascal 4.00

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 30-NOV-1989    ArticleIdent: Q50338

 On Page 30 of the "Microsoft Pascal Compiler for the MS-DOS Operating
 System User's Guide," there is a documentation error for Version 4.00.
 The reference to PASCAL.LIB is correct for Version 3.20 and Version
 3.3x, but should be LIBPASER.LIB for real mode and LIBPASEP.LIB for
 protected mode in Version 4.00.


 226. Pascal 4.00: Compiler Treats Far Index As Near

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist4.00 subscript
 Last Modified:  4-JAN-1990    ArticleIdent: Q51519

 The example below demonstrates a problem when using a far index with
 the Microsoft PASCAL Compiler Version 4.00. The error occurs in
 compiling line 24 of the source file. In that line, IDX is used as a
 memory offset index to the address pointed to by the ADSMEM component
 of FAR_STRING.

 First the ES register is loaded with the segment of FAR_STRING, then
 loaded with the segment to which FAR_STRING.STR_ADS points. The ES is
 loaded with the segment in which IDX is located, without saving the
 previous segment address.

 By the time of the MOV to AL, ES incorrectly points to IDX and so
 cannot correctly access a byte within the FAR_STRING.STR_ADS' memory
 area.

 Changing the index from far to near (VARS to VAR) corrects the
 problem.

 Microsoft has confirmed this to be a problem in Pascal Version 4.00.
 We are researching this problem and will post new information here as
 it becomes available.

 The following code and assembly listing demonstrate the problem:

 Compile options: pl /c /Fc farsub.pas libpas7p.lib

 Source Code
 -----------

 MODULE BUG;

 {$LIST-}          { Set default listing behavior. }
 {$DEBUG-}         { Turn off all debug. }
 {$LINESIZE:132}   { Listing width. }
 {$REAL:8}         { All reals are 8 bytes. }
 {$FLOATCALLS-}    { Inline floating point operations. }
 {$SYMTAB-}

 TYPE
   FAR_STRING_TYPE = RECORD
     MAX_LEN : WORD;
     STR_ADS : ADSMEM;
     STR_LEN : WORD;
     END;

 FUNCTION  FIND_3
  (CONSTS FAR_STRING:FAR_STRING_TYPE;
  VARS IDX:WORD):BOOLEAN;

   BEGIN
   WHILE IDX < FAR_STRING.STR_LEN DO
     BEGIN
     IF FAR_STRING.STR_ADS^[IDX] = 3 THEN
       BEGIN
       BREAK;
       END
     ELSE
       BEGIN
       IDX := IDX + 1;
       END;
     END;
   FIND_3 := TRUE;
   END;

 END.  { MODULE BUG. }

 Object Code
 -----------

 L21:

 Procedure/Function : FIND_3

     ** 000001    PUSH      BP
     ** 000002    MOV       BP,SP
     ** 000004    SUB       SP,0002H
     ** 000008    PUSH      DI
     ** 000009    PUSH      SI
 L22:
 I4:
     ** 00000A    LES       DI,[BP].0AH
     ** 00000D    MOV       AX,ES:06H[DI]
     ** 000011    LES       SI,[BP].06H
     ** 000014    CMP       AX,ES:[SI]
     ** 000017    JBE       I5            !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 L24:                                     ! Pascal 4.0 created a bug here.
     ** 000019    LES       DI,[BP].0AH   ! DI,DWord Ptr [FAR_STRING]
     ** 00001C    LES       BX,ES:02H[DI] !
     ** 000020    LES       DI,[BP].06H   ! DI,DWord Ptr [IDX]
     ** 000023    MOV       DI,ES:[DI]    !
     ** 000026    MOV       SP,AX         !
     ** 000028    MOV       AL,ES:[BX][DI]! ES points to IDX's segment;
     ** 00002B    XOR       AH,AH         !  not to FAR_STRING.STR_ADS's
     ** 00002D    CMP       AX,0003H      !  segment as it should.
     ** 000030    JNE       I6            !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 L26:
     ** 000032    JMP       I5
 L27:
     ** 000034    JMP       I7
 I6:
 L30:
     ** 000036    LES       DI,[BP].06H
     ** 000039    INC       ES:[DI]
 L31:
 I7:
 L32:
     ** 00003C    JMP       I4
 I5:
 L33:
     ** 00003E    MOV       [BP].FEH,01H
 L34:
 I3:
     ** 000042    MOV       AX,[BP].FEH
     ** 000045    POP       SI
     ** 000046    POP       DI
     ** 000047    MOV       SP,BP
     ** 000049    POP       BP
     ** 00004A    LRET      0008H
 L36:

 Procedure/Function : BUG

     ** 00004D    PUSH      BP
     ** 00004E    MOV       BP,SP
     ** 000050    SUB       SP,0004H
     ** 000054    PUSH      DI
     ** 000055    PUSH      SI
     ** 000056    MOV       STKBQQ,BP
 I8:
     ** 00005A    POP       SI
     ** 00005B    POP       DI
     ** 00005C    MOV       SP,BP
     ** 00005E    POP       BP
     ** 00005F    LRET


 227. Pascal 4.00 Supports COM1:

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 30-NOV-1989    ArticleIdent: Q50476

 The communications port COM1: is accessible by file operations in
 Pascal Version 4.00. To access this device, you must assign a file to
 "COM1" and call the REWRITE function to open it. After this is done,
 you can read and write characters to the communications port just as
 if it were a file. Remember, COM1: is an unbuffered device; therefore,
 characters can be lost at high baud rates.

 The following example compiled with Pascal Version 4.00 under both
 OS/2 and MS-DOS.

 PROGRAM SendOutputToCom1(input,output);

 var f : text;

 BEGIN
   assign(f, 'com1');
   rewrite(f);
   writeln(f, 'Hi com1...');
 END.


 228. Passing PROCEDUREs as Arguments Can Hang Computer

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  4-JAN-1990    ArticleIdent: Q51584

 The computer will hang when the main program calls Proc2 with Proc1 as
 a parameter. In addition, the following must be true:

    Proc1 is the first procedure in the source code file.
    Proc2 calls Proc1 which is passed as an argument.

 There are two workarounds, as follows:

 1. Make Proc1 a [PUBLIC] procedure.

 2. Don't allow Proc1 to be the first procedure in the source file
    (i.e., there must be at least one procedure defined above Proc1 in
    the source file).

 The following program illustrates the above problem with the two
 workarounds demonstrated in the commented out sections.

 PROGRAM Hang (INPUT, OUTPUT);

    { PROCEDURE Dummy;
        BEGIN
           WriteLn ('This Procedure declaration must be');
           WriteLn ('uncommented to implement workaround #2');
        END; }

    PROCEDURE Proc1 { [PUBLIC] };
       BEGIN
          WriteLn ('The above keyword, [PUBLIC], must be');
          WriteLn ('uncommented to implement workaround #1');
       END;

    PROCEDURE Proc2 (PROCEDURE ProcArg);
       BEGIN
          ProgArg;     { Calling ProcArg }
       END;

    BEGIN  { main program }
       Proc2 (Proc1);  { Cause Proc2 to call Proc1 }
    END.


 229. No Appendix H in the Microsoft Pascal Reference Manual

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 26-FEB-1990    ArticleIdent: Q51747

 On Page 124 of the "Microsoft Pascal Compiler for the MS-DOS Operating
 System User's Guide" supplied with Microsoft Pascal Version 4.00, it
 incorrectly states the following:

    In Microsoft Pascal, the message describes the error, and the
    number can be used to look up more information (see Appendix H,
    "Messages," in the Microsoft Pascal Reference Manual).

 Also, on Page 96 of the "Microsoft Pascal Reference Manual," it
 incorrectly states the following:

    See Appendix H, "Messages," for a complete listing of error
    messages and warnings.

 There is no Appendix H in the reference manual. The correct location
 for error messages is Appendix F of the "Microsoft Pascal Compiler for
 the MS-DOS Operating System User's Guide," starting on Page 221.


 230. User Error #905 Program Size Too Large

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified:  4-JAN-1990    ArticleIdent: Q51762

 In Pascal, user error #905 is not documented. The entire error
 is as follows:

    user error #905  Program size too large (exceeds 64K bytes of code)

 This error is generated in pass two of the compiler. In Pascal, each
 module must have less than 64K of code, though a multiple module
 program can be larger than this.

 Chapter 8 ("Compiling and Linking Large Programs") of the "Microsoft
 Pascal Compiler for the MS-DOS Operating System User's Guide," Version
 4.0, explains the full process of setting up multiple module programs.


 231. Manual Setup for Microsoft Pascal Version 4.00

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 14-MAR-1990    ArticleIdent: Q51900

 The following information demonstrates how to manually set up
 Microsoft Pascal Version 4.00 for DOS and OS/2 mode on a hard drive.
 It will show you how to set up in the same way as the SETUP.EXE
 program.

 This information demonstrates how to set up Microsoft Pascal Version
 4.00 under the directory "PASCAL" on Drive C. You may change the
 directory name or the drive name.

  1. Create the following directories:

        C:\PASCAL\BINR      (Create only if you want DOS mode.)
        C:\PASCAL\BINB
        C:\PASCAL\BINP      (Create only if you want OS/2 mode.)
        C:\PASCAL\LIB
        C:\PASCAL\INCLUDE
        C:\PASCAL\TMP
        C:\PASCAL\LIB
        C:\PASCAL\INIT
        C:\PASCAL\WORK

  2. Add the following to your AUTOEXEC.BAT file or a separate batch
     file:

        SET PATH=C:\PASCAL\BINB;C:\PASCAL\BINR  (for DOS mode)
        or
        SET PATH=C:\PASCAL\BINB;C:\PASCAL\BINP  (for OS/2 mode)
        or
        SET PATH=C:\PASCAL\BINB;C:\PASCAL\BINR;C:\PASCAL\BINP (for DUAL mode)

        SET INCLUDE=C:\PASCAL\INCLUDE
        SET LIB=C:\PASCAL\LIB
        SET TMP=C:\PASCAL\TMP
        SET INIT=C:\PASCAL\INIT

     Note: It is important that you do NOT add spaces inside these
     commands. For example, "SET LIB = C:\PASCAL\LIB" or
     "SET LIB=C:\PASCAL\LIB" are incorrect. The correct method for setting
     this path is "SET LIB=C:\PASCAL\LIB".

     Note: For the OS/2, if you want these changes to be global for all
     screen groups, include these commands in your CONFIG.SYS file.
     Otherwise, follow the above procedure, and then rename your
     AUTOEXEC.BAT to AUTOEXEC.CMD.

  3. Add the following lines to your CONFIG.SYS file, if they do not
     already exist:

        FILES=20
        BUFFERS=20

     (You must reboot after this step for these changes to take effect.)

  4. Copy the following files into C:\PASCAL\BINR. (You can skip this
     step if you do not want to install for DOS mode.)

        File                           Distribution Disk
        ----                           -----------------

        ERROUT   EXE    10729          Setup and Compiler
        EXEMOD   EXE    12336          Setup and Compiler
        EXEPACK  EXE    14803          Setup and Compiler
        SETENV   EXE    10870          Setup and Compiler
        EXEC     EXE     9299          Library 2 disk
        CV       EXE   263890          Microsoft CodeView for MS-DOS
        CV       HLP    22444          Microsoft CodeView for MS-DOS
        MOUSE    COM    14551          Microsoft CodeView for MS-DOS
        CALLTREE EXE    31233          Microsoft Editor
        M        EXE    94821          Microsoft Editor

  5. Copy the following files into C:\PASCAL\BINB:

        SETUP    EXE    81181          Setup and Compiler
        87       EXE     8798          Setup and Compiler
        BIND     EXE    36946          Setup and Compiler
        ECH      EXE    19351          Setup and Compiler
        EXP      EXE    32220          Setup and Compiler
        EXEHDR   EXE    29942          Setup and Compiler
        IMPLIB   EXE    30166          Setup and Compiler
        PAS1     EXE   139623          Utilities
        PAS2     EXE   131199          Utilities
        PAS3     EXE    40401          Utilities
        MAKE     EXE    38613          Utilities
        LINK     EXE   117001          Examples
        PL       EXE    31861          Examples
        RM       EXE    24884          Examples
        UNDEL    EXE    30046          Library 1 disk
        LIB      EXE    49661          Library 2 disk
        ILINK    EXE    88929          Library 2 disk
        CVPACK   EXE    49400          Microsoft CodeView for MS-DOS
        MEGREP   EXE    31915          Microsoft Editor

  6. Copy the following files into C:\PASCAL\BINP. (You can skip this
     step if you do not want to install for OS/2 mode.)

        CVP      EXE   233249          Microsoft CodeView for MS OS/2
        CVP      HLP    22444          Microsoft CodeView for MS OS/2
        MEP      EXE    97063          Microsoft Editor

  7. Copy the following files into C:\PASCAL\INCLUDE:

        FINK             3472          Examples
        FINKXU           4331          Examples
        FINU             5482          Examples
        CLOCK    INT      308          Examples
        INTRP    INT      225          Examples
        PORT     INT      129          Examples
        BSE      INT     1062          Examples
        BSEDOS   INT    39921          Examples
        BSEERR   INT    18185          Examples
        BSESUB   INT    20490          Examples
        OS2      INT      716          Examples
        OS2DEF   INT     1835          Examples

  8. Copy the following files into C:\PASCAL\INIT:

        WS       DLL     2609          Microsoft Editor
        WS       ZXT     2084          Microsoft Editor

  9. To create the TOOLS.INI file, choose the type of editor you would
     like to use (these files are located on the "Microsoft Editor"
     distribution disk):

        BRIEF.INI
        EPSILON.INI
        QUICK.INI

     Then, rename the file you choose to TOOLS.INI, and place it in the
     INIT subdirectory pointed to by the "SET INIT=C:\INIT" environment
     variable.

 10. Copy the following files into C:\PASCAL\WORK:

        README   DOC    48065          Setup and Compiler
        PASEXEC  INC     4450          Examples
        DEMOEXEC PAS     1211          Examples
        PRIMES   PAS      634          Examples
        SORTDEMO PAS    27342          Examples
        MAKESORT BAT     1326          Examples
        MAKESORT CMD     1313          Examples
        EMOEM    ASM    12125          Examples
        ENTX6L   ASM    10863          Examples
        ENTXSTUB ASM      394          Examples
        EXT      DOC    15877          Microsoft Editor
        EXT      H       8730          Microsoft Editor
        EXTHDR   OBJ     1893          Microsoft Editor
        EXTHDRP  OBJ     2021          Microsoft Editor
        SKEL     C       2457          Microsoft Editor
        SKEL     DEF      211          Microsoft Editor

 11. Copy all the files from the Library 1 and Library 2 disks into the
     C:\PASCAL directory. This directory will be used to temporarily
     store the component libraries.

 12. There is a file called MAKELIB.BAT, which will automatically build
     the libraries for DOS and/or OS/2 mode. By typing "MAKELIB" by
     itself at the DOS prompt with no arguments, it will show a list of
     parameters to use when building a library.

     The following is an example to build a DOS emulator library:

        Type:  C:\PASCAL> MAKELIB C:\PASCAL DOS \LIB EMULATOR

     After the desired libraries have been created, delete all the
     files in C:\PASCAL by changing the working directory to C:\PASCAL
     and typing DEL *.*. This will regain the lost disk space used by
     the component libraries.


 232. Setting Up Pascal 4.00 on a Dual Floppy Machine

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 10-JAN-1990    ArticleIdent: Q51936

 Question:

 How do I set up Pascal Version 4.00 on dual 5.25-inch floppy disks?

 Response:

 The following is one configuration that allows you to run the Pascal
 compiler with a minimum of disk swaps. This is only one of a large
 number of possible configurations; feel free to change any settings as
 you like.

 This particular configuration takes five 5.25-inch floppy disks. The
 file to place on the floppy disk is listed on the left, and its source
 disk is listed on the right.

 Disk One: Compiler
 ------------------

    File                          Source Disk
    ----                          -----------

    PAS1.EXE                      Disk 2: Utilities
    PAS2.EXE                                "
    PAS3.EXE                                "
    PL.EXE                        Disk 3: Examples

 Disk Two : Utilities 1
 ----------------------

    File                          Source Disk
    ----                          -----------

    ERROUT.EXE                    Disk 1: Setup and Compiler
    EXEMOD.EXE                              "
    EXEPACK.EXE                             "
    SETENV.EXE                              "
    EXEC.EXE                      Disk 5: Libraries 2
    MOUSE.COM                     Disk 6: CodeView for MS-DOS
    CALLTREE.EXE                  Disk 8: Microsoft Editor
    M.EXE                                   "
    87.EXE                        Disk 1: Setup and Compiler
    ECH.EXE                                 "
    EXP.EXE                                 "
    EXEHDR.EXE                              "
    IMPLIB.EXE                              "
    RM.EXE                        Disk 3: Examples

 Disk Three: Utilities 2
 -----------------------

    File                          Source Disk
    ----                          -----------

    MAKE.EXE                      Disk 2: Utilities
    LINK.EXE                      Disk 3: Examples
    ILINK.EXE                     Disk 5: Libraries 2
    UNDEL.EXE                     Disk 4: Libraries 1

 Disk Four: CodeView
 -------------------

    File                          Source Disk
    ----                          -----------

    CV.EXE                        Disk 6: CodeView for MS-DOS
    CV.HLP                                  "
    CVPACK.EXE                              "

 Disk Five: Libraries
 --------------------

    File                          Source Disk
    ----                          -----------

    LIB.EXE                       Disk 5: Libraries 2

 Notice that the Libraries disk contains only LIB.EXE, the library
 manager. You need to build the run-time library from the floppy disks,
 using the following procedure:

 1. Enter the following line at the DOS prompt:

       set path=a:\;b:\

 2. Insert the Libraries disk into Drive B. Put the Setup and Compiler
    source disk in Drive A. After making sure the current drive is Drive
    A, type the following:

       setup /l

    The /l option only builds libraries; it does not install the
    compiler. The Setup program invoked with the /l option only asks
    questions that pertain to the run-time libraries that you want
    built. The resulting combined library is placed on your Libraries
    disk along with modules to which you may want to link in the
    future.

 3. Add the following lines to your AUTOEXEC.BAT file:

       SET TMP=b:\
       SET INCLUDE=b:\
       SET LIB=b:\

 4. Add the following lines to your CONFIG.SYS file, if they do not
    already exist:

       FILES=20
       BUFFERS=20

 5. You must reboot for the changes in the CONFIG.SYS file to take
    effect.

 You may want to write a test program to compile and link in order to
 familiarize yourself with the disk swapping process.

 This is by no means the only way to set up Pascal 4.00 on a 360K
 floppy disk system, but it has been tested and works correctly. Feel
 free to change any settings or disk contents as you see fit, so that
 your environment is set up as you would like.


 233. Increasing the Maximum Number of Open Files in Pascal 4.00

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  4-JAN-1990    ArticleIdent: Q52104

 The following procedure allows you increase the maximum number of open
 files running DOS Version 3.3 or OS/2 Version 1.1:

 1. Increase the number of file handles, starting at 20 for this
    example, by editing the startup source file CRT0DAT.ASM. This is
    located on the Startup Source Code disk. Change the following line
    to the desired amount.

       _NFILE_ = 20

 2. Increase the per-process limit in the DOS version of the same file,
    CRT0DAT.ASM, by uncommenting the code duplicated below (remove the
    ';'):

                      ;     mov     ah,67h
                      ;     mov     bx,_NFILE_
                      ;     callos

    In the OS/2 version of CRT0DAT.ASM, you must enable the line

                      ;extrn  DOSETMAXFH:far

    and also enable the code below in the same manner:

                      ;     mov     ax,_NFILE_
                      ;     push    ax
                      ;     call    DOSSETMAXFH

 3. Increase the system-wide limit by editing your CONFIG.SYS. Change
    the following line to the desired amount:

       FILES=20

 4. Assemble the modified CRT0DAT.ASM using the batch file STARTUP.BAT
    on the Startup Source Code disk. This file also contains sample
    command lines.

 5. To use the new CRT0DAT.OBJ, either use the LIB utility to replace
    the .OBJ in the appropriate Pascal run-time library, or explicitly
    link your program with it.


 234. ADS and ADR: Pascal Operators -- Documentation Supplement

 Product Version(s): 3.20 3.30 4.00 | 4.00
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER | docsup
 Last Modified: 16-JAN-1990    ArticleIdent: Q57494

 The ADS and ADR operators in Pascal evaluate to the address of the
 object to which they are applied. ADS (ADdress Segmented) evaluates to
 the full address (segment|offset) of the object, and ADR (ADdress
 Relative) evaluates only to the offset into the default data segment.
 These operators have the same precedence as the Pascal NOT operator,
 and have a higher precedence than the other Pascal operators.

 Note 1: Pascal Version 3.20 used incorrect precedence rules for the ADS
 and ADR operators. See Note 2 below for details.

 Documentation for ADS and ADR can be found in the "Microsoft Pascal
 Reference Manual" on Pages 104-109 and 147, and in the "Microsoft
 Pascal User's Guide" on Pages 139-141.

 Syntax of ADS/ADR Expressions
 -----------------------------

 The ADS and ADR operators are used to take the address of any symbol
 or expression. For example,

    ADS x
 and
    ADS (i + j * k)

 are legal expressions for all Pascal versions except 3.20. Parentheses
 must be used in the second example because ADS (or ADR) has a higher
 precedence than the + and * operators.

 Note 2: In Version 3.20, the ADS and ADR operators would evaluate the
 entire expression following it, disregarding precedence. Therefore,
 the following expression

    ADR a + b   (where a and b are variables)

 would be incorrectly evaluated as

    ADR (a + b)

 rather than

    (ADR a) + b

 as the correct precedence rules would dictate.

 Syntax of ADS/ADR Declarations and Statements
 ---------------------------------------------

 ADS and ADR can be used both as type clause prefixes (declaring a type
 as an ADR of something, for example, a pointer) and as prefix
 operators (ADR of a variable, for example, taking the address). The
 following code example displays this:

 PROGRAM TEST(INPUT,OUTPUT);

 TYPE ARRAY_TYPE     = ARRAY [1..10] OF INTEGER;

 VAR  CHAR_VAR       : CHAR;
      ADR_CHAR       : ADR OF CHAR;           { ADR used as type
                                                clause prefix    }
      INT_ARRAY      : ARRAY_TYPE;
      ADS_ARRAY      : ADS OF ARRAY_TYPE;

 BEGIN
      CHAR_VAR := 'Z';
      INT_ARRAY[1] := 2;

      ADR_CHAR := ADR CHAR_VAR;               { ADR used as prefix
                                                operator         }
      ADS_ARRAY := ADS INT_ARRAY;

      WRITELN(ADR_CHAR^, ADS_ARRAY^[1]);      { up arrow (^) used
                                                to dereference
                                                address type     }
 END.

 The output for this program would be as follows:

    Z       2

 Note 3: If you want to return the actual physical address of any
 object, use the field notations .s and .r for the segment and relative
 offset addresses, respectively. However, these addresses are expressed
 only in decimal notation by the compiler. For example, you could add
 the following line to the above program to obtain the relative offset
 address of CHAR_VAR and the segment and relative offset addresses of
 ARRAY_TYPE:

    WRITELN(ADR_CHAR.R, ADS_ARRAY.R, ADS_ARRAY.S);

 The output for this line would be similar to the following:

    66      70      25478

 This feature is documented in the "Microsoft Pascal Reference Manual"
 on Pages 105-107.

 ADS with Functions
 ------------------

 When taking the address of a function, the usage of parentheses
 changes the meaning of the expression. The expression

    ADS func

 (where "func" is a function) will evaluate to the address of the
 function a, and the expression

    ADS (func)

 will evaluate to the address of the return value of the function.

 When using ADS to get the address of a function or procedure, ADS will
 return a value of the type ADSFUNC or ADSPROC, respectively. These two
 predefined types are compatible with C function pointers.

 To call a function or procedure with variables or parameters of these
 types, their value must be passed, externally, to a non-Pascal
 routine, which in turn will call the function or procedure. For more
 information on ADSFUNC and ADSPROC, see the "Microsoft Pascal User's
 Guide," Page 140.


 235. Pascal 4.00 Setup Cannot Find WIN86EM.LIB

 Product Version(s): 4.00    | 4.00
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER |
 Last Modified: 15-FEB-1990    ArticleIdent: Q58643

 An unexpected warning can occur with the Microsoft Pascal Version 4.00
 Setup program when the compiler is being installed with options to
 write Windows applications.

 If you answer yes to the following prompt

    Remove STACK segment from library for Windows? [y]

 Setup will attempt to copy a file called WIN86EM.LIB from the Library
 1 Disk. The file does not exist. Setup will issue a warning message
 such as the following:

   WARNING: File copy failed : A:\win86em.lib to
   C:\PASCAL\lib\win86em.lib

 Although the file WIN86EM.LIB does not exist, the Library 1 Disk does
 contain the file WIN87EM.LIB. This is the file that Setup should have
 attempted to copy.

 The solution is to copy the file WIN87EM.LIB into the Pascal LIB
 subdirectory. WIN87EM.LIB is not intended to be included in any of the
 combined libraries so there is no danger of the Setup program having
 problems when it creates the combined libraries. WIN87EM.LIB is meant
 to be a stand-alone library file in the LIB subdirectory.


 236. The PUBLIC and EXTERN Attributes in Mixed-Language Programming

 Product Version(s): 4.00
 Operating System:   OS/2
 Flags: ENDUSER | s_c L4001
 Last Modified: 26-FEB-1990    ArticleIdent: Q58648

 The PUBLIC attribute, when applied to variables in Microsoft Pascal
 Version 4.00, indicates that a variable may be accessed by other
 loaded modules, and instructs the compiler to make a variable visible
 and available to other modules, by implication allocating memory for
 the variable.

 This behavior is in contrast to the EXTERN attribute, which identifies
 to the compiler a variable that resides in some other loaded module,
 instructing the compiler not to allocate memory for the variable
 because it has been declared (and memory allocated for it) in another
 module and will be resolved by the linker at link time.

 This behavior is not always consistent when performing mixed-language
 calls between C and Pascal under OS/2. When passing pointer variables
 that have been allocated space in a shared memory segment, although
 the variable has been declared (far) in the main C calling module, it
 must also be declared PUBLIC in the Pascal module. Failure to do so
 will result in the following linker warning:

    PASCAL1.OBJ(PASCAL1.pas) : warning L4001: frame-relative fixup,
    frame ignored near 000A in segment NAME pos: 23C Record type:
    75E8 target external 'identifier'

 The warning is defined in the "Microsoft CodeView and Utilities
 Software Development Tools for MS OS/2 and MS-DOS Operating Systems
 Update" as follows:

    A reference is made relative to a segment which is different from
    the target segment of the reference. For example, if _foo is
    defined in segment _TEXT, the instruction "call DGROUP:_foo" will
    result in this warning. The frame DGROUP is ignored, so the linker
    will treat the call as if it were "call _TEXT:_foo".

 Under OS/2, if multiple pointer variables are using the same shared
 segment, the above warning may lead to a protection violation if the
 executable is run. This may be somewhat counter-intuitive according to
 the definitions of PUBLIC and EXTERN detailed in the "Microsoft Pascal
 Reference Manual" for Version 4.0, Section 11.5.2. The following code
 demonstrates the problem.

 Sample Code
 -----------

 { Pascal Module: compile with pl /c }

 MODULE PASCAL1;

 TYPE

     SAMPLE = RECORD
            DEC   : INTEGER;
            NAME  : ARRAY[1..3] OF INTEGER;
            SCALE : REAL
          END;

 SARRAY = ARRAY[1..100] OF SAMPLE;

 VAR

          FOO  [C, EXTERN]:  ADS OF SARRAY;

          { Change EXTERN to PUBLIC to correct the problem }

          GOO             :  ADS OF SARRAY;

 PROCEDURE DEMO(A:ADSMEM);

  BEGIN
    GOO := FOO;
    writeln('Hello World');
    writeln(GOO.S); { Observe the segment address for GOO }

  END;

 END.

 /* C module: compile with cl -c -AL */

 #define INCL_DOSPROCESS
 #define INCL_DOSMEMMGR
 #define SHRSEGNAME  "FOOBAR"
 #include <os2def.h>
 #include <bsedos.h>
 #include <stdio.h>
 #include <process.h>

 struct sample far *foo;
 /* Pointer to be passed back to pascal module */

 SEL SharedSel;

 extern pascal demo(struct sample far *);

 extern pascal pascal1;

 main()
 {

 /* allocate shared memory segment */
 DosAllocShrSeg(256, SHRSEGNAME, &SharedSel);

 /* foo allocated memory in shared segment */
 foo = (struct sample far *) MAKEP(SharedSel,0);

 demo(foo);    /* call Pascal procedure */

 DosFreeSeg(SharedSel);

 exit(0);
 }

 Compile each of the above modules separately and link with the
 following command:

    link /NOD /NOE pascal1+Cmodule,,,LLIBCE+OS2+LIBPASE;

 The above warning will be observed. If the EXTERN attribute for FOO is
 changed to PUBLIC, the program will link without warnings and will run
 correctly.


 237. Location and Description of File System Error Numbers

 Product Version(s): 3.x 4.00
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 18-APR-1990    ArticleIdent: Q59988

 After opening a file in Pascal, you can check for file errors by
 verifying the .errs field of the file record. This field will either
 contain 0 (zero), which indicates no error, or a number between 1 and
 15. These error codes (1-15) are listed on Pages 257-258 of the
 "Microsoft Pascal Compiler for the MS-DOS Operating System User's
 Guide" for Version 4.0 manual under the section marked as follows:

    Runtime File System Errors(1000-1199)

 A number between 1-15 is returned in the .errs field of the Pascal
 file record, as shown in the following, indicating any errors that may
 have occurred while opening the file:

    f : text; {File}
    error : integer; {Receives error}
    error := f.errs; {Return a number 1-15}

 The value returned by f.errs may be one of the following:

  1 - Hard Data Error: Parity, CRC, check sum, etc.
  2 - Device Name Invalid: Unit/device/volume name, format, or number
  3 - Operation: Invalid operation (for example, RESET a printer)
  4 - File System: File system internal error
  5 - Device Offline
  6 - Lost File: File itself is no longer available.
  7 - File Name: Invalid syntax (name too long, etc.)
  8 - Device Full: Disk full, directory full, all channels allocated
  9 - Unknown Device
 10 - File Not Found
 11 - Protected File: Duplicate filename or file write-protected
 12 - File in Use: File in use, concurrency lock, already open
 13 - File Not Open: File closed, I/O to unopened FCB
 14 - Data Format: Data format error, decode error, range error
 15 - Line Too Long: Buffer overflow, line too long


 238. Writing to a segment:offset Memory Location Using MS Pascal

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 15-AUG-1990    ArticleIdent: Q64806

 The following steps outline how to write directly to a specific
 segment:offset memory location using the Microsoft Pascal compiler
 version 4.00 (the information below is contained in the "Microsoft
 Pascal Reference Manual," Section 9.1.2, Pages 104-109):

 1. Declare a variable of type "ADS OF <type>", where <type> is the
    data type that you want to write; for example:

       var ptr : ads of byte;

 2. Set the segment and offset of the variable by using the ".s" and
    ".r" record elements; for example:

       ptr.s := 16#5F00;       { Segment value = 5F00 hex }
       ptr.r := 16#04CD;       { Offset value  = 04CD hex }

 3. To read and write from/to the address, use the dereference operator
    "^"; for example:

       ptr^  := 65;
       value := ^ptr;

 The sample program below was written in Microsoft Pascal and reads and
 writes bytes near memory location B800:0000 (hex), which is the start
 of standard video memory:

 Sample Code
 -----------

 program screen;

 var ptr   : ads of byte;  { The pointer variable }
     value : word;         { Something to read memory into }

 begin
   ptr.s := 16#b800;       { Assign the segment value of the pointer }
   ptr.r := 16#0000;       { Assign the offset value of the pointer }
   ptr^  := 65;            { Write 65 to location B800:0000 (hex) }

   ptr.r := 16#0024;       { Set the offset to a new value }
   value := ptr^;          { Read from location B800:0024 (hex) }
 end.

 Note: The sample program will only work under DOS. It will generate a
 GP fault under OS/2 because writing to video memory directly is
 prohibited under OS/2.


 239. Pascal 4.00 PC, SS, FP, and SP Can't Find Run-Time Errors

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# S900822-32 docerr
 Last Modified: 31-AUG-1990    ArticleIdent: Q65324

 When a run-time error occurs in the Microsoft Pascal 4.00 program, the
 program will display the values for the PC, SS, FP, and SP. The values
 are called the "machine error context" in the "Microsoft Pascal 4.0:
 User's Guide."

 The values generated by the program are incorrect, are not meaningful,
 and do not represent the values of the machines registers at the time
 the error occurred. Consequently, these values cannot be used to find
 run-time errors.

 On Page 225, the "Microsoft Pascal 4.0: User's Guide" incorrectly
 states that these values can be used to find run-time errors. In
 particular, it incorrectly states that you can use the Program Counter
 (PC) along with a linker map file (.MAP file) to find the routine in
 which the error occurred.

 The only way to easily find run-time errors in Pascal 4.00 programs is
 to compile and link the program for debugging in the CodeView
 debugger.

 This information applies to Microsoft Pascal 4.00 for MS-DOS and MS
 OS/2.


 240. SCO Now Supports All Versions of Pascal for XENIX

 Product Version(s): 3.30 3.31
 Operating System:   XENIX
 Flags: ENDUSER | SR# S900924-11
 Last Modified: 26-DEC-1990    ArticleIdent: Q65887

 The Santa Cruz Operation (SCO) has assumed responsibility for sales
 and support of all versions of the Microsoft Pascal Compiler
 (including versions 3.30 and 3.31) for the XENIX operating system.

 SCO is fully committed to the UNIX marketplace and solidly backs
 Microsoft applications and languages. SCO is also committed to
 updating and adding versions of the Pascal Compiler for XENIX.

 SCO has the resources required to support this product on a variety of
 configurations and terminals.

 Such support is not free. As is typical in the UNIX world, SCO charges
 for support on a variety of levels. A comprehensive explanation of the
 sales and support programs can be obtained directly from SCO at the
 following address:

    Support Department
    The Santa Cruz Operation
    400 Encinal Street
    Santa Cruz, CA  95061

    Phone Numbers: (800) 347-4381 Support
                   (800) 726-8649 Sales
                   (408) 425-7222 Main Number


 241. Pascal Error 201 "Types Not Assignment Compatible" in UNIT

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | SR# S900924-27 buglist4.00
 Last Modified: 26-DEC-1990    ArticleIdent: Q66138

 The error "201 Types Not Assignment Compatible" incorrectly occurs
 when an enumerated data type is used as an array index if the array is
 declared as a procedure parameter within a Pascal UNIT.

 This information applies only to the Microsoft Pascal Compiler version
 4.00 for MS-DOS and OS/2.

 Microsoft has confirmed this to be a problem with the Microsoft Pascal
 Compiler version 4.00. We are researching this problem and will post
 new information here as it becomes available.

 The error occurs only if all of the following conditions are met:

 1. A Pascal UNIT is being compiled.

 2. The array is a parameter to a Pascal PROCEDURE within the UNIT.

 3. An enumerated data type is used as an index to the array.

 The following code example reproduces the error:

 Code Example
 ------------

 INTERFACE;
 UNIT FOO(PROC1);

      TYPE enum = (a,b,c,d,e);
           enarr = array[enum] of INTEGER;

      PROCEDURE PROC1(EnumArray : enarr);
 BEGIN
 END;

 IMPLEMENTATION OF FOO;

      TYPE enum = (a,b,c,d,e);
           enarr = array[enum] of INTEGER;

 PROCEDURE PROC1;
      VAR  en    : enum;
           local : enarr;
           x     : INTEGER;
      BEGIN
           FOR en := a TO e DO BEGIN
                WRITELN ( EnumArray[en]); { Error 201.}
                x := EnumArray[en];       { Error 201.}
                WRITELN ( local[en]);   { Compiles ok.}
                x := local[en];         { Compiles ok.}
           END;
      END;
 END.


 242. Trapping I/O Errors Using the "TRAP" Flag in Pascal 4.00

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | SR# S901009-56
 Last Modified: 26-DEC-1990    ArticleIdent: Q66318

 When a file variable is defined within Pascal version 4.00, that file
 variable automatically has three associated flags that are not
 explicitly defined through a Record type. These three flags are
 accessed in the same way you would access a field within a Record
 Type:

 FileVar.Trap - Determines whether I/O errors should be trapped for this
                file.

 FileVar.Mode - Mode in which the File or Device was opened.

 FileVar.Errs - Error number, when an I/O error occurs if the Trap flag
                is set to "True".

 Utilizing the "Trap" and "Errs" flags, you can perform error trapping
 on all file or device I/O.

 This information applies to the Microsoft Pascal Compiler version
 4.00 for MS-DOS and OS/2.

 Once a File variable is assigned to a file or device, error trapping
 can be performed by setting the "Trap" flag to "True" and then
 checking the value of the "Errs" flag after I/O is performed on the
 file or device. If "Errs" is nonzero, an error has occurred allowing
 you to process the error. If the "Trap" flag is set to "False" and an
 I/O error occurs, the program will terminate with an I/O error.

 The following sample program demonstrates how to trap errors while
 printing to the standard device PRN. The same method is used for data
 files.

 Compile and Link with the following command:

    PL PrnTest.Pas

 PrnText.Pas
 -----------

 Program ErrorTrap;

 Var prn: Text; {Declare File variable of type Text
                 which will be used for the standard
                 device PRN}

 { This procedure will be called when the value of
   prn.Errs is non-zero following any I/O on prn.
   This procedure is not automatically called.
   The value of prn.Errs must be checked, and
   depending on its value, control should be
   passed to this Procedure. Prn.Errs must be
   set back to zero after the error has been
   processed to allow error trapping to continue. }

 Procedure ErrorHandler;
 Begin
   Writeln('An error occurred, Number: ', prn.Errs);
   prn.Errs:=0;
 End;

 Begin
   Assign(prn, 'PRN');  {Assign Standard device PRN to file
                         variable prn}

   prn.Trap:= True;     {Activate Error trapping for prn}

 {The following Writeln statement will generate an error
  because the file PRN has not yet been opened, but only
  associated with the device PRN. The flag Prn.Errs is
  then checked for a nonzero value and control is passed
  to the Error Handler Procedure if an error occurred.}

   Writeln(prn, 'This Should Not Print');
   If prn.Errs <> 0 Then ErrorHandler;

   ReWrite(prn);  {Open up the file (PRN device) so the
                   the following Writeln statement will
                   execute successfully.}

   Writeln(prn, 'This Should Print');
   Close(prn);
 End.


 243. Pascal Reply Letters: Appnotes BP0359, BP0360, BP0361

 Product Version(s): 3.13 3.20 3.30 3.3x 4.00 | 4.00
 Operating System:   MS-DOS                   | OS/2
 Flags: ENDUSER | S_QuickPas policy appnote BP0359 BP0360 BP0361
 Last Modified: 26-DEC-1990    ArticleIdent: Q66492

 Below are the three form letters that Microsoft sends in response to
 unsolicited letters from customers who have Pascal or QuickPascal:

    Appnote Number   Title
    --------------   -----

    BP0359           Pascal Suggestion Reply Letter
    BP0360           Pascal Question Reply Letter
    BP0361           Pascal Problem/Docerr Reply Letter

 This information applies to all Microsoft Pascal versions (including
 3.13, 3.20, 3.30, 3.3x, 4.00) and to Microsoft QuickPascal version
 1.00.

 Note: Page 1 of 2 is shown below for each reply letter. Page 2 of 2,
 the "Product Assistance Checklist," is the same for each reply letter,
 and is shown in a separate article found by querying for the following
 words:

    product and assistance and checklist

 BP0359: Pascal Suggestion Reply Letter
 --------------------------------------

 Dear PASCAL Customer:

 Thank you for your letter concerning your suggestion to our PASCAL
 language product. Although we are unable to respond to your technical
 questions by letter, we do forward your letters to our PASCAL
 development team. This procedure provides developers with customer
 feedback, which will in turn make Microsoft's products even better.
 Now that we can no longer respond to letters (unless solicited by
 Microsoft), we are providing the following new service:

 Our toll-line number, (206) 637-7096, is available Monday through
 Friday (except holidays), 8 AM to 5 PM Pacific Standard Time, and is
 designed to answer questions about set up and installation procedures,
 problem reports, and documentation errors. We also address most
 programming, code debugging, and problem solving issues.

 There are many supplemental sources of information relating to the
 PASCAL languages, including reference guides and books published by
 Microsoft Press. Support is also available electronically through
 Microsoft OnLine and CompuServe. One of the features of these services
 is to provide access to the Microsoft Knowledge Base. The Microsoft
 Knowledge Base contains the latest technical information about
 Microsoft language products. For more information about Microsoft
 OnLine, which is designed for software developers, call (800) 443-
 4672. For more information about CompuServe, which is the largest
 general online information service for personal computer users, call
 (800) 848-8199.

 Sincerely,

 Blain Barton
 Business Languages Team Manager
 Product Support Services
 BP0359

 BP0360: Pascal Question Reply Letter
 ------------------------------------

 Dear PASCAL Customer:

 Thank you for your letter concerning our PASCAL language product.
 Although we are unable to respond to your technical questions by
 letter, we do forward your letters to our PASCAL development team.
 This procedure provides developers with customer feedback, which will
 in turn make Microsoft's products even better. Now that we can no
 longer respond to letters (unless solicited by Microsoft), we are
 providing the following new service:

 Our toll-line number, (206) 637-7096, is available Monday through
 Friday (except holidays), 8 AM to 5 PM Pacific Standard Time, and is
 designed to answer questions about set up and installation procedures,
 problem reports, and documentation errors. We also address most
 programming, code debugging, and problem solving issues.

 There are many supplemental sources of information relating to the
 PASCAL languages, including reference guides and books published by
 Microsoft Press. Support is also available electronically through
 Microsoft OnLine and CompuServe. One of the features of these services
 is to provide access to the Microsoft Knowledge Base. The Microsoft
 Knowledge Base contains the latest technical information about
 Microsoft language products. For more information about Microsoft
 OnLine, which is designed for software developers, call (800) 443-
 4672. For more information about CompuServe, which is the largest
 general online information service for personal computer users, call
 (800) 848-8199.

 Sincerely,

 Blain Barton
 Business Languages Team Manager
 Product Support Services
 BP0360

 BP0361: Pascal Problem/Docerr Reply Letter
 ------------------------------------------

 Dear PASCAL Customer:

 Thank you for your letter concerning your problem and/or documentation
 error pertaining to our PASCAL language product. Although we are
 unable to respond to your technical questions by letter, we do forward
 your letters to our PASCAL development team. This procedure provides
 developers with customer feedback, which will in turn make Microsoft's
 products even better. Now that we can no longer respond to letters
 (unless solicited by Microsoft), we are providing the following new
 service:

 Our toll-line number, (206) 637-7096, is available Monday through
 Friday (except holidays), 8 AM to 5 PM Pacific Standard Time, and is
 designed to answer questions about set up and installation procedures,
 problem reports, and documentation errors. We also address most
 programming, code debugging, and problem solving issues.

 There are many supplemental sources of information relating to the
 PASCAL languages, including reference guides and books published by
 Microsoft Press. Support is also available electronically through
 Microsoft OnLine and CompuServe. One of the features of these services
 is to provide access to the Microsoft Knowledge Base. The Microsoft
 Knowledge Base contains the latest technical information about
 Microsoft language products. For more information about Microsoft
 OnLine, which is designed for software developers, call (800) 443-
 4672. For more information about CompuServe, which is the largest
 general online information service for personal computer users, call
 (800) 848-8199.

 Sincerely,

 Blain Barton
 Business Languages Team Manager
 Product Support Services
 BP0361


 244. SIZEOF Returns Wrong Value with Multidimensional Super Array

 Product Version(s): 3.32 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# S901107-110 buglist3.32 buglist4.00
 Last Modified: 10-NOV-1990    ArticleIdent: Q66807

 If a multidimensional super array is declared with different values
 for the lower array bounds, the sizeof() function will return an
 incorrect value for the size of the array. This problem is illustrated
 in the program below.

 Microsoft has confirmed this to be a problem in Microsoft Pascal
 versions 3.32 and 4.00 for MS-DOS. We are researching this problem and
 will post new information here as it becomes available.

 After examining the resulting assembly code using CodeView, it appears
 that the sizeof() function assumes that the base value of both the
 dimensions is the same. For example, if the "sup" type is modified to
 read as follows

      sup = super array[1..*,1..*] of integer;

 this will return the correct answer of 20 bytes for the size.
 Apparently, memory is being referenced and allocated correctly;
 however, the sizeof() function is clearly returning the wrong value in
 the first case.

 Code Example
 ------------

 program sample(input, output);

 type
   sup = super array[1..*,0..*] of integer;

 var
   x : ^sup;
   y : word;

 begin
   new(x, 1, 10);     { 1 integer * 11 integers (0..10) = 11 integers }

   y := sizeof(x^);   { 11 integers * 2 bytes/integer = 22 bytes }
   writeln(y);        { writeln prints 20 }
 end.


 245. Patch for PASCAL.LIB 3.30; DIRECT Access File SEEK/PUT Problem

 Product Version(s): 3.30
 Operating System:   MS-DOS
 Flags: ENDUSER | appnote SP0281 buglist3.30 fixlist4.00
 Last Modified: 14-DEC-1990    ArticleIdent: Q67000

 The application note "Patch for PASCAL.LIB 3.30" is available from
 Microsoft Product Support Services.

 This application note corrects a problem with DIRECT file access in
 Microsoft Pascal version 3.30. Microsoft has confirmed this to be a
 problem in Microsoft Pascal Compiler version 3.30 for MS-DOS. (This
 problem was corrected in Microsoft Pascal Compiler version 4.00;
 therefore, owners of Pascal version 4.00 do not need this application
 note.)

 This application note includes the following four files:

 1. PASNEW.LIB replaces the PASCAL.LIB shipped with Pascal 3.30. You
    can rename PASNEW.LIB to PASCAL.LIB to replace the old PASCAL.LIB,
    or you can specify PASNEW.LIB at the library (.LIB) prompt at link
    time. Make sure to keep the original 3.30 PASCAL.LIB as an archive.

 2. FILF.OBJ is a corrected version of the module that is incorrect in
    the old PASCAL.LIB library. Specifying FILF.OBJ at the object
    module (.OBJ) prompt at link time will also implement the patch
    without using the PASNEW.LIB library.

 3. DIRECT.PAS is a code example that shows the DIRECT file access
    problem.

 4. READ.ME is a copy of the text of this application note.

 The following steps (shown in the DIRECT.PAS example on the enclosed
 disk) demonstrate the problem with DIRECT file access in Pascal 3.30:

 1. Open a file with DIRECT access and write to it.

 2. Close the file and open it again.

 3. SEEK to one of the records you previously wrote.

 4. Attempt to PUT a new value in the record and close the file again.

 The above steps cause the new value to not be placed in the record.
 Also, the directory length of the file may be incorrect. The
 PASNEW.LIB and FILF.OBJ files on the enclosed disk correct this
 problem.

 Code Example (DIRECT.PAS)
 -------------------------

 Program test(INPUT,OUTPUT);

 Var
     f: file of word;
     i: integer;
     J:INTEGER;

 Begin
     WRITE('ENTER NUMBER OF RECORDS ');
     READLN(J);
     assign(f, 'testfile');
     f.mode:=direct;
     f.share:=sm_denyrd;
     rewrite(f);
     f^:=0;                          { fill value    }
     FOR I:=1 TO J DO PUT(F);          {J RECORDS GET FILLED WITH 0}
     close(f);

     WRITE('ENTER RECORD NUMBER TO SEEK ');
     READLN(J);
     RESET(F);
     SEEK(F,J);
     f^:=1;                          { put a 1 in the buffer }
     put(f);                         { write it }
     close(f);

     RESET(F);
     SEEK(F,J);
     GET(F);
     WRITELN;
     WRITELN('F^=',F^:2,'       F^ SHOULD EQUAL 1');
     CLOSE(F);
 End.


 246. Incorrect Reference of ADSMEM EXTERN FUNCTION; Pascal Example

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | SR# S901116-96 buglist4.00
 Last Modified: 26-DEC-1990    ArticleIdent: Q67375

 The PASCAL compiler fails to flag an incorrect usage of a FUNCTION
 that returns an ADSMEM value.

 Microsoft has confirmed this to be a problem with the Microsoft Pascal
 Compiler version 4.00 for MS-DOS and MS OS/2. To work around the
 problem, learn and use the correct syntax.

 The code below shows both the correct syntax and the illegal syntax of
 the use of a FUNCTION that returns an ADSMEM value. The correct logic
 is to assign the value returned by the FUNCTION to an ADSMEM variable,
 then reference the desired part of the ADSMEM variable.

 PROGRAM test1(output,input);

 var
    a: WORD;
    b: ADSMEM;

 FUNCTION Getmqq: ADSMEM; EXTERN;

 ! Program to display how to reference the correct offset of a
 ! memory address.

 BEGIN
    a := Getmqq.r;                  !wrong assignment statement
    WRITELN (output,'a.r = ',a.r);  !wrong result
    b := Getmqq;                    !correct assignment
    WRITELN (output,'b.r = ',b.r);  !correct results
 END.


 247. Pascal 4.00 Manual Incorrectly Refers to SORT.PAS File

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 26-DEC-1990    ArticleIdent: Q67376

 Pages 22 to 31 of the "Microsoft Pascal Compiler: User's Guide" for
 Pascal 4.00 incorrectly make reference to the program, SORT.PAS. In
 this section of the manual, SORT.PAS serves as a sample program for
 demonstrating the use of the PASx compile and LINK commands from DOS.
 Attempting to follow the examples in this part of the manual using
 Pascal 4.00 will fail because SORT.PAS was not shipped with Pascal
 version 4.00. It was only shipped with Pascal version 3.32.

 The reference to SORT.PAS on pages 22 to 31 should be changed to a
 different demo program, such as SORTDEMO.PAS. SORTDEMO.PAS can be used
 in place of SORT.PAS for the purpose of demonstrating the compile and
 link commands from DOS.

 This information applies to Microsoft Pascal version 4.00 for MS-DOS
 and MS OS/2.

 Note that SORTDEMO.PAS and SORT.PAS are not the same program.
 SORTDEMO.PAS contains many sorting algorithms, such as bubble sort,
 quick sort, insertion sort, and so on. SORT.PAS just contains a simple
 bubble sort algorithm.

 If Pascal 4.00 is configured to run only under DOS (and not OS/2) on
 your system, you will need to copy the file OS2.INT from the Examples
 disk to the INCLUDE path of your hard drive. The PAS1 compiler will
 need to open this file when compiling SORTDEMO from DOS. Absence of
 this file will result in the error "File access error ... " at compile
 time. For more information on this problem, query on the following
 words:

    Pascal and sortdemo and bound


 248. "Symbol Defined More Than Once: SUBSQQ" Error

 Product Version(s): 3.04
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR56929
 Last Modified:  2-JAN-1991    ArticleIdent: Q11985

 Question:

 While adding a Pascal language-user interface to our FORTRAN language
 system, a run-time library compatibility problem has surfaced. When we
 search both run-time libraries during a link, a "Symbol defined more
 than once: SUBSQQ" error is reported in the second run-time library
 searched.

 This is both an operational problem (our MAKEs terminate at the error)
 and a potential run-time problem. The only run-time problem we know of
 occurs when the FORTRAN substring is used (for example, TEST(I:I)=' ')
 and the Pascal library is searched first. This problem will generally
 lock up a system at run time.

 We would like to know the following:

 1. Is there a patch for the libraries?

 2. Is there a potential Pascal run-time problem when we link the
    FORTRAN library first to solve the FORTRAN substring crash?

 Response:

 No. You are not likely to have a problem using the executable you
 created.

 For the first problem with the MAKE file, you should use conditional
 execution based on whether or not you receive certain error levels.

 In regard to the library problem, you may have a FORTRAN main program
 that calls Pascal routines that, for example, provide a user interface
 to your system. However, there may be something in the structure of
 your program that tangles the linker.

 Examine the contents of the FORTRAN and Pascal libraries using the LIB
 utility. You can see that the function SUBSQQ is present in both
 PASCAL.LIB and FORTRAN.LIB. You also can see that the object module
 contains the SUBSQQ function in the Pascal library, which contains
 many other entry points. This is in contrast to the FORTRAN object
 module containing SUBSQQ, which only has three entry points. The
 following is an example:

 PASCAL.LIB:
 ----------

 sets              Offset: 000101d0H  Code and data size: 4c5H
   ADDSQQ            CEQSQQ            CLESQQ            CLTSQQ
   MIN               MULSQQ            O3ESQQ            SETSQQ
  *SUBSQQ*           T3OSQQ            Z3RSQQ

 FORTRAN.LIB:
 -----------

 fstl              Offset: 0000fb00H  Code and data size: 19eH
   FCPSQQ            FSTLQQ            SUBSQQ

 An entry point is not necessarily a function. For example, in the
 FORTRAN library module containing SUBSQQ, FCPSQQ is actually a module
 name, while SUBSQQ is a procedure and FSTLQQ a function.

 Your program uses at least one entry point contained in both of these
 two modules. The entry point does not necessarily need to be SUBSQQ.

 For example, if you first link in the Pascal library and then the
 FORTRAN library (and if your program generates calls to ADDSQQ and
 FSTLQQ), the linker will first pull in the "sets" module from the
 PASCAL.LIB to resolve the reference to ADDSQQ. The linker then must
 pull in the "fstl" module from the FORTRAN.LIB to resolve the
 reference to FSTLQQ. The linker will then check all its entry points
 for duplicates, find that now it has duplicates of the SUBSQQ
 procedure, and generate a message that you have pulled in two
 (possibly different) versions of SUBSQQ.

 This procedure should generate a fatal error and make it impossible
 for you to proceed. If this occurs and your machine hangs, try
 switching your link order. Everything should work properly because you
 are using two Microsoft compilers, as well as using the same version
 number of two particularly compatible compilers (they share the same
 source code for many routines). In fact, the SUBSQQ procedure is
 indeed identical in FORTRAN and Pascal version 3.31.

 We recommend that you proceed with the executable you created by
 linking in FORTRAN first, then Pascal. You should not encounter any
 problems using this procedure.


 249. ADS of Function/Procedure May Gives Incorrect Results

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | SR# S901116-69
 Last Modified:  2-JAN-1991    ArticleIdent: Q67888

 ADS returns the segment and offset of a variable, function, or
 procedure. When calling ADS of a intrinsic function, it will return
 the incorrect address of zero. ADS of an external function/procedure
 will produce the correct results unless an ADS call to an intrinsic
 was performed first. In the latter case, it will then assign zero to
 the variable of the ADS of the external function/procedure and assign
 the ADS of the external function/procedure to the variable that holds
 the ADS of the intrinsic function/procedure.

 This information applies to Microsoft Pascal version 4.00 for MS-DOS
 and MS OS/2.

 In the code example below, the wrong addresses are printed. If Getmmq
 had been the only use of the ADS function, the correct results would
 have be printed. With the second use of the ADS function on the
 external, the addresses are incorrectly switched and the ADS of F1
 procedure prints the address of Getmmq, and the ADS of Getmmq function
 prints zero. Had the ADS of the intrinsic function been the only call,
 then ADS would have returned zero.

 PROGRAM t(output,input);
 VAR
    a,b: ADSMEM;

 FUNCTION F1:INTEGER;
 BEGIN
    F1 := 5;
 END;

 FUNCTION Getmqq(wants : WORD):ADSMEM;EXTERN;

 BEGIN
   a := ADS F1;
   b := ADS Getmmq;
   WRITELN(output,'F1    =',RETYPE(INTEGER4,b)); !prints ADS of GETMQQ
   WRITELN(output,'GETMQQ=',retype(INTEGER4,a)); !prints "0"
 END.


 250. PASCAL 4.0 Can Fail to Report Bad RETYPE Arguments; Cause Hang

 Product Version(s): 4.00   | 4.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | SR# S901220-19
 Last Modified:  9-JAN-1991    ArticleIdent: Q68022

 The Pascal compiler does not always detect errors in the arguments of
 the RETYPE function, which can cause the program to hang at run time.

 Microsoft has confirmed this to be a problem with Microsoft Pascal
 Compiler version 4.00 (buglist4.00). We are researching this problem
 and will post more information here as it becomes available. To work
 around the problem, pass the correct arguments to the RETYPE function.

 The RETYPE function takes two arguments: the first argument is the
 type; the second argument is a declared variable. The RETYPE command
 will type-cast the second argument using the first argument. In the
 code below, the compiler does not detect an error. When the program
 below is run, the computer will hang.

 program test(output,input);
 type
    t = ads of integer;   !segment address of integer
 var
    a : ads of word;      !segment address of word

 procedure p(const x: integer4);
    begin writeln('X = ',x); end;

 begin
    p(retype (t,a)^);                  ! correct code
    p(retype (t, ads a^)^);            ! incorrect code..
 end.                                  ! ..convert the address of
                                       ! ..pointer into a type???

 The compiler should detect this error on the first pass and generate
 the "^201 Types Not Assignment Compatible" error on the second call to
 procedure p.


 251. Summary of Pascal 4.00 Compiler's Command-Line Switches

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# S910201-74
 Last Modified: 14-FEB-1991    ArticleIdent: Q69175

 The following is a summary of the command-line switches for Microsoft
 Pascal Compiler version 4.00. All switches correspond to Pascal
 metacommands, so you can either use the metacommand in the source file
 or give the command as a switch to the compiler. Any instruction given
 as a metacommand in the source file overrides the corresponding switch
 given at compile time.

 For more information about the compiler and its switches, see Chapter
 5, "More About Compiling" in the "Microsoft Pascal Compiler for MS-DOS
 Operating System: User's Guide" for version 4.00.

    Switch     Default     Metacommand     Action
    ------     -------     -----------     ------

    /A         Off         $indexck        Checks for array index values
                                           in range, including super
                                           array indices.

    /C         Off         $decmath        Directs the compiler to use
                                           the decimal math routines in
                                           the math run-time library,
                                           DECMATH.LIB.

    /D         Off         $debug          Switches on all debugging
                                           switches.

    /E         Off         $entry          Generates procedure entry and
                                           exit calls for the debugger.

    /I         Off         $initck         Checks for use of
                                           uninitialized values.

    /L         Off         $line           Generates line-number calls
                                           for debugger.

    /M         Off         $mathck         Checks for mathematical errors,
                                           such as overflow and division
                                           by zero.

    /N         Off         $nilck          Checks for dereferencing of
                                           any pointers that are NIL.

    /Q         Off         $debug          Switches off all debugging
                                           switches.

    /R         Off         $rangeck        Checks for subrange validity
                                           including assignments.

    /S         Off         $stackck        Checks for stack overflow at
                                           procedure or function entry.

    /T         Off         $tagck          Checks tag fields in variant
                                           records.

 The debug (/D) switch will turn on all debug switches (those whose
 metacommand ends with "CK"). The error-checking switches and
 corresponding metacommands cause a significant increase in the size of
 code generated. Therefore, you may want to use them in the early
 stages of program development, then recompile your program without
 them once you have thoroughly debugged your program (for example, use
 the /Q switch to turn off debug switches). Removing the debug switches
 will reduce your program's code size.






 Microsoft QuickPASCAL Compiler
 =============================================================================


 1. QuickPascal Does Not Support Installable Graphics Drivers

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-MAY-1989    ArticleIdent: Q43769

 Turbo Pascal has a routine called InstallUserDriver to install a
 vendor-added graphics device driver. QuickPascal Version 1.00 does not
 implement installable graphics device drivers.

 At this point, we know of no programs that have been written that have
 implemented this call because no one has developed these vendor-added
 graphics device drivers.


 2. QuickPascal Does Not Link TPUs

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-MAY-1989    ArticleIdent: Q43770

 A file with an extension of .TPU is a precompiled unit file used in
 Turbo Pascal. QuickPascal Version 1.00 does not link Turbo Pascal .TPU
 files. If the source code for .TPU files is available, compile it using
 QuickPascal. This will create a .QPU file (QuickPascal unit file),
 which then can be used by QuickPascal.


 3. QuickPascal Not Compatible with Turbo Pascal 3.0

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-MAY-1989    ArticleIdent: Q43771

 Microsoft QuickPascal Version 1.00 is not compatible with Turbo Pascal
 Version 3.0. It is source compatible with Turbo Pascal 5.0.

 The Turbo Pascal 5.0 package includes TURBO3.TPU and GRAPH3.TPU units
 to make Turbo Pascal 5.0 compatible with Version 3.0.

 The units equivalent to TURBO3.TPU and GRAPH3.TPU are not included in
 QuickPascal Version 1.00.


 4. Description of units and their use

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-MAY-1989    ArticleIdent: Q43970

 Question:

 How do I implement the idea of modules in QuickPascal?

 Response:

 To use modules in QuickPascal you must create a "unit."  A unit is
 a collection of constants, data types, variables, procedures, and
 functions.

 To create a unit, do the following:

 1. Create a program (call it MODULE1.PAS, for example) that adheres to
    the unit specification. More information on unit specification is
    given below.

 2. Compile MODULE1.PAS. QuickPascal produces a file by the name of
    MODULE1.QPU. MODULE1.QPU is a unit.

 In the main program, include the line after the program statement:

    uses module1;

 The module1 unit is now automatically "linked" with the main program.

 A unit starts with the reserved word UNIT, followed by the unit's name.
 The unit also contains INTERFACE and IMPLEMENTATION sections. The
 INTERFACE section is "visible" to any other units or programs that use
 this unit. The IMPLEMENTATION section is not "visible" to any programs
 that use this unit. The IMPLEMENTATION section usually is used by
 "visible" procedures and functions that appear in the INTERFACE
 section.

 See also "Pascal By Example," Chapter 7, Pages 87-93.


 5. QuickPascal Accepts a Function Name as an Argument

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-MAY-1989    ArticleIdent: Q44473

 The Microsoft QuickPascal Compiler Version 1.00 accepts a function
 name as an argument to a procedure as shown below; however, Turbo
 Pascal Version 5.00 does not accept it.

 Turbo Pascal Version 5.00 thinks that the Foo is a recursive call when
 it is specified in the Val procedure. In QuickPascal, this is a way to
 assign a value to the Foo function. No recursion is performed.

 function Foo(Var.....) : REAL;

 begin
    .
    .
    Val(Mystring,Foo,Error);
 end;


 6. Example of QuickPascal to Assembler Procedure Call

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1989    ArticleIdent: Q44474

 QuickPascal Version 1.00 can interface to assembler object modules.
 The following example shows how to access global variables from within
 the assembly routine; it also shows the segment conventions necessary
 to interface with QuickPascal:

 Program PasAsmTest;
 {$F+}                               (* Turn on far call model *)
 {$L AsmTest}                        (* Turn on local symbol info *)
 Procedure TestRoutine;  External;   (* Define routine as external *)
 {$F-}                               (* Turn off far call model *)
 VAR
    TestInt : Integer;
    TestBool: Boolean;

 BEGIN
    TestInt := 2;
    TestBool := FALSE;
    Writeln ('Before assembly call, variables are:');
    Writeln ('TestBool = ', TestBool);
    Writeln ('TestInt = ', TestInt);
    TestRoutine;
    Writeln;
    Writeln ('After assembly call, variables have changed');
    Writeln ('TestBool now equals ', TestBool);
    Writeln ('TestInt = ', TestInt);
 END.

 ; Assemble command lines
 ;
 ; MASM:
 ;     Assemble with:
 ;            Masm asmtest.asm;
 ;
 ; QuickAssembler command line:
 ;     Assemble with:
 ;            qcl /c asmtest.asm
 ;
 ; QuickAssembler environment:
 ;     Choose Options.Make.Build Flags, Release mode (not Debug)
 ;     Choose Options.Make.Assembly Flags.Labels, Convert to Upper

 DATA Segment
    TRUE  Equ  1
    Extrn TestBool : BYTE
    Extrn TestInt  : WORD
 DATA Ends

 CODE Segment                  ; Setup Code and Data segments
    ASSUME CS:CODE,DS:DATA

 Public TestRoutine
 TestRoutine Proc Far
    PUSH     BP
    MOV      BP, SP            ; Preserve required registers on stack
    PUSH     DS

    Mov      TestBool, TRUE    ; Change the variables
    Mov      TestInt, 0010

    POP      DS
    MOV      SP, BP            ; Restore to entry state
    POP      BP
    RET
 TestRoutine EndP
 CODE EndS
 END

 Please note the following standard conventions:

 1. All code is placed within a single segment called Code.

 2. Data cannot be declared within the assembly routine.

 3. The BP, SP, and DS are preserved. DS and SS need only be preserved,
    if used. The above example uses the standard entry and exit form
    for Microsoft interfacing.


 7. QuickPascal Fillmasks Are Transparent

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 25-MAY-1989    ArticleIdent: Q44476

 Question:

 Turbo Pascal Version 5.00 fillmasks are opaque. Does QuickPascal
 follow this convention?

 Response:

 No, it does not. QuickPascal fillmasks are transparent; however, there
 are differences in how fillmasks are handled by different
 figure-drawing functions.

 If you use a _rectangle function and fill the rectangle with a
 pattern1, then draw an overlapping second rectangle and fill that with
 a pattern2, you will see both patterns in the overlay area. In Turbo
 Pascal 5.00, you will only see pattern2 in the overlay area.

 The _ellipse and _pie functions use a different fill algorithm
 (floodfill). Thus, if you fill an overlapping ellipse (or pie) it does
 not fill the entire area; it fills until it hits a solid border.
 Depending on where the center of the ellipse (or pie) is, either the
 overlap area or the nonoverlap area is filled; not both. In the case
 of the overlap area being filled, you see both patterns.

 The following program draws two overlapping rectangles and two
 overlapping ellipses with different centers and fills them with
 different patterns:

 program fill (input, output);

 uses MsGraph, Crt;

 CONST
    mask1 : _FillMask = (0,66,36,24,0,0,0,0);
    mask2 : _FillMask = (0,0,0,0,24,36,66,0);

 VAR
    errorcode : INTEGER;
    c         : CHAR;

 BEGIN
    errorcode := _setvideomode(_MRES16COLOR);

    _setcolor(3);
    _setfillmask (mask1);
    _ellipse (_GFILLINTERIOR,100,40,160,170);
    _ellipse (_GFILLINTERIOR,210,40,280,140);
    _rectangle (_GFILLINTERIOR,0,20,60,80);

    _setfillmask (mask2);
    _rectangle (_GFILLINTERIOR,20,40, 80,130);
    _ellipse (_GFILLINTERIOR,110,40,200,180);
    _ellipse (_GFILLINTERIOR,260,40,310,200);

    c := ReadKey;
    errorcode := _setvideomode(_DEFAULTMODE);
 END.


 8. Misleading Error Message in QuickPascal Debug Window

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 26-SEP-1989    ArticleIdent: Q44708

 If a numeric value followed by a letter is entered in the QuickPascal
 Debug window, the error message "<Error P0008: Invalid end of line>"
 is displayed. This is misleading. A more accurate error message is
 "Invalid expression."

 An example of when this error message appears is if you mistyped the
 command "32,h" (which is used to print the hexadecimal equivalent of
 32). The misleading error message will be reported if the command is
 entered as "32h".

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 9. Byte Used as Parameter Generates Invalid Error Message

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 31-MAY-1989    ArticleIdent: Q44709

 The following program produces "Error 127: Invalid variable reference"
 when compiled with QuickPascal 1.00. The error message is incorrect
 because the syntax for the code is correct.

 PROCEDURE Broken (VAR b : Byte);
 BEGIN
 END;

 VAR
     x : Boolean;

 BEGIN
    Broken ( Byte(x) );
 END.

 Microsoft has confirmed this to be a problem in QuickPascal Version
 1.00. We are researching this problem and will post new information
 when it becomes available.

 To work around the problem, use a temporary variable as the parameter
 passed to Broken, as follows:

 PROCEDURE Broken (VAR b : BYTE);
 BEGIN
 END;

 VAR
     x    : BOOLEAN;
     temp : BYTE;

 BEGIN
    temp := Byte (x);
    Broken ( temp );
 END.


 10. QP Cannot Compare Packed Arrays of Char > 255 Elements

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 31-MAY-1989    ArticleIdent: Q44710

 QuickPascal generates "Error 51: Conflicting operands" when packed
 arrays of characters greater than 255 elements are compared.

 Turbo Pascal has the same limitation. Packed arrays of characters with
 more than 255 elements are not supported in QuickPascal. The on-line
 help should mention this, but does not.

 The following program demonstrates the problem:

 CONST
    max = 256;

 VAR
    s1,
    s2  : PACKED ARRAY [1..max] OF CHAR;
    i   : INTEGER;

 BEGIN
     FOR i := 1 TO max DO
       BEGIN
           s1[i] := ' ';
           s2[i] := ' ';
       END;

     IF s1=s2
        THEN Writeln ('PASS')
        ELSE Writeln ('FAIL');
 END.


 11. Documentation Error in QuickPascal README.DOC: QPENV.ENV

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 21-JUN-1989    ArticleIdent: Q45488

 The README.DOC file from the Setup/Utilities disk of QuickPascal
 Version 1.00 incorrectly states that information regarding the QP
 environment is found in the file titled QPENV.ENV. Information on the
 environment is actually found in the help file named QPENV.HLP.


 12. _GrStatus Is Documented in the On-line Help Only

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-JUN-1989    ArticleIdent: Q45489

 QuickPascal contains the MSGraph function _GrStatus, which returns the
 status of the most recently executed graphics routine. _GrStatus
 checks for errors that can occur when executing graphics routines.

 _GrStatus is not covered in "Pascal by Example," but it is completely
 documented in the on-line help system.

 See the on-line help system program, PALETTE1, for an example of how
 to use _GrStatus.


 13. QuickPascal Will Hang above 173 Levels of Nested Procedures

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 21-JUN-1989    ArticleIdent: Q45491

 In the Pascal language, procedures may be defined within other
 procedures. If you nest too many procedures, QuickPascal (and QPL)
 will hang. The procedures can be nested up to 127 levels with
 QuickPascal and Turbo Pascal. Above 127 levels, Turbo Pascal generates
 the error "Too many nested scopes"; above 128 levels, QuickPascal
 generates the error "Unknown identifier (P128)." However, above 173
 levels of nesting, QuickPascal will hang.

 Microsoft has confirmed this to be a problem in QuickPascal Version
 1.00. We are researching this problem and will post new information
 as it becomes available.


 14. QuickPascal Supports Arrays Up to Limit of DOS

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-JUN-1989    ArticleIdent: Q45492

 QuickPascal supports static and dynamic allocation of arrays up to 64K
 in length. When using getmem() to allocate an array dynamically, you
 may allocate from 0 to 65519 bytes. The static allocation limit is
 restricted by a total data segment size of 64K. All other static data
 and start-up and run-time overhead also come out of this 64K.

 If you would like to allocate data items larger than this amount, you
 must use BIGHEAP.QPU, which is a unit provided to do so. The sample
 program BIGMEM.PAS gives an example of how to do this. BIGHEAP.QPU
 allows allocations up to the amount of free memory under DOS.


 15. Latest Logitech Mouse Driver Works Fine with QuickPascal

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 23-JUN-1989    ArticleIdent: Q45636

 There were some problems with early Logitech mouse drivers and
 QuickPascal 1.00. Two of the problems are as follows:

 1. When QuickPascal was in 43-line mode, the mouse would not go below
    line 25.

 2. The mouse cursor appeared to split into two pieces so it appeared
    as if you had two cursors.

 All known problems with Logitech Mice and QuickPascal Version 1.00 are
 solved by obtaining the latest mouse driver (Version 4.00) from
 Logitech. You can call Logitech at (415) 795-0427.


 16. Type with STRING Can Hang QP.EXE If Tracing (F8) Through Code

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# S910111-255 buglist1.00
 Last Modified:  6-FEB-1991    ArticleIdent: Q68662

 An assignment to the second string variable within a record type will
 hang the machine if you try to Trace (F8) through the source code in
 the QP.EXE environment. This problem will occur when you try to step
 through any statement after the string assignment.

 Microsoft has confirmed this to be a problem in Microsoft QuickPascal
 version 1.00 for MS-DOS. We are researching this problem and will post
 new information here as it becomes available.

 The program will execute correctly as an executable .EXE file.

 The following code will hang the machine after the assignment of
 F^.Str2 when using the Trace (F8) command in QP.EXE. To duplicate the
 problem, the second variable within the record must be a string. The
 length of the string does not matter. The program will hang if you
 Trace (F8) though the code and then try to step through any statement
 after the string assignment.

 Sample Code
 -----------

 program test;
 uses DOS;
 type
    FCB = record
       Str1 : integer;         {anything}
       Str2 : string[3];       {has to be a string}
    end;
 var
    F : ^FCB;

 begin
    F^.Str1 := 34;
    F^.Str2 := '34';           {step through and hangs}
 end.


 17. QP 1.00 README: Special Instructions for QuickPascal Express

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 27-JUN-1989    ArticleIdent: Q45968

 The following information is taken from the QuickPascal Version 1.00
 README.DOC file.

 Special Instructions for QP Express
 -----------------------------------

 You may have difficulty running the QP Express Computer-Based Training
 (CBT) program due to your video driver/graphics card combination. Try
 the following:

 1. Make a backup copy of the QP Express or QP Express/QP Advisor disk.
    Use the backup copy for the remainder of this procedure.

 2. On the backup copy of the QP Express or QP Express/QP Advisor disk,
    you will find files with the extension .VID. Each of these files is
    a driver for a specific type of graphics card. The following
    drivers support the indicated graphics cards:

       Driver            Graphics Cards
       ------            --------------

       ATT6300.VID       For Olivetti and ATT PCs
       CGASNO.VID        For CGA cards that produce a snow effect
       ERICSSON.VID      For Ericsson PCs
       HERC102.VID       For the Hercules 102 card
       HERC112.VID       For the Hercules 112 card

    If you use one of these computers/displays, rename the appropriate
    driver to SCREEN.VID. For example, if you run an AT&T computer,
    type the following:

       RENAME ATT6300.VID SCREEN.VID

 3. You can now resume SETUP or run the CBT directly by typing LEARN.


 18. QuickPascal Data Type Byte Is Unsigned Not Signed

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 23-JUN-1989    ArticleIdent: Q45970

 The documentation "Pascal by Example" incorrectly states that data
 type Byte is a signed byte (value range from -128 to 127) on Page 156.

 The documentation correctly states that data type Byte is an unsigned
 byte (value range from 0 to 255) on Page 14. Data type Byte is also
 correctly identified as an unsigned byte in the QuickPascal Advisor
 (on-line help) under "Pascal Language, Data Types."


 19. All Objects Must Be Defined Before Methods Can Be Written

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1989    ArticleIdent: Q46008

 When creating a QuickPascal program involving object-oriented
 programming (OOP), you must define all objects before writing the
 methods associated with these objects. It may seem natural to define
 an object, the methods associated with it, and then the next object;
 however, this is not the proper way to write QuickPascal OOP code.

 You get the following error:

    Source: C:\Workdir\file.pas
    Error 21: BEGIN expected

 Instead, you must define all of your objects first, and then define
 all of their methods.

 Incorrect Coding
 ----------------

 PROGRAM test;

 Type
    Texperiment1 = OBJECT
       ch1 : char;
       PROCEDURE exp_method1;
    End;
    PROCEDURE Texperiment1.exp_method1;
    Begin
      { Method code }
    End;

    Texperiment2 = OBJECT
       ch2 : char;
       PROCEDURE exp_method2;
    End;
    PROCEDURE Texperiment2.exp_method2;
    Begin
      { Method code }
    End;

 BEGIN    { Main Code }
 END.     { End of main }

 Correct Coding
 --------------

 PROGRAM test;

 Type
 { Define Objects }
    Texperiment1 = OBJECT
       ch1 : char;
       PROCEDURE exp_method1;
    End;

    Texperiment2 = OBJECT
       ch2 : char;
       PROCEDURE exp_method2;
    End;

 { Define Methods }
    PROCEDURE Texperiment1.exp_method1;
    Begin
      { Method code }
    End;
    PROCEDURE Texperiment2.exp_method2;
    Begin
      { Method code }
    End;

 BEGIN    { Main Code }
 END.     { End of main }


 20. QuickPascal Allows Redirection at the DOS Prompt

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 27-JUN-1989    ArticleIdent: Q46132

 DOS redirection allows you to specify both input and output files for
 Microsoft QuickPascal programs. In programs that do not use the Crt
 unit, all that is required is to issue the following command line:

    programname <inputfile >outputfile

 If the program uses the Crt unit, the command line above must be used,
 and in addition, the following four lines must be included in the file
 prior to the first input or output statement:

    Assign( Input, '' );
    Reset( Input, '' );
    Assign( Output, '' );
    Reset( Output, '' );

 The above four lines are required because the Crt unit changes the
 names of the standard input and output sources; the four lines above
 reassign them to their original settings. This change is made to speed
 up the I/O operations. Programs that do not use the Crt unit send the
 output to the screen through DOS, which adds overhead. Programs that
 use the Crt unit can send the output directly to the BIOS or directly
 to video memory.

 Borland's Turbo Pascal operates the same way. If you want to redirect
 the I/O and use the Crt unit, you must include the same four lines of
 code.

 More information on I/O redirection can be found in the "Microsoft
 QuickPascal Pascal by Example" manual on Page 104. More information on
 the Crt unit can be found in the same manual starting on Page 105.


 21. No Purple-Labeled Disks in QuickPascal Version 1.00

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 13-JUL-1989    ArticleIdent: Q46451

 Problem:

 On Pages 4 and 5 of the "Microsoft QuickPascal Up and Running" manual,
 the following instructions are given:

    Insert the purple-labeled Setup/Utilities distribution disk.

 I don't have any purple-labeled disks.

 Response:

 This is a documentation error. There are no purple-labeled disks with
 Microsoft QuickPascal Version 1.00. All disks, including the
 Setup/Utilities disk, are white, blue, and tan.


 22. Auto Recompile and Debug option

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 13-JUL-1989    ArticleIdent: Q46730

 When you turn the "debug information" option Off in the compile
 options window, the compiler does not recompile when you use F5 to run
 after a change was made in the source.

 When you load a file into QuickPascal (QP) and press F5 to run it, QP
 compiles and runs the program. If you quit the program and go back to
 the source, change the source, and press F5 to run again, QP
 recompiles (because the source was changed) and runs just as expected.

 However, if you turn debug information Off and press F5 to run, QP
 recompiles the program as expected (because a change was made to the
 environment). If you quit the program and return to the source, change
 the source, and press F5 to run again, QP does not recompile here when
 it should because the source has been changed.

 With the debug information option Off, you must use the "build main
 program" option under the Make menu to get the program recompiled.

 Microsoft is researching this problem and will post new information as
 it becomes available.


 23. QuickPascal Editor Cannot Mark Last Line of File

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 13-JUL-1989    ArticleIdent: Q46742

 QuickPascal does not mark (SHIFT+DOWN ARROW) the last line in a file
 unless the line is followed by a linefeed character. To get around
 this problem, you should insert a linefeed or use SHIFT+RIGHT ARROW to
 mark the last line.

 Microsoft has confirmed this to be a problem in QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 24. Cannot Get Context-Sensitive Help on Errors in Debug Window

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 13-JUL-1989    ArticleIdent: Q46743

 If you receive an error while in the debug window, you cannot use the
 on-line help system to get help information. This is a limitation of
 QuickPascal Version 1.00.

 Microsoft has confirmed this to be a problem in QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 25. Undocumented Procedures: _Polygon and _Plygon_wxy

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 13-JUL-1989    ArticleIdent: Q46744

 The following two procedures are included in the graphics unit
 MSGraph, but are not included in the documentation:

    PROCEDURE _Polygon( control  : Integer; VAR pointarray;
                        numpoints: Integer );

    PROCEDURE _Polygon_wxy( control   : Integer; Var pointarray;
                            numpoints : Integer);

 Both procedures draw a polygon in the current color. They either draw
 just the outline of the shape or fill the entire shape depending on
 the value of control, either _GBorder or _GFillInterior. The variable
 pointarray is an array of _XYCoords (or _WXYCoords for _Polygon_wxy),
 each of which specifies one of the polygon's vertices. The argument
 numpoints indicates the number of elements in pointarray (the number
 of vertices).

 Neither of these procedures is documented in "Pascal by Example" or in
 the on-line help system. They are documented within the on-line
 README.DOC file.


 26. QuickPascal 1.00 PACKING.LST

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 24-OCT-1989    ArticleIdent: Q46746

 Packing List for Microsoft QuickPascal (R) Compiler, Version 1.00
 5.25-inch disk set is as follows:

 Disk 1: Setup/Utilities

    Files                  Description
    -----                  -----------

 PACKING.LST            Packing list (this file).
 SETUP.EXE              SETUP program -- installs QuickPascal.
 README.DOC             Directs you to README in Help.
 FIXSHIFT.COM           Fixes BIOS bug for certain Compaq and other
                        keyboards.
 MOUSE.COM              Microsoft Mouse driver.
 MSHERC.COM             TSR -- supports Hercules (R) card graphics.
 QPMKKEY.EXE            Creates customized keyboard command files.
 SAMPLES\BIGHEAP.PAS    New versions of GetMem and FreeMem that allocate
                        heap space in blocks larger than 65520 bytes.
 SAMPLES\BIGMEM.PAS     BIGMEM.PAS uses the sample BigHeap unit.
 SAMPLES\MOUSE.PAS      Real mode mouse control routines; derived from
                        Microsoft OS/2 programmer's reference, Chapter 3.
 SAMPLES\SORTDEMO.PAS   Demonstrates six common sorting algorithms.
 SAMPLES\OBJECTS.PAS    Object-oriented demo.
 SAMPLES\CRLF.PAS       Normalizes all line endings of a text file to CRLF.
 SAMPLES\GRDMEO.PAS     Demonstrates the QuickPascal graphics library. It
                        uses two additional units: menu and turtle.
 SAMPLES\MENU.PAS       Used by Grdemo.
 SAMPLES\TURTLE         Used by Grdemo (for Turtle graphics).
 BRIEF.KEY              Keyboard MAP files.
 EMACS.KEY                " "
 EPSILON.KEY              " "
 QP.KEY                   " "
 ME.KEY                   " "

 Disk 2 : Program

    Files                  Description
    -----                  -----------

 QP.EXE                 Microsoft QuickPascal program environment.
 QPL.COM                QuickPascal command-line compiler.
 QPL.ERR                QuickPascal compiler error messages.

 Disk 3: Microsoft QuickPascal Advisor

    Files                  Description
    -----                  -----------

 QP.HLP                 QuickPascal help files.
 QPENV.HLP                " "

 Disk 4: Libraries

    Files                  Description
    -----                  -----------

 SYSTEM.QPU             System Unit.
 CRT.QPU                CRT Interface Unit.
 DOS.QPU                DOS Interface Unit.
 MSGRAPH.QPU            Graphics Interface Unit.
 MSGRUTIL.QPU           Graphics Support Unit.
 GRAPH.QPU              Graphics Support Unit.
 PRINTER.QPU            Printer Interface Unit.
 COURB.FON              Font files.
 ROMAN.FON                " "
 SCRIPT.FON               " "
 TMSRB.FON                " "
 HELVB.FON                " "
 MODERN.FON               " "

 Disk 5: Microsoft QuickPascal Express

    Files                  Description
    -----                  -----------

 LEARN.EXE              Computer-Based Training file.
 QPCBT.CTX                " "
 QPCBT.SCN                " "
 QPCBT.SOB                " "
 LEARN.PIF              Computer-Based Training Windows PIF file.
 ATT6300.VID            Computer-Based Training display drivers.
 CGASNOW.VID              " "
 ERICSSON.VID             " "
 HERC102.VID              " "
 HERC112.VID              " "
 QPERR.HLP              QuickPascal additional help files.
 QPGRAPH.HLP              " "
 NOTES.HLP                " "

 Additional reference words: distribution directory disks qp


 27. How to View Registers When Debugging Assembly Modules

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified:  6-SEP-1989    ArticleIdent: Q46768

 In the data sheet for QuickPascal, there is the following statement
 that describes the ability of QuickPascal to display CPU registers:

    In addition, the integrated debugger supports debugging assembly-
    language routines imported into your program with the $L directive,
    including viewing of CPU registers.

 This point requires elaboration to successfully view the registers.

 As an example, if you have an assembly module named foo.asm that will
 be invoked from your Pascal code, then you can view registers when you
 have a {$L foo.obj} in your code and you have the assembler source
 file present in the current directory.

 When you start debugging and you enter into a procedure from foo.obj,
 you will automatically see the registers in the debug window, and in
 another window you will see the assembler file.


 28. Incorrect Syntax in Var-String Checking Sample Procedure

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 18-AUG-1989    ArticleIdent: Q46804

 The section on Page 78 of Microsoft's "Pascal by Example" that
 describes var-string checking has a sample procedure header of
 incorrect syntax.

 The procedure is declared as follows:

    PROCEDURE print_str ( data_str : STRING[20]);

 Compiling this statement results in the following error message:

    ERROR 19: ")" expected

 The procedure should be declared as follows:

    PROCEDURE print_str ( data_str : STRING);


 29. QuickPascal Uses LIM 4.0 for EMS Swapping When Enabled

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 25-AUG-1989    ArticleIdent: Q46842

 Problem:

 When attempting to invoke QuickPascal Version 1.00 with the /SWAP:EMS
 command line option, the following error message occurs:

    Cannot open swap file

 This error occurs with 2 MB of expanded memory.

 Response:

 QuickPascal Version 1.00 supports LIM specification 4.0 EMS. (the 3.2
 LIM specification is not supported.)

 To use this option, you must have at least 1 MB of free expanded
 memory and a device driver that supports LIM specification 4.0.

 For more information please see Page 4 of the README.DOC file
 contained within the QuickPascal on-line help system.


 30. QP with /Zi Does Not Place CodeView Information into .EXE

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1989    ArticleIdent: Q47015

 In QuickPascal Version 1.00, it is not possible to use /Zi to get
 CodeView information into the executable file.

 CodeView will run QuickPascal executables, but it comes up in assembly
 mode because there is no symbolic information.

 Currently, there is no way to get CodeView information into the
 executable file.

 This feature is under review and will be considered for inclusion in a
 future release.


 31. QuickPascal Sound Function Sounds Different Than Turbo

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified:  6-SEP-1989    ArticleIdent: Q47017

 I have a program that uses the sound function in the CRT unit. It
 sounds different when I run it in QuickPascal than when I run it in
 Turbo.

 The program plays a short sound that increases in frequency. When I
 run it in Turbo, it sounds crisp; however, when I run it in
 QuickPascal, it sounds very grainy and rough.

 The following repeat loop generates a different quality of sound when
 run under the two products:

     i := 440;
     repeat
         sound(i);
         delay(12);
         inc(i,5);
     until i > 880;
     nosound;

 This loop calls the standard sound function from the QuickPascal unit
 CRT. It generates slightly different sound than TurboPascal.

 If it is mandatory that this loop sound identical to Turbo (for
 compatibility issues), you could replace the built-in sound and
 nosound functions with the following two procedures in your source
 code:

 procedure mysound( hz : word );
 var ps    : byte;
     count : word;
 begin
     if hz > 0 then
         begin
             ps := Port[97];
             if (ps and $03) = 0 then
             begin
                 Port[97] := ps or $03;
                 Port[67] := 182;
             end;
             count := 1193280 div hz;
             Port[66] := Lo(count);
             Port[66] := Hi(count);
         end;
 end;

 procedure mynosound;
 begin
     Port[97] := Port[97] and not $03;
 end;

 Then, call your own sound functions (mysound and mynosound) instead of
 the regular sound function in CRT. For example, the above repeat loop
 would now look similar to the following:

     i := 440;
     repeat
         mysound(i);
         delay(12);
         inc(i,5);
     until i > 880;
     mynosound;

 Microsoft has confirmed this to be a problem in QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 32. {$E} and {$O} Directives

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1989    ArticleIdent: Q47022

 Two compiler directives, {$E} and {$O}, are accepted by the
 QuickPascal (QP) compiler, yet no help or documentation is available
 on these directives outside of the README.DOC.

 The directives are accepted by the compiler for compatibility with
 TurboPascal. These two directives are actually ignored.

 The {$E} directive controls the usage of the emulator math package
 with the Borland product, while the {$O} directive controls overlay
 code generation. Neither of these directives is supported under QP.

 Information concerning QP and these two directives is in the
 README.DOC file included with the QuickPascal package.


 33. "Error 131: Invalid Real Operation" Constant Out of Range

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00 docerr
 Last Modified:  6-SEP-1989    ArticleIdent: Q47032

 The program shown below generates the following error message:

    Error 131: Invalid real operation

    An operation on two real types in this statement resulted in an
    invalid floating-point operation. Either an overflow occurred or
    an attempt was made to divide by zero.

 This explanation may be misleading because the error also occurs
 when a declared constant is out of range.

 The following program illustrates this problem:

 PROGRAM test
 CONST
   co : COMP = 9e20;       { this value is out of range   }
 BEGIN                     { The range should be          }
 END.                      {    9.2E-18 to 9.2E+18        }

 Microsoft has confirmed this to be a problem in QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 34. QuickPascal Does Not Support Multiple Debug Sessions

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1989    ArticleIdent: Q47033

 Question:

 If I load two different programs into QuickPascal, set a breakpoint in
 the first program, and try to execute the second program, I get the
 following error and QuickPascal switches back to my first program:

    Cannot set breakpoint

 On-line help for this error indicates that a breakpoint was set on a
 line that does not contain executable code.

 The breakpoint within my first program is set correctly and I did not
 try to set a breakpoint within my second program. What causes this
 problem?

 Response:

 Microsoft QuickPascal Version 1.00 does not support multiple debug
 sessions. You must clear the breakpoints from your first program
 before you try to run or trace your second program. When you run a
 second program, all debug information for the first program is lost.


 35. QuickPascal Menu Colors Not Restored on VGA Adapters

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1989    ArticleIdent: Q47034

 When using a VGA display adapter, running or debugging a graphics
 program while inside the QuickPascal (QP) environment causes the menu
 colors to be remapped if the video mode is changed and not restored
 before the control returns to the QuickPascal environment. This
 happens in either of the following situations:

 1. You trace into a program that changes the graphics mode. After the
    colors change, restart or break the program.

 2. You set the video mode and do not restore the default mode before
    the program ends.

 This is expected behavior on an VGA display. To prevent this from
 occurring, you must invoke QuickPascal with the /S switch.

 The /S option is used to save the color palettes on the VGA. By
 default, this switch is not active. /S must be used if you have a VGA
 and your graphics program is manipulating the VGA color palettes. This
 switch causes the color palettes to be saved to disk or memory.
 QuickPascal swaps the palettes back when returning to the QP
 environment from your program.

 If the menu colors are not correct after you complete these
 procedures, the colors may have been stored in the QP.INI file. In
 this case, erase the QP.INI file so that defaults will be used the
 next time you start QuickPascal.


 36. QuickPascal Evaluates All Compiler Directives for Syntax

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1989    ArticleIdent: Q47116

 QuickPascal evaluates all directives, even if the directive is
 contained in a block that is not defined.

 On Page 250 of "Pascal by Example," the following text is presented:

    Conditional directives produce different code from the same source
    file if a conditional identifier is defined. The conditional
    directives are, in effect, a variation of the IF control statement.
    If a condition is true, code between the {$IFxxxCondition} and
    {$ENDIF} directives is compiled. If the condition is false, the
    compiler skips the code between the two directives. An optional
    {$ELSE} directive provides further control.

 The part about "If the condition is false..." is misleading. The
 compiler skips until it finds a "{$". The compiler is looking for
 {$ENDIF}. If you have any directives in that block, the compiler will
 check to make sure they are valid.

 The following code illustrates the problem:

 {$IFDEF VER40}
     {$k-}
 {$ENDIF}

 program foo;
 begin
     writeln('This is a test.');
 end.

 Even though VER40 is not defined, the compiler will complain that
 {$k-} is not a valid directive.


 37. _HRES16COLOR Video Mode Constant Spelled Incorrectly in Help

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified:  6-SEP-1989    ArticleIdent: Q47251

 In Microsoft QuickPascal Version 1.00's on-line help, the videomode
 constant "_HRES16COLOR" is spelled incorrectly as "_HRES16COL". It is
 incorrect only in the Index under Video modes.

 The error is under review and will be corrected in a future release of
 QuickPascal.

 To see this incorrect information, invoke QuickPascal, bring up the
 Help.Index menu, choose V on the selection bar, and then choose Video
 modes.


 38. Quick Environments Do Not Notice If Floppy Drive Isn't Ready

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | S_QuickC S_QuickASM
 Last Modified:  6-SEP-1989    ArticleIdent: Q47252

 If you enter one of the QuickC, QuickAssembler, or QuickPascal
 environments, do a File.Open, type in "A:\" to pull up the list of
 files available on Drive A, and the floppy drive is not ready, the
 environment simply waits. If you type "A:\*.*", the QuickPascal
 environment will still wait. The QuickC and QuickAssembler packages
 are better in that they produce an error message that says that an
 invalid file specification was entered. However, the Help menu does
 not mention that this problem can be caused by the drive not being
 ready.

 Microsoft is researching this problem and will post new information as
 it becomes available.


 39. Help for "Cannot Open Swap File" Is Incorrect in QuickPascal

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified:  6-SEP-1989    ArticleIdent: Q47394

 When bringing up the Microsoft QuickPascal Version 1.00 environment,
 the help for the following error message incorrectly states that this
 error occurs when swap is OFF:

    Cannot open swap file

 The help for the error message should state that this error occurs
 when swap is turned ON and there is insufficient disk space or EMS
 memory for the swap file. In addition, this error message can also
 occur when the directory specified for the swap file does not exist.

 The following command line reproduces the error if the directory
 "C:\SWAP" does NOT exist:

    qp /swap:on=c:\swap\swap.dat


 40. Addr() Address Function and @ Operator Example

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 15-SEP-1989    ArticleIdent: Q47479

 The following is a description of the QuickPascal function Addr(), and
 the at-sign operator "@".

    Syntax:     FUNCTION Addr ( VAR id : <ident> ) : Pointer;

 The Addr() function returns the memory address of id, where id may be
 a variable, procedure, or function identifier. The return value of
 Addr() is a 32-bit pointer containing two 16-bit values representing
 the segment and offset of the location of id in memory.

 The at-sign "@" operator is equivalent to the Addr() function.

 The following are examples showing the use of the Addr function and
 the at-sign "@" operator:

 Example 1: Using the Addr() Function
 ------------------------------------

 PROGRAM xAddr;
 VAR
     p : pointer;
 BEGIN
     p := Addr (p);
     Writeln ('The address of p is at ', Seg(p^), ':', Ofs(p^));
 END.

 Example 2: Using the @ Operator
 -------------------------------

 PROGRAM At_Operator;
 VAR
     p : pointer;
 BEGIN
     p := @p;
     Writeln ('The address of p is at ', Seg(p^), ':', Ofs(p^));
 END.


 41. Select Text Fails on Toshiba T1000 with DOS 2.11 in ROM

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified:  6-SEP-1989    ArticleIdent: Q47483

 The Toshiba T1000 with DOS 2.11 in ROM does not select text with the
 SHIFT+arrow keys in the Microsoft QuickPascal environment.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching the problem and will post new information as
 it becomes available.


 42. Get_area := Self.height; Incorrect in "Pascal by Example"

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 11-SEP-1989    ArticleIdent: Q47485

 In Section 15.5, on Page 234 of Microsoft QuickPascal's "Pascal by
 Example," there is a typographical error in the example program
 OBJECTDE.PAS. The second line up from the bottom of the page is
 printed as follows:

    get_area := Self.height;

 The line should be as follows:

    get_area := Self.area;

 This program is also included in the on-line programming examples that
 can be called up from the QuickPascal environment. The on-line example
 contains the correct code.


 43. Illegal File Specification

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | S_QuickC
 Last Modified: 15-SEP-1989    ArticleIdent: Q47611

 No checking is done on path specifications that are entered in the
 Options.Environment menu. Thus, if an invalid path is given for the
 EXE directory, QuickPascal generates the following error:

    Illegal file specification:
    <path and file name here>

 Neither QuickC nor QuickPascal checks to be sure that a path
 specification entered in the Options.Environment menu is valid. Thus,
 if you were to enter the path incorrectly, you would not find out
 until an attempt is made to use the path.

 This is not considered a problem in either QuickC or QuickPascal.


 44. Method Compiler Directive {$M+} Is Disabled by Default

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified:  6-SEP-1989    ArticleIdent: Q47626

 In Section 15.3.1, Page 227 of Microsoft QuickPascal's "Pascal by
 Example," it states that "(The {$M+} directive is enabled by
 default.)" This is incorrect. The default for the Method compiler
 directive is disabled, i.e., {$M-}. You must explicitly enable Method
 checking with {$M+} if you want to use objects and object-oriented
 extensions. In Appendix B, Page 247, the proper default is listed.


 45. File.Open Requires an Extension After Specifying *.XXX

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | S_QuickC buglist1.00
 Last Modified:  6-SEP-1989    ArticleIdent: Q47633

 When you invoke the File.Open menu and specify, for example, *.YYY, QP
 shows the .YYY files in the File List box. If you type in the filename
 such as XXX without the .YYY extension, you receive the following from
 QP:

    'XXX.YYY' does not exist
           Create?

 QP doesn't know that you are referring to XXX.YYY, so it assumes the
 file does not exist. You must include the extension. This also applies
 to QuickC.

 Microsoft is researching this problem and will post new information as
 it becomes available.


 46. Quick Pascal 1.00 Does Not Allow Truncation of Large Files

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1989    ArticleIdent: Q47696

 When attempting to load a file that is too large to fit into the
 environment, Quick Pascal 1.00 does not give the option of truncating
 the file in order to load it.

 This option is under review and will be considered for inclusion in a
 future release of Quick Pascal.


 47. Error 50 and Error 127 in Program FirstGraphics

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified:  6-SEP-1989    ArticleIdent: Q47742

 On Pages 173 and 174 of the Microsoft QuickPascal "Pascal by Example"
 manual, the example program FirstGraphics contains two errors.

 The following

    _MoveTo( vc.NumXPixels DIV 4, vc.NumYPixels * DIV 4);

 will produce

    Error 50: Error in expression

 at compile time. To correct this problem, insert a 3 between * and
 DIV.

 Also,

    _SetVideoMode(_DefaultMode);

 will produce

    Error 127: Invalid variable reference

 at compile time. Assign the function call to an integer such as a or i
 that has already been declared as an integer in the program, as
 follows:

    a := _SetVideoMode(_DefaultMode);

 Pascal functions, unlike C functions, require the returned value to be
 assigned to a variable.


 48. Mixed Pascal/Assembly Example (switch.asm) Does Not Work

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr hang assembly runtime
 Last Modified:  6-SEP-1989    ArticleIdent: Q47771

 The example program in "Pascal By Example," on Page 165, does not work
 as documented. Occasionally the computer locks up, nothing happens
 when the example is executed, or the following error is generated:

    Run-time Error 200: Division by Zero

 To correct the program, add the instructions {$F+} and {$F-} around
 the external declaration for switch().

 This error occurs because the program example neglects the fact that
 an assembly language procedure must be called with a far call. The
 {$F+} turns far calls on, {$F-} turns far calls off. Thus, the example
 program should read as follows:

 {$F+}
 {$L switch}
 PROCEDURE switch(VAR a, b: Word); EXTERNAL;
 {$F-}

 .
 .
 .

 switch(x, y)

 Also, the assembly language file given should have the following lines
 appended to its end:

 CODE ENDS
      END


 49. Index Incorrectly States That a "Single" Is 6-Bytes Long

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 11-SEP-1989    ArticleIdent: Q47799

 The Index entries for the "Single" and "Real" types read as follows:

    Single       Stores 6-byte floating point number
    Real         Stores 6-byte floating point number

 The entry for Real is correct. However, the entry for Single should
 read as follows:

    Single       Stores 4-byte floating point number.

 This information is stated correctly in "Pascal By Example" on Page
 15.

 It is also documented correctly in the Online Help, following a
 different query path as shown below:

 1. Pull down the help menu.

 2. Choose "Contents."

 3. Choose "Data Types."

 4. Choose "Single."

    This screen correctly states that a Single occupies 4 bytes.


 50. Changing Directory/Drive in Shell Changes Them in Picker

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 11-SEP-1989    ArticleIdent: Q47819

 Question:

 I found that changing drives in a shell changes them in the picker. Is
 this correct behavior?

 To reproduce the problem, do the following:

 1. Start QuickPascal (QP) (a file must not have been opened during the
    session).

 2. Call File.Open and note your current drive and directory, then
    cancel.

 3. Execute File.DOS Shell.

 4. Change the drive or directory and exit the shell.

 5. Call File.Open.

 The current drive/directory now matches the drive/directory made
 current while in the shell. Changes made in the shell should not
 affect the current drive/directory of the environment. You should be
 able to change these only with the file picker dialog.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.



 51. QP Unit Swapped In for Trace Isn't Swapped Back Out

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified:  6-SEP-1989    ArticleIdent: Q47999

 If nine windows are opened in QuickPascal (QP) Version 1.00, and a
 trace into a program that uses a unit that isn't loaded in a window is
 made, one of the open files is swapped out so that QP can trace into
 the unit.

 The unit remains in the swapped window upon program completion. If the
 traced program is in the only unsaved window, it is the one swapped
 out. At program completion, the traced program is unavailable for
 further editing (even though it is saved to disk).

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 52. Help for Run-Time Error 103 Is Inaccurate

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00 docerr
 Last Modified:  6-SEP-1989    ArticleIdent: Q48002

 The help for run-time 103 states "An I/O operation was attempted on an
 unopened file." Attempting an I/O operation on an unopened file
 actually generates either run-time 104 or 105. Run-time 103 occurs if
 you try to close a file that was not opened.

 The following are the run-time errors returned when
 procedures/functions are used with unopened (or unassigned) files:

    Func/Proc   Error Returned
    ---------   --------------

    Erase             3
    Rename            3
    Reset           102
    Rewrite         102
    BlockRead       103
    BlockWrite      103
    Close           103
    FilePos         103
    FileSize        103
    Flush           103
    Seek            103
    Eof             104
    Eoln            104
    SeekEof         104
    SeekEoln        104
    Read            104
    Readln          104
    Write           105
    Writeln         105


 53. Getting Help on QuickPascal Errors

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | documentation
 Last Modified: 21-APR-1990    ArticleIdent: Q48055

 To obtain help on QuickPascal error numbers when they are not produced
 by the environment, there are several special steps that must be
 taken. Note that these steps are not required by QuickC due to its
 support of the HELPFILES environment variable.

 Contexts and help text for all of the errors produced by QuickPascal
 are contained in the QPERR.HLP help file. This file is used only when
 help is requested from an error dialog box. For this help file to be
 accessed by the rest of the QuickPascal environment, the following
 copy should be made at the DOS prompt:

    COPY QP.HLP /b + QPERR.HLP /b

 Note: QPERR.HLP should not be erased because it is still the file that
 error dialog boxes use to locate help.

 The contexts of these error messages are in the form E.P####, where
 #### is the error number you are looking for, left-padded with zeros
 to four places. For example, the context for error number 32 would be
 E.P0032.

 Run-time error messages can be searched for by using the format
 E.R####.  For example E.R0202.  (note the R for run-time)

 To search for error number 32, type E.P0032 in an editor window,
 highlight the entire phrase, and then press F1 to search for the
 context.


 54. Address of Function in Debug Window Not Supported

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 15-SEP-1989    ArticleIdent: Q48225

 In the debug window, QuickPascal does not show the value of a function
 or procedure correctly. Instead of showing the actual address, it
 shows the value as 0000:0000.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.

 Viewing the address of a function in the debug window currently is not
 supported. This feature will be considered for inclusion in a future
 release.

 To demonstrate the problem, trace into a program that has a function
 or procedure in it. Bring up the debug window and type the following:

    @foo

 Foo is the name of the function or procedure in question. The @
 operator should cause the address of foo to be displayed, but instead,
 the value 0000:0000 is displayed.


 55. Watch Window Should Be Tiled to Avoid Overlapping

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified:  6-SEP-1989    ArticleIdent: Q48237

 Adding a watch to QuickPascal (QP) Version 1.00 creates a completely
 overlapping debug window, which is impractical for the purpose of
 watching variables. Continued debugging overlaps ALL of the watch
 window, again defeating the purpose. It is necessary to resize each
 time. The best way to handle this is by tiling your existing windows.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 56. File.Save to a Nonexistent Drive Gives Incorrect Error

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 27-SEP-1989    ArticleIdent: Q48239

 If you do a File.Save on a machine with one floppy drive by entering
 B:\XXX.PAS as the filename, QuickPascal (QP) gives the following error:

    Illegal file specification:
         'B:\XXX.PAS'

 B:\XXX.PAS is a valid filename. The error SHOULD say that the drive
 does not exist.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 57. Environment Control of Search Path for Source File

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 11-SEP-1989    ArticleIdent: Q48277

 Question:

 Will adding a search path to the source section of environment control
 affect opening a source file once QuickPascal (QP) has started?

 Response:

 No; the source path section of the environment control has no effect
 on opening any files once QuickPascal has started. If you want to open
 a file in a directory other than the current working directory, you
 must select that directory from the "Dirs / Drives:" window under the
 open menu.

 However, if you were to add a path to the source section of the
 environment menu, and SAVE it, you could quit QuickPascal and then
 enter a file on the command line after QP and it will find the file
 and load QuickPascal with that file. To view this, try the following:

 1. Make a directory named "c:\test", and place a sample .PAS file
    there.

 2. Start QuickPascal and go to the environment menu under "options".

 3. Enter "c:\test" on the source line, select SAVE, and quit
    QuickPascal.

 4. On the command line, you can enter "qp file.pas" from any directory
    and QuickPascal will find your file.


 58. QP 1.00: Marking Text Blocks: Cannot Use Mouse to Mark End

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 11-SEP-1989    ArticleIdent: Q48278

 In the QuickPascal (QP) Version 1.00 environment, use the following
 procedure to mark a text block with the keyboard:

 1. Move the cursor to the desired beginning location (using the
    keyboard or mouse).

 2. Press ^K B, to mark the beginning of the text block.

 3. With the arrow keys, move the cursor to the desired end location.

 4. Press ^K K to mark the end of the text block.

 If the mouse is used to move the cursor to the end of the text block,
 ^K K will fail, and the text block will not be highlighted.


 59. Description of Compiler Option: Var-String Checking

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | $v+ $v- {$v+} {$v-}
 Last Modified: 21-SEP-1989    ArticleIdent: Q48443

 The Var-String checking option controls whether or not strict type
 checking is performed on variable-length string parameters (in
 functions and procedures). When this directive is enabled, formal and
 actual parameters must be of IDENTICAL string types. When this
 directive is disabled, formal and actual string parameters can have
 different declared lengths (e.g. you can pass string[6] type data to
 functions that expect string[8] type data).

 The following program compiles only if Var-String checking is turned
 off. If Var-String checking is enabled, the compiler produces a type
 mismatch error.

 PROGRAM    vartest;
 PROCEDURE  print_str( var data_str : string);
    BEGIN
      writeln(data_str:10);
    END;

 VAR
    data_str1 : STRING[20];
    BEGIN
      data_str1:= 'abcdefghijklmnopqrst';
      print_str(data_str1);
      data_str1:= 'abc';
      print_str(data_str1);
    END.


 60. How to Manually Set Up QuickPascal on a Hard Disk

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 26-SEP-1989    ArticleIdent: Q48738

 The following information explains how to manually set up Microsoft
 QuickPascal Version 1.00 for a hard disk. It shows you how to set
 up in the same way as the SETUP.EXE program.

 This information demonstrates how to set up QuickPascal under the
 directory "QP" on Drive C. Please note that this is not the only
 configuration possible.

 1. Create the following directories:

       C:\QP
       C:\QP\SAMPLES
       C:\HLP

 2. Add the following to your AUTOEXEC.BAT file:

       SET PATH=C:\QP;C:\QC\HLP

    You may place this in a separate batch file if you prefer.
    Note: It is very important that you do not add spaces in or
    after the PATH variable. For example, "SET PATH= C:\QP;C:\QP\HLP"
    and "SET PATH=C:\QP;C:\QP\HLP " do not work correctly.

 3. Add the following to your CONFIG.SYS file:

       FILES=20
       BUFFERS=20

    You must reboot your machine for this to take effect.

 4. Copy the following files to C:\QP:

       File            5.25-Inch Disk          3.50-Inch Disk
       ----            --------------          --------------

       MOUSE.COM       Setup/Utilities         Setup/Program/Utilities
       MSHERC.COM      Setup/Utilities         Setup/Program/Utilities
       QPMKKEY.EXE     Setup/Utilities         Setup/Program/Utilities
       BRIEF.KEY       Setup/Utilities         Setup/Program/Utilities
       EMACS.KEY       Setup/Utilities         Setup/Program/Utilities
       ME.KEY          Setup/Utilities         Setup/Program/Utilities
       QP.KEY          Setup/Utilities         Setup/Program/Utilities
       EPSILON.KEY     Setup/Utilities         Setup/Program/Utilities
       QP.EXE          Program                 Setup/Program/Utilities
       QPL.COM         Program                 Setup/Program/Utilities
       QPL.ERR         Program                 Setup/Program/Utilities
       SYSTEM.QPU      Libraries               Libraries
       CRT.QPU         Libraries               Libraries
       DOS.QPU         Libraries               Libraries
       GRAPH.QPU       Libraries               Libraries
       MSGRUTIL.QPU    Libraries               Libraries
       MSGRAPH.QPU     Libraries               Libraries
       PRINTER.QPU     Libraries               Libraries
       COURB.FON       Libraries               Libraries
       HELVB.FON       Libraries               Libraries
       MODERN.FON      Libraries               Libraries
       ROMAN.FON       Libraries               Libraries
       SCRIPT.FON      Libraries               Libraries
       TMSRB.FON       Libraries               Libraries
       LEARN.EXE       MS Express              MS Express/Advisor
       LEARN.PIF       MS Express              MS Express/Advisor
       QPCBT.CTX       MS Express              MS Express/Advisor
       QPCBT.SCN       MS Express              MS Express/Advisor
       QPCBT.SOB       MS Express              MS Express/Advisor
       ATT6300.VID     MS Express              MS Express/Advisor
       CGASNOW.VID     MS Express              MS Express/Advisor
       HERC102.VID     MS Express              MS Express/Advisor
       ERCSSON.VID     MS Express              MS Express/Advisor
       HERC112.VID     MS Express              MS Express/Advisor

 5. Copy the following to C:\QP\HLP:

       File            5.25-Inch Disk          3.50-Inch Disk
       ----            --------------          --------------

       README.DOC      Setup                   Setup/Program/Utilities
       PACKING.LST     Setup                   Setup/Program/Utilities
       QP.HLP          MS Advisor              MS Express/Advisor
       QPENV.HLP       MS Advisor              MS Express/Advisor
       QPERR.HLP       MS Express              MS Express/Advisor
       QPGRAPH.HLP     MS Express              MS Express/Advisor
       NOTES.HLP       MS Express              MS Express/Advisor

 6. Copy all *.PAS files to C:\QP\SAMPLES.

 Microsoft QuickPascal Version 1.00 should now be set up on your hard
 disk.


 61. Error 19 Caused By Missing Space in Expression

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 26-SEP-1989    ArticleIdent: Q48843

 Under QuickPascal Version 1.00, 'error 19: ")" expected', occurs on
 any expression where a real number with no digits after the decimal
 point exists with a closing parenthesis directly to the right.
 Inserting a space or a 0 (zero) after the decimal eliminates the
 error.

 The following valid expression

    x := (1. + 1./9.);

 generates the following error and marks the decimal before the closing
 parentheses:

    error 19: ")" expected

 No error is generated if a space is inserted between the decimal and
 the closing parentheses, as follows

    x := (1. + 1./9. );

 or a zero is inserted after the decimal, as in the following:

    x := (1. + 1./9.0);

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 62. Problem in Options Environment Causes Vague Error

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 26-SEP-1989    ArticleIdent: Q48946

 If an incorrect path is entered in the Options.Environment window in
 the space for the EXE directory, an error message pop-up is returned
 when a compile is attempted. An incorrect path is a path to a
 non-existent directory or a directory path that exceeds the
 64-character length permitted by MS-DOS. The following is the message
 that is returned:

    +------------------------+
    |   Source:  xxxxx.PAS   |
    |   Cannot create file   |
    |    < OK >    <Help>    |
    +------------------------+

 This error message doesn't clarify the cause of the error. QuickPascal
 should return an error message that states "Invalid Executable Path"
 (or equivalent). However, since MS-DOS doesn't return enough precise
 error information, a clearer message is currently impossible.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.

 To correct the problem, make sure that the environment path is valid,
 i.e., set to an existing directory, and/or is fewer than 64 characters
 in length.


 63. QP Reports Incorrect Number of Lines Compiled If Lines > 65535

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 26-SEP-1989    ArticleIdent: Q48986

 While compiling, QuickPascal displays a running total of the number of
 lines compiled in the currently compiling module, as well as the total
 number of lines in all modules compiled so far. This progress
 information is correct for programs up to 65,535 total lines. For
 larger programs, after compiling the 65,535th line, the counter wraps
 around and begins at 0 (zero) again.

 Therefore, when compilation is complete, QuickPascal displays the
 actual number of lines minus 65,536. So, if your program has 65,540
 lines, QPL displays 4 lines compiled instead of the correct number of
 lines. This problem occurs both in the environment and with the command
 line compiler QPL.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 64. Modification of Type Comp with Negative Exponent

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified:  2-OCT-1989    ArticleIdent: Q48990

 When a variable of type comp is modified using the Debug.Modify value
 option in QuickPascal, unexpected results may occur. When the variable
 is modified using scientific notation to have a negative exponent,
 e.g. 1.5E-6, the resulting value that is stored in that variable is
 incorrect, e.g. 2.4309066601E+14.

 To reproduce the error, use the following code fragment and carry out
 the steps outlined below (any code that has a variable of type comp
 can be substituted):

 Code Fragment
 -------------

    program compmod (input, output)

    var comptest: comp;

    begin
    end.

 Use the following steps to reproduce the problem:

 1. Begin tracing through the program using the F8 key.

 2. Enter the Debug window and add a watch on the variable comptest.

 3. Enter the Debug window and select "modify value". Modify the comptest
    variable to be a value with a negative exponent (e.g. 6.6E-6). The
    value in the watch value demonstrates the error.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 65. Make Menu Doesn't Show Product as .QPU When Source Is a Unit

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified:  2-OCT-1989    ArticleIdent: Q49009

 When compiling a stand-alone unit, the make menu should change to show
 that the product is <file>.QPU instead of <file>.EXE. This is not the
 case in QuickPascal Version 1.00. This could be confusing since a
 compilation finishes without error and the menu shows that <file>.EXE
 was produced when in actuality <file>.QPU was produced.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 66. On-Line Help Incorrectly Describes Range Checking

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified:  2-OCT-1989    ArticleIdent: Q49116

 Use the on-line help to look up compiler options. The $R (range
 checking) directive is incorrectly listed in the on-line help as being
 turned on ($R+) for default. The actual default is off ($R-).


 67. Characters Beyond Column 255 Become Reversed in Editor

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00 QP
 Last Modified:  2-OCT-1989    ArticleIdent: Q49117

 When a long line is typed in the QuickPascal editor and the 255th
 character is reached, following characters are displayed in reverse
 order and a beep is sounded for each character. Characters beyond
 Column 270 scroll off the screen. The following is an example:

                              255            270
                               |              |
    hello there hello there helolleh ereht olle

 Although QuickPascal won't let you view more than 255 character lines,
 it maintains data after the 255th column. These characters, however,
 are useless because they are preserved in reverse order. In addition,
 lines longer than 128 in length are longer than the maximum allowable
 by the compiler.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 68. Real Variables Can Be Modified to Less Than Minimum Value

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified:  2-OCT-1989    ArticleIdent: Q49118

 When using QuickPascal's debugging features to modify real values, it
 is possible to specify an incorrect value. The results vary for
 different types of reals.

 When most real variables are modified to below their allowable
 minimum, they are modified by the environment to become 0 (zero).
 However, for the types double and extended, the value severely loses
 accuracy between X.Xe-308 and X.Xe-325. These ranges vary slightly
 depending on the values of X.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.


 69. File.DOS Shell While Running Program Stops Execution

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 10-OCT-1989    ArticleIdent: Q49317

 In QuickPascal Version 1.00, if you are using F8 to step through your
 program and choose DOS shell from the File menu, when you exit from
 that shell, the program you were running is restarted.

 To demonstrate this behavior, use the following procedure:

 1. Load the following sample program into the QuickPascal environment:

       program hello (output);

       begin
               writeln ('hello');
               writeln ('goodbye');
       end.

 2. Compile the program by invoking Build Main File from the MAKE menu.

 3. Press F8 to step to the begin line.

 4. Press F8 again to step to the writeln ('hello'); line.

 5. Invoke DOS Shell from the File menu. QuickPascal will shell to the DOS
    command prompt.

 6. Type "exit" (without the quotation marks) at the DOS command prompt
    to quit that shell and return to the QuickPascal environment.

 Now, if you press F8 again, you might expect to execute the
 writeln('goodbye'); line because that is exactly where you left off.
 However, QuickPascal starts executing from the beginning again.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. This feature is under review and will be considered for changes
 in a future release.


 70. Watching Out-of-Range Integers

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 10-OCT-1989    ArticleIdent: Q49320

 Problem:

 In the program below, the value of -32768 is assigned to an integer
 called X. I want to watch -X and see 32768 in the watch window. However,
 QuickPascal shows -32768 when I watch -X.

 Program test;

 var X : integer;

 begin
     X := -32768;
 end.

 Response:

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information as
 it becomes available.

 QuickPascal handles this condition correctly up to the limit of an
 integer. For example, if you assign X the value of -32767 and then
 watch -X, QuickPascal displays 32767 in the watch window.

 This does not work for -32768 because you have exceeded the range of
 an integer. If you plan to store an integer larger than plus or minus
 32767, you must use the appropriate data type, longint.

 In the program below, X is now a longint. You can now watch -X and see
 32768 in the watch window.

 Program Example
 ---------------

 Program test;

 var X : longint;

 begin
     X := -32768;
 end.


 71. QuickPascal 1.00: A Program Can Use Up to 81 Units

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 10-OCT-1989    ArticleIdent: Q49499

 As documented in "Pascal by Example" on Page 88, a QuickPascal Version
 1.00 program can use up to 81 units.

 A "unit" is defined as "a related collection of declarations and
 procedures."

 For more information on units, refer to Pages 87-93, Chapter 7, the
 section titled "Units", in the Microsoft QuickPascal "Pascal by
 Example" text.


 72. How to Process Command-Line Arguments in QuickPascal

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 14-FEB-1990    ArticleIdent: Q58319

 Question:

 How do I process command-line arguments in QuickPascal?

 Response:

 Command-line arguments are accessed through two functions included in
 the SYSTEM unit: ParamCount and ParamStr. ParamCount returns the
 number of command-line arguments, while ParamStr can return a specific
 command-line argument in the form of a string. See the sample program
 below or see sample programs in the online help that show how to
 process command-line arguments.

 These online help sample programs are as follows:

     PARAMS.PAS
     SUMINT.PAS
     SUMREAL.PAS
     EXITHALT.PAS

 These files can be found under "Example Programs" on the Contents menu
 in the online help (that is, Help.Contents.Example
 Programs.-program-name-, where -program-name- is the name of the
 sample program).

 Code Sample
 -----------

 The following program also shows how to process command-line
 parameters:

 PROGRAM foo;

 VAR
     count,
     i       :  Word ;

 BEGIN
         { Display each command-line argument. }

         Writeln( 'Command-line arguments:' );
         Writeln;

         count := ParamCount;            { Number of parameters }

         FOR i :=0 TO count DO
                 Writeln( 'Parameter ', i, '   ', ParamStr( i ) );

 END.

 Compile the above program and then run it by typing the name of the
 .EXE file followed by various argument strings separated by spaces.


 73. Clicking on Help Contents Dots Might Not Work in QuickPascal

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 30-NOV-1989    ArticleIdent: Q49713

 When using the right mouse button to select help contents, clicking on
 the dots associated with a desired help topic might have no result.

 To accurately choose an item from the help contents window, click on
 the desired word or phrase next to the dot.


 74. Run-Time Error 105 Caused by Huge Array

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 30-NOV-1989    ArticleIdent: Q49738

 QuickPascal's run-time error 105, which normally means that the file
 specified was not open for output, is also caused by having an array
 indexed from 0 to 65535. The following code demonstrates this:

 Code Example
 ------------

 PROGRAM test;
 VAR
     i : LongInt;
     memflag : ARRAY[0..65535] of Integer;
 BEGIN
     FOR i := 0 to 65535 DO
     BEGIN
       writeln(i);
       memflag[i] := 0;
     END;
 END.

 The above code terminates with error 105. If the array is
 declared to be of type Byte, the program terminates later in the code.
 If the array is indexed any other way (e.g. [1..65535] or [0..65534]),
 the problem does not occur and either error 49 ("Structure too big") or
 error 146 ("Too many variables in the data segment") is displayed.


 75. Break When Expression Is True in Debug Breaks Incorrectly

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 30-NOV-1989    ArticleIdent: Q50131

 If you set a breakpoint (Break When Expression Is True) in one file
 and then run another program that has the same variable, the second
 program breaks when the expression is true from the first program.

 The following demonstrates this problem.

 1. Start with the following programs in two separate tiled windows:

      PROGRAM   foo1;               PROGRAM   foo2;

      VAR  i : INTEGER;             VAR  i : INTEGER;

      BEGIN                         BEGIN

         FOR i := 1 TO 4 DO            FOR i := 2 TO 10 DO
            WRITELN ('i = ',i);           WRITELN ('i = ',i);

      END.                          END.

 2. From foo1 window, go to (Debug.Set Breakpoint.Break When Expression
    Is true) and add "i = 3" (without the quotation marks) in the
    Expression: box.

 3. Press the F5 key to run the foo1. The program will run and print "i
    = 1" and "i = 2" in the output window, then break.

 4. Switch to foo2 window and press the "F5" key to run foo2. The
    program will run and print "i = 2", then break. This should not
    happen. Instead, it should print "i = 2" through "i = 10".

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information
 here as it becomes available.


 76. Help Screen for Error 13 Has Incomplete Information

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00 docerr
 Last Modified: 30-NOV-1989    ArticleIdent: Q50132

 The help screen for "Error 13: String constant exceeds line" says that
 the string does not have a closing quotation mark and that string
 constants must be contained in the same line.

 If a string is not contained in the same line, it still may have a
 closing quotation mark, it's just not on the same line as the opening
 quotation mark. A better explanation would be the following:

    A closing quote for the string was not found on the same line as
    the opening quote. A string must be contained on a single line.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information
 here as it becomes available.


 77. QP1.00:<Find All> Does Not Exist When Searching in Help Window

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-MAR-1990    ArticleIdent: Q50473

 In QuickPascal Version 1.00, when performing a Search.Find in a help
 window, the <Find All> option is unavailable. This option is available
 when searching in a regular file window.

 This option is under review and is being considered for inclusion a
 future release of QuickPascal (QP).


 78. QuickPascal 1.00 PACKING.LST (3.5-Inch Version)

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 30-NOV-1989    ArticleIdent: Q51250

 The following information is from the packing list for the 3.5-inch
 version of Microsoft QuickPascal (R) Compiler, Version 1.00:

 Disk 1: Program/Setup/Utilities

 Files                  Description
 -----                  -----------

 QP.EXE                 Microsoft QuickPascal program development
                        environment.
 QPL.COM                QuickPascal command-line compiler.
 QPL.ERR                QuickPascal command-line compiler error
                        messages.
 PACKING.LST            Packing list (this file).
 SETUP.EXE              SETUP program -- installs QuickPascal.
 README.DOC             Directs you to README in Help.
 FIXSHIFT.COM           Fixes BIOS bug for certain Compaq (R) and other
                        keyboards.
 MOUSE.COM              Microsoft Mouse driver.
 MSHERC.COM             TSR -- supports Hercules (R) card graphics.
 QPMKKEY.EXE            Creates customized keyboard command files.

 SAMPLES\BIGHEAP.PAS    New versions of GetMem and FreeMem that can
                        allocate heap space in blocks larger than 65,520
                        bytes.

 SAMPLES\BIGMEM.PAS     BIGMEM.PAS uses the sample BigHeap unit.
 SAMPLES\MOUSE.PAS      Real mode mouse control routines; derived from
                        "Microsoft OS/2 Programmer's Reference," Chapter
                        3.
 SAMPLES\SORTDEMO.PAS   Graphically demonstrates six common sorting
                        algorithms
 SAMPLES\OBJECTS.PAS    Object-oriented demo.
 SAMPLES\CRLF.PAS       Normalizes all line endings of a text file to
                        CRLF.
 SAMPLES\GRDMEO.PAS     Demonstrates the QuickPascal graphics library.
                        It uses two additional units: menu and turtle.
 SAMPLES\MENU.PAS       Used by Grdemo.
 SAMPLES\TURTLE         Used by Grdemo (for Turtle graphics).
 BRIEF.KEY              Keyboard MAP files.
 EMACS.KEY                " "
 EPSILON.KEY              " "
 QP.KEY                   " "
 ME.KEY                   " "

 Disk 2: Microsoft QuickPascal Advisor/Microsoft QuickPascal Express

 Files                  Description
 -----                  -----------

 QP.HLP                 QuickPascal help files.
 QPENV.HLP                " "
 QPERR.HLP                " "
 QPGRAPH.HLP              " "
 NOTES.HLP                " "
 LEARN.EXE              Computer-Based Training file.
 QPCBT.CTX                " "
 QPCBT.SCN                " "
 QPCBT.SOB                " "
 LEARN.PIF              Computer-Based Training Windows PIF file.
 ATT6300.VID            Computer-Based Training additional display
                        drivers.
 CGASNOW.VID              " "
 ERICSSON.VID             " "
 HERC102.VID              " "
 HERC112.VID              " "

 Disk 3: Libraries

 Files                  Description
 -----                  -----------

 SYSTEM.QPU             System Unit.
 CRT.QPU                CRT Interface Unit.
 DOS.QPU                DOS Interface Unit.
 MSGRAPH.QPU            Graphics Interface Unit.
 MSGRUTIL.QPU           Graphics Support Unit.
 GRAPH.QPU              Graphics Support Unit.
 PRINTER.QPU            Printer Interface Unit.
 COURB.FON              Font files.
 ROMAN.FON                " "
 SCRIPT.FON               " "
 TMSRB.FON                " "
 HELVB.FON                " "
 MODERN.FON               " "


 79. Bad Expression in Debug Window Yields Incorrect Error Message

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified:  4-JAN-1990    ArticleIdent: Q51473

 If you enter a numeric value followed by a character in the debug
 window, you will get the error "Invalid end of line," which is
 incorrect. The error should read "Invalid expression."


 80. Error 73 Caused by Passing Incorrect Parameters

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified:  4-JAN-1990    ArticleIdent: Q51776

 QuickPascal's ERROR 73, which is defined as "Error in Statement," may
 be caused by passing different parameters than that which a function
 or procedure expects.

 As expected, the compiler highlights the call to the procedure or
 function and brings up the error message window. But if you select
 <Help> when given the ERROR 73 message, the QuickPascal environment
 gives "An undefined error occurred in the statement" as more
 information.

 The following code demonstrates this behavior:

 program errtest;

 procedure test;
 var i: integer;
 begin
      i := 3;
 end;

 begin
      test(3);
 end.

 The compiler highlights the call to test and brings up ERROR 73 on a
 pop-up window.


 81. OK to Redefine Predefined Functions and Procedures

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | S_PasCal
 Last Modified:  4-JAN-1990    ArticleIdent: Q51777

 If you define a function or procedure in your QuickPascal program
 which happens to have the same name as a run-time library routine, you
 will receive no error messages, and QuickPascal will accept your
 definition of the function instead of the run-time routine's
 definition.

 The following code demonstrates this behavior:

 program dupefunc;

 function sin (x: Real):Real;
 begin
    sin := 30.0;
 end;

 var x, y : Real;
 begin
    x := 7.0;
    y := sin(x);
    writeln('Sin of 7.0 returns: ', y);
 end.

 The program writes the following line to the screen upon execution:

 Sin of 7.0 returns: 30

 This is expected behavior for QuickPascal and also occurs in Pascal
 Version 4.00.


 82. How to Pass Functions and Procedures As Parameters

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  2-JAN-1990    ArticleIdent: Q51832

 It is possible to pass functions or procedures as parameters to other
 functions or procedures. To do this, you must declare a TYPE of that
 procedure or function and you must declare the procedure or function
 with long calls and returns. The following code demonstrates this:

 Code Example
 ------------

 program passing(input, output);
 type
         Func = function(x : integer) : integer;
         Proc = procedure(x : integer);

 var
         x : integer;

 {$F+}

 function square(x : integer) : integer;
 begin
         square := x * x;
 end;

 procedure printline(x : integer);
 begin
         write('The square of ',x,' is ');
 end;

 {$F-}

 procedure trial(myfunc : Func ; myproc : Proc ; x : integer);
 var
         z : integer;
 begin
         myproc(x);
         z := myfunc(x);
         writeln(z);
 end;

 begin
         trial(square, printline, 5);
 end.

 Note the two types defined in the program: one called Func and the
 other called Proc. The Func type can be any function that takes an
 integer and returns an integer; the Proc type can be any procedure
 that takes an integer. If, for example, you have another procedure
 that takes a single integer, you can pass it with the same Proc type.

 Also note the {$F+} and {$F-} compiler directives. These compiler
 directives tell the compiler to generate long calls and returns.


 83. QuickPascal Cannot Trace Program with Pointers of Type OBJECT

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified:  6-MAR-1990    ArticleIdent: Q57291

 Tracing into a program with pointers of type OBJECT in QuickPascal
 Version 1.00 causes the system to hang at the line that follows the
 assignment of the pointer.

 Trace into the following program in the QuickPascal environment using
 F8. The system hangs at the line after the assignment of the pointer.
 The program runs correctly if you use F5 to run the program from
 within the environment or to run it from the DOS prompt outside the
 environment; the program hangs the machine only when tracing using F8.

 Code Sample
 --------------

      PROGRAM ObjectPointer;
      {$M+}

      TYPE
           obj = OBJECT
                 str : STRING
           END;

      VAR
           ptr : ^obj;

      BEGIN

           new (ptr);
           ptr^.str := 'Hello';
           writeln ('ptr^.str = ', ptr^.str);  { Will hang here.}

      END.

 Microsoft has confirmed this to be a problem with QuickPascal Version
 1.00. We are researching this problem and will post new information
 here as it becomes available.



 84. QuickPascal May Not Install in 3.x Box of OS/2 with HPFS

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 16-JAN-1990    ArticleIdent: Q57312

 QuickPascal may not install properly on a fixed disk if you are in the
 3.x box of OS/2 and your hard drive has the High Performance File
 System (HPFS) installed.

 The following are descriptions of problems that occur when running
 Setup:

 Case 1
 ------

 If you specify the destination drive to be one on which HPFS is
 installed, and if the current default drive is Drive A, QuickPascal
 will always try to use Drive B as the destination drive, unless the
 machine has no Drive B. In this case, QuickPascal will attempt to use
 Drive A as the destination drive, even though you are using A as the
 source drive.

 Case 2
 ------

 If the current default drive is Drive C and Drive C has HPFS
 installed, then QuickPascal will install all files in the root
 directory of Drive C (C:\), even if you specify C:\QP as the
 destination directory.

 To work around setup problems, use a manual installation procedure for
 QuickPascal.

 The following is the manual setup procedure:

 1. Copy all files from the distribution disks to a subdirectory on the
    hard drive.

 2. Invoke QuickPascal from the 3x box.

 3. Correctly set the environment paths from the Options in the
    QuickPascal menu.


 85. FEXPAND() May Return the Wrong Path in QuickPascal

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 16-JAN-1990    ArticleIdent: Q57519

 The QuickPascal Version 1.00 run-time library function FEXPAND() does
 not return the root directory as the directory name if a single
 backslash '\' is passed as a string. Instead, the function returns the
 current working directory.

 Microsoft has confirmed this to be a problem with Microsoft
 QuickPascal Version 1.00. We are researching this problem and will
 post new information here as it becomes available.

 Code Example
 ------------

 PROGRAM findfile;

 USES  Dos;

 VAR
     full_path   : pathstr;
     dir         : DirStr;
     fname       : NameStr;
     exten       : ExtStr;

 BEGIN

     full_path := FExpand( '\' );
     FSplit( full_path, dir, fname, exten );
     Writeln( 'File found first in:' );
     Writeln( 'Drive/directory : ', dir );
     Writeln( 'File name       : ', fname );
     Writeln( 'Extension       : ', exten );

 END.

 The current workaround for this problem is to pass in '\.\' instead of
 '\'. This procedure will return the root directory.



 86. Syntax Charts for Pascal Program Structure -- Declarations

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_pascal
 Last Modified: 21-JAN-1990    ArticleIdent: Q57556

 A block in QuickPascal Version 1.00 is part of a procedure or function
 declaration, or a program or unit. A block is made up of declarations
 and statements, as shown below:

                   +------------------+       +----------------+
      block ------>| declaration part |------>| statement part |
                   +------------------+       +----------------+

 The declaration part is made up of labels, constants, types,
 variables, and procedure/function declarations.  All of these
 declarations are LOCAL to the block.

 Example
 -------

 declaration part -----+--------------------------------------+-->
                    ^  |                                   ^  |
                    |  +--->[ LABEL declaration part ]-----+  |
                    |  |                                   |  |
                    |  +--->[ CONSTANT declaration part ]--+  |
                    |  |                                   |  |
                    |  +--->[ TYPE declaration part ]------+  |
                    |  |                                   |  |
                    |  +--->[ VARIABLE declaration part ]--+  |
                    |  |                                   |  |
                    |  +--->[ PROC/FUNC declaration part ]-+  |
                    |                                         |
                    +-----------------------------------------+

 Labels declared in the LABEL declaration part mark statements in the
 corresponding statement part. Each label marks only one statement.

 Example
 -------

 label
 declaration part ---->{ LABEL }----->[ label ]--+--->{ ; }
                                  ^              |
                                  |              |
                                  +----{ , }<----+

 Digits or identifiers may be used for labels. Digits must be in the
 range of 0-9999.

 Example
 -------

 constant
 declaration part --->{ CONST }----+--->[ const. decl. ]-----+--->
                                ^  |                       ^ |
                                |  |                       | |
                                |  +->[ typed const. decl]-+ |
                                |                            |
                                +----------------------------+
 type
 declaration part ---->{ TYPE }---->[ type decl. ]---+--->
                                ^                    |
                                |                    |
                                +--------------------+

 variable
 declaration part ---->{ VAR }----->[ var decl. ]--+--->
                                ^                  |
                                |                  |
                                +------------------+

 procedure/function
 declaration part --------+--->[ procedure decl. ]-----+--->
                       ^  |                         ^  |
                       |  |                         |  |
                       |  +---->[ function decl ]---+  |
                       |                               |
                       +-------------------------------+

 Code Example
 ------------

 PROGRAM TEST(output);

 LABEL     x1;

 CONST     NUM_GOMERS = 1000;

 TYPE      ARRAY_TYPE = array [1..10] of char;

 VAR       char_array : ARRAY_TYPE;
                    i : integer;

 FUNCTION Foo( spud : char ):integer;

      VAR    x   : integer;

 BEGIN

      x := 5;
      writeln('This should print.');
      Foo := x;

 END;

 BEGIN
      i := 0;

      goto x1;

      if (i < 2) then
        begin
           writeln('this should not print.');
           x1:  i := foo( char_array[1] );
        end;
 END.


 87. Documentation Error in HORIZON.PAS

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 23-JAN-1990    ArticleIdent: Q57860

 The sample program HORIZON.PAS on Page 189 of the "Microsoft
 QuickPascal - Pascal By Example" and the online help example program
 in "Pascal By Example" does not cycle through the 256 colors. The
 following lines are incorrect:

    rainbow[col + 192] := Red OR NOT gray;
    rainbow[col + 192 + 256] := Red OR NOT gray;

 To correct the problem, change "OR" to "AND," as follows:

    rainbow[col + 192] := Red AND NOT gray;
    rainbow[col + 192 + 256] := Red AND NOT gray;

 The correction allows the program to cycle through the 256 colors.


 88. _RemapAllPalette May Fail on VGA

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified:  5-FEB-1990    ArticleIdent: Q57892

 The QuickPascal run-time graphics function, _RemapAllPalette, may fail
 on a VGA if a color that is out-of-range is given as its argument.

 For a value to be a legal color on a VGA, it must be of the binary
 form 0000000000XXXXXX00XXXXXX00XXXXXX. If _RemapAllPalette is given a
 color or an array of colors as an argument, and if any of the colors
 in the array are illegal, the function will terminate execution and
 return. This is not quite consistent with the way it behaves on EGAs.

 This problem is evident in the HORIZON.PAS program located on Page 189
 of "Microsoft QuickPascal - Pascal by Example," and also available
 from the online help by selecting the following from the HELP menu:

    Contents.Pascal by Example Programs.HORIZON.PAS

 A workaround can be achieved by masking each of the values in the
 array with the hex value $003F3F3F. This forces each color back into
 the "legal" range.

 Microsoft has confirmed this to be a problem with the _RemapAllPalette
 function in QuickPascal Version 1.00. We are researching this problem
 and will post new information here as it becomes available.


 89. Different Results When Running Program from DOS Prompt

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  5-MAR-1990    ArticleIdent: Q58109

 Different results may be obtained when running a program from within
 the QuickPascal environment and when running the same executable from
 the DOS prompt.

 The QuickPascal environment may appear to automatically initializes
 all global variables and arrays to 0 (although this behavior is not
 guaranteed); in the case of an array of type BOOLEAN, all entries are
 initialized to FALSE. However, this behavior does not occur after
 exiting the environment and running the same executable from the DOS
 prompt. When running a program from the DOS prompt, any uninitialized
 variables will consistently be undefined.

 Also note that this automatic initialization only applies to global
 variables. Any variable or array declared locally within a procedure
 or function must be initialized, whether running the program from
 within the environment or from the DOS prompt. Otherwise, its value
 (or the value of its elements, in the case of an array) will be
 undefined.

 This is expected behavior. The general rule to follow when writing
 good code is to initialize ALL variables and arrays before use to
 avoid inconsistent results. Otherwise, their contents may be
 undefined, and the output of your program will be unpredictable.

 The following code demonstrates this situation:

 Code Example
 ------------

 PROGRAM bogus_code;

 VAR
         x : integer;
         P : array [1..10] of integer;   { Array declared globally }

 PROCEDURE call;

         VAR

         A : array [1..10] of integer;   { Array declared locally }

 BEGIN

  { Uncomment this section to initialize array A }

    {x := 1;
     while x <= 10 do
         BEGIN
          A[x] := 0;
          x := x+1;
         END;}

     x := 1;

     while x <= 10 do
         BEGIN
          write( A[x], ' ' );  { Print contents of array A }
          x := x + 1;
         END;

     writeln;

 END; { call }

 BEGIN   { main }

         call;

  { Uncomment this section to initialize array P }

    {x := 1;
     while x <= 10 do
         BEGIN
          P[x] := 0;
          x := x+1;
         END;}

     x := 1;

     while x <= 10 do
         BEGIN
          write( P[x], ' ' );  { Print contents of array P }
          x := x + 1;
         END;

     writeln;

 END.

 Compile the above program and run it from within the QuickPascal
 environment using F5. It will print random numbers from array A, while
 array P will output all 0's (zeros), even though it has not been
 explicitly initialized. Then exit the environment and run the program
 from the DOS prompt. Both arrays will then output random numbers. To
 achieve consistent results from both within the QuickPascal
 environment and from the DOS prompt, uncomment the two initialization
 routines above.

 Also note that if the Options.Compiler.Debug_Information switch is
 disabled in the QuickPascal environment, variables and arrays will not
 be initialized, either from within the environment or from the DOS
 prompt.


 90. Path Incorrectly Stated in "Up and Running"

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 26-FEB-1990    ArticleIdent: Q58652

 On Page 7, 11, and 15 of the "Microsoft QuickPascal -- Up and Running"
 manual, the default paths for the file types are incorrectly stated. The
 correct default paths for the file types are shown below:

    Path                      File Type
    ----                      ---------

    C:\QP                     Executable (.EXE)
    C:\QP                     Unit (.QPU)
    C:\QP\HLP                 Help (.HLP)


 91. Using the Undocumented SWAP Option When Invoking QuickPascal

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 26-FEB-1990    ArticleIdent: Q58782

 When compiling a very large program with multiple large modules in
 QuickPascal, a dialog box with the following message may appear:

    Error 1:  Out of memory

 Clicking on the <help> switch of the dialog box reveals the following
 explanation:

    There was not enough memory for compiling. Either the program was
    too big or available memory was insufficient.

    - Split a large program into smaller parts. Put functions and
      procedures into a unit. Allocate variables dynamically rather
      than statically.

    - Close unneeded windows before compiling.

    - Reinvoke QP, swapping to disk or to expanded memory.

         To swap to disk:               QP /SWAP:DISK
         To swap to expanded memory:    QP /SWAP:EMS

 The SWAP option is not documented. The out-of-memory problem may be
 caused by using a large number of units, especially if you are using
 MSGRAPH.QPU or GRAPH.QPU. QuickPascal tries to load ALL of the units
 on the USES line into memory before deciding which parts of these
 units it needs to use. If you have large, memory-intensive units, this
 uses up memory very fast and you may get the "out-of-memory" error
 message even though the resulting executable may be very small.

 However, using SWAP may not be the automatic solution for the
 out-of-memory problem. SWAP does NOT cause these units to be loaded
 into the swap area. When SWAP has been invoked using one of the above
 commands, QuickPascal creates a 1 MB swap file on disk (or in expanded
 memory) to use for swapping in and out some of the QuickPascal
 environment elements. (To use SWAP, you must have at least 1 MB of
 free disk space, or you must be using an expanded memory module.)

 Therefore, reinvoking QuickPascal with the SWAP option still may not
 cure the "out-of-memory" error message.

 At load time, the initial swap area is set aside, and part of the user
 interface (environment) code is loaded into it. The amount of free
 memory does not change after that; that is, HEAP size remains a
 constant. A predetermined amount of code is swapped in and out of the
 swap area in single chunks as needed.

 This swapping area is not used at all by QuickPascal for any of the
 units or the program being compiled, but it should help when making
 room for a very large program that does not use any of the graphics
 units.


 92. QP Help: Error: Out of Memory

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60513

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 1: Out of memory

 There was not enough memory for compiling. Either the program was too
 big or available memory was insufficient.

 - Split a large program into smaller parts. Put functions and
   procedures into a unit. Allocate variables dynamically rather than
   statically.

 - Close unneeded windows before compiling.

 - Reinvoke QP, swapping to disk or to expanded memory.

      To swap to disk:               QP /SWAP:DISK
      To swap to expanded memory:    QP /SWAP:EMS


 93. QP Help: Error: Line Too Long

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60514

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 10: Line too long

 The line at the cursor exceeds QuickPascal's maximum line length of
 128 characters.

 Possible methods for shortening the line include:

    - Breaking a complex expression into smaller parts
    - Reducing the length of variable and constant names
    - Deleting any trailing blanks or tabs on the line
    - Creating long strings with the plus (+) operator


 94. QP Help: Error: Field or Method Already Defined

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60515

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 102: Field or method already defined

 This name has already been used to define a field or method.

 Give the field or method a different name, or rename the previously
 defined field or method that uses the same name.


 95. QP Help: Error: Invalid QPU File

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60516

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 103: Invalid QPU file

 The USES statement refers to a file that is not a valid .QPU file.
 Either the file does not exist, or it exists but is not a compiled
 QuickPascal unit.

 Check to make sure the file exists and is spelled correctly. If the
 problem persists, delete the .QPU file and recompile the unit from its
 original source code.


 96. QP Help: Error: Duplicate Unit Name

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60517

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 104: Duplicate unit name

 The same unit has been specified more than once in the USES statement.

 Remove the duplicate references.


 97. QP Help: Error: Circular Unit Reference

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60518

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 105: Circular unit reference

 A circular reference was made in the interface section of a unit.

 Circular references are allowed only in the implementation sections of
 units.


 98. QP Help: Error: Error in Real Constant

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60519

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 106: Error in real constant

 This constant does not conform to the syntax for a real number. Change
 the constant to the correct syntax.


 99. QP Help: Error: Coprocessor Required

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60520

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 107: Coprocessor required

 QuickPascal requires a math coprocessor to perform this operation.
 Unless your computer uses math chips from the Intel 80x87 family, you
 cannot specify the {$N+} compiler directive or the use of a
 coprocessor in the Compiler dialog box under the Options menu.


 100. QP Help: Error: Too Many Nested Conditional Directives

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60521

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 108: Too many nested conditional directives

 A series of conditional statements is nested too deeply.

 Break the construct into smaller pieces that do not require such deep
 nesting.


 101. QP Help: Error: Misplaced Directive

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60522

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 109: Misplaced directive

 This directive is out of sequence or located in the wrong part of the
 program. Move or delete the directive. For example, an $ENDIF
 directive must appear after an $IFxx directive.


 102. QP Help: Error: $ENDIF Directive Missing

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60523

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 110: $ENDIF directive missing

 The $IFxx compiler directive requires an $ENDIF directive to terminate
 the $IFxx block.

 Insert the $ENDIF directive at the appropriate location.


 103. QP Help: Error: Too Many Conditional Symbols

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60524

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 111: Too many conditional symbols

 The number of defined symbols exceeded the maximum in QuickPascal.

 Use {$UNDEF} to undefine some symbols or to reduce the number of
 conditional symbols. Use a UNIT or included file, if necessary.


 104. QP Help: Error: Error in Integer Constant

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60525

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 11: Error in integer constant

 The integer constant at the cursor was not in the range -2147483647 to
 2147483648.

 Check that the number is an integer within range.

 This error occurs when specifying the lowest value in the LongInt
 range, -2147483648. Use First( LongInt ) to represent this value.


 105. QP Help: Error: Header Does Not Match Previous Declaration

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60526

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 112: Header does not match previous declaration

 This procedure or function header does not match its original
 declaration.

 A procedure or function's first declaration takes precedence over a
 subsequent header. The headers must match exactly. Change the
 incorrect header to match the correct one. Cutting and pasting ensures
 a perfect match.


 106. QP Help: Error: Invalid Qualification

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60527

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 113: Invalid qualification

 An error occurred in the identifier name used as a qualifier, or the
 name given to the qualifier is not available within the current scope.

 Check the spelling of the qualifying name. Make sure that any needed
 units are specified in the USES statement.


 107. QP Help: Error: Too Many Parameters

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60528

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 114: Too many parameters

 The size in bytes of passed parameters exceeded 64K.


 108. QP Help: Error: Class Must Be Defined at Global Level

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60529

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 115: Class must be defined at global level

 A class has been defined locally.

 Classes must be defined at the beginning of the program (or at the
 beginning of either the INTERFACE or IMPLEMENTATION sections of a
 unit) in order to make them global definitions.

 Move the class definition up with the global level declarations.


 109. QP Help: Error: Class Must Be Defined in Type Definition

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60530

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 116: Class must be defined in type definition

 Define a class within a TYPE declaration.


 110. QP Help: Error: Invalid Procedure or Function Reference

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60531

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 117: Invalid procedure or function reference

 An attempt was made to assign a near procedure to a procedure
 variable.

 Procedure variables must refer to far procedures.

 To correct the problem:

 - Turn on the Far Calls directive under the Compiler option in the
    Options menu.

 - Place the procedure declaration between the {$F+} and {$F-}
   directives.


 111. QP Help: Error: Procedure or Function Variable Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60532

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 118: Procedure or function variable expected

 The variable must be a procedural-type variable.

 Check to see that you followed the correct syntax for declaring and
 typing variables within a parameter list. Remember that returned
 variables require the VAR keyword.


 112. QP Help: Error: Object Type Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60567

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 119: Object type expected

 An object type was expected.


 113. QP Help: Error: Object Must Be Defined at Global Level

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60568

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 120: Object must be defined at global level

 An object has been defined at a level other than a global level.

 Move the definition up to the same level as global constants and
 variables.


 114. QP Help: Error: OBJECT Must Be Defined in Type Definition

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60569

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 121: OBJECT must be defined in type definition

 An occurrence of "OBJECT" has been found outside of a type
 declaration. The keyword "OBJECT" is reserved for declaring class
 types.

    MyClass = (OBJECT)
        the_data: Integer;
        Procedure MyClass.MyMethod;
    END;


 115. QP Help: Error: Error in Character Constant

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60570

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 12: Error in character constant

 The character constant at the cursor contains an error.

 Check that the value assigned to the constant is a character data type
 (not an integer, real, string, or other data type).


 116. QP Help: Error: Invalid Class Type

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60571

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 122: Invalid class type

 The name of a defined object was invalid.

 The name of an object cannot be the same as a parent name. For
 example, the following will cause this error:

    TYPE
        my_name = OBJECT( my_name );


 117. QP Help: Error: Class Table Overflow

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60572

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 123: Class table overflow

 The number of classes that can be stored in the class table has been
 exceeded.

 Reduce the number of classes to continue.

 You may be able to decrease the number of classes by using instances
 of existing classes.


 118. QP Help: Error: Syntax Error

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60573

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 124: Syntax error

 The statement is not formed correctly.


 119. QP Help: Error: This Method Has No Parent

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60574

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 125: This method has no parent

 INHERITED has been applied to a method that has no parent. Either
 create a parent class with a method to inherit, or do not use the
 INHERITED keyword.


 120. QP Help: Error: Type of Expression Must Be POINTER

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60575

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 126: Type of expression must be POINTER

 The expression in the statement must be of a POINTER type.


 121. QP Help: Error: Invalid Variable Reference

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60576

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 127: Invalid variable reference

 A constant, expression, or function has been applied to a procedure
 expecting a VAR parameter. Substitute a variable to continue.


 122. QP Help: Error: Symbol Table Overflow

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60577

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 128: Symbol table overflow

 QuickPascal can only support up to 64K of declared symbols in a unit
 or program.

 Avoid symbol table overflow by moving some declarations into another
 unit.


 123. QP Help: Error: Too Many Imported Units

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60578

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 129: Too many imported units

 QuickPascal allows up to 81 units to be included in a program. Combine
 procedures and functions into existing units to reduce the number of
 total units.


 124. QP Help: Error: Code Cannot Exceed 64K Bytes

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60579

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 130: Code cannot exceed 64K bytes

 The total size of the code cannot exceed 64K bytes. Split the program
 into several units to continue.


 125. QP Help: Error: Invalid Real Operation

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60580

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 131: Invalid real operation

 An operation on two real types in this statement resulted in an
 invalid floating-point operation. Either an overflow occurred or an
 attempt was made to divide by zero.


 126. QP Help: Error: String Constant Exceeds Line

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60581

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 13: String constant exceeds line

 The string is missing a closing quote. A string must be contained on a
 single line.


 127. QP Help: Error: Real Overflow

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60582

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 132: Real overflow

 A floating-point operation produced an overflow. Do not exceed the
 maximum allowed value of a real type.


 128. QP Help: Error: Real Underflow

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60583

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 133: Real underflow

 A floating-point operation produced an underflow. This error only
 occurs if you are using the 8087 numeric coprocessor with a control
 word that unmasks underflow exceptions.


 129. QP Help: Error: Undefined External

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60584

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 134: Undefined external

 A subprogram has been declared external, but it was not defined by
 any of the .OBJ files linked in with the program.


 130. QP Help: Error: Too Many Object File Names

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error filenames
 Last Modified: 15-APR-1990    ArticleIdent: Q60585

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 135: Too many object file names

 Too many .OBJ files have been linked in. Reduce the number of object
 files to link with the program.


 131. QP Help: Error: Invalid Object File

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 15-APR-1990    ArticleIdent: Q60586

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 136: Invalid object file

 The object file that was to be linked contains invalid information.
 Verify that the file actually is an .OBJ file.


 132. QP Help: Error: Object File Too Large

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60652

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 137: Object file too large

 The object file that was to be linked is too large. .OBJ files cannot
 exceed 64K in length.


 133. QP Help: Error: Invalid Segment Definition

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60653

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 138: Invalid segment definition

 An .OBJ file being read in by the {$L} directive contained one of the
 following:

 - The AT combine type

 - Two code segments, one named CODE and one named CSEG

 - A data or code segment exactly 64K in size


 134. QP Help: Error: Invalid Segment Name

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60654

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 139: Invalid segment name

 A segment had an invalid name.

 A data segment may be named DSEG or DATA. A code segment may be named
 CSEG or CODE. There can be only one code and one data segment.


 135. QP Help: Error: Code Segment Too Large

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60655

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 140: Code segment too large

 The code segment is too large. Code segments may not exceed 64K in
 length. Reduce the size of the segment by splitting the program into
 several units.


 136. QP Help: Error: Invalid PUBLIC Definition

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60656

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 141: Invalid PUBLIC definition

 Error 141 occurs when loading .OBJ files with {$L <name>}.

 A symbol declared as PUBLIC in the .OBJ file is already in the symbol
 table from a different definition. A name collision has occurred.

 Change one of the names.


 137. QP Help: Error: Unexpected End of File

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60657

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 14: Unexpected end of file

 QuickPascal encountered an end-of-file where one was not expected
 (possibly in the middle of your program code).

 Check that you remembered the END statement in your source code.
 Alternately, remove any unintentional nonprinting characters at the
 cursor with the DEL key, or retype the entire line.


 138. QP Help: Error: Invalid EXTRN Definition

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60658

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 142: Invalid EXTRN definition

 Error 142 occurs when loading .OBJ files with {$L <name>}.

 The .OBJ file contains an EXTRN directive that refers to something
 other than a procedure, function, data item, or typed constant. An
 EXTRN may not refer to a type, simple constant, absolute variable, or
 inline procedure or function.


 139. QP Help: Error: Too Many EXTRNs

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60659

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 143: Too many EXTRNs

 Error 143 occurs when loading .OBJ files with {$L <name>}.

 An .OBJ file exceeded the QuickPascal limit of 512 EXTRN definitions
 per .OBJ file.


 140. QP Help: Error: Invalid Fixup

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60660

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 144: Invalid fixup

 Error 144 occurs when loading .OBJ files with {$L <name>}.

 An .OBJ file may not contain fixup records on byte values or fixups in
 the data segment. Such fixups are likely to occur if data is
 initialized to point to code. An .OBJ file may not contain initialized
 data.


 141. QP Help: Error: Too Many Opened Files

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60661

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 145: Too many opened files

 Compilation has exceeded the number of available DOS file handles.

 File handles are taken up by used units and by files included with the
 {$I} directive. Reduce the number of files in a single compilation, or
 increase the number of available handles by putting the following in
 CONFIG.SYS:

    FILES=20

 TSR (terminate-and-stay-resident) programs may use up file handles.
 Remove resident software, then recompile.


 142. QP Help: Error: Too Many Variables

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60662

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 146: Too many variables

 Storage size of all variables exceeded the capacity of the data
 segment.

 Variables and typed constants are stored in the data segment along
 with program data. The data segment may not exceed 64K.

 Use dynamic allocation (New or GetMem) to place data on the heap.


 143. QP Help: Error: Directive Must Be At Top of Program

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60663

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 147: Directive must be at top of program

 A global compiler directive was located after the beginning of the
 declaration of a program or unit.

 Global compiler directives must precede the implementation section in
 a unit. In a program, they must precede the first declaration,
 appearing before any CONST, TYPE, VAR, PROCEDURE, or FUNCTION. Global
 compiler directives are usually located immediately after any USES
 statements.


 144. QP Help: Error: Invalid Directive

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60664

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 15: Invalid directive

 The directive at the cursor is not a valid QuickPascal compiler
 directive.

 Verify that the directive uses the correct syntax (see the Directives
 entry in the Contents help screen).


 145. QP Help: Error: Invalid Assignment

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60665

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 148: Invalid assignment

 An assignment was made to an invalid type.

 Variables of type FILE and Text cannot be assigned to directly.


 146. QP Help: Error: Set Type Out of Range

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60666

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 149: Set type out of range

 The base type of a set exceeded the limit of a set.

 A set may have only 256 elements. Its base type must be a subrange
 within 0..255, or an enumerated type with no more than 256 values.
 Base types of ShortInt, Integer, LongInt, or Word are not permitted.


 147. QP Help: Error: Index Out of Range

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60667

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 150: Index out of range

 The index of an array variable declaration specified an invalid number
 of elements.

 The range of the index type of an array determines the number of
 elements in the array. Using a LongInt subrange as an array index will
 cause this error. Each array must fit within a single 64K segment. An
 array declared with this index range would exceed the maximum size for
 an array, no matter what type of element.


 148. QP Help: Error: Object Variable Expected in Member Function

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60668

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 151: Object variable expected in Member function

 The variable passed as the first argument to the Member function was
 not an object.


 149. QP Help: Error: Object Type Expected in Member Function

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60669

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 152: Object type expected in Member function

 The type passed as the second argument to the Member function was not
 a class.


 150. QP Help: Error: Expression Too Complicated

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60670

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 153: Expression too complicated

 An expression contains too many terms.

 Break up the complex expression into simpler expressions.


 151. QP Help: Error: Line Information Table Overflow

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60671

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 155: Line information table overflow

 The storage capacity for debug information was exceeded.

 The QuickPascal debugger can keep track of up to 16K source lines.

 Turn off the debugger with the {$D-} directive, or compile some source
 files without debugger information.


 152. QP Help: Error: Fixup Table Overflow

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60787

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 156: Fixup table overflow

 A program may only have 16K fixups.


 153. QP Help: Error: Source Table Overflow

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60788

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 157: Source table overflow

 The storage capacity for source file names was exceeded.

 QuickPascal allows a maximum of 2K of memory to keep track of the
 names of source files used in a program.

 Combine some files, or rename files with shorter names.


 154. QP Help: Error: Unit Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60789

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 158: Unit expected

 A USES clause in a program called for a file that did not contain a
 UNIT heading.

 A used file must begin with a heading:

    UNIT <identifier>;


 155. QP Help: Error: End of File Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60790

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 16: End of file expected

 QuickPascal expects an end-of-file at the cursor location.

 Move or delete everything after the END statement.


 156. QP Help: Error: Unsatisfied Forward Name Reference

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60791

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 159: Unsatisfied forward name reference

 A type declaration was used but never defined.


 157. QP Help: Error: Invalid Fixup in Iterated Data

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60792

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 160: Invalid fixup in iterated data

 A fixup cannot occur in an iterated data record.

 Check the assembly files for a relocatable reference inside a DUP
 record.


 158. QP Help: Error: Include Files Not Allowed Here

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60793

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 161: Include files not allowed here

 A file was included inside of a statement.

 Files cannot be included within a statement.


 159. QP Help: Error: Stack Overflow

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60794

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 162: Stack overflow

 A stack overflow occurred during the link process.


 160. QP Help: Run-Time Error: File Does Not Exist

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60795

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 2: File does not exist

 No file exists by the name assigned to the file variable.

 When a file variable that has been assigned the name of a nonexistent
 file is passed to the Append, Erase, Rename, or Reset procedures, this
 error occurs.


 161. QP Help: Run-Time Error: Path Does Not Exist

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60796

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 3: Path does not exist

 The specified path name does not exist.

 When a file variable that has been assigned an invalid file name or a
 name of a nonexistent subdirectory is passed to the Append, Erase,
 Rename, Reset, or Rewrite procedures, this error occurs. It also
 occurs when the path passed to ChDir, MkDir, or RmDir is not valid or
 does not exist.


 162. QP Help: Run-Time Error: Out of File Handles

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60797

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 4: Out of file handles

 The program ran out of DOS file handles when it tried to open a file.
 This probably occurred during a call to the Append, Reset, or Rewrite
 procedures.

 Increase the setting in CONFIG.SYS to FILES=20, or reduce the number
 of files open at any one time. QuickPascal may use some file handles;
 try to run the program outside the QuickPascal environment.

 TSR (terminate-and-stay-resident) programs may use up file handles.
 Remove resident software, then run the program.


 163. QP Help: Run-Time Error: Invalid File Access

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60798

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 5: Invalid file access

 The procedures Append, ChDir, Erase, MkDir, Rename, Reset, Rewrite, or
 RmDir generate this error upon attempting to:

   - Read from a write-only file
   - Write to a read-only file or a directory name
   - Write to or create a file or directory on a full disk
   - Create a directory by an existing name
   - Rename a file to an existing name
   - Rename a directory
   - Remove a read-only file, a nonexistent file, the root directory,
     or a non-empty or nonexistent directory


 164. QP Help: Run-Time Error: Invalid File Handle

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60799

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 6: Invalid file handle

 A file handle that was somehow invalid was passed to DOS.

 This may mean that an area of memory was overwritten.


 165. QP Help: Run-Time Error: Invalid Access Code

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60800

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 12: Invalid access code

 The Append or Reset procedures found an invalid access code in
 FileMode.


 166. QP Help: Error: Identifier Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60801

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 17: Identifier expected

 The syntax of the current line requires an identifier of some kind.

 An identifer is a name of a constant, type, variable, procedure, or
 function.

 Add an appropriate identifier to the line.


 167. QP Help: Run-Time Error: Invalid Drive Value

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60802

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 15: Invalid drive value

 A procedure was passed an invalid value for a drive.

 The ChDir and GetDir procedures give this error if passed an invalid
 drive specification.


 168. QP Help: Run-Time Error: Current Directory May Not Be Deleted

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60803

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 16: Current directory may not be deleted

 The RmDir procedure was passed a path that represents the current
 directory.


 169. QP Help: Run-Time Error: Rename Must Occur on Same Drive

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60804

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 17: Rename must occur on same drive

 The Rename procedure was passed file names with different drive
 specifications.


 170. QP Help: Run-Time Error: Error in Reading Disk

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60805

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 100: Error in reading disk

 The current position was at the end-of-file when an attempt was made
 to read from a file.


 171. QP Help: Run-Time Error: Error in Writing to Disk

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60806

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 101: Error in writing to disk

 The disk was full when an attempt was made to write to a file.


 172. QP Help: Run-Time Error: File Not Yet Assigned

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60809

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 102: File not yet assigned

 The Append, Erase, Rename, Reset, or Rewrite procedures were passed a
 file variable that had not been assigned to a filename by the Assign
 procedure.


 173. QP Help: Run-Time Error: File Not Open

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60810

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 103: File not open

 An I/O operation was attempted on an unopened file.


 174. QP Help: Run-Time Error: File Not Opened for Input

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60811

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 104: File not opened for input

 An attempt was made to read from a file that was not opened or was
 opened for output only.


 175. QP Help: Run-Time Error: File Not Opened for Output

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60812

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 105: File not opened for output

 An attempt was made to write to a file that was not opened or was
 opened for input only.


 176. QP Help: Run-Time Error: Invalid Numeric Input

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60813

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 106: Invalid numeric input

 The numeric format of an input value read by the Read or Readln
 procedures was invalid.


 177. QP Help: Error: ";" Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60814

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 18: ";" expected

 QuickPascal expected a semicolon at or before the current cursor
 location.

 Insert a semicolon at or before the current cursor location, or at
 the end of the previous line.


 178. QP Help: Run-Time Error: Write-Protected Disk

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60815

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 150: Write-protected disk

 An attempt was made to write to a write-protected disk.


 179. QP Help: Run-Time Error: Unknown Unit

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60816

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 151: Unknown unit

 An I/O operation was directed to a drive or device that does not
 exist.


 180. QP Help: Run-Time Error: Drive or Device Not Ready

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60817

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 152: Drive or device not ready

 An I/O operation was directed to a drive that did not contain a floppy
 or whose door was not closed, or to a device that is unable to service
 the request.


 181. QP Help: Run-Time Error: Invalid Command

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60818

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 153: Invalid command

 The operating system did not recognize a command that was passed to
 it.


 182. QP Help: Run-Time Error: Data Error (CRC)

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60819

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 154: Data error (CRC)

 A disk sector contained a CRC error.


 183. QP Help: Run-Time Error: Length of Request Structure Invalid

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60820

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 155: Length of request structure invalid

 An invalid length was used in a disk operation.


 184. QP Help: Run-Time Error: Seek Error

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60821

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 156: Seek error

 A DOS error occurred during a seek operation.


 185. QP Help: Run-Time Error: Non-MS-DOS Disk

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60822

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 157: Non-MS-DOS disk

 An I/O operation was directed to a disk that is not formatted or is
 formatted for a different system.


 186. QP Help: Run-Time Error: Sector Not Found

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60823

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 158: Sector not found

 A nonexistent sector was requested in a disk operation.


 187. QP Help: Run-Time Error: Printer Out of Paper

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60824

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 159: Printer out of paper

 An operation was directed to a printer that has no paper.


 188. QP Help: Error: ")" Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60825

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 19: ")" expected

 QuickPascal found an opening parenthesis but cannot find a matching
 closing parenthesis.

 Check for balanced parentheses in lists, enumerated types, arrays,
 record initializations, and in expressions that use parentheses.
 Insert a ")" where you want the list or expression to end.


 189. QP Help: Run-Time Error: Write Fault

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60826

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 160: Write fault

 A hardware error occurred.


 190. QP Help: Run-Time Error: Read Fault

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60827

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 161: Read fault

 A hardware error occurred.


 191. QP Help: Run-Time Error: General Failure

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60828

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 162: General failure

 A hardware or other system error occurred.


 192. QP Help: Run-Time Error: Object Not Allocated

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60889

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 180: Object not allocated

 An object was passed to the Dispose procedure without previously
 being allocated by the New procedure.

 This error can also occur if the object structure has been corrupted
 or overwritten.


 193. QP Help: Run-Time Error: Invalid Object Reference

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60890

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 181: Invalid object reference

 A method was sent to an object that was not allocated previously by
 the New procedure.

 This error can also occur if the object structure has been corrupted
 or overwritten.


 194. QP Help: Run-Time Error: Division by Zero

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60891

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 200: Division by zero

 An attempt was made to divide by zero.


 195. QP Help: Run-Time Error: Range Check Error

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60892

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 201: Range check error

 An out-of-range value was assigned to a variable, used as an array
 index, or passed to a procedure or function.

 This error is possible only when range checking is turned on by the
 {$R+} directive.


 196. QP Help: Run-Time Error: Stack Overflow Error

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60893

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 202: Stack overflow error

 The stack contained insufficient space for the local variables for a
 procedure or function.

 This error is possible only when stack checking is on. Stack checking
 is turned on by the {$S+} directive.


 197. QP Help: Run-Time Error: Heap Overflow Error

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60894

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 203: Heap overflow error

 The heap contained insufficient space for allocation of the specified
 amount of memory by the GetMem or New procedures.


 198. QP Help: Run-Time Error: Invalid Pointer Operation

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60895

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 204: Invalid pointer operation

 A pointer set to NIL or to a non-heap location was passed to the
 Dispose or FreeMem procedures.


 199. QP Help: Error: Cannot Open File

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60896

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 2: Cannot open file

 QuickPascal could not open the specified file.

 If the file is a unit, make sure the unit has been compiled into a
 .QPU file.

 If the file is an include file or an .OBJ file, make sure the
 Environment path under the Options menu is correct.


 200. QP Help: Error: "." Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60897

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 20: "." expected

 QuickPascal expected a period after the last END statement in the
 program.

 Insert the period or check the line for correct syntax. Your program
 may be missing a BEGIN statement.


 201. QP Help: Run-Time Error: Floating Point Overflow

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60898

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 205: Floating point overflow

 A floating-point operation resulted in an overflow.


 202. QP Help: Run-Time Error: Floating Point Underflow

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60899

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 206: Floating point underflow

 A floating-point operation resulted in an underflow.


 203. QP Help: Run-Time Error: Invalid Floating Point Operation

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60900

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Run-Time Error 207: Invalid floating point operation

 This error occurred because of one of the following:

 - A stack overflow occurred, with either alternate math or
   coprocessor.

 - A non-positive value was passed to the Ln function.

 - A negative value was passed to the Sqrt function.

 - The value passed to the Round or Trunc functions was not in the
 range of a LongInt (-2147483648..2147483647).


 204. QP Help: Error: BEGIN Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60901

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 21: BEGIN expected

 QuickPascal found the start of a statement block without the BEGIN
 keyword.

 If BEGIN is present but in a different location, check for any missing
 keywords such as VAR or DO.


 205. QP Help: Error: END Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60902

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 22: END expected

 QuickPascal found the end of a statement block without the END
 keyword.

 If an END keyword is present, check for balanced BEGIN and END
 statements. Also check for END statements in constructs that expect
 END statements but do not use BEGIN statements (such as CASE
 statements).


 206. QP Help: Error: Label Must Be in the Range 0..9999

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60903

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 23: Label must be in the range 0..9999

 QuickPascal encountered a label that lies outside the accepted range
 of label numbers.

 Change the label to a number between 0 and 9999 or to a unique name.
 If the label is referred to frequently, use the Replace command with
 the Verify option.


 207. QP Help: Error: Identifier or Label Already Defined

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60904

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 25: Identifier or label already defined

 This name is already defined as having a different value or meaning.

 Identifiers within the same scope must be unique. One name can refer
 only to one data type, one procedure, one function, etc. A label can
 be defined only once. A label may not be defined twice in the same
 program.

 Give this identifier a new name, or rename the previous one that uses
 this same name. Change the current label or the previous label with
 the same name or number.


 208. QP Help: Error: Error in Type Definition

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60905

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 26: Error in type definition

 QuickPascal found an error in the definition of this type.

 Check the syntax for what you want to define, and also check any
 limitations of that particular data type.


 209. QP Help: Error: This Type Not Allowed Here

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60906

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 27: This type not allowed here

 The data type of the identifier or value containing the cursor is not
 a valid data type at this location.

 Check the syntax of the code and verify the correct data type. Change
 the identifier or value to the correct type.


 210. QP Help: Error: OF Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60907

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 28: OF expected

 This statement requires an additional OF keyword for completion.

 Check the syntax of the associated statement. For example, CASE
 statements and ARRAY declarations both require the OF keyword as part
 of their complete syntax.


 211. QP Help: Error: Implementation Restriction

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 19-APR-1990    ArticleIdent: Q60908

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 29: Implementation restriction

 You exceeded QuickPascal's capacity for this construct.

 Break the construct into smaller pieces.


 212. QP Help: Error: File Too Big

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61002

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 3: File too big

 The file exceeds the maximum size.

 Try putting some procedures and functions into a custom unit and
 compiling again. If the program uses include files, convert them to
 units wherever possible.


 213. QP Help: Error: "]" Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61003

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 31: "]" expected

 QuickPascal found an array or set with unbalanced brackets.

 Balance the brackets by adding the closing square bracket.


 214. QP Help: Error: Unknown Identifier

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61004

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 32: Unknown identifier

 The name at the cursor has not been declared.

 You must declare all names before they can be used. If the name is
 defined in a unit, check that the unit appears in the USES statement.


 215. QP Help: Error: Error in Simple Type Definition

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61005

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 33: Error in simple type definition

 An error was made in defining a simple type.

 Check the syntax of your declaration.


 216. QP Help: Error: Type Identifier Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61006

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 34: Type identifier expected

 QuickPascal expects a data type at the cursor location.

 Add the appropriate data type (for example, Integer, Char, or Double)
 as required by the statement. For instance, array declarations require
 the data type of the array elements, and function declarations require
 both the data types of the returned value and the types of parameters
 passed to the function.


 217. QP Help: Error: "=" Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61007

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 35: "=" expected

 The statement requires an equal sign at the cursor.

 Check the syntax for the statement. This error often occurs in CONST
 initializations or TYPE declarations. Use := for value assignments and
 = for testing equality or initializing a constant.


 218. QP Help: Error: Constant Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61008

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 36: Constant expected

 QuickPascal requires a constant or constant expression at the cursor.

 You cannot use a variable or an expression that uses variables at this
 location.

 Insert a new constant or the appropriate existing constant at the
 cursor.


 219. QP Help: Error: Integer or Real Constant Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61009

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 37: Integer or real constant expected

 QuickPascal requires a numeric constant at the cursor.

 You cannot use a variable or an expression that uses variables at
 this location.

 Insert a new numeric constant or the appropriate existing numeric
 constant at the cursor.


 220. QP Help: Error: Range Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61010

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 38: Range expected

 The syntax used in this statement requires that you specify a range of
 values.

 Specify a range of values with two periods between the lower and upper
 range limits. For example, 1..5 specifies the values 1, 2, 3, 4, and
 5. Examples of keywords that use ranges include CASE and ARRAY.


 221. QP Help: Error: Subrange Bounds Must Be Scalar

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61011

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 39: Subrange bounds must be scalar

 The limiting values of a subrange must be scalar.

 "Scalar" refers to values that are either integers or or enumerated
 data types, such as A..Z. The boundary values cannot be real.

 Replace the subrange bounds with the appropriate scalar values.


 222. QP Help: Error: Incompatible Subrange Types

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61012

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 40: Incompatible subrange types

 The statement contains two different subrange types.

 A subrange type is composed of a specified range of any standard or
 user-defined ordinal types. Subranges consist of elements of the same
 type. The lower and upper bounds of a subrange must be of the same
 data type.

 Change one of the boundary values so that both values share the same
 data type.


 223. QP Help: Error: Too Many Nested Files

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61013

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 4: Too many nested files

 The program nests include files too deeply. If the files included must
 include other files, keep the nesting to a maximum depth of eight
 files.

 Convert some of the include files to units.


 224. QP Help: Error: Low Bound Exceeds High Bound

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61014

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 41: Low bound exceeds high bound

 The low bound range in a declared array exceeds the high bound range.
 For example:

    ARRAY[1..10] OF Integer;    {correct}
    TYPE
        my_rg = 1..10;

    ARRAY[10..1] OF Integer;    {incorrect}
    TYPE
        my_rg = 10..1;


 225. QP Help: Error: ":" Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61015

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 42: ":" expected

 A colon (:) was expected but did not occur in the statement. The ":"
 symbol is used to

 - Declare a variable

 - Designate a label within a program

 - Identify a constant in a CASE statement

 - Indicate a value will be returned by a function


 226. QP Help: Error: Unsatisfied Forward Reference

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61016

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 43: Unsatisfied forward reference

 The formal parameter list and block has not been declared for a
 FORWARD procedure.


 227. QP Help: Error: Integer Constant Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61017

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 44: Integer constant expected

 An integer constant was expected in the statement. Replace the
 variable identifier with an integer constant.


 228. QP Help: Error: Invalid String Length

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61018

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 45: Invalid string length

 The length of a string must be an integer between 1 and 255.


 229. QP Help: Error: Tag Field Type Must Be Scalar or Subrange

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 24-APR-1990    ArticleIdent: Q61019

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 46: Tag field type must be scalar or subrange

 The tag field in the variant record must be either a scalar or
 subrange type.

 Tag fields are separate fields of a record that indicate the variant
 used in the record variable.


 230. QP Help: Error: "(" Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-APR-1990    ArticleIdent: Q61020

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 47: "(" expected

 A left parenthesis "(" must be paired with a right parenthesis ")".
 Check statements with nested parentheses to verify that the number of
 right and left parentheses match.


 231. QP Help: Error: Too Many Literals

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 24-APR-1990    ArticleIdent: Q61021

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 48: Too many literals

 The program has too many literal constants to fit into memory. Reduce
 the number of constants by passing parameters to procedures and
 functions.


 232. QP Help: Error: Error in Expression

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61114

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 50: Error in expression

 An undefined syntax error occurred in the expression.


 233. QP Help: Error: Cannot Read File

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61115

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 5: Cannot read file

 QuickPascal cannot read from the specified file.

 Check that the disk drive functions properly and that the disk
 contains no errors or bad sectors.


 234. QP Help: Error: Conflicting Operands

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61116

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 51: Conflicting operands

 The operands in the expression are of an incompatible type. For
 example,

    'A' DIV 5


 235. QP Help: Error: Right Operand Is Not a Set

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61117

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 52: Right operand is not a set

 The operand to the right of a set operator is not a set. Set
 operations can only be performed on sets.


 236. QP Help: Error: Invalid Identifier

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61118

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 53: Invalid identifier

 An identifier was used in an illegal context.


 237. QP Help: Error: Invalid Type Cast

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61119

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 54: Invalid type cast

 An attempt has been made to cast to an incompatible type. Check to
 see if the type is compatible.


 238. QP Help: Error: Cannot Create File

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61120

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 55: Cannot create file

 An I/O error has prevented the file from being created.

 Check for defective disk media.


 239. QP Help: Error: Cannot Write File

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61121

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 56: Cannot write file

 An I/O error has prevented the file from being written.

 Check for defective disk media.


 240. QP Help: Error: Variable Type Must Be Pointer

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61122

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 57: Variable type must be pointer

 The variable in this statement must be of a pointer type.

 You may be trying to dereference something that is not a pointer.


 241. QP Help: Error: Variable Type Must Be Record

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61123

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 58: Variable type must be record

 The variable in the statement must be of a record type.


 242. QP Help: Error: Variable Type Must Be Array or String

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61124

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 59: Variable type must be array or string

 The variable in the statement must be declared as an array or a
 string.


 243. QP Help: Error: No Such Field in This Record or Object

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61125

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 60: No such field in this record or object

 A field does not exist in this record or object type with the
 specified identifier.

 Check the declaration to verify that the field exists.


 244. QP Help: Error: Cannot Close File

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61126

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 6: Cannot close file

 QuickPascal cannot close the specified file.

 Check that the disk drive functions properly and that the disk
 contains no errors or bad sectors.


 245. QP Help: Error: Index Type Is Not Compatible with Declaration

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61127

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 61: Index type is not compatible with the
            declaration

 The specified index type, or subscript, of the array in this
 statement is not consistent with the original array declaration. For
 example, given the declarations:

    VAR
        TheGrade   : Array[ 1..25 ] OF Char;
        the_letter : Char;

 the error occurs on the following line:

    the_letter := TheGrade[ 'A' ];


 246. QP Help: Error: Routine Too Big

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61128

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 62: Routine too big

 The procedure or function is too large to fit into memory.

 Divide the routine into smaller components.


 247. QP Help: Error: UNTIL Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61129

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 63: UNTIL expected

 UNTIL was expected in the statement but not found.

 A REPEAT statement must include an UNTIL keyword, as in

    REPEAT
        TestCase;
    UNTIL the_var = 1;


 248. QP Help: Error: Boolean Expression Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61130

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 64: Boolean expression expected

 The expression being evaluated in a conditional statement must
 produce a result of type Boolean.


 249. QP Help: Error: DO Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61131

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 65: DO expected

 DO was expected in the statement but not found.

 A WHILE statement or a WITH statement must include a DO keyword, as
 in

    WHILE (Eof( myfile ) = False) DO
        Readln( myfile );
 or

    WITH the_record DO
        the_size := 10;


 250. QP Help: Error: THEN Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61132

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 66: THEN expected

 THEN was expected in the statement but not found.

 An IF statement must include a THEN keyword, as in

    IF (the_color = red) THEN
        DisplayStopSign;


 251. QP Help: Error: Invalid Label

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61133

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 67: Invalid label

 The label is incorrectly defined.

 A label is a digit sequence whose value ranges from 0 to 9999.
 Leading zeros are not significant.


 252. QP Help: Error: Unknown Label

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61134

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 68: Unknown label

 The label referred to by the GOTO statement could not be located.

 A label must occur within the scope of the current block.


 253. QP Help: Error: Label Not Within Current Block

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61135

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 69: Label not within current block

 A GOTO statement cannot refer to a label outside the current block.
 Either place the label within the scope of the block, or use a
 procedure or function.


 254. QP Help: Error: Label Already Defined

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61136

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 70: Label already defined

 A label with the same name has already been defined.

 Rename the label with a unique name.


 255. QP Help: Error: Cannot Seek File

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61137

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 7: Cannot seek file

 The compiler could not seek the specified file.

 This is typically a hardware problem. Check that the disk drive is
 functioning properly.


 256. QP Help: Error: Label Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61138

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 71: Label expected

 The GOTO statement must include a label. For example,

    GOTO 1000;


 257. QP Help: Error: Undefined Label in Preceding Statement Part

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61139

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 72: Undefined label in preceding statement part

 The label referenced by the GOTO statement has not been defined. A
 label must occur within the scope of the current block.


 258. QP Help: Error: Error in Statement

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61140

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 73: Error in statement

 An undefined error has occurred in the statement.


 259. QP Help: Error: ":=" Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61141

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 74: ":=" expected

 A ":=" was expected but did not occur in the statement.

 The assignment operator (:=) assigns a value to a variable or
 function. Do not confuse ":=" with the equivalence operator (=).


 260. QP Help: Error: Type Mismatch

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61142

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 75: Type mismatch

 A type-incompatibility situation occurred, for one of the following
 reasons:

 - The variable and the expression in an assignment statement were not
   compatible types.

 - An actual parameter passed to a procedure or function was not
   type-compatible with a formal parameter.

 - An expression contained incompatible types of operands.

 - An expression used as an array index was not type-compatible for
   indexing an array.


 261. QP Help: Error: Variable Identifier Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61143

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 76: Variable identifier expected

 A variable was expected in the statement.

 Replace the constant with a variable identifier.


 262. QP Help: Error: Invalid FOR Control Variable

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61144

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 77: Invalid FOR control variable

 The control variable in a FOR statement must be of an ordinal type.


 263. QP Help: Error: Scalar Type Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61145

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 78: Scalar type expected

 A scalar type was expected in the statement.

 A scalar type has a finite number of elements. Scalar types include
 Boolean, Char, enumerated types, integer types, and subranges.


 264. QP Help: Error: TO or DOWNTO Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61146

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 79: TO or DOWNTO expected

 The keywords TO or DOWNTO are required in a FOR statement. For
 example,

    FOR loop := 1 TO 10
 or
    FOR loop := 100 DOWNTO 10


 265. QP Help: Error: Disk Full

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61147

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 80: Disk full

 The disk is too full to continue the operation. Exit to DOS and
 delete unwanted files to free additional space.


 266. QP Help: Error: Invalid End of Line

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61148

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 8: Invalid end of line

 QuickPascal encountered a carriage return without a line feed or a
 line feed without a preceding carriage return.

 Re-enter the end-of-line character to correct the line terminator.


 267. QP Help: Error: Constant Value Out of Range

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61149

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 81: Constant value out of range

 A value exceeded the acceptable range for the data type of the
 constant.

 QuickPascal infers the acceptable range of a constant based on the
 type of value entered.

 Reassign the constant a value within the range of the current data
 type, or change the data type.


 268. QP Help: Error: "," Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61150

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 82: "," expected

 QuickPascal expects a comma between items in a list, such as multiple
 parameters passed to a procedure or function.

 Insert a comma at the current cursor location.


 269. QP Help: Error: Division by Zero

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61151

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 83: Division by zero

 The divisor in the expression evaluated to zero, resulting in a
 division by zero.

 Alter the value of the divisor.


 270. QP Help: Error: Too Many Local Routines

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61152

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 84: Too many local routines

 The maximum number of procedures and functions that QuickPascal can
 handle locally has been exceeded.

 Move some of the procedures or functions to a global level, or create
 a unit for some of the routines.


 271. QP Help: Error: Integer Expression Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61153

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 85: Integer expression expected

 The expression was not an integer type.

 Change the result of the expression to an integer type. If you need
 to convert a real number to an integer, use the Trunc function.


 272. QP Help: Error: Pointer Type Cannot Be Referenced

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61154

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 86: Pointer type cannot be referenced

 The pointer type cannot be referenced.

 Cast or assign the pointer to a typed pointer.


 273. QP Help: Error: Typed Pointer Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61155

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 87: Typed pointer expected

 The statement expects a typed pointer.

 Replace the untyped pointer variable at the cursor with a typed
 pointer variable.


 274. QP Help: Error: File Type Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61156

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 88: File type expected

 A typed, untyped, or text file was expected.


 275. QP Help: Error: Cannot Write Expressions of This Type

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61157

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 89: Cannot write expressions of this type

 The Write and Writeln statements can print only numeric, string, and
 Boolean data. A command to print a complex or user-defined data type
 such as a record, set, pointer, or enumeration has been entered; this
 cannot be done.

 Convert the value to a string and then print the string.


 276. QP Help: Error: Ordinal Expression Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61158

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 90: Ordinal expression expected

 A procedure or function expected an ordinal type.

 A variable passed to this procedure or function must be of an ordinal
 type. An expression passed to it must evaluate to an ordinal value.


 277. QP Help: Error: Illegal Character

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61159

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 9: Illegal character

 QuickPascal encountered an invalid character.

 Some illegal characters do not appear on the screen. QuickPascal
 placed the cursor where it found the invalid character. Use the DEL
 key to remove that character (and retype it if necessary). If the
 problem persists, retype the entire line.

 Valid QuickPascal source code characters are a..z, A..Z, 0..9, $ @ _
 ; : , . + - * / = ^ ' # < > [ ] ( ) { } and " " (blank space). Other
 characters are valid only in comments.


 278. QP Help: Error: Invalid File Type

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61160

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 91: Invalid file type

 The file operation does not accept a file of this type.

 Check the syntax for the file operation and make sure the operation
 accepts the file type you specified. This problem often occurs if you
 try to use a Text file operation on a binary file or vice versa.


 279. QP Help: Error: Variable Parameter Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61161

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 92: Variable parameter expected

 A constant or expression has been specified where Pascal requires a
 variable.

 Replace the parameter with a variable reference.


 280. QP Help: Error: Cannot Read Expressions of This Type

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61162

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 93: Cannot read expressions of this type

 The Read and Readln statements accept only numeric, string, and
 Boolean data. If you wish to read in a user-defined type, such as a
 set or pointer, read the value as a number and then convert it to the
 appropriate value.


 281. QP Help: Error: Integer or Real Expression Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61163

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 94: Integer or real expression expected

 QuickPascal expects an expression that evaluates to an integer or
 real value. Modify the expression as needed so that it results in
 either an integer or real number.


 282. QP Help: Error: Integer or Real Variable Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61164

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 95: Integer or real variable expected

 QuickPascal expects a numeric variable of an integer or real type at
 the cursor location.


 283. QP Help: Error: INLINE Error

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61165

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 97: INLINE error

 There is an error in the INLINE statement syntax. Check the
 machine-language and INLINE syntax carefully.


 284. QP Help: Error: Label Definition Not Allowed in INTERFACE

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61166

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 98: Label definition not allowed in INTERFACE part

 Labels cannot be defined in the INTERFACE portion of a unit. Define
 any labels in the IMPLEMENTATION section of the unit.


 285. QP Help: Error: INTERFACE Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61167

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 99: INTERFACE expected

 QuickPascal expects an INTERFACE statement immediately following the
 unit declaration. Any variables, constants, procedures, etc., that
 you want a calling program to have access to must appear within the
 INTERFACE portion of the unit. Place any declarations that you do not
 want the calling program to access in the IMPLEMENTATION section of
 the unit.


 286. QP Help: Error: IMPLEMENTATION Expected

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61168

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 100: IMPLEMENTATION expected

 Place an IMPLEMENTATION statement prior to any executable code. If
 there are declarations that you do not want the calling program to
 have access to, place them in the IMPLEMENTATION section of a unit.
 Such declarations typically include variables, constants, etc., that
 need to be available to all of the unit's procedure and function
 definitions.


 287. QP Help: Error: Invalid Unit File

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_error
 Last Modified: 25-MAY-1990    ArticleIdent: Q61169

 The following information is from the QuickPascal Version 1.00
 QPERR.HLP help file:

    Error 101: Invalid unit file

 The USES statement refers to a file that is not a valid unit.

 Check the spelling of the name you referenced. Make sure the program
 or file is compatible with QuickPascal.


 288. _GFillInterior Does Not Always Fill Ellipse

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_quickc
 Last Modified: 25-MAY-1990    ArticleIdent: Q61311

 The following code demonstrates that the _GFillInterior flag will not
 fill the ellipse if the center of that ellipse is off the screen:

 PROGRAM Show;

 USES MSGraph, Crt;

 VAR
    DummyInt:Integer;
    DummyChar:Char;

 BEGIN
    DummyInt := _SetVideoMode(_EResColor);
    (** This one fills ok **)
    _Ellipse(_GFillInterior,220,75,420,275);

    (** This one does not **)
    _Ellipse(_GFillInterior,220,280,420,480);

    DummyChar := ReadKey;
    DummyInt := _SetVideoMode(_DefaultMode);
 END.

 _GFILLINTERIOR works differently depending on whether it is used with
 one class of function (_rectangle and _polygon) or the other (_ellipse
 and _pie). In the first case (for example, _rectangle and _polygon), a
 polygon scanfill is done that fills based on the shape of the object,
 regardless of where it is on the screen, or any other objects (or
 lines) within the object. This is usually the best approach, since it
 fills the way you would normally expect.

 The second case (for example, _ellipse) is handled differently. In
 this case, it is equivalent to doing a _floodfill() call, using the
 current color as the border, with the starting position at the
 "center" of the ellipse. _pie is equally arbitrary, although it uses a
 point about 3/4 of the way along a line bisecting the arc. The key in
 either case is that the starting-point is arbitrary and fixed. If that
 point is outside the viewport or is already drawn in the
 border/drawing color, the floodfill doesn't do anything.

 Also, because it is a floodfill, not a scanfill, objects or lines
 inside the ellipse/pie can cause it to not be filled entirely, whereas
 scanfill always fills completely. This is by design.

 One reason for adding _polygon to C Version 6.00 is to add the ability
 to draw virtually any shape (for example: you can simulate ellipses
 and pies) and still do a scanfill.


 289. QuickPascal May Not Correctly Reset Colors When Exiting

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 11-SEP-1990    ArticleIdent: Q65500

 Under certain circumstances, Microsoft QuickPascal (QP) version 1.00
 does not correctly reset all colors when exiting back to DOS.
 QuickPascal seems to change the color palette when it was previously
 set by DOS. The problem has been reproduced only on machines that use
 Compaq VGA cards.

 By design, QuickPascal does not make any assumptions about your
 intentions when modifying colors. If you are within the environment
 and modified any colors, QP will not reset these colors when you exit.
 The following procedure demonstrates this behavior:

 1. Compile the following program under QuickPascal version 1.00 and
    then exit to DOS.

       program colortst;
       uses crt;
       var
          i : integer;
       begin
          for i:=1 to 15 do begin
             textcolor(i);
             writeln('this is color ',i);
          end;
       end.

 2. At the DOS prompt, type "MODE CO80".

 3. Run "colortst". This will display 15 lines of text in different
    colors.

 4. Enter QuickPascal and then exit.

 Color #6 of the program will change from light brown to light yellow.

 As a workaround, the following batch file can be used to set the
 colors back to the default:

    mode co80
    qp %1 %2 %3 %4 %5
    mode co80


 290. Use RESET(fh,recordsize) When Working with Non-Typed Files

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00 SR# S900910-39
 Last Modified: 26-DEC-1990    ArticleIdent: Q65570

 Microsoft QuickPascal contains a variable type of "FILE" that declares
 a file handle for an un-typed file. This is useful in conjunction with
 the BlockRead and BlockWrite statements in that it allows you to open
 any file and then READ or WRITE any type of data to the file. (This is
 equivalent to OPENing a file for BINARY and using the GET and PUT file
 I/O statements in BASIC.)

 To prevent unexpected errors of "Runtime error - 100" (which is
 attempting to read past the end of file), the RESET statement's
 optional second parameter must be used. This second parameter
 specifies the logical record length for the file. If not specified,
 the record size defaults to 128 bytes.

 This information applies to Microsoft QuickPascal version 1.00 for
 MS-DOS.

 Since the default for the record size parameter of the RESET statement
 is 128-bytes in length, failing to use this parameter when working
 with non-type files will usually result in "Runtime error - 100,"
 attempt to read past end of file. This is because all files are not a
 multiple of 128-bytes in length.

 The following sample program demonstrates how not using the record
 size parameter of the RESET statement can lead to "Runtime error -
 100."

 To run the programs below, you must create a file called TEST.DAT.
 Contents of TEST.DAT should be as follows:

    ABCDEFGHIJKLMNOPQRSTUVWXYZ

 Sample Program 1
 ----------------

 PROGRAM ResetTest;
 VAR fh: FILE;
      s: STRING[26];
 BEGIN
   ASSIGN(fh, 'test.dat');
   RESET(fh);              { Opens file with record size of 128-bytes.}
   BlockRead(fh, s, 1);    { Attempts to READ one 128-byte record but}
   WRITELN(s);             { fails because the file is only 26 bytes.}
   CLOSE(fh);
 END.

 When the above program is executed, the BlockRead statement will
 generate "Runtime error - 100" because the default record size is
 128-bytes and the file is only 26-bytes in length. Changing the RESET
 statement to include a record size parameter from 1 to 26 will allow
 the program to execute successfully. The following program will
 execute without error:

 Sample Program 2
 ----------------

 PROGRAM ResetTest;
 VAR fh: FILE;
      s: STRING[26];
 BEGIN
   ASSIGN(fh, 'test.dat');
   RESET(fh, 26);          { Opens file with record size of 26-bytes.}
   BlockRead(fh, s, 1);    { Reads one 26-bytes record.              }
   WRITELN(s);
   CLOSE(fh);
 END.


 291. Excellent "QuickPascal Programming" Book from MS Press

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_pascal manual
 Last Modified: 24-OCT-1990    ArticleIdent: Q65878

 The following excellent book is available to support customers of
 Microsoft QuickPascal version 1.00:

    "Microsoft QuickPascal Programming", by Kris Jamsa, published
    by Microsoft Press, copyright 1990.

 This book teaches both the Pascal language and the Microsoft
 QuickPascal environment, and is an excellent guide for beginning,
 intermediate, and advanced Pascal programmers. This book is a great
 supplement to the existing documentation and online help shipped with
 Microsoft QuickPascal 1.00.


 292. Comparison of Pascal 4.00 and QuickPascal: Which Should I Buy?

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# S900927-116 S_Pascal
 Last Modified:  8-OCT-1990    ArticleIdent: Q66011

 This article compares Microsoft Pascal version 4.00 with Microsoft
 QuickPascal version 1.00. This information may be very important when
 deciding which product to buy or use.

 The only advantages to using Microsoft Pascal 4.00 are the ability to
 create OS/2 programs and to perform interlanguage calling. Otherwise,
 the Pascal 4.00 package is substantially more difficult to use than
 QuickPascal 1.00.

 QuickPascal offers a powerful and easy-to-use programming environment.

 This information applies to Microsoft QuickPascal version 1.00 for
 MS-DOS and to Microsoft Pascal Compiler version 4.00 for MS-DOS and MS
 OS/2.

 COMPARISON OF PASCAL 4.00 COMPILER WITH QUICKPASCAL 1.00
 --------------------------------------------------------

 Which Operating Systems Are Supported
 -------------------------------------

 QuickPascal 1.00 can only run under DOS or in the DOS compatibility
 box of Windows or OS/2. Programs compiled with QuickPascal can only
 run under DOS.

 Pascal 4.00 can create programs for either DOS or OS/2. Pascal 4.00
 also comes with libraries that enable you to create programs for
 Microsoft Windows versions 2.x for MS-DOS, but NOT for Windows version
 3.00.

 Programming Environment of QuickPascal Versus Pascal
 ----------------------------------------------------

 QuickPascal comes with an integrated programming environment, QP.EXE.
 Like the other Microsoft "Quick" products, QP.EXE has a
 character-oriented window interface. This means that you write
 programs in a window or series of windows. (Internally, the windows in
 QP.EXE are not stored as bit-mapped graphical windows, but are instead
 created in text mode with graphics characters and text.) QP.EXE has
 overlapping windows. Common editor functions can be accessed from
 pull-down menus accessible by the ALT key or by a mouse click. QP.EXE
 has the following menus:

    Menu Name   Purpose
    ---------   -------

    File        Managing multiple files
    Debug       Debugging programs
    Search      Search and replace
    Make        Program building and program management
    Options     Customizing the editor and programming environment
    View        Managing programming windows and the output screen
    Help        Access to online help

 The QuickPascal QP.EXE environment has a complete online help system
 and context-sensitive help similar to the other Microsoft Quick
 products. QP.EXE has full mouse support.

 Pascal 4.00 does not come with a programming environment, but instead
 comes with the Microsoft Editor (M.EXE or MEP.EXE). The Microsoft
 Editor is a programmer's editor with most of the standard editing
 functions, such as cutting and pasting text, searching and replacing,
 and managing multiple files. The Pascal compiler can be launched from
 within the Microsoft Editor. This editor can be customized by writing
 extensions in C and compiling them. The Microsoft Editor is difficult
 to learn and use, but it is a powerful editor with many useful
 features. The Pascal 4.00 compiler will compile any programs that are
 ASCII text files, thus programmers can use any editor of their choice,
 as long as they save the Pascal source code as text.

 Interlanguage Calling
 ---------------------

 Programs compiled in QuickPascal can only call programs created in
 assembly language.

 Programs compiled in Pascal 4.00 can call programs created with the
 Microsoft family of languages, including C, FORTRAN, BASIC, COBOL, or
 assembly language. (Note that only certain versions of C, FORTRAN,
 BASIC, and COBOL can link with Pascal 4.00.)

 Compatibility / Portability
 ---------------------------

 QuickPascal 1.00 is highly source-code compatible with Borland's Turbo
 Pascal 5.00. Porting code to and from Turbo Pascal 5.00 is a fairly
 straightforward process.

 Pascal 4.00 is very minimally source-code compatible with Borland's
 Turbo Pascal products. Porting code to or from Turbo Pascal requires
 extensive source code changes.


 293. No Color on Magnavox VGA Using QP or QC GRAPHICS.LIB

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# S901005-21 S_C S_QuickC
 Last Modified: 26-DEC-1990    ArticleIdent: Q66423

 Customers have reported that the GRDEMO program shipped with both
 QuickPascal version 1.00 and QuickC version 2.00 does not run in color
 on a Magnavox VGA Adapter. The resolution is correct but the colors
 are shades of gray.

 The problem was reported with Magnavox VGA BIOS version 1.05.
 Customers have reported that this problem is resolved in Magnavox VGA
 BIOS version 1.11.

 This information applies to QuickPascal version 1.00, to QuickC
 versions 2.00, 2.01, 2.50, and 2.51, and to Microsoft C Compiler
 version 6.00 for MS-DOS.

 The problem lies in GRAPHICS.LIB, which is essentially the same for
 all the above mentioned products. Some calls to this library will
 incorrectly reset the color palette. This is a minor hardware
 incompatibility with the Magnavox VGA Adapter and there is currently
 no workaround.

 For a related article concerning the C product line, query the
 Microsoft Knowledge Base using the following words:

      Magnavox and setvideomode


 294. QuickPascal Uses Radians, Not Degrees, for Sin and Cos

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# S901231-66
 Last Modified: 14-FEB-1991    ArticleIdent: Q69163

 You must pass angle measurements in radians (not degrees) to Microsoft
 QuickPascal's Sin and Cos functions.

 Microsoft QuickPascal version 1.00 uses radians for its trigonometric
 functions (Sin and Cos); therefore, the value from QuickPascal will be
 different from a calculator's value for sine and cosine, unless your
 calculator is using radians.

 To convert degrees to radians, multiply the degrees by pi/180, where
 pi equals approximately 3.14159265359.

 Note: Pi is an intrinsic function than returns the value of pi in
 QuickPascal. See the online Help in QP.EXE for more information (by
 placing the cursor on the word "pi" in QP.EXE and pressing the F1
 function key).

 The following sample QuickPascal program shows how to convert degrees
 to radians:

 program convert(input,output);
  var
       x:integer; y:real;
   begin
       x:=45;
   writeln('sin of 45 radians =', sin(x));
   writeln('sin of 45 degrees =', sin(x*pi/180));
   end.






 Microsoft Programmer's Work Bench [Development Environment]
 =============================================================================


 1. Using the Features of PWB to Build a Program with Overlays

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 18-APR-1990    ArticleIdent: Q60050

 A MAKE file built with PWB can be modified (within reason) with the
 user supplied information section. This section, coded as

    # << User_supplied_information >>

 can contain other instructions that PWB (actually NMAKE or NMK) is
 supposed to carry out during the MAKE cycle. All instructions that
 follow this "fence" are not changed by PWB.

 The following instructions detail two implementations of that "fence"
 to allow PWB to build a program that uses overlays.

 While the following steps appear tedious, they are simple in practice.

 Once the changes are made, the only time you need to edit the MAKE
 file directly is to change your overlay structure, or to add or delete
 modules. When adding or deleting modules, you must both edit the
 program list with Make.Edit Program List and modify the commands in
 the user section. If you are only modifying the overlay structure, you
 change just the user section.

 The overlay structure in the example is as follows:

    HELLO.OBJ  (root)
        |
        +----A.OBJ (first  overlay)
        |
        +----B.OBJ (second overlay)

 All of the .OBJs are built from .C files with the same base name.

 1. Use PWB to build the program list in the normal way. This step is
    the same for any new program list.

    a. Start PWB.

    b. Choose Make.Set Program List and specify a new name -- HELLO.MAK
       in this example.

    c. Add HELLO.C, A.C, and B.C to the list. (If you have additional
       .C or .OBJ files, you would add them as well.) When all the
       files are listed, select Set Dependencies.

    d. Choose Options.Build Options and click on the Set Initial
       Build Options button and select DOS EXE.

    e. From Options.Compile Options, select the proper memory model.

    f. From Options.Link Options.Set Debug Options, turn off
       Incremental Link.

    g. From the Options.Browse Options dialog box, turn Generate Browse
       Information on.

    h. Choose Make.Rebuild All to make sure that the program builds
       properly without overlays. If it doesn't, review your work in
       previous steps.

 2. Now that you have a working program list, add the non-PWB
    information to the end.

    a. Choose Make.Clear Program List so that you can edit the MAKE
       file. Attempting to edit the current program list results in the
       message "No-edit file may not be modified."

    b. Choose File.Open to open the MAKE file so you can modify it.

    c. Go to the end of the file and start a blank line.

       Starting in column 1, add the following line:

          # << User_supplied_information >>

       Be sure to enter the line exactly as shown -- spacing is
       significant. This line is a "fence". Everything below the fence
       is yours and is not modified by PWB. Conversely, you should not
       modify anything above the fence because that section belongs to PWB.

    d. Below the fence starting in column one, add the pseudo-target:

          OVERLAID : $(OBJS)

       Be sure it starts column 1. Do not put a blank line after this line.

    e. Copy the command section from the $(PROJ).EXE description block
       to immediately follow the pseudo-target. The command section begins
       on the line following the line that reads

          $(PROJ).exe : $(OBJS)

       and ends at the next blank line. Do not copy the $(PROJ).EXE
       line, and do not leave a blank after the target. After you have
       copied the commands, your file should appear as follows:

          ... PWB section here, unmodified ...

          # << User_supplied_information >>

          OVERLAID : $(OBJS)
          !IF $(DEBUG)                    # copy of commands...
                  $(LRF) @<<$(PROJ).lrf
          $(RT_OBJS: = +^
          ) $(OBJS: = +^
          )
          $@
          ...

    f. Use the following procedure to modify the commands to link an
       overlaid EXE instead of a normal EXE.

       Note: There are two subsections in this section: a debug section
       that starts at the first "!IF $(DEBUG)" and ends at "!ELSE", and
       a release section that starts after the "!ELSE" and ends at the
       first "!ENDIF".

       You need to make the following modifications to both
       subsections.

       i. Delete the line that reads as follows:

             ) $(OBJS: = +^

          After the right parenthesis on the line that moved up, put
          your list of .OBJ files with parentheses to indicate which
          ones go in which overlays. If you need to use more than one
          line for all of your objects, be sure to put a plus sign (+)
          at the end of each line except the last.

      ii. Replace "$@" on the next line with "$(PROJ).EXE".

          In our example,

                 $(LRF) @<<$(PROJ).lrf
             $(RT_OBJS: = +^
             ) $(OBJS: = +^     # delete this line
             )                  # append OBJ list here ...
             $@                 # replace this line with $(PROJ).EXE

          becomes:

                 $(LRF) @<<$(PROJ).lrf
             $(RT_OBJS: = +^
             ) hello.obj +
             (a.obj) +
             (b.obj)
             $(PROJ).exe

          Remember to make the changes in both branches of the !IF
          $(DEBUG).

    g. The last step is to modify the browser database build commands.
       These are the two lines at the very end of the file that begin
       with "$(NMAKEBSC...". PWB adds and deletes these lines in the
       PWB section as you turn browser information on and off.

       Since PWB won't delete and add these lines in the user section,
       enclose them in !IF $(BROWSE)...!ENDIF so they'll be executed
       only when you ask for browse information. You also need to
       delete the "$(NMFLAGS)" macro from the second line to prevent
       infinite NMAKE recursion.

       The following lines

          $(NMAKEBSC1) MAKEFLAGS=
          $(NMAKEBSC2) $(NMFLAGS) -f $(PROJFILE) $(PROJ).bsc

       become:

          !IF $(BROWSE)
              $(NMAKEBSC1) MAKEFLAGS=
              $(NMAKEBSC2) -f $(PROJFILE) $(PROJ).bsc
          !ENDIF

       If you need special NMAKE options for building the browser
       database, just add them where you removed $(NMFLAGS).

 3. Reactivate the MAKE file by selecting Make.Set Program List.

 4. With these changes, if you select Make.Rebuild All, you will still
    get a non-overlaid program because PWB normally builds the first
    target in the MAKE file. To build the overlaid program, modify the
    command line passed to NMAKE so that NMAKE builds your overlay
    target rather than the regular EXE. Select Options.NMAKE Options
    and specify "OVERLAID" as the target by putting it in the NMAKE
    options box, or use Make.Build Target.

 5. With "OVERLAID" in Options.NMAKE Options you can build your program
    by either selecting Make.Rebuild All or Make.Build *.EXE, as usual.
    If you want to build a non-overlaid program, delete "OVERLAID" from
    the NMAKE options box.

    Note that if you use debug options with overlays you will get a
    linker warning L4047. This warning, and the dialog box that says
    that CRT0DAT.ASM can't be found, are normal when building overlaid
    programs for debugging and can be ignored. You can debug the overlaid
    program normally, with full debugging information available.

    This MAKE file behaves almost identically to a regular PWB MAKE
    file. The only differences are that NMAKE options are NOT  passed
    to the browser build unless you add them to the browser build line,
    and that you must edit the user supplied section if you add or
    delete modules from the project.


 2.

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.00 fixlist1.10 s_c
 Last Modified:  5-FEB-1991    ArticleIdent: Q60392

 TOOLS.PRE is a sample Programmer's WorkBench (PWB) initialization file
 that is installed (and modified) when C 6.00 is installed by running
 the Setup program. On pages 19 and 20 of "Microsoft C: Installing and
 Using the Professional Development System," it states that the
 contents of TOOLS.PRE can be merged with an existing TOOLS.INI file,
 if one exists, or it can be renamed to TOOLS.INI, if there isn't one.
 To work correctly, you must make sure that the contents of this file
 are preceded by a PWB tag (for example, [PWB]) because the supplied
 TOOLS.PRE lacks this tag.

 When merging the PWB 1.00 TOOLS.PRE file into an existing TOOLS.INI
 file, a [PWB] tag should be added just above the area where the file
 is merged. For example:

 [PWB]
   .
   .
   .
   (TOOLS.PRE contents)
   .
   .
   .

 [NEXT-TAG]

 If TOOLS.PRE is being renamed to TOOLS.INI, the tag should be added as
 the first line in the file. In either case, failure to add the tag
 will result in PWB ignoring the initialization information.

 Microsoft has confirmed this to be a problem in PWB version 1.00. This
 problem was corrected in PWB version 1.10.


 3. How to Abort Compilation When Using PWB

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_c
 Last Modified: 17-JUL-1990    ArticleIdent: Q60500

 Question:

 How do I abort a compile that is in progress when using the
 Programmer's WorkBench (PWB) environment?

 Response:

 Under MS-DOS (or the OS/2 3.x compatibility box), use CTRL+C to abort.

 Under OS/2, use "Arg Meta Compile" to abort a compilation taking place
 in the background.

 The default keystrokes for Arg Meta Compile are ALT+A F9 CTRL+F3.

 You can also create a macro and assign it to a key to abort the
 compile process. Below is a sample macro that you could place in your
 TOOLS.INI file under the [pwb] tag.

    [pwb]
    Abort:=Arg Meta Compile
    Abort:Ctrl+F5

 Note: In either OS/2 or MS-DOS, the ESC key and CTRL+BREAK do not
 abort a compilation.


 4. PWB Makefiles Are Read-Only When Set as Active Program List

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 25-MAY-1990    ArticleIdent: Q60749

 When you choose the Make.Set Program List option within the
 Programmer's WorkBench (PWB) environment to set a program list for the
 current project, the makefile associated with the current program list
 is marked as read-only and is not editable.

 Code Example
 ------------

 // FOO.C

 #include <stdio.h>
 void main ( void )
 {
    printf ( "Foobar\n" ) ;
 }

 1. Using the above sample program, choose the Make.Set Program List
    menu options and call the program list FOO.MAK.

 2. Save the list.

 3. Choose the File.Open menu, and enter FOO.MAK as the file you want
    to open.

 4. Place your cursor anywhere in the file and press ENTER. You will be
    greeted with the following a pop-up message:

       No-edit file may not be modified.

 If you want to edit the makefile, choose the Make.Clear Program List
 options, and you can edit the makefile as you want.


 5. Why Zero-Length .SBR Files Are Left on the Disk by the PWB

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 16-JAN-1991    ArticleIdent: Q61056

 When using the Source Browser functionality within the Programmer's
 WorkBench, you can expect to have zero-length .SBR files on your disk.
 This is by design of the PWBRMAKE utility.

 PWBRMAKE.EXE is a utility that converts the .SBR files created by the
 compiler for each program module into a single database file that can
 be read by the Programmer's WorkBench (PWB) Source Browser. The
 resulting Source Browser database file has the extension .BSC.

 When a Source Browser database (a .BSC file) is built from .SBR files,
 the .SBR files are truncated to zero length to save disk space since
 they can be quite large. .SBR files are truncated to zero length,
 rather than being deleted, because PWBRMAKE performs incremental
 updates to the database and, therefore, needs the time and date stamp
 from the files.

 When you rebuild part of your project, new .SBR files are built for
 those modules. Each .SBR file that has not been re-created during a
 build is included as a zero-length file. This tells PWBRMAKE that the
 file has no new contribution to make to the database, so no update of
 that part of the database is required.


 6. Do Not Start Programmer's WorkBench by Typing PWBED

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 11-JUL-1990    ArticleIdent: Q61307

 You cannot start the Programmer's WorkBench by typing PWBED. This is
 incorrect. Type PWB to start the Programmer's WorkBench environment.

 In the REAL MODE directory specified during setup, there will be two
 executables for the PWB, PWB.COM and PWBED.EXE. PWB.COM actually
 spawns PWBED.EXE. If you use PWBED to start the PWB, it will consume
 approximately 500K of memory. By executing a DOS SHELL from within the
 PWB and running CHKDSK, you will notice there is very little memory
 left.

 When you invoke the PWB the correct way (by typing PWB), then shell-
 out and do a CHKDSK, you will see that the PWB has only consumed
 approximately 8K of available memory.

 The PWB appears to work correctly if you invoke it with PWBED.
 However, since it is using so much memory, you will receive memory
 problems, such as "out of memory," "cannot compile," or "cannot
 build." These are caused because there is not enough memory to spawn
 either NMAKE, the compiler, or the linker.


 7. Steps Needed to Make Source Browser Usable

 Product Version(s): 1.00    | 1.00
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER |
 Last Modified: 11-JUL-1990    ArticleIdent: Q61309

 Before using the Browse menu options, you must first define and build
 the database the Source Browser will use. If this database is not
 already built, all options on the Browse menu will be grayed out and
 unusable.

 The following steps must be taken to define a database that is usable
 by the Source Browser menu options:

 1. Generate a program list using the Set Program List command in the
    Make menu. The PWB creates one internally if you do not specify one
    and the program only uses one source file. If a program is larger
    than one source file and a program list is not set, it is
    impossible to generate a Source Browser database.

 2. Choose Browse Options from the Options menu. You must select the
    Generate Browse Information field in the dialog box to create the
    Source Browser database.

 3. Build your program using the Make Menu option. You MUST have a
    successful build (compile AND link) of the program for a Source
    Browser database to be generated.

 The Browse Menu options should now be available for use.

 If, after taking the steps outlined above, the Browse Menu options
 are still unavailable for use, query on the following keywords:

    Browse and Options and Unavailable and Strange and Circumstances
 For printed documentation explaining the setup and use of the Source
 Browser, see Pages 50-52 of "Installing and Using the Professional
 Development System." You can also find information about the Source
 Browser in the online help under Programmer's WorkBench, Using the PWB
 Source Browser.


 8. SYS2070 Issued When Executing PWB.EXE for the First Time

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 13-JUN-1990    ArticleIdent: Q61572

 When running the Programmer's WorkBench (PWB) for the first time, the
 following OS/2 system error may be issued:

    Session Title:
    PWBED.EXE

    SYS2070: The system could not demand load the
    application's segment. MSHELP HELPSHRINK is in error.
    For additional detailed information also see message SYS0127

 This system error is caused by the PWB's use of a version of
 MSHELP.DLL that is not as current as the one that was shipped with C
 version 6.00. For the PWB to function correctly, the correct version
 of MSHELP.DLL must be in the LIBPATH.

 The README.DOC on the C version 6.00 Setup/Compiler 1 Disk warns of
 this potential problem, and suggests that QuickHelp (QH) be terminated
 as a background keyboard monitor before Setup is run.

 This problem is usually caused as a result of the Setup program not
 being able to copy its version of MSHELP.DLL over the old version of
 MSHELP.DLL. If another process (most likely a detached session of
 QH.EXE) was accessing this file during the execution of Setup, the
 Setup program will issue a message similar to the following:

    ERROR: Could not create file C:\OS2\DLL\mshelp.dll
    ERROR: File copy failed: A:\the PWB\mshelp.dll to C:\OS2\dll\mshelp.dll

 To solve this problem, take the following steps:

 1. Disable QH as a keyboard monitor:

    a. Press ALT+Q (to invoke QH).

    b. Press O (for the Options menu).

    c. Press T (to Terminate the monitor).

 2. Copy the up-to-date version of MSHELP.DLL from the distribution
    disk:

    a. Insert the Setup/Compiler 1 Disk into Drive A.

    b. Change the default Drive A.

    c. Run Setup with the /copy option by typing the following:

          setup /copy

    d. Press ENTER

    e. Press ENTER again (unless the setup files are in a drive other
       than A).

    f. At the prompt asking for the name of the file to copy, type
       MSHELP.DLL and press ENTER.

    g. At the prompt asking for the name of the directory to which to
       copy this file, type the directory in which the old MSHELP.DLL
       is located (most likely C:\OS2\DLL).

    h. Setup should then ask for the Programmer's WorkBench/Utilities
       for OS/2 Disk to be inserted into the setup drive.

    i. When Setup is finished copying the file, press ENTER at the
       next prompt.

 The PWB should now start up correctly.


 9. U1355 Bad Command or File Name

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr filename
 Last Modified: 27-SEP-1990    ArticleIdent: Q61607

 The following undocumented error may occur when attempting to run an
 executable file such as CL.EXE, LINK.EXE, NMAKE.EXE, etc., from inside
 the Programmer's WorkBench (PWB).

    U1355 Bad Command or File Name

 The error occurs because the directory containing the .EXE file is not
 specified in the search path or an incorrect LINK.EXE is being
 executed.

 This problem can be corrected by adding the missing directory name(s)
 to the path in the AUTOEXEC.BAT or STARTUP.CMD and rebooting, or
 executing NEW-VARS.BAT or NEW-VARS.CMD. If an incorrect linker is the
 problem, the search path can be rearranged to find the new version of
 the linker first, or the old linkers can be deleted or renamed.
 Finally, it may be necessary to delete the CURRENT.STS and PROG.STS
 files before the PWB will work correctly. This error is not documented
 in the PWB online help.


 10. Saving Compiler Results File in the PWB

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 25-MAY-1990    ArticleIdent: Q61636

 The Programmer's WorkBench (PWB) deletes the compiler results file
 upon exiting the PWB. In DOS or OS/2, the file can be saved if the
 compiler results window is made current and the File.Save As menu
 option is selected.

 The compiler results file will appear similar to the following:

    +++ PWB  [E:\] Rebuild
            NMAKE  /z /a /f E:\pwb.mak
         cl /c /W4 /Fm /Ot /FoGLOBL.obj GLOBL.C
    Microsoft (R) C Optimizing Compiler Version 6.00
    Copyright (c) Microsoft Corp 1984-1990. All rights reserved.

    GLOBL.C
         echo @GLOBL.lrf > NUL
         link @GLOBL.lrf

    Microsoft (R) Segmented-Executable Linker  Version 5.10
    Copyright (C) Microsoft Corp 1984-1990.  All rights
    reserved.

    Object Modules [.OBJ]: GLOBL.obj,GLOBL.exe,NUL, /NOD:SLIBCE
    SLIBCEP , /NOI /BATCH /EXE /FAR /PACKC;


 11. Programmer's WorkBench Edit Switch Is Unimplemented

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 14-MAY-1990    ArticleIdent: Q61642

 The edit switch for the Programmer's WorkBench (PWB), documented on
 Page 79 of the version 6.00 "Microsoft C Reference" manual, is
 unimplemented in PWB version 1.00. The switch is designed to set the
 active file as read-only so that it cannot be edited.

 If you add an option in your TOOLS.INI file under the PWB tag to read
 either

    Edit:yes
    Edit:no

 PWB will return an error message saying "Edit is not an editor
 switch."

 As a workaround, invoke PWB with the /r option to open up the current
 file as read-only.


 12. Certain Key Sequences Cause R6003 or SYS1943 in PWB 1.00

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.00 fixlist1.10
 Last Modified:  4-FEB-1991    ArticleIdent: Q61660

 In the Programmer's Workbench (PWB) version 1.00, it has been observed
 that certain unusual editing sequences can cause the following errors:

 In DOS:

    Run-time error R6003 - integer divide by 0

 In OS/2:

    SYS1943 protection violation, trap number 13

 The following sequences reproduce the errors:

    Procedure                             Keystrokes
    ---------                             ----------

 1. Bring up several files.               ALT+F O x3
    Select the Options menu.              ALT+O
    Select Linker options.                L
    Select Set Debug Options.             ALT+G
    Pull up help on the options.          F1
    Arg-refresh through several files.    ALT+A SHIFT+F7 x3
    Escape back to the Editor screen.     ESC x3

 2. Select the Options menu.              ALT+O
    Select Editor Settings.               S (or K)
    Go down thirteen lines.               DOWN ARROW key x13
    Backspace.                            BACKSPACE
    Undo.                                 ALT+BACKSPACE

 Note: Step 2 reproduces only the R6003 error in DOS, not the SYS1943
 error.


 13. PWB 1.00 Requires Decimal Value for Stack Size in LINK Options

 Product Version(s): 1.00    | 1.00
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER | buglist1.00 fixlist1.10
 Last Modified:  5-FEB-1991    ArticleIdent: Q61871

 In the Programmer's WorkBench (PWB) version 1.00, there is a problem
 with changing a program's stack size in some situations. When
 specifying the stack size in the Link Options dialog box (from the
 Options menu), you must enter the value in the form of a decimal
 integer. Although the Help menu tells you this field accepts positive
 integers in octal and hexadecimal form, PWB 1.00 will not accept them.

 When an octal or hexadecimal value is entered in the stack-size field,
 any digits specified as A-F are discarded and replaced by 0 (zero). If
 digits precede a letter, the digits are retained and the letters are
 discarded.

 Microsoft has confirmed this to be a problem in PWB version 1.00. This
 problem was corrected in PWB version 1.10.


 14. SYS0002 Produced If MSHELP.DLL Not Installed

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | pwbhelp
 Last Modified: 23-JAN-1991    ArticleIdent: Q61955

 Under OS/2, if MSHELP.DLL is not installed correctly or is not on the
 LIBPATH, the following error may appear in a window when starting the
 Programmer's WorkBench (PWB):

                     Cannot Autoload Extension
                     e:\c600\binp\pwbhelp.pxt
 MSHELP:  SYS0002:  The system cannot find the file specified

                         < OK >   < Help >

 Make sure that the latest version of MSHELP.DLL (the one that was
 included with the Microsoft C Compiler version 6.00) is installed in a
 directory contained in your LIBPATH.

 If this file was not copied off the disks during setup, you can
 execute the following command with your Setup disk in Drive A:

    a:setup /copy

 Specify the file MSHELP.DLL at the prompt, then specify the
 destination directory.

 The default for SETUP.EXE is to put OS/2 DLLs in the C:\OS2\DLL
 directory. If you choose to install the DLLs in some other directory,
 you must edit the LIBPATH in your CONFIG.SYS file and restart the
 system.


 15. Enabling of Source Browser Menu Related to .BSC and .MAK Files

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 29-MAY-1990    ArticleIdent: Q61968

 The Source Browser feature of the Programmer's WorkBench (PWB) is
 enabled or disabled depending upon the existence of a database file
 (.BSC file) AND a program list (.MAK file). The existence of a .BSC
 database file alone does not guarantee that the Browse menu will be
 enabled for all modules in a project, even if the .BSC file was built
 from .SBR files for every module. The setting of a program list is
 also required.

 Thus, if a .BSC file is built outside of the PWB with PWBRMAKE, then
 upon entering the PWB, the Browser will be enabled for only one module
 at most (see below). The easiest method to enable the Browse menu for
 ALL modules is to select "Set program list" on the Make menu, then
 type in the base name of the .BSC file (with the .MAK or no extension)
 when it prompts you for the filename. If the .MAK file you enter does
 not exist, then the dialog box appears for adding files to the program
 list, whereas you can just select "Save List" without actually adding
 any files. At this point, the Browser menu will be enabled for all
 files you bring up into the PWB editor.

 The existence of a Source Browser database file means that the Browse
 menu will be enabled for a source file with a matching base name of
 the .BSC file.

 For example, assume a project consists of several modules, with the
 main source module called PROJECT.C. In addition, assume a Browser
 database file called PROJECT.BSC is built from the .SBR Browser
 information files produced by the compiler for every module in this
 project. If the file PROJECT.C is brought up in the PWB, the Browse
 menu will be enabled because the base name (PROJECT) is the same as
 the base name of the database file PROJECT.BSC.

 On the other hand, if any of the other source files in the project are
 opened in the PWB, the Browse menu will be disabled because the base
 names do not match the base name of the database file. Also, if
 PROJECT.C is made the current file (which enables the Browse menu) and
 an option is selected on the browse Menu, such as "Goto Reference"
 (which causes a jump to a different module), the Browse menu will
 become disabled. The only way to re-enable the Browse menu in this
 case is to make PROJECT.C the current file again.

 The way to enable the Browse menu for all modules is to set a program
 list to a file with the .MAK extension and the same base name as the
 .BSC file. Thus, in the example above, setting the program list to
 PROJECT.MAK will enable the Browse menu for all modules. In fact, this
 connection between the .BSC file and the .MAK file enables the Browse
 menu for the modules in the current project, and for ANY file opened
 under the PWB.

 The result is that if you bring up a file in the editor that is
 completely unrelated to the current project (and may not even have a
 related .BSC file), you can still use the Browse menu options.
 However, in this situation, the information available from the Browser
 still only pertains to the original project.

 In summary, the .MAK file and .BSC file relationship is based solely
 on the file existence, NOT the file contents. The program list does
 NOT need to contain the names of the modules in the current project
 (or even be an actual makefile) for the Browser to function.


 16. Modifying TOOLS.INI May Have No Effect on PWB Environment

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 17-JUL-1990    ArticleIdent: Q62170

 Changing settings in the TOOLS.INI file to modify the behavior of the
 Programmer's WorkBench (PWB) may not work under certain circumstances.
 For instance, if you decide to change the PWB to 50-line mode by
 setting "height:50" in the TOOLS.INI file, it will not work if the PWB
 was previously used in the 25- or 43-line mode.

 This is because some environment information is also recorded in the
 CURRENT.STS file, which is read in after the TOOLS.INI file --
 overriding the TOOLS.INI settings.

 The following are three workarounds for this problem:

 1. Use the /DS switch when invoking the PWB. This will ignore the
    CURRENT.STS file. However, this option also causes the current file
    history (of files being edited) to be ignored.

 2. Delete the CURRENT.STS file. This also causes the current list of
    programs being edited to be ignored.

 3. The better option is to select Editor Settings from the Options
    menu. When the list of editor switch settings appears, it can be
    changed and saved to the TOOLS.INI file by pressing SHIFT+F2. This
    will save the settings and cause the selection to take effect.


 17. Reversing Mouse Buttons in the PWB Cannot Be Done

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 25-JUL-1990    ArticleIdent: Q62330

 Currently under the Programmer's WorkBench (PWB) released with version
 6.00 of the Microsoft C Optimizing Compiler, it is not possible to
 reverse the functionality of the mouse buttons.

 It is possible to change the functionality of the mouse buttons under
 OS/2 and DOS, but this will be overridden by the PWB environment.


 18. Attempting to Expand a Help Dialog Box Hangs DOS

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.00
 Last Modified: 25-JUL-1990    ArticleIdent: Q62331

 When one of the pull-down menus in the Programmer's WorkBench (PWB)
 version 1.00 is selected (File, Edit, View, etc.) and then F1 is
 chosen for help on that menu, a small help screen appears. If CTRL+F10
 is chosen in an attempt to expand the window to full screen, the
 machine will hang under DOS. If the machine doesn't hang, it may
 require another invocation of CTRL+F10 to cause the problem.

 Under OS/2, the machine may not hang, but the PWB's functionality will
 be disrupted and attempts to free oneself may cause a GP fault. It may
 be possible to exit the PWB, but at the very least, the CURRENT.STS
 file will be corrupted so that future entrances to PWB will result in
 very odd window configurations.

 Microsoft has confirmed this to be a problem with the PWB version
 1.00. We are researching this problem and will post new information
 here as it becomes available.


 19. PWB Doesn't Update Mark Location If Mark Moves Up or Left

 Product Version(s): 1.00 | 1.00
 Operating System:   OS/2 | 1.00
 Flags: ENDUSER | buglist1.00
 Last Modified: 13-JUN-1990    ArticleIdent: Q62388

 If you set a mark in a file, and that location then moves upward or
 toward the left in the file, PWB does not reset the mark location;
 however, it does correctly update marks that move downward or to the
 right in the file.

 Consider the following file:

 /* Test.dat */
 test1

 test2

 test3

 Place the cursor on the "2" in test2. Choose the Search.Define Mark
 menu option. Name the mark "mark1" and press ENTER. Now, move the
 cursor to another location in the file. Choose the Search.Go To Mark
 option from the menus. Go to "mark1". Note that the cursor is back on
 the "2" in test2.

 Next, add another blank line between test1 and test2. Again, move your
 cursor and go to mark1. Note that the cursor is back on the "2" in
 test2.

 Now, delete both the lines between test1 and test2. Select the
 Search.Go To Mark option from the menus. Note that the cursor is on
 the same location as it was before you deleted these lines. The same
 behavior will happen if you delete any of the characters before the
 "2" in the test2 line.

 Microsoft has confirmed this to be a problem in the Programmer's
 WorkBench (PWB) version 1.00. We are researching this problem and will
 post new information here as it becomes available.


 20. PWB 1.00 "Set Dependencies" Fails with Spaces in #include Line

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.00 fixlist1.10 s_c
 Last Modified:  5-FEB-1991    ArticleIdent: Q62578

 The Programmer's WorkBench (PWB) version 1.00 (shipped with C version
 6.00) includes a "Set Dependencies" option in the "Set Program List"
 window. This option automatically sets up build dependencies for all
 include files used in the current project. This option will fail with
 a message that the include file does not exist if there are embedded
 spaces between the left angle bracket (<) and the include-file name in
 an include directive line.

 The Set Dependencies option will work correctly if the space(s) are
 removed or if a new build option is added to the TOOLS.INI file.

 Although embedded spaces are legal in C programming syntax, the
 Programmer's WorkBench fails to parse the include line correctly if
 spaces exist before the filename. The following line of code shows the
 situation where the "Set Dependencies" error will occur:

    #include < stdio.h >

 The space before the "s" in stdio.h prevents PWB from finding the
 STDIO.H include file. (The trailing space after stdio.h does not
 affect the behavior of "Set Dependencies".)

 The full text of the error message window for the line above is as
 follows:

         stdio.h does not exist
    Cannot build its dependency tree.
    Abort dependency lists generation?
         <Yes>    <No>    <Help>

 Selecting <Help> displays a help screen that describes the problem as
 being either a mistyped filename or a nonexistent file, but the actual
 file DOES exist. Removing the embedded space will correct the problem.

 You can also add two new "build" lines to the TOOLS.INI file to make
 the PWB recognize include directives that contain spaces. These lines
 should be included under the section with the [PWB] tag, and should
 have the following syntax:

    build: include .c                                              \
        "^[ \t]*#[ \t]*include[ \t]*\"[ \t]*\\([^\"]+[ \t]*\\)\""  \
        case
    build: include .c                                              \
       "^[ \t]*#[ \t]*include[ \t]*<[ \t]*\\([^>]+\\)[ \t]*>"      \
        case system

 (Note: These build switch statements are broken down into multiple
 lines with the line continuation character (\) because of space
 limitations; you may enter each of them into the TOOLS.INI file on a
 single line, rather than multiple lines.)

 There is one drawback to this workaround; you will still get the error
 message shown above because the "old" build switch is applied before
 the new one. To have the new build switch take effect, you need to
 select "No" when prompted to abort the dependency list generation.
 Once you have selected "No" for each file with spaces in the include
 directive, the dependencies will then be generated correctly.

 Microsoft has confirmed this to be a problem in the Programmer's
 WorkBench version 1.00. This problem was corrected in the Programmer's
 WorkBench version 1.10.


 21. PWB 1.10 Dialog Boxes May Blink After Dialog Help Is Obtained

 Product Version(s): 1.10
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.10 flicker
 Last Modified: 19-FEB-1991    ArticleIdent: Q69347

 When working with the Programmer's WorkBench (PWB) version 1.10 under
 DOS, there are several instances where a dialog box may start flashing
 incorrectly. This situation occurs when you obtain help on a PWB
 informational pop-up dialog box and then return from the Help dialog
 screen. At this point you may find that the original dialog box is
 rapidly blinking.

 This problem may occur when trying to get help on a topic for which
 there is no help, trying to use an unassigned key, or when PWB informs
 you that you changed a file but didn't save it before you tried to
 exit. In each of these cases, PWB gives you a pop-up dialog box
 informing you of the situation. If you get help on this informational
 dialog box and then press ESC or click Cancel, the original dialog box
 will start blinking.

 This is not normal behavior, however, PWB is still fully functional
 and you may proceed by selecting an appropriate choice from the
 flashing dialog box.

 Microsoft has confirmed this to be a problem in the Programmer's
 WorkBench version 1.10. We are researching this problem and will post
 new information here as it becomes available.


 22. R6000 Stack Overflow After Deleting Current Makefile

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 25-JUL-1990    ArticleIdent: Q62668

 If you are viewing your makefile in a window in PWB 1.00, then delete
 the makefile from a shell; attempting to make the window containing
 the makefile active will cause a run-time error R6000, stack overflow.

 To duplicate this problem, bring up a sample program and set the
 program list to that file's makefile. Next, open up another window
 and open the makefile in that window. Now, either from the Run.Run
 <DOS-OS/2> Command menu or the File.<DOS-OS/2> Shell, delete that
 makefile.

 After returning back to the PWB, make the window containing the
 makefile the active program list either by pressing the F6 key to
 toggle windows or by clicking the left mouse button in that window.

 You will be faced with a popup message saying "File has been deleted
 from disk. Delete from memory?" Answering "yes" brings up the popup
 six to eight more times. Then, PWB will abort to the system prompt
 with an R6000 (stack overflow) error message and another message, "File
 has been deleted from disk."

 Microsoft has confirmed this to be a problem in PWB version 1.00. We
 are researching this problem and will post new information here as it
 becomes available.


 23. PWB 1.00 Extensions Only Return True Under DOS

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 15-AUG-1990    ArticleIdent: Q63052

 Extensions written for use by the Programmer's WorkBench (PWB) version
 1.00 under the DOS operating system are recognized as returning true
 regardless of their actual return values.

 The use of return values as a way of providing conditional jumps
 inside PWB macros is a common practice that is affected by the above
 limitation for PWB extensions. The following sample extension and
 macro demonstrate the above problem. Once installed, both the foo()
 and foo2() functions will be seen as returning true to PWB.

 Sample Code
 -----------

 // foo.c

 #include <string.h>
 #include <stdlib.h>
 #include <ext.h>

 PWBFUNC foo( unsigned argData, ARG far *pArg, flagType fMeta );
 PWBFUNC foo2( unsigned argData, ARG far *pArg, flagType fMeta);

 // Switches.
 struct swiDesc swiTable[] =
 {
    { NULL, NULL, 0 }
 };

 // Commands.
 struct cmdDesc cmdTable[] =
 {
    { "foo", foo, 0, NOARG },
    { "foo2",foo2,0, NOARG },
    { NULL, NULL, 0, 0 }
 };

 void EXTERNAL WhenLoaded()
 {
     SetKey( "foo",         "alt+f" );
     SetKey( "foo2",       "ctrl+f" );
     return;
 }

 PWBFUNC foo( unsigned argData, ARG far *pArg, flagType fMeta )
 {
  return(FALSE);  /* FALSE is defined as 0 in ext.h */
 }

 PWBFUNC foo2( unsigned argData, ARG far *pArg, flagType fMeta)
 {
  return(TRUE);   /* TRUE is defined as 1 in ext.h  */
 }

 // End of foo.c

 ; macros in tools.ini to test foo and foo2

 load foo

 test:=foo ->loc1 arg "true" message => :>loc1 arg "false" message
 test2:=foo2 ->loc2 arg "true" message => :>loc2 arg "false" message

 test:alt+t
 test2:ctrl+2

 Microsoft has confirmed this to be a problem with PWB version 1.00. We
 are researching this problem and will post new information here as it
 becomes available.


 24. PWB Text Highlight with Mouse Acts Strange After Search

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 15-AUG-1990    ArticleIdent: Q63059

 The click-and-drag method of selecting text with the mouse in the
 Programmer's Workbench (PWB) sometimes works incorrectly when used
 after a search function.

 To reproduce this problem, do the following:

 1. Select a word in the text using the mouse (double-click on a single
    word).

 2. Execute the search function (select the Search menu, choose Find,
    then OK).

 3. Now try to highlight the text a few lines below the word you used
    to search on (using the click-and-drag method).

 The text will be highlighted starting at the original word that was
 searched for, rather than at the starting mouse position.

 To work around this problem, click the left button anywhere in the
 text window, then perform the text highlight.

 Microsoft has confirmed this to be a problem with the Programmer's
 Workbench version 1.00. We are researching this problem and will post
 new information here as it becomes available.


 25. PWB Does Not Return from DOS Shell with ";" in TMP

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 25-JUL-1990    ArticleIdent: Q62702

 If there is a semicolon ";" in your TMP environment variable, you may
 not be able to return to the Programmer's Workbench by typing "exit"
 after selecting "DOS Shell" from the File menu in PWB.

 Since the TMP environment variable is used to specify a single
 directory rather than a path, the semicolon character should not be
 used.

 To re-create this situation, type the following at the command line:

    set TMP=C:\TMP;

 Then select DOS Shell from within PWB. Typing "exit" on the DOS
 command line will not bring you back into PWB.

 To correct the problem, remove the semicolon from the end of the TMP
 environment variable.


 26. PWB BACKUP.BAK Does Not Create Backup of Source File Correctly

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER| buglist1.00
 Last Modified: 24-JUL-1990    ArticleIdent: Q63234

 Version 1.00 of the Programmer's Workbench does not create a backup of
 your source file correctly if the PROJECT.MAK has the same base name
 as the SOURCE.C file. When you build or rebuild the project, the file
 saved as your backup is a copy of the CURRENT.STS file.

 A workaround to this problem is to name your PROJECT.MAK with a
 different base name than your SOURCE.C file. This will still save a
 copy of your CURRENT.STS file with the base name of the PROJECT.MAK.
 However, it will correctly save a backup of the SOURCE.C as
 SOURCE.BAK.

 Microsoft has confirmed this to be a problem in version 1.00 of the
 Programmer's Workbench and will post new information here as it
 becomes available.



 27. PWB menukey Switch Resets to ALT When Shelling Out to DOS

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00
 Last Modified: 10-JUL-1990    ArticleIdent: Q63267

 If the "menukey" switch in the DOS version of the Programmer's
 Workbench (PWB) version 1.00 is set to anything other than ALT (which
 is the default), it will be redefined to the ALT key after shelling
 out to DOS. This means the menukey switch will lose its assignment
 anytime you choose Compile, Run Program, Debug Program, or DOS Shell.

 The menukey switch determines which keystroke activates the PWB main
 menu bar. The ALT key is normally used for this, but menukey can be
 redefined to any keystroke. For example, menukey is automatically
 defined to F9 if you select Brief Editor emulation when installing the
 Programmer's WorkBench.

 Whenever you invoke any function (such as Build) that goes out to DOS
 for execution and then returns, the menukey switch is reset to ALT, so
 that both ALT AND the user-defined keystroke invoke the menu.

 To work around this problem, you can use the Restart command to invoke
 a macro that redefines the menukey to the desired value each time you
 return from a DOS SHELL command, which will then keep ALT from
 activating the menu. For example, to make it so that F9 is always
 reset as the only menukey, put the following line in the PWB tagged
 section of the TOOLS.INI file:

    restart:= arg "menukey:F9" assign

 Since the Restart command, if it exists in TOOLS.INI, is invoked
 automatically when returning from a SHELL command, this guarantees
 that the key assignment will always remain consistent.

 Microsoft has confirmed that the automatic reactivation of ALT as the
 menukey is a problem with the Programmer's WorkBench version 1.00. We
 are researching this problem and will post new information here as it
 becomes available.


 28. PWB: Print Does Not Put CR/LF at EOL If Text Selected

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.00
 Last Modified: 25-JUL-1990    ArticleIdent: Q63318

 Using the Programmer's Workbench version 1.00, when a region of text
 is selected and the Print function is invoked, the resulting output
 contains linefeed characters (0x0A) at the end of each line, rather
 than a carriage return/linefeed (<CR><LF>) combination (0x0D and
 0x0A).

 Some printer drivers do not recognize this as a valid end-of-line
 (EOL) character and do not print correctly.

 To reproduce this problem, open a file that contains the <CR><LF>
 combination at the end of each line. Highlight a region of text in the
 file and from the File menu choose Print. Tab to the second field and
 type in the following:

    copy %s test.txt

 This will copy the region of selected to the file TEST.TXT. Using a
 standard hex file viewer, you can see that the end of a line is
 denoted by a single 0A. If you look at the original file using the hex
 viewer, it will contain 0A 0D at the end of each line.

 The Programmer's Workbench will recognize this type of file (with a
 single 0A at each end of line) and display it correctly if you try to
 open it within the Workbench, but many printer drivers do not
 understand this type of file.
 The workaround for this problem is to write a program that translates
 each 0x0A found in the output file to the bytes 0x0D and 0x0A, or use
 a printer driver that understands this type of file. In fact, most
 printers have an escape sequence or dip switch to make it recognize
 this type of file.

 Microsoft has confirmed this to be a problem with the Programmer's
 Workbench version 1.00. We are researching this problem and will
 post new information here as it becomes available.


 29. Unknown Function psrch with Brief Emulation in PWB

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 25-JUL-1990    ArticleIdent: Q63319

 When using the Brief emulation feature of the Programmer's WorkBench
 version 1.00, reinitialization of the TOOLS.INI file will cause a
 number of unknown functions to appear when you try to use them. In
 short, most of the unknown functions that may be reported are related
 to search features such as the psearch switch. The error message
 associated with this search feature is commonly "Unknown function
 psrch."

 This error occurs only after you use the Initialize function.

 The Initialize function discards current macro definitions and rereads
 the appropriate section of TOOLS.INI. This is not exactly the same as
 restarting PWB; the Autostart macro is not executed after Initialize.
 The BRIEF emulation depends on the Autostart macro to define the
 search functions.

 To recover the definition of the missing macros, execute the toggle_re
 BRIEF emulation macro (CTRL+F6). To avoid having to remember to
 execute this macro, you can add this to the main section of TOOLS.INI:

    reinit:=Initialize Autostart
    reinit:Shift+F8

 Or you can define the macros as follows:

    psrch:=arg arg "String to Search for" prompt ->can
                                            psearch => :>can cancel
    msrch:=arg arg "String to Search for" prompt ->can
                                            msearch => :>can cancel
    qrepl:=arg arg qreplace
    srchname:="REoff"


 30. Problems Viewing README.DOC Inside PWB Online Help and QH

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER  |
 Last Modified: 15-AUG-1990    ArticleIdent: Q63661

 Problems can occur when attempting to access the README.DOC from
 within the DOS versions of Programmer's WorkBench (PWB) or QH via the
 online help.

 When attempting to view the README.DOC file using the online help
 inside the DOS version of PWB, the messages "Error displaying help"
 and then "Cannot process cross reference" may be displayed in
 successive dialog boxes.

 When attempting to view the README.DOC file from within QH, the
 message "The database README.DOC is not open, or the topic is not
 found" may be displayed.

 Again, these problems are found only in the DOS version of PWB and QH.
 Access of the README.DOC in this manner does not produce errors under
 the OS/2 versions of PWB or QH.

 The following are two possible workarounds for the problem in PWB:

 1. The README.DOC can be loaded into the help system by typing the
    following

       arg "$PATH:readme.doc!" arg pwbhelp

    with default keys:

       Alt+A $PATH:readme.doc! F1

    Note that this method may fail if there is another file named
    README.DOC in the path before the C 6.00 README.DOC. If this is the
    case, the other README.DOC will be loaded instead of the C 6.00
    README.DOC. This method can also fail if there is not enough memory
    to load the file into the help system.

 2. If the previous method fails, the C 6.00 README.DOC can be loaded
    into PWB as a normal text file via the File.Open menu option. The
    README.DOC can be found in the C 6.00 bound executable directory
    (for example, C:\C600\BINB).

 The following are three possible workarounds for the problem in QH:

 1. Inside QH, select View.Search, type "$PATH:readme.doc!" and press
    ENTER. Again, this will bring up the first README.DOC on the path.

 2. You can also select File.Open and load the the file by giving the
    full path and filename of the C 6.00 README.DOC. QH allows you to
    open any text file under 64K in size.

 3. To enable direct access of the README.DOC from within QH via the
    README.DOC button, it is necessary to point the QH environment
    variable to the directory where the README.DOC is located. For
    example:

       set qh=c:\c600\binb\readme.doc

    The QH environment variable is not documented in the C 6.00 printed
    or online documentation.

 Microsoft is researching this problem and will post new information
 here as it becomes available.


 31. CTRL+NUM/ May be Read as CTRL+/ in DOS with NUM LOCK On

 Product Version(s): 1.00 1.10 | 1.00 1.10
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist1.10
 Last Modified: 15-NOV-1990    ArticleIdent: Q66740

 In versions 1.00 and 1.10 of Programmer's WorkBench (PWB), the
 CTRL+NUM/ (CTRL+/ on the numeric keypad) and ALT+NUM/ (ALT+/ on the
 numeric keypad) combinations may be interpreted as CTRL+/ and ALT+/
 (on the main keyboard). This problem happens only in DOS or the OS/2
 DOS 3.x box, and only on certain computers. This behavior will cause
 any macro or function assigned to CTRL+NUM/ or ALT+NUM/ to not execute
 when NUM LOCK is on.

 To reproduce this problem, assign a function or macro to CTRL+NUM/.
 Then execute the TELL function (CTRL+T by default) and press CTRL+NUM/.
 The TELL function prompts for a keystroke, then displays the name of
 the keystroke and the function assigned to it. With NUM LOCK on, TELL
 will return the following:

    unassigned:Ctrl+/.

 With NUM LOCK off, TELL will return the following:

    <function name>:Ctrl+num/.

 This behavior is identical for the ALT+NUM/ key name, but works
 properly for all other key names on the numeric keypad.

 If NUM LOCK is off, or if the protected-mode version of PWB is run,
 this behavior does not occur.

 This behavior has been observed on the following machines:

    Northgate 386-33
    PS/2 Model 70
    PS/2 Model 80-311

 Microsoft has confirmed this to be a problem in PWB version 1.00 and
 1.10. We are researching this problem and will post new information
 here as it becomes available.


 32. PWB Command-Line Option /DP Is Documented But Not Implemented

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 27-JUL-1990    ArticleIdent: Q63951

 The /DP switch for the Programmer's WorkBench (PWB), documented on
 Page 49 of the version 6.00 "Microsoft C Reference," is not
 implemented in version 1.00 of the PWB. This switch is designed to
 ignore the most recent program list upon starting the PWB.

 The /DP switch is mentioned only in the "Microsoft C Reference" and
 not in the online help.

 Upon invocation, the Programmer's WorkBench version 1.00 does not
 automatically set the program list to the last program list used.
 Therefore, the /DP command-line switch was not implemented because it
 would have no purpose.

 With the PWB version 1.00, there is no way to have the last program
 list set automatically at startup.


 33. With the "deflang" Switch PWB Prompts for Setting Program List

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified:  3-AUG-1990    ArticleIdent: Q64353

 As documented on Page 79 of the "Microsoft C Reference" shipped with C
 version 6.00 and in the online help, the "deflang" switch in the
 Programmer's WorkBench (PWB) sets the default filename extension for
 list boxes in PWB dialog boxes. Another (undocumented) feature of this
 switch is to enable you to be prompted to "Set Program List?" when
 loading a source file with a .MAK file associated with it in the
 current directory.

 By default, "deflang" is not set. You can set the deflang switch in
 the [PWB] tagged section of the TOOLS.INI file, for example:

    deflang:C

 This changes the default filename extension in the PWB's dialog boxes
 (such as Open in the File menu) from "*.*" to "*.c", so that only
 files with the .c extension show up by default. Other languages can be
 specified as well, as shown below:

    Switch Setting     Extension
    --------------     ---------

    no value            .*
    C                   .c
    Asm                 .asm
    BASIC               .bas
    FORTRAN             .for
    Pascal              .pas
    COBOL               .cbl
    LISP                .lsp

 Note that the online documentation specifies "Assembler" as the switch
 to use for .ASM files, but this is incorrect. "Asm" is the correct
 switch to use to make Assembler the default language.

 The deflang switch also enables you to be prompted as to whether or
 not the program list should be set automatically. If you load a file
 that has the extension specified by the "deflang" switch and you also
 have a .MAK file with the same base filename in the same directory,
 the PWB will prompt you about loading the program list.

 For example, assume that deflang is set to C and FOO.MAK and FOO.C are
 in the same directory. If you type PWB FOO.C at the command-prompt,
 the PWB will pause when loading and prompt with "Set Program List?
 FOO.MAK". At this point you can specify <yes> or <no>.

 When already in the PWB, if you select Open from the File menu, and
 select FOO.C as the file to open, the PWB will also prompt you at this
 point regarding whether or not you want FOO.MAK loaded as the program
 list, but only if NO program list is currently set.


 34. Can't Resize a Window with a Macro in PWB

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 30-AUG-1990    ArticleIdent: Q64433

 A window cannot be resized using the "resize" function in a macro.
 After Programmer's WorkBench (PWB) performs the resize function, it
 waits for the you to respond with the UP ARROW or DOWN ARROW key.
 Functions that are placed in the macro after the resize function are
 ignored. If "record on" is selected and you try to record the resizing
 of a window, the macro will stop recording until the ENTER key on the
 numeric keypad is pressed.

 The following is an example:

    resizeit:= cancel arg arg nextmsg window resize up up up NumEnter

 The above example stops at the resize function and waits for you to
 resize the window. The remaining functions are ignored.

 To make a window a specified size, move the cursor to a location on
 the screen and then open the window with the "window" function.

 The following is an example of a macro that opens the "<compile>"
 window with a specified size:

 compile_size:= up up up up up up up up up up
 resize_it:=cancel meta down compile_size arg window window arg \
            "<compile>" setfile window
 resize_it:ALT+U

 Note: The size of the compile window can be adjusted by changing the
 number of ups on the compile_size line.


 35. PWB Hangs When Run with Some Communication Programs Under OS/2

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 30-AUG-1990    ArticleIdent: Q64435

 When running Programmer's WorkBench (PWB) under OS/2 while
 simultaneously running communication programs, PWB will appear to
 hang. To correct the problem, terminate any communication programs and
 PWB will resume as normal.


 36. "Cannot Open File current.$" May Mean Incorrect INIT Variable

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 17-DEC-1990    ArticleIdent: Q64566

 When using the Programmer's Workbench (PWB), the following message may
 appear as a pop-up dialog box when selecting Compile or DOS Shell (or
 OS/2 Shell for OS/2):

    +----- Cannot open file! -----+
    |   D:\TEST\SRC\X\current.$   |
    |  No such file or directory  |
    |-----------------------------|
    |      < OK >   < Help >      |
    +-----------------------------+

 One cause for this error is an incorrect setting of the INIT
 environment variable. To remedy the situation, exit PWB and make sure
 that the INIT environment variable is set to a valid directory name
 (for example, a directory that exists).

 To reproduce this message, set your INIT environment variable to an
 invalid directory, for instance (if a directory named X does not exist
 on your drive):

    SET INIT=X

 Then start PWB and try to compile a program. The message will appear
 in the middle of the screen.

 One possible reason why your INIT environment variable may be set
 incorrectly, even if your AUTOEXEC.BAT sets it correctly, is that you
 might have run out of environment space in the setting of the
 variable. You can refer to the "MS-DOS Encyclopedia," Article 2, for
 more information about increasing your environment space.


 37. How to Use the PWB with the Windows 3.00 SDK

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 15-AUG-1990    ArticleIdent: Q64788

 Detailed step-by-step instructions on how to set up the Programmer's
 WorkBench (PWB) for use with the Windows version 3.00 Software
 Development Kit (SDK) can be found in a file provided with the SDK
 called PWBINFO.WRI.

 The file explains how to set PWB switches so that Windows applications
 can be built from within PWB. The file also explains how to access the
 SDK's online help.

 This file can be viewed and printed with the WRITE program, which is
 packaged with the Windows 3.00 package.


 38. Tips for Using the Microsoft Advisor Online Help

 Product Version(s): 1.00 1.10 | 1.00 1.10
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | s_quickc s_c s_qh
 Last Modified: 23-JAN-1991    ArticleIdent: Q64829

 The following are some tips for more effectively using the online
 documentation included with the Microsoft C Compiler version 6.00
 Programmer's Workbench (PWB) as well as the Microsoft Advisor
 command-line help system:

 1. Finding help on a topic for which the exact name is not known.

    If the exact spelling of a topic is not known, the help for that
    topic can't be accessed directly (for instance, by using the F1 key
    in PWB), but it can usually be found indirectly.

    By using the table of contents and selecting links that pertain to
    the subject in question, the topic can usually be found. To get to
    the table of contents from within QuickHelp, select the Categories
    menu, then "C 6.00".  From within PWB, choose the Help menu, then
    select Contents.

    If you know the general spelling of the topic, an alphabetical
    index is available by choosing Index from the main contents screen.

 2. "Paging" through the online documentation.

    The online documentation can be "paged through" like you would page
    through a manual.

    In PWB, CTRL+F1 takes you from one topic to the next sequential
    topic in the help file. In QuickHelp, Choose Next or Back from the
    View menu to move in either direction.

 3. Scanning a list of available topics (as in a printed index).

    There are alphabetical indices for every major component of the
    product. Just choose Index from the main contents screen and select
    the appropriate topic.

 4. Techniques for using the online help.

    For more information on how to use the help system, as well as on
    the general organization and structure of the help system, choose
    Using Help from the main contents screen.

    For additional help, see Chapter 4, "Using the On-Line Reference,"
    of the "Microsoft C Installing and Using the Professional
    Development System" manual that comes with C version 6.00.

 5. Printing out the online help files.

    By using the HELPMAKE utility, the help files can be decoded to
    readable text files, which can then be printed. For more
    information about the HELPMAKE utility, see Chapter 7 of the
    "Microsoft C Advanced Programming Techniques" manual that comes
    with C version 6.00.


 39. Predefined Identifiers in Microsoft C 6.00

 Product Version(s): 6.00   | 6.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_quickhelp s_c s_utils
 Last Modified: 24-OCT-1990    ArticleIdent: Q65472

 The following information is contained in the online help for the
 Microsoft C Compiler version 6.00.

 This information below can be accessed by using the following steps:

 1. Obtain help on the text "cl" using either the F1 key from the
    Programmer's WorkBench, or by using "qh cl" from the DOS or OS/2
    command lines.

 2. Select Preprocessor Options, then Predefined Identifiers.
 The compiler automatically defines identifiers useful in writing
 portable programs. You can use these identifiers to compile code
 sections conditionally. These identifiers are always defined unless
 otherwise stated.

    Identifier       Target Identified
    ----------       -----------------

    MSDOS            MS-DOS operating system
    M_I86            Member of the I86 processor family
    M_I86mM          Memory model type
                     <m> = T    Tiny
                           S    Small (default)
                           C    Compact model
                           M    Medium model
                           L    Large model
                           H    Huge model
    M_I8086          8088 or 8086 processor; default or with /G0
                        option
    M_I286           80286 processor; defined with /G1 or /G2 option
    _MSC_VER         Identifies the version of Microsoft C
    NO_EXT_KEYS      Disables Microsoft-specific language extensions
                        and extended keywords; defined only with /Za
                        option
    _CHAR_UNSIGNED   Changes default char type to unsigned; defined
                        only with /J option

 The _MSC_VER identifier has a value of 600 for the Microsoft C Compiler
 version 6.00. This identifier is not defined in Microsoft C versions
 5.10 and earlier.


 40. How to Add Other Language Compilers to PWB's Build Options

 Product Version(s): 1.00 1.10 | 1.00 1.10
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | s_pascal b_basiccom s_c h_masm h_fortran b_cobol
 Last Modified: 24-OCT-1990    ArticleIdent: Q65568

 The Programmer's WorkBench (PWB) is an environment capable of
 utilizing different compilers for mixed-language programming. When
 installed during BASIC version 7.10 setup, PWB version 1.10 shows
 build options for the BASIC language only. However, it is possible to
 include other language compilers to utilize the full features of the
 PWB utility.

 The following information applies to the Programmer's WorkBench
 version 1.10 utility supplied with Microsoft BASIC Professional
 Development System (PDS) version 7.10 for MS-DOS and MS OS/2.

 Note that the 1.00 version of PWB is shipped with Microsoft C
 Professional Development System (PDS) version 6.00. The steps below
 should also apply to PWB version 1.00.

 The Programmer's WorkBench (PWB.EXE) is an advanced development
 environment capable of integrating several language compilers,
 NMAKE.EXE, LINK.EXE, and the CodeView debugger. It offers the ability
 to accomplish tasks, such as program development under protected mode
 and mixed-language programming. This ability is not available in the
 QuickBASIC extended development environment (QBX.EXE).

 Two special files, PWBC.PX$ (for protected mode OS/2) and PWBC.MX$
 (for DOS mode), reside on the BASIC PDS 7.10 disks and support the
 option of using the C compiler in PWB. Since SETUP.EXE (in BASIC PDS
 7.10) does not copy PWBC.PX$ and PWBC.MX$ during installation, these
 files must be unpacked and transferred to your machine, for example to
 the \BINP subdirectory located in the \BC7 directory. (Note: The
 UNPACK.EXE utility is found on disk 1 of the BASIC PDS package.) After
 unpacking, the files will have the names PWBC.PXT and PWBC.MXT.

 Next, the following command lines must be added to the TOOLS.INI file
 to make the C compiler available to PWB:

    [pwb - .BAS .BI]
       LOAD: LogicalDrive:\[Path]\PWBC.PXT

 For further information about installing PWBC.PXT and PWBC.MXT, see
 Page 54 of the "Microsoft BASIC 7.1: Getting Started" manual.

 If you want to program in languages other than BASIC or C [such as
 Microsoft Macro Assembler (MASM), Microsoft Pascal, Microsoft FORTRAN,
 or Microsoft COBOL 3.00/3.00a], the following steps will insert the
 initial build options to include other languages to PWB's build
 options menu. In the example below, options to include the MASM.EXE
 assembler are specified. If some other language's compiler is desired,
 substitute appropriate changes for that compiler, where noted in the
 specified areas:

  1. In PWB, go to the Options menu and select Build Options.

  2. Choose Save Current Build Options.

  3. Enter a meaningful message, such as "Options to Include MASM" in
     the window's edit field (if some other language is desired, change
     MASM to the appropriate name). Select the OK button from the "Save
     Current Build Options" and "Build Options" windows.

  4. Open the "TOOLS.INI" file in the PWB utility and go down to the
     bottom of the file. Somewhere near the bottom should be the tag
     "[PWB-Build Options: Options to Include MASM]" (or the language
     that was specified).

  5. In this section, add the following NMAKE instructions:

        build: inference .asm.obj masm_asm_obj
        build: command masm_asm_obj "masm $<;"

     Note: For languages other than MASM, distinguish a variable name
     in the inference rule to be used in the commands line (such as
     masm_asm_obj has been used above) and then specify the appropriate
     compiler in the commands line within the quotation marks. The
     special filename macro specified in the quotation marks, "$<",
     applies the command to any object that has an out-of-date
     executable file.

  6. Press SHIFT+F8 to reinitialize the file and then close it.

  7. Go to the File menu and select New (it is a good idea to close any
     files that are currently open before this step).

  8. Go to the Options menu and select Build Options.

  9. Choose Initial Build Options.

 10. Select the "Options to Include MASM" option (it should be near the
     bottom of the list).

 After completing these instructions, the PWB utility will now be ready
 to compile assembler along with BASIC source code, provided that paths
 to the necessary compilers are furnished.


 41. PWB Err Msg: Out of Local Memory. Unable to Recover.

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 17-OCT-1990    ArticleIdent: Q65913

 When setting a program list inside of the Programmer's WorkBench
 (PWB), the following message may occur:

    Out of Local Memory.  Unable to Recover.

 The error is printed on the screen and the PWB exits to DOS. This
 error may occur when the program list contains too many names. To
 resolve the problem, combine object modules into libraries whenever
 possible. Remove the .OBJ files from the program list and replace them
 with the new libraries. This will reduce the number of object modules
 that need to be defined in the program list.

 Another method that sometimes helps to alleviate the error is to open
 the File menu and close as many unneeded files as possible. This
 should be done before setting the program list.


 42. Situation Where PWB Online Help Text Disappears

 Product Version(s): 1.00 1.10 | 1.00 1.10
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | SR# S901010-118 B_BasicCom S_C B_cobol
 Last Modified: 24-OCT-1990    ArticleIdent: Q66229

 When requesting help in Microsoft Programmer's WorkBench (PWB)
 versions 1.00 and 1.10, the following sequence of events will cause
 the Help screen text to disappear, leaving only the hyperlinks.

 This information applies to Programmer's WorkBench version 1.00 (which
 comes with Microsoft C Professional Development System version 6.00
 for MS-DOS and MS OS/2), and to Programmer's WorkBench version 1.10
 (which comes with Microsoft COBOL Professional Development System
 version 4.00 and with Microsoft BASIC Professional Development System
 (PDS) version 7.10 for MS-DOS and MS OS/2).

 Microsoft has confirmed this to be a problem in PWB. We are
 researching this problem and will post new information here as it
 becomes available.
 Follow these steps to reproduce the problem:

 1. From the DOS or OS/2 prompt, enter PWB. From the File menu, select
    New. Type PLINES and request help by pressing F1 or single-clicking
    the right mouse button.

 2. In the Help dialog, double-click the left mouse button with the
    cursor on the hyperlink "Using PWB Functions."

 3. Double-click the left mouse button with the cursor on the hyperlink
    "PWB Functions by Category."

 4. Double-click the left mouse button with the cursor on the hyperlink
    "Moving Through Files."

 5. The vertical scroll bar will show that you are at the bottom of the
    dialog. Press PGUP and you will notice that the hyperlinks to Up,
    Index, Contents, and Back have disappeared. Double-click the left
    mouse button with the cursor on any of these empty hyperlinks; the
    text on the screen will disappear, with empty hyperlinks appearing
    on the screen.


 43. How to Insert Spaces Before a Block of Text in PWB

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | S_EDITOR
 Last Modified: 24-OCT-1990    ArticleIdent: Q66231

 It is sometimes desirable to indent or move over a block of text in
 the Programmer's WorkBench (PWB) or the M Editor. The following steps
 can be used to insert spaces before a block of text to indent it:

 1. Get into boxarg mode. You can select this mode from the Edit menu
    under the Programmer's Workbench, or select the boxstream function
    under the Microsoft Editor.

 2. Highlight the area you want to contain the spaces. This may be
    anywhere in the file.

 3. Select the linsert function. By default, this is CTRL+N.

 The highlighted area should now be moved over and replaced by spaces.

 You don't have to be in boxarg mode for this to work; linsert always
 treats its argument as a boxarg regardless of the current mode.
 However, the highlight on the screen won't match the area that is
 going to be inserted unless you use boxarg mode.

 Also, ldelete can be used to unindent a block of text. However, you
 must be in boxarg or streamarg mode for it to work correctly. In
 linearg mode, it will delete entire lines.


 44. PWB's Use of Expanded Memory

 Product Version(s): 1.00 1.10
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 23-OCT-1990    ArticleIdent: Q66308

 The DOS version of the Programmer's WorkBench (PWB) will utilize
 expanded memory to swap its own segment overlays if it detects that
 expanded memory is available in the system. When PWB needs a new
 overlay, the existing overlay in memory is first copied into expanded
 memory. If there is not enough room in expanded memory to copy the
 overlay, the least recently used overlay is discarded to make room for
 it. This scheme allows most overlays to be read from expanded memory
 instead of from disk.

 Note that this is the only method by which PWB will take advantage of
 available expanded memory, and that PWB versions 1.00 and 1.10 have no
 internal provisions to make use of extended memory in any way.


 45. PWB May Exit to DOS If TMP Not Set Correctly

 Product Version(s): 1.00 1.10
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00 buglist1.10
 Last Modified: 24-OCT-1990    ArticleIdent: Q66309

 If the tmp environment variable is set only to a drive (with no path
 specified), the PWB may "crash" out to DOS when a compile is
 attempted. The screen will still show the PWB, but there will be a
 prompt displayed.

 This problem may be reproduced using the following procedure:

 1. Set up the environment to run the PWB.

 2. Set the tmp environment variable to the current drive, without
    specifying a path. For example:

       SET TMP=C:

 3. Execute the PWB and create or load a simple source file.

 4. Attempt to compile the source file. (Note: If the COMPILE option is
    not available on the make menu, make sure the file has a name with a
    .c extension.)

 Microsoft has confirmed this to be a problem with the Programmer's
 WorkBench versions 1.00 and 1.10. We are researching this problem and
 will post new information here as it becomes available.


 46. MASM Build Switches for PWB 1.10

 Product Version(s): 1.10    | 1.10
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER |
 Last Modified:  5-DEC-1990    ArticleIdent: Q66339

 When setting a program list containing .ASM files in Programmer's
 WorkBench (PWB) version 1.10, the following error message occurs:

    Program List: file 'filename' will be ignored
    File type unused by current build options

 The .ASM files are not recognized because PWB 1.10 does not contain
 build switches specific to any language. Build switches are now loaded
 from language extension files (.MXT for DOS and .PXT for OS/2). If you
 have an assembly language extension file, you will not see this error
 message. Language extensions are not necessary and are only a
 convenience for controlling the build process; only the build switches
 are really needed.

 The following build switches can be added to a tagged section in your
 TOOLS.INI file. To use these build options, first choose your language
 options from the Options Build Options menu, then initialize this
 section by typing {arg} tag_name {reinitialize} (type the following to
 invoke the sample build switch below:

    ALT+A asm_rules SHIFT+F8

 These switches can also be added to a custom set of build options
 saved by Save Current Build Options. They may then be initialized by
 choosing Build Options from the Options menu, and then selecting Set
 Initial Build Options to choose the new custom language options.

 Sample Build Switches
 ---------------------

 [pwb-asm_rules]
 ;
 ;   MASM build rules
 ;
 build:macro ASM "MASM"
 build:macro AFLAGS_G "/Mx /T"
 build:macro AFLAGS_D "/Zi"
 build:macro AFLAGS_R ""
 build:inference .asm.obj as_asm_obj
 build:release command as_asm_obj  \
             "$(ASM) $(AFLAGS_G) $(AFLAGS_R) $<, $@;"
 build:debug command as_asm_obj  \
             "$(ASM) $(AFLAGS_G) $(AFLAGS_D) $<, $@;"
 build:include .asm "^[ \t]*include[ \t]+\\([^ \t]+\\)"
 build:include .inc "^[ \t]*include[ \t]+\\([^ \t]+\\)"

 These assembly flags can then be modified from PWB by using the
 following macros. The macros must be assigned to keystrokes to be
 activated. This can be done using the <ASSIGN> pseudo file. They can
 then be used to redefine the flags to pass to MASM.

 ;
 ;   MASM option-setting macros
 ;
 setAFG:= arg "Global MASM Options?"  prompt -> cancel lasttext home \
         "build:macro AFLAGS_G \"" endline "\"" assign

 setAFD:= arg "Debug MASM Options?"   prompt -> cancel lasttext home \
         "build:macro AFLAGS_D \"" endline "\"" assign

 setAFR:= arg "Release MASM Options?" prompt -> cancel lasttext home \
         "build:macro AFLAGS_R \"" endline "\"" assign


 47. Unexpected Behavior with the /Gt Switch and the PWB

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | S_C
 Last Modified: 15-JAN-1991    ArticleIdent: Q66828

 Adding the /Gt compiler switch with an argument to the Additional
 Options section of the C Compiler Options on the Programmer's
 WorkBench (PWB) Options menu can cause the value of the argument to be
 changed or dropped.

 Microsoft has confirmed this to be a problem in the Programmer's
 WorkBench version 1.00. We are researching this problem and will post
 new information here as it becomes available.

 When you add the /Gt switch with an argument (for example, /Gt30) and
 click OK, then immediately go back into the Compiler Options dialog
 box; you will see that the /Gt30 switch you just set is now /Gt3.

 If you set a /Gt switch and specify a value, it will compile with that
 correct value because it was written to the file on disk that is used
 to build the program.

 If you go back in and look at the compiler options and see that the
 value is incorrect and Cancel the options dialog, you will still
 compile with your initial correct /Gt value.

 You will compile with the incorrect /Gt value only if you make another
 change in that dialog and select OK. This is because you changed the
 options, so PWB rewrites the options to the file on disk. In the case
 of /Gt, that option is written incorrectly and from that point on, you
 will compile with the incorrect /Gt value.

 Not all values of /Gt are incorrect. The most common incorrect values
 end in zero. The following are examples where the problem occurs:

    /Gt40 will turn into /Gt4
    /Gt0  will turn into /Gt
    /Gt20 will turn into /Gt

 Some other values that get changed are the following:

    /Gt113 will turn into /Gt3
    /Gt305 will turn into /Gt35
    /Gt14  will turn into /Gt4
    /Gt22  will turn into /Gt

 As a possible work around, do not set /Gt in the PWB, and set the
 environment variable CL to the desired threshold, as in the following
 example:

    set cl=/Gt40

 This value will be read by the compiler when it is called from the
 PWB.

 Also, you can set the /Gt switch on the Additional Options line in
 either Set Debug Options or Set Release Options, rather than the
 global Additional Options.


 48. REsearch() Function Prototype Not Found in EXT.H Header File

 Product Version(s): 1.00 1.10 | 1.00 1.10
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist1.00 buglist1.10
 Last Modified:  4-DEC-1990    ArticleIdent: Q67274

 The Programmer's WorkBench (PWB) function REsearch(), although
 included in EXTSUP.LIB, is not prototyped in the EXT.H header file. To
 call REsearch(), use the following prototype:

 int REsearch( PFILE pFile, flagType fForward, flagType fAll,
               flagType fCase, flagType fWrap, char _far *pattern,
               fl *pflStart );

 For more information, see online help.

 Microsoft has confirmed this to be a problem in PWB versions 1.00 and
 1.10. We are researching this problem and will post new information
 here as it becomes available.


 49. PWB Help Crashes When Using "Moving Through a File"

 Product Version(s): 1.10   | 1.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.10
 Last Modified: 14-DEC-1990    ArticleIdent: Q67361

 When using the online help through the Programmer's WorkBench (PWB),
 the help system will crash if you do the following:

 1. After entering help, choose Contents.

 2. Select the Microsoft Advisor from the list of contents.

 3. Select the Programmer's WorkBench button followed by the "Moving
    Through a File" selection.

 At this point a header will appear on the screen and the elevator for
 the window will appear as though it is at the bottom of a page.

 The page can be scrolled up and the contents viewed, especially if
 highlighted, but the menu items at the top will be blacked out
 (although they are present). From this point, no further help can be
 accessed.

 If you exit help and then reenter, nothing will come up.
 Re-initializing does not reinstate the help system. Only shelling out,
 exiting, and reentering will allow you to access the help system.

 Microsoft has confirmed this to be a problem in the Programmer's
 WorkBench version 1.10. We are researching this problem and will post
 new information here as it becomes available.


 50. PWB Hangs with Novell NetWare

 Product Version(s): 1.00 1.11
 Operating System:   MS-DOS
 Flags: ENDUSER | s_quickc s_codeview s_c
 Last Modified: 14-DEC-1990    ArticleIdent: Q67483

 On certain installations of a Novell network, the network will cause
 the Programmer's WorkBench (PWB) to hang. This problem may also occur
 in CodeView or QuickC. The hang usually occurs when an attempt is made
 to use the mouse.

 If you have a peripheral (such as a mouse) that uses Interrupt Request
 Level (IRQ) 3, and your system is part of a network using Novell
 NetWare version 2.15 or earlier, your system may hang when you load
 QuickC, PWB, or CodeView. As a temporary solution, set your peripheral
 to use another interrupt. For more information, contact your Novell
 NetWare dealer.

 If taking these steps does not solve the problem, please contact
 Microsoft Product Support Services.


 51. PWB Menu Hyperlink in PWB.HLP is Inconsistent in Version 1.10

 Product Version(s): 1.10   | 1.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 23-JAN-1991    ArticleIdent: Q67614

 When selecting help on the Programmer's WorkBench (PWB) version 1.10
 from the Categories menu in QuickHelp version 1.70, the help screen
 for Microsoft Advisor Help System is presented instead. This behavior
 may be duplicated by following the procedure outlined below:

 1. Start QuickHelp without an argument to get help on any topic. This
    will bring up the main help screen.

 2. Select the Programmer's WorkBench choice under the Categories menu.

 Instead of bringing up the help screen for Programmer's WorkBench, you
 will see the screen for the Microsoft Advisor Help System.

 If the PWB.HLP help file is decoded using helpmake as follows

    helpmake /D /T /Opwb.doc pwb.hlp

 we can see that the reason for this is that the .context directive for
 Programmer's WorkBench appears in the wrong section in the decoded
 help file. The following line

    .context Programmer's Workbench

 appears above the section for "Microsoft Advisor Contents." To correct
 the problem, move the .context directive for Programmer's WorkBench to
 the proper section, which is the "Programmer's WorkBench Contents."

 The helpfile must then be recompressed, as follows:

    helpmake /E7 /T /Opwb.hlp pwb.doc

 The choice of /E7 is shown here for demonstration purposes only, and
 is strictly arbitrary in this case. If maximum compression is desired,
 the numerical argument to the /E switch may be left off, or /E15 may
 be specified. Maximum compression will restore the database as close
 to its original size and state as possible.


 52. "missing ':' in ->" Caused by Control Character

 Product Version(s): 1.00 1.10 | 1.00 1.10
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 14-DEC-1990    ArticleIdent: Q67736

 When invoking the Programmer's WorkBench (PWB), if there is a control
 character at the end of the TOOLS.INI file, [usually a CTRL+Z (ASCII
 26) end-of-file marker] and you only have a [pwb] tagged section, an
 error message will appear stating "missing ':' in ->". Note that the
 "->" is the graphic right-arrow symbol.

 This is not a problem in the PWB. A control character is a legal macro
 name. The message indicates that a macro definition or key assignment
 is expected after the character. To keep this message from appearing,
 place the tag

    [end]

 before the control character at the end of your TOOLS.INI file. With
 this tag at the end of the file, you always suppress the message, even
 if you edit TOOLS.INI with an editor that inserts CTRL+Z's at the end
 of the file. This is because the -> symbol must be within the [pwb]
 tagged section for this error message to be displayed, and the [end]
 tag forces the -> into its own tagged section.

 Simply deleting the control character will work until you edit the
 file with an editor that replaces the CTRL+Z, then this message
 reappears. This may also when using the COPY command to concatenate
 files.


 53. Inconsistent Error Attempting to Load Nonexistent Extension

 Product Version(s): 1.00 1.10
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 28-DEC-1990    ArticleIdent: Q67777

 When attempting to load a Programmer's WorkBench extension through a
 macro definition in the TOOLS.INI file, if the extension file does not
 exist, or is not in the current path, the following error message is
 displayed in a dialog box:

    pwbhelp:  SYS0123:  A file name or volume label contains an
                        incorrect character

 This error message should indicate that the extension file could not
 be found; however, the message is generated by the OS/2 operating
 system's DLL loading code, and therefore, cannot be changed by PWB.

 The following error message is generated in the DOS version of PWB,
 which displays this message in a dialog box:

    No such file or directory

 To correct the problem, make sure that the directory in which the
 extension resides is in the current path.


 54. PWB May Record Incorrect Paths for Dependencies in Makefile

 Product Version(s): 1.00 1.10  | 1.00 1.10
 Operating System:   MS-DOS     | OS/2
 Flags: ENDUSER | buglist1.00 buglist1.10
 Last Modified:  6-FEB-1991    ArticleIdent: Q67780

 Creating a program list with dependencies in directories other than
 the project (makefile) directory may result in the Programmer's
 WorkBench (PWB) recording the wrong paths to these dependencies.

 The following steps illustrate the problem:

 1. Create subdirectories named TEST and TESTA under the same
    directory, with sample files FOO.C in TEST and GOO.C in TESTA.

 2. Invoke PWB from the TESTA directory.

 3. Create a program list.

 4. Add FOO.C and GOO.C with full path.

 5. Save the list.

 The resulting makefile will contain the line:

    OBJS = goo.c foo.c

 The correct line should read:

    OBJS = goo.c ..\TEST\foo.c

 Changing the location of the project makefile or changing the names of
 the subdirectories will generate the correct paths for dependencies in
 the makefile.

 Microsoft has confirmed this to be a problem in the Programmer's
 WorkBench versions 1.00 and 1.10. We are researching this problem and
 will post new information here as it becomes available.


 55. PWB Extensions in DOS Cannot Shell to DOS

 Product Version(s): 1.00 1.10
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-FEB-1991    ArticleIdent: Q67792

 Extensions written for the Programmer's WorkBench (PWB) that require a
 call to the operating system do not work correctly under DOS. One
 example of this is the FILTER.C sample extension packaged with
 Microsoft C 6.00.

 When PWB.COM is executed under DOS, it spawns the main editor
 (PWBED.EXE). PWBED.EXE is cleared from memory when a DOS shell is
 executed from within the editor. Once the shell has completed,
 PWBED.EXE is reloaded from disk and initialized. The initialization is
 what causes the problem because it also initializes any extensions to
 the editor at the same time. This means that any information that the
 extension was keeping track of is lost.


 56. Not Enough Core Message Caused by Lack of Memory

 Product Version(s): 1.00 1.10
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-FEB-1991    ArticleIdent: Q68070

 When loading the Programmer's WorkBench (PWB), a message box may
 appear on the screen containing the message "Cannot Autoload
 Extension, not enough core." The extension file that could not be
 loaded will be indicated. You need to free more memory so that the
 extensions can be loaded.


 57. Windows DLL Build Options Ignore .RC Files in PWB 1.10

 Product Version(s): 1.10   | 1.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.10 S_C P_WINSDK
 Last Modified: 11-JAN-1991    ArticleIdent: Q68155

 In the Programmer's WorkBench version 1.10, the default build options
 for creating a Windows DLL will ignore any .RC files included in the
 Program List, and therefore, will not build them into the project.

 Use the following steps to correct this problem:

  1. If there is a Program List currently set, clear it.

  2. Set the Main Language to C.

  3. Set the Initial Build Options to Windows DLL.

  4. Create a new Program List containing all the files you want in your
     project.

  5. Save the Program List. At this point, PWB will tell you that your
     .RC file will be ignored. Choose OK when that dialog box appears.

  6. Choose Editor Settings from the Options menu.

  7. Find the line that starts:

        build: target $(PROJ).dll

  8. Change the word "res_dll" on that line to "rc_dll".

  9. Move the cursor off that line to highlight the change. Press SHIFT+F2
     to save the new settings.

 10. Press F2 to exit the ASSIGN pseudofile.

 11. Choose Edit Program List from the Make menu.

 12. Choose Save List. The .RC file will now be saved in the Program
     List and used as expected.

 After these steps are taken, the settings will be saved in the .STS
 file for that project, and will remain correct as long as Set Initial
 Build Options is never selected when this Program List is set. In
 order to keep from repeating these steps for future projects, the
 build options should be saved under a descriptive name, such as
 "Corrected Windows DLL Settings." They can then be chosen for any
 future Windows DLLs.

 Microsoft has confirmed this to be a problem in the Programmer's
 WorkBench version 1.10. We are researching this problem and will post
 new information here as it becomes available.


 58. PWB Build Switch Reference Available as an Application Note

 Product Version(s): 1.00 1.10 | 1.00 1.10
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | appnote softlib SW0330
 Last Modified: 29-JAN-1991    ArticleIdent: Q68367

 The "PWB Build Switch Reference" contains detailed descriptions and
 examples for customizing PWB build switches.

 The Programmer's WorkBench (PWB) can build various types of projects
 based on the information contained in "build switches." These build
 switches are interpreted by PWB in order to create a makefile for a
 project. The switches are normally set for you by PWB for common types
 of projects, but you may define your own build switches to handle an
 advanced project where you require more control over the build
 process. For example, customized build switches will allow you to
 utilize different languages, to incorporate other tools into a
 project, or to build new kinds of targets.

 Although build switch customization is documented in the PWB online
 help, the information is somewhat limited. Therefore, an application
 note was created to cover the customization process in detail. The
 title of this application note is "PWB Build Switch Reference" and it
 can be obtained by calling Microsoft Product Support Services at (206)
 637-7096.

 The "PWB Build Switch Reference" can also be found in the Software/
 Data Library (as file SW0330.ARC) by searching on the keyword SW0330,
 the Q number of this article, or S12875. SW0330 was archived using the
 PKware file-compression utility.

 Note that the application note found in the Software/Data Library is
 an ordinary text file, which lacks the typefaces and formatting of the
 printed version that is available by calling Microsoft Product Support
 Services. Because the printed application note is clearer and easier
 to follow, it is highly recommended that you call for the printed
 version, and that you use the downloaded version only as an interim
 copy.

 Also note that you normally DO NOT need to modify build switches just
 to customize the compile and link operations -- this can generally be
 done by selecting commands from the Options menu. By selecting options
 from the Compile or LINK Options dialog boxes, the correct build
 switches are automatically modified to contain the desired
 information.


 59. Brown Screen Color Changes to Yellow After Running PWB

 Product Version(s): 1.00 1.10
 Operating System:   MS-DOS
 Flags: ENDUSER | s_c buglist1.00 buglist1.10 remapping
 Last Modified:  6-FEB-1991    ArticleIdent: Q69064

 After running PWB, the brown screen color changes to yellow until the
 system is rebooted or the video mode is reset.

 For example, if you run PWB and then run the Microsoft editor, the
 brown characters will appear yellow.

 To work around this problem, you can create a batch file called
 PWB.BAT. In this file, you can start PWB and then reset the video
 mode. For example:

     pwb.bat
             pwb %1 %2 %3 %4
             mode co80,25

 Microsoft has confirmed this to be a problem in PWB versions 1.00 and
 1.10. We are researching this problem and will post new information
 here as it becomes available.


 60. Reinitializing After Changing Editor Settings Is Very Slow

 Product Version(s): 1.10   | 1.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 11-FEB-1991    ArticleIdent: Q69142

 The current editor settings in the Programmer's WorkBench (PWB) may be
 changed by choosing Editor Settings from the Options menu, making a
 change to the <assign> pseudofile, and then saving that file. If
 SHIFT+F8 (initialize) is pressed while the <assign> pseudofile is
 still displayed, PWB may appear as though it is hung; it is actually
 reinitializing each statement of the editor settings (<assign>)
 pseudofile.

 The following steps will reproduce this behavior:

 1. Enter PWB and select the Options menu.

 2. Choose the Editor Settings menu.

 3. Make a change in the <assign> pseudofile and then save it.

 4. Press the "initialize" keystroke combination (SHIFT+F8) and a popup
    box will appear stating "reinitializing...". The reinitialization
    is actually taking place but it is very slow because PWB is
    rebuilding the <assign> pseudofile for each entry in your TOOLS.INI
    file.

 This behavior does not occur in PWB version 1.00. Version 1.10
 includes a change to the earlier version; you can see a new assignment
 (made via "arg textarg <assign>") immediately updated if you are
 viewing the <assign> pseudofile.

 This is expected behavior because the <assign> pseudofile is meant to
 show the settings that were in effect at the time the file was
 displayed. It is not recommended that it be dynamically updated except
 via the mechanism of actually editing the file. If you changed a
 setting via "arg textarg assign" (ALT+A textarg ALT+=), a better way
 to view your new setting(s) is by using "refresh" (SHIFT+F7), or by
 switching away and back again via "setfile" (F2).


 61. PWB Ignores Certain Compiler Switches in Additional Options

 Product Version(s): 1.00 1.10 | 1.00 1.10
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | s_c
 Last Modified: 25-FEB-1991    ArticleIdent: Q69145

 The compiler switches

    /Fo, /Fe, /F hexnum, /Fm, and /link link-info

 are ineffective when entered in the Additional Options field of the C
 Compiler Options dialog box from the Options menu of the Programmer's
 Workbench (PWB). This is the intended behavior. The functionality of
 all of these switches is provided through the Compiler, Link, and
 Build Options dialog boxes from the Options menu.

 The /Fo switch is overridden by PWB as it creates the .MAK file needed
 to build the project. To perform this function correctly:

 1. Set a program list from the Make menu.
 2. Choose Build Options from the Options menu.
 3. Choose the Build Directory button.
 4. Enter the destination path in that field, such as:

       C:\C600\PROJECT\

 5. Rebuild the project, and both the .EXE and .OBJ files will be placed
    in that directory.

 The other switches are used only to pass information to the linker
 when the CL command is used outside PWB without the /c option. Because
 PWB always compiles and links separately, these switches are lost. To
 utilize these switches from within PWB, select the appropriate options
 in the Link Options dialog box from the Options menu.


 62. How to Increase the Size of the PWB Build Status Box Under DOS

 Product Version(s): 1.00 1.10
 Operating System:   MS-DOS
 Flags: ENDUSER | window dialog
 Last Modified: 22-FEB-1991    ArticleIdent: Q69475

 In the DOS version of the Microsoft Programmer's WorkBench (PWB)
 versions 1.00 and 1.10, the status box displayed in the center of the
 screen during a compile can be made larger by increasing the length of
 the command being executed.

 When Build or Rebuild All is selected from the Make menu in PWB, a
 build status box appears on the screen showing the command currently
 being executed. Unfortunately, this box is often too small and the
 current command being displayed gets truncated. One way to increase
 the size of this box is to increase the length of the NMAKE command
 line.

 To increase the length of the NMAKE command line, add the following
 text (without the quotation marks) to the NMAKE Options dialog box,
 which can be selected from the Options menu:

    "                                                /NOLOGO"

 Be sure to include the spaces when you type this line. Then, when you
 select Build or Rebuild All from the Make menu, the build status box
 will be almost as wide as the screen, allowing most of the subsequent
 commands to fit completely into the box.

 If you use the PWB "compile" command, or choose the Compile File
 option from the Make menu, the build status box behaves similarly --
 the longer the command to be executed command, the larger the box will
 be.






 Microsoft CodeView
 =============================================================================


 1. Sequential Mode Not Available in CodeView Version 3.00

 Product Version(s): 3.00 3.01 3.11  | 3.00 3.01 3.11
 Operating System:   MS-DOS          | OS/2
 Flags: ENDUSER |
 Last Modified:  6-FEB-1991    ArticleIdent: Q69065

 The CodeView sequential mode (/T option) is not available in CodeView
 version 3.00.

 In CodeView versions 2.30 and earlier, the /T option caused the
 debugger to operate in "sequential mode," which means that only a
 command-line interface was available. You could then type the command
 "=COM1" to redirect the input and output to the COM port, which
 allowed debugging via a remote terminal.

 The /T option and the "=COM1" command are not available in CodeView
 3.00, 3.10, and 3.11 because of the new windowing environment used in
 these versions.

 However, you can still redirect CodeView output to COM1 using the
 Redirected Output command.

 The Redirected Output command causes the CodeView debugger to write
 all subsequent command output to a device, such as another terminal, a
 printer, or a file. The term "output" includes not only the output
 from commands but also the command characters that are echoed as you
 type them.

 The second greater-than symbol (optional) appends the output to an
 existing file. If you redirect output to an existing file without this
 symbol, the existing file will be replaced. For example:

    >>COM1

 In the example above, output is redirected to the device designated as
 COM1 (probably a remote terminal). You might want to enter this
 command, for example, when you are debugging a graphics program and
 want CodeView commands to be displayed on a remote terminal while the
 program display appears on the originating terminal.

    >>OUTFILE.TXT

 In the example above, output is redirected to the file OUTFILE.TXT.
 This command is helpful in keeping a permanent record of a CodeView
 session.


 2. How Interrupts Are Handled in CodeView

 Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR55548
 Last Modified:  9-AUG-1989    ArticleIdent: Q11817

 Question:

 How does CodeView handle interrupt vectors? Does it mask any
 interrupts when it runs?

 Response:

 CodeView saves and restores about 60 interrupt vectors as a safety
 feature. However, it only redirects the following nine vectors for its
 own use:

    0       Divide By 0
    1       Single Step
    2       NMI
    3       Breakpoint
    9       Keyboard
    21H     DOS functions
    22H     DOS terminate
    23H     ^C
    24H     Critical Error

 The remaining estimated 51 vectors are never altered by CodeView
 unless something else (e.g. the program being debugged) alters them
 after CodeView has started up. In this case, CodeView restores them to
 their original value as it exits.

 When you enter G(o) and let your program run, CodeView relinquishes
 control and lets all interrupts (except the nine listed above) flow
 into your application for processing. However, when you hit a
 breakpoint, the 8259 Programmable Interrupt Controller is masked. This
 prevents interrupts from coming into your application while your
 program is suspended. If you enter G(o) again, CodeView reenables
 interrupts to your application.

 To avoid a bug in the 8086 family, CodeView masks the interrupt
 controller during T(race) commands and some P(rogram step) commands.
 CodeView Versions 2.00 and above solve this restriction by emulating
 the interrupts for your application.

 You normally do not single-step or trace real-time code, so this
 should not be a problem for developers writing interrupt-driven code.
 However, it is something you should be aware of if you are depending
 on interrupts to get to your application. For example, it will not
 work if you enter "T 1000" and expect your program to catch and
 process interrupts during the trace. You will need to set a breakpoint
 at the instruction with which you are concerned, then enter G(o).


 3. Debugging Routines That Are in Libraries

 Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS                        | OS/2
 Flags: ENDUSER | TAR55321
 Last Modified: 21-AUG-1989    ArticleIdent: Q11877

 Question:

 When CodeView attempts to debug a function from a library module, it
 is unable to find the source even when that module was compiled with
 -Zi. It prompts me to "Enter Directory for Program (CR for None)?". I
 enter the directory in which PROGRAM.C resides, but CodeView cannot
 find it. Is there any solution other than not placing modules I wish
 to debug in libraries?

 Response:

 This is a consequence of the way the LIB utility works. When adding an
 object module to a library, LIB records only the source file's base
 name, not its extension. Therefore, "c:\c\source\module1.c" becomes
 "c:\c\source\module1" (no extension). When you are debugging an
 application that calls "module1", CodeView attempts to find
 "c:\c\source\module1". However, it does not accept the filename you
 give because the file is really named "module1.c".

 One way to work around this restriction is to rename your source file
 from "c:\c\source\module1.c" to "c:\c\source\module1" (no extension)
 after you have compiled it and put it into a library. This way, the
 actual name will match the name CodeView is searching for.

 Another solution is to use Library Manager Version 3.07 (which came
 with MASM 5.00) or later; this solves the problem by not stripping the
 file's extension as it is put into a library.


 4. CVP May Generate a Trap B with Large Programs Under OS/2 1.30

 Product Version(s): 2.20 2.30 3.00 3.10 3.11
 Operating System:   OS/2
 Flags: ENDUSER | gp fault protection violation
 Last Modified: 25-FEB-1991    ArticleIdent: Q69348

 Debugging a large application with CodeView under OS/2 version 1.30
 may result in a Trap B system error. Trap B is a "segment not present"
 exception, which results from changes that were made to this version
 of the operating system.

 In version 1.30 of OS/2, the code for DosPTrace() was made swappable,
 while in previous versions it was not. DosPTrace() is part of the OS/2
 API that allows a parent process to control the execution of a child
 process, and to access the child process's memory directly to insert
 breakpoints or change data.

 Because CodeView relies heavily on DosPTrace(), problems arise if this
 code is swapped from memory. The majority of problems occur when
 execution reaches a breakpoint while the DosPTrace() code is not
 present; control should then jump to code that is not currently in
 RAM.

 Because large programs (or heavily loaded systems) tend to result in
 more swapping, this problem appears much more readily when debugging
 large applications.

 The only sure workaround for this problem is to turn off swapping
 while debugging, but it also may help to increase or free up available
 memory. To disable swapping, modify the MEMMAN switch in CONFIG.SYS as
 follows:

    MEMMAN=NOSWAP

 To increase available memory, either install more memory in the
 computer itself or terminate all other unnecessary processes before
 debugging (to remove them from memory).

 This problem is the result of a design change with OS/2 1.30 and is
 not a problem with CodeView. This change is being reconsidered for
 future versions of OS/2. New information will be posted here as it
 becomes available.


 5. Using Two Monitors with CodeView

 Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS                        | OS/2
 Flags: ENDUSER | TAR56465
 Last Modified: 11-SEP-1989    ArticleIdent: Q11966

 Question:

 How do I use CodeView with two monitors? Where is this option
 documented?

 Response:

 Invoke CodeView with the following command:

    CV /2 PROGRAM

 This command tells CodeView to put its display on your secondary
 monitor and lets your program's output go to the default display. This
 option is documented in the "CodeView Options" section of the
 "Microsoft CodeView and Utilities Software Development Tools for the
 MS-DOS Operating System" manual in all products except Microsoft C
 Version 4.00, where it is documented in the README file.

 You must have two monitors and two display adapters to use this
 feature. You must have a monochrome and a non-monochrome monitor;
 because a monochrome monitor's video memory is in a different
 location than a CGA, EGA, or VGA's. This is how CodeView implements
 the /2 option, by writing to both sets of video memory.

 When you use the /2 option, your program's display appears on the
 current default adapter and monitor, while the debugging display
 appears on the secondary adapter and monitor. You can switch which
 monitor is the current default adapter with the MS-DOS MODE command.
 "MODE MONO" causes standard output to go to the MDA, while "MODE CO80"
 causes standard output to go to your CGA, EGA, or VGA.

 For example, if you have both a CGA and an MDA, you might want to set
 the CGA up as the default adapter. You could then debug a graphics
 program with the graphics display appearing on the graphics monitor
 and the debugging display appearing on the monochrome adapter.


 6. /L Must Give Full Pathname to .DLL Unless in Current Directory

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 16-AUG-1989    ArticleIdent: Q47937

 When debugging dynamic link modules with CodeView Protect (CVP), you
 must use the /L switch. Before invoking CVP, make certain that the
 .DLL is in the LIBPATH specified in the CONFIG.SYS file. When invoking
 CVP with the /L switch, if the .DLL is not located in the current
 directory, you must specify the full drive and pathname to the DLL. An
 example is the following:

    CVP /L d:\os2\dll\stdll.dll stmain.exe

 In this example, the full drive and pathname are given for the DLL to
 be debugged. If the full pathname is not given, CodeView will come up.
 However, you will be unable to step into the DLL. CodeView will simply
 step over that call.


 7. CodeView Cannot Trace into Single-Line Functions

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 15-SEP-1989    ArticleIdent: Q47624

 CodeView Versions 2.20 and 2.30 do not trace into a function that is
 contained in a single line of code. For example, if the following
 program is compiled and loaded into CodeView, an attempt to trace into
 the function funct() results in the trace stepping over the function,
 rather than tracing into it.

 Sample Program
 --------------

 /* SIMPLE.C ... a very simplistic sample program                    */

 int funct(void);
 int x;

 void main(void)
 {
   x = funct()
  }

 /* single-line function. It does nothing more than return a value.  */

 int funct(void){return 1;}

 If the above function is modified so that it performs exactly the same
 task but is located on multiple lines, as follows, then CodeView
 handles it correctly:

 int funct(void)
  {
    return 1;
   }



 8. Trace Stops on Line Following a Loop Before Loop Is Done

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | S_C
 Last Modified: 15-SEP-1989    ArticleIdent: Q47625

 In trace mode, CodeView stops on the line following a loop that does
 not have open and close braces ({}), before the loop is done.

 When tracing through a loop without the braces ({}), the trace stops
 on the statement immediately following the loop each time through the
 loop, giving the impression that the statement is being executed
 inside the loop. Actual program execution is correct.

 The following program was compiled with C Version 5.10 with the
 command line

    cl /Zi /Od program.c

 and run using CodeView 2.20, as follows:

     cv program.exe

 The trace stops at the printf each time through the loop even though
 printf is not part of the loop, but does not print anything until the
 end of the program.

 Sample Program
 --------------

 #include <stdio.h>

 void main(void)
 {
     int i;
     int count;

     count = 0;

     for(i=0;i<3;i++)
         if(i)
             count++;

     printf("Count is %d\n",count);
 }


 9. The 37th Call Added to the Calls Menu Corrupts CodeView Screen

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist2.20 fixlist2.30
 Last Modified: 10-NOV-1989    ArticleIdent: Q50496

 The CodeView Calls menu shows the current depth of function calls as
 well as the line number the routine was called from and the parameters
 passed. The current routine is always at the top and the routine from
 which the current routine was called is directly below.

 The routines in the Calls menu are first labeled 0-9, and if you are
 nested more than ten levels deep, CodeView labels the next 26 calls
 A-Z, for a display that can accept 36 levels of subroutine calls. If
 you exceed this limit and then select the Calls menu, the CodeView
 display becomes corrupted.

 If the display is corrupted in this manner, the Redraw ("@") dialog
 command can be used to restore the display to it's original state.

 The Stack Trace dialog command (K) has the same function as the Calls
 menu and correctly handles nesting of more than 36 levels deep.

 Microsoft has confirmed this to be a problem with CodeView Version
 2.20. This problem was corrected in Version 2.30.


 10. Quickwatch Seems to Hang When Expanding Very Large Arrays

 Product Version(s): 3.00 3.10 3.11 | 3.00 3.10 3.11
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER | s_quickc
 Last Modified:  6-FEB-1991    ArticleIdent: Q68010

 When expanding an element in a large array (usually greater than 1000
 elements, but system dependent), the quickwatch function appears to
 hang. This apparent problem is caused by the time it takes to re-align
 the data in the window, and is actually normal operation. If you place
 the same array element in the Watch Window, it will expand instantly.


 11. Structures Declared with Near, Far, Pascal, and Fortran

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | S_C S_QuickC buglist2.20 buglist2.30
 Last Modified: 16-AUG-1989    ArticleIdent: Q47694

 CodeView is unable to display elements of structures declared with the
 following keywords:

    near
    far
    pascal
    fortran

 Using ?? to display a structure yields the structure table with only
 one value inside. This value is the first element in the structure.
 Using w? or ? yields the following error message:

    Operand types incorrect for this operation

 Microsoft has confirmed this to be a problem with CodeView Versions
 2.20 and 2.30. We are researching this problem and will post new
 information as it becomes available.

 To work around this problem, recompile without these keywords, or
 obtain the address of the structure element and put a watch on the
 memory location.

 Consider the following large model program:

 struct { int x;
          int y;
          int z;} near a;    /* or far, pascal, fortran */

 void main(void)
 {
   a.x = 1;
 }

 To put a watch on a.x, you could issue the following commands:

 ? &a
 0x0345:0000       <- result is the address of the structure
 ww 0x0345:0x0     <- address of x
 ww 0x0345:0x2     <- address of y (two byte int from x)

 This puts a watch on the first and second elements (x and y) in the
 structure.


 12. Older Vega VGAs Hang CodeView When in VGA Mode

 Product Version(s): 2.10 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER |
 Last Modified: 14-AUG-1989    ArticleIdent: Q27212

 Question:

 Why does my old Vega VGA card cause CodeView to hang when I start it
 in VGA mode? It works properly when I start CodeView when the card is
 in CGA mode.

 Response:

 Some of the older Vega VGAs do not work correctly with CodeView. The
 Vega VGA card uses the same maskable interrupt for detecting graphics
 mode as CodeView.

 We recommend that you contact Vega by calling 1 (800) 248-1850 for
 advice if you experience this problem.


 13. Ambiguous Documentation of Enter ASCII (EA) Command

 Product Version(s): 2.10 2.20 | 2.10 2.20
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 16-AUG-1989    ArticleIdent: Q47764

 In the "Microsoft C 5.1 Optimizing Compiler" manual, the "CodeView and
 Utilities" section does not thoroughly document the EA command for
 CodeView. The following is a more complete explanation:

    EA address [list]

    The Enter ASCII (EA) command modifies array to the value of [list].
    Address refers to what you want to modify. [list] refers to a
    string literal such as "hello". EA will copy [list] to array. Thus,
    if you specify address by giving an array, such as an array of
    characters, the array will have [list] copied into it. However, if
    you were to give a pointer to a character, then the bytes that make
    up the pointer will be directly modified, not the block of memory
    the pointer is pointing at.

 Consider the following examples:

 char array[] = "Hello";
 char *ptr    = "Hello";

 >EA array "Hi"
 >EA ptr   "Hi"

 The result is that the array would contain "Hillo", and ptr will be
 pointing to some unknown memory location.

 The array is considered a constant pointer to a block of memory, and
 as such, any operations on it can only affect the block of memory.
 However, ptr is a variable; therefore, any operations on it affect the
 value of ptr, which happens to be a two- or four-byte number. That
 number happens to refer to a location in memory.

 If you want to changed the block of memory that ptr points to, you
 must do the following:

    >EA &ptr[0] "Hi"

 Essentially, this takes the address of the character that ptr is
 pointing at, gives a constant address, and thus modifies the block of
 memory there. To clarify, imagine you have a character located some
 place in memory. To move a character, you must make a copy of it to
 some other memory location; it is not possible to take its address and
 modify the address directly to change where the character is located.
 Thus, the address of that character is always a constant value. ptr[0]
 happens to be a character located someplace in memory. As such, the
 address of that specific character is a constant value. Since a
 constant cannot be modified, EA changes the block of memory starting
 at where the constant pointer is pointing.


 14. Debugging of DLLs That Do Not Have the .DLL Extension

 Product Version(s): 2.30   | 2.30
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 21-AUG-1989    ArticleIdent: Q47938

 CodeView Protect (CVP) Version 2.30 has the ability to debug DLLs that
 are called with DosLoadModule(). DosLoadModule() can load DLLs that
 do not have the .DLL extension. However, CVP 2.30 cannot debug DLLs
 that do not have the .DLL extension. If you want to debug DLLs that
 are called with DosLoadModule, they must have the .DLL extension.

 Microsoft is aware of this limitation with CodeView Protect 2.30. We
 are researching this problem and will post new information as it
 becomes available.


 15. Resident Software May Cause "Internal Debugger Error 80"

 Product Version(s): 1.x 2.00 2.10 2.10 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 29-AUG-1989    ArticleIdent: Q47989

 Question:

 Sometimes when I run CodeView, I get an "Internal Debugger Error 80"
 message. What causes this?

 Response:

 Internal Debugger Error messages are usually caused by problems in
 your MS-DOS environment; the most likely cause is the presence of
 memory-resident software, commonly referred to as TSRs (terminate-
 and-stay-resident software).

 For example, running CodeView with Borland's Sidekick loaded has been
 known to cause "Internal Debugger Error 80" and "R6002: Floating Point
 not loaded" error messages. "Internal Debugger Error 80" has also been
 reported when CodeView was run with Software Solutions' "Software
 Carousel" loaded into memory.

 CodeView Versions 2.00 and later have become increasingly more
 sensitive to TSRs. If you receive an Internal Debugger Error message,
 or you are experiencing strange problems within CodeView, make sure
 you are running CodeView with no memory-resident software loaded
 (including, but not limited to, device drivers, screen savers,
 keyboard enhancers, command-line editors, etc.). Disabling your
 resident software, but not rebooting, may not completely remove its
 interference, so be sure to "boot clean" when trying to resolve a
 problem of this type.

 If you continue to receive the error message without memory-resident
 programs, try running CodeView on some other program to see if the
 error is related to particular code. If the error is related to the
 specific code, and you are unable to determine the cause, you may want
 to call Microsoft Product Support for assistance at (206) 454-2030.

 If the error is not dependent on your code, the problem might be the
 particular sequence of CodeView commands you execute. Make a note of
 what operations you performed, i.e., the sequence of Trace, Go, Watch,
 Tracepoint, etc., commands that were issued, and contact Microsoft
 Product Support via phone, letter, or Microsoft OnLine.


 16. CVP Restart Command (Dialog Version) Doesn't Properly Set argc

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist2.20 buglist2.30
 Last Modified: 28-AUG-1989    ArticleIdent: Q48000

 When using the dialog version of the Restart command, you can restart
 your program with command-line arguments; however, under CodeView
 Protect (CVP) Versions 2.20 and 2.30, argc does not get properly set.

 The Dialog Restart command is often used to restart a program with
 command line arguments. For example, you could use the following:

    L arg1 arg2 arg3

 This example restarts the current executable file, retaining any
 breakpoints, watchpoints, and tracepoints, with arg1, arg2, and arg3
 loaded into argv[1], argv[2], and argv[3], respectively. Argv[0] is
 always set to the name of the current executable file. Argc, at this
 point, should be set to four. The problem presents itself here; argc
 either remains unchanged from the value it was initially set to when
 CodeView was started, or is decremented by one. If, for example,
 CodeView is started with two command-line arguments (argc would then
 be set to three) and then executed, the previous example argc (which
 should then set argc to four) would remain unchanged. When using the
 Dialog Restart command and specifying fewer arguments than were
 specified at start up, argc sometimes is decremented by one.

 Microsoft has confirmed this to be a problem with CodeView Versions
 2.20 and 2.30. We are researching this problem and will post new
 information as it becomes available.


 17. Cannot Load CTRL+Z-Terminated Files with Less than 129 Bytes

 Product Version(s): 1.00 1.10 2.00 2.10
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00 buglist1.10 buglist2.00 buglist2.10 qfbv
 Last Modified:  4-NOV-1988    ArticleIdent: Q26548

 Problem:

 When using the F(ile) O(pen) command to load a text file which has
 less than 129 bytes and is terminated with a hex 1A (decimal 26,
 CTRL+Z, EOF), CodeView issues the error message "Not a text file." If
 the CTRL+Z character is removed, or if the file size is 129 bytes or
 greater, CodeView has no problem loading it.

 Response:

 Microsoft has confirmed this to be a problem in Version 1.00, 1.10,
 2.00, and 2.10. We are researching this problem and will post new
 information as it becomes available.


 18. Debugging High Resolution EGA or VGA Graphics

 Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS                        | OS/2
 Flags: ENDUSER | TAR61178
 Last Modified: 14-AUG-1989    ArticleIdent: Q23308

 Question:

 I am trying to debug a program that does EGA or VGA graphics. When I
 continue from a breakpoint after the program has painted the screen,
 the screen is not as it was before the breakpoint. I think that all
 colors have been turned to black, but I am not sure.

 I tried this procedure with no switches, with /s, and with /t. The
 program is using the EGA in 640x350 16-color mode. Is this supposed to
 work? If it does not work, why not? What will you do about supporting
 the higher modes for the new machines such as the Personal System 2
 series from IBM?

 Response:

 This behavior is partly related to the size of the buffer that
 CodeView creates for storing screen information. If you are running on
 a CGA, EGA or VGA board, this buffer is by default 16K. If you are running
 on a monochrome board, this buffer is by default 4K. As you are
 finding, 16K is simply not enough memory for a color image using
 640x350 resolution (the maximum resolution supported would be
 640x200).

 One of the reasons why CodeView does not have the ability to handle
 the buffer requirements of an EGA image is that the EGA registers are
 write only. There is no way for CodeView to detect what mode the EGA
 currently is in so it can adjust the size accordingly. Also note that
 with the different resolutions the image is stored in different memory
 locations. The black on black characters may simply be a blank image
 because CodeView cannot tell that the resolution is different and
 therefore the image is located elsewhere.

 With the PS/2 machines this is not an issue because the EGA registers
 have read capability. We are reviewing this with regard to future
 implementations of CodeView.

 The following are some ways to work around this current limitation:

 1. Try writing a routine that will place the display in the desired
    mode before you invoke CodeView. CodeView will be able to judge
    which mode is currently in effect and can locate the image in the
    correct area of memory. Note that the image will not be displayed
    in color. You will only see the higher resolution since the buffer
    is not big enough.

 2. Debug your applications that run in high resolution graphics with a
    second monitor (use the /2 switch). Since the display is going to a
    different screen, CodeView will not have to worry about changing
    the video modes or the buffering.


 19. CodeView Version 2.20 Is Called CVPCK.EXE by DOS Version 2.10

 Product Version(s): 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER | CV CVPCK CVPACK 2.x
 Last Modified: 21-SEP-1989    ArticleIdent: Q48689

 Question:

 When trying to invoke CodeView Version 2.20 under DOS Version 2.10 or
 2.11, I get the messages "Cannot Find CVPCK.EXE" and "Please enter new
 program spec:". How can I get CodeView 2.20 to work under DOS Versions
 2.1x?

 Response:

 If you rename CV.EXE to CVPCK.EXE, you can run CodeView Version 2.20
 under DOS Version 2.10 or 2.11. You must also rename CV.HLP to C.HLP
 to make the on-line help accessible.

 CodeView Version 2.20 is included with C Version 5.10, FORTRAN Version
 4.10, Pascal Version 4.00, and Macro Assembler (MASM) Version 5.10.

 Many people mistakenly assume that CodeView is actually looking for
 CVPACK.EXE, which also comes with the software packages listed above.
 If you rename CVPACK.EXE to CVPCK.EXE and then try to run CVPCK.EXE,
 you will receive the error message "overlay not found." If you receive
 this error, delete CVPCK.EXE, copy both CV.EXE and CVPACK.EXE from the
 installation disks, and follow the instructions above.

 Under DOS Versions 3.x, a C program's name is available from argv[0].
 Under DOS Versions 2.x, argv[0] always equals the letter "C", so
 programs that need to find themselves under DOS Versions 2.x also have
 their own names hard coded as the filename to locate. Unfortunately,
 the hard-coded name within CodeView Version 2.20 is "CVPCK.EXE", so
 this is what it looks for under DOS Versions 2.x.


 20. CodeView String Search Length Limited to 19 Characters

 Product Version(s): 2.10 2.20 2.30 | 2.10 2.20 2.30
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER | SR# G890810-24574 P_WinSDK
 Last Modified: 19-SEP-1989    ArticleIdent: Q48863

 CodeView Versions 2.20 and 2.30 and CodeView for Windows Version 2.10
 have a 19-character limit in the "Find..." option of the Search menu,
 even though the dialog box is much longer than 19 characters. Entering
 a search string longer than 19 characters results in one of two error
 messages.

 If the search string entered is 20 or 21 characters long, CodeView
 displays the erroneous message "No match of regular expression," even
 if the search string does exist in the file. If the search string is
 22 characters or more in length, CodeView displays the more
 appropriate message "Regular expression too long."

 Although 19 characters sometimes can be limiting, CodeView does
 substring searches so that searching for the following

    AFunctionWithAVeryL

 finds the following string:

    AFunctionWithAVeryLongName

 You will have problems only if you have both of the following and
 you are trying to locate one, but not the other:

    AFunctionWithAVeryLongName()
    AFunctionWithAVeryLongParameterList(a,b,c,d,e,f,g,h,i,j)

 In this case, you won't be able to specify search strings long enough
 to distinguish between the two. However, you can repeatedly use the
 Next command from the Search menu to find the next occurrence of the
 following:

    AFunctionWithAVeryL

 The Next command will find whichever of the above two function names
 that comes next in the source file.


 21. Files, Environment Inaccessible Only While Running under CVP

 Product Version(s): 2.20
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 30-NOV-1989    ArticleIdent: Q49313

 Due to combined problems in both protected-mode CodeView (CVP) Version
 2.20 and OS/2 Version 1.00 or 1.10, programs that correctly access
 data files and/or system environment information could fail when
 attempting this same access while running under CVP 2.20. This is
 strictly a protected-mode problem and is unrelated to the use of
 CodeView under MS-DOS. The sample program at the end of this article
 can be used to demonstrate this problem.

 The system environment information includes such items as the path and
 other environment variables, as well as the current working directory
 for each disk drive. This information is normally available to an
 executing program, but for a program being debugged with CVP 2.20
 running under OS/2 1.00 or 1.10, most of this environment information
 is inaccessible.

 This inaccessibility is a result of environment handling problems in
 both CVP 2.20 and OS/2 Version 1.00. Since CodeView is run from the
 command prompt, all the current environment information is available
 to CodeView itself, but the program being debugged is given its own
 new screen group in which to run. It is in this new screen group that
 the current environment information is lost because it is not carried
 over by either OS/2 or CodeView.

 Although the OS/2 problem has been corrected in Version 1.10, the
 CodeView problem still prevents access to the environment. Therefore,
 upgrading either CodeView or OS/2 alone does not solve the problem.
 Only with CodeView Version 2.30 running under OS/2 Version 1.10 is the
 problem eliminated.

 There may be some environment information available to the program
 being debugged, but only if it was set in the CONFIG.SYS file at start
 up. Since each new screen group is begun with a copy of the original
 start-up system environment, any SET commands carried out in the
 CONFIG.SYS file will then be duplicated for all subsequent screen
 groups.

 Otherwise, if a program needs access to environment variables that
 were set in the current screen group where CodeView will be invoked,
 then the only way to make the information available while debugging is
 to temporarily hard code the information into the program. After
 debugging, the program can be changed back to using the actual
 environment strings.

 The only other alternative to temporarily hard code the environment
 information into the program is to set the environment variables in the
 CONFIG.SYS file at boot time, rather than setting them in the current
 screen group.

 The only reason a file access will fail only while the program is
 running under CodeView is if the program is assuming the file is in
 the current working directory on the current or another drive.

 If this is the case, then one of the following workarounds may be used
 to gain access to files while debugging:

 1. Use full pathnames for all file accesses, since this alleviates any
    dependency on knowing the current working directory for the drive
    that is being accessed. If it is not feasible to have hard-coded
    pathnames in the completed program, at least adding the full paths
    temporarily will allow debugging.

 2. Put the files to be accessed in the root directory of the boot
    drive. This allows them to be found even under CodeView because
    with no environment information, the current working directory
    defaults to the root of the boot drive.

 3. Use a two-monitor debugging setup and start CodeView with the /2
    option. In this situation, CVP does not need to start a new screen
    group for the program being debugged because it can run it on the
    second monitor. Thus, the current environment information is
    available to both programs because they are both running in the
    current screen group.

    For more information about debugging with a two-monitor setup, query
    on the following:

       CodeView two monitor debugging

 The following C program can be used to demonstrate this environment
 problem:

 Program Example:
 ---------------

     /* TEST.C - shows inaccessible files under CodeView

        Compile with : CL /Zi /Od test.c
        Run with : test <filename>      where <filename> is any file
                        in the current directory.  The file will be
                        opened properly.
        Begin CVP with : CVP test <filename>     where <filename> is
                        the same as before. The file will not be
                        found when the program is run or traced.
     */

     #include <stdio.h>
     void main(int, char *[]);

     void main(int argc, char *argv[])
     {
         FILE *dfile ;

         if ((dfile = fopen(argv[1], "rb")) == NULL) {
             perror ("") ;
             printf ("Cannot open file '%s'.\n\n", argv[1]) ;
         }
         else {
             printf("File %s opened OK.\n\n", argv[1]) ;
             fclose (dfile) ;
         }
     }


 22. COM Port Time-Out Halts Redirection of CVP to Remote Terminal

 Product Version(s): 2.20 2.30
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 27-OCT-1989    ArticleIdent: Q49376

 When using protected-mode CodeView (CVP) under OS/2, there is a
 problem with the serial communications (COM) ports timing out after 60
 to 90 seconds of inactivity. This time-out makes it essentially
 impossible to do remote terminal debugging with CVP. Once the time-out
 occurs, no further input is accepted from the remote terminal. The
 only workaround is to quit CodeView and begin again, or to do a break
 and then restart the redirection to the COM port.

 The CodeView Debugger allows redirection of input and output to a file
 or device. This procedure is commonly used to set up a remote (dumb)
 terminal for CodeView input and output, while the PC screen is used
 for displaying the program input and output. The terminal is connected
 through a COM port, which eliminates the need for a second video
 adapter as is required when using two monitors with the /2 option.
 Entering "=COM1" at the CodeView command prompt enables input and
 output redirection to the device designated as COM1.

 This debugging arrangement works great with CodeView under MS-DOS, but
 it becomes unworkable with CVP under OS/2 because the internal calls
 that are used to set up the redirection do not account for time-outs
 due to inactivity. Thus, if you are entering commands from the remote
 terminal at a steady pace, everything proceeds smoothly. However, if you
 stop and wait for more than about 60 seconds without doing any input,
 the port will time-out and leave you stranded because the keyboard no
 longer responds.

 In a normal debugging session, it is quite likely that there would be
 many instances greater than 60 seconds where input is not yet needed
 or desired; therefore, this situation quickly becomes intolerable. The
 only way to regain control is to enter CTRL+C at the PC keyboard,
 which ends the redirection. At that point, you could enter "=COM1"
 again on the PC keyboard to restart the redirection if you so desired.


 23. CVP 2.30 Does Not Allow Pathnames for DLLs Specified with /L

 Product Version(s): 2.30
 Operating System:   OS/2
 Flags: ENDUSER | buglist2.30
 Last Modified: 10-OCT-1989    ArticleIdent: Q49377

 Protected-mode CodeView (CVP) Version 2.30 allows debugging of dynamic
 link libraries (DLLs) by specifying their names on the command line
 with the /L switch. Because of a problem exclusive to CVP 2.30, this
 particular version of the debugger does not allow a pathname to be
 used with /L to specify the DLL's location in another directory.
 Therefore, all DLLs to be debugged with CVP 2.30 must reside in the
 current working directory.

 Since DLLs are also required to be in a directory that is on the
 LIBPATH, two copies of the DLL may need to be resident on the disk,
 unless the current working directory is also a LIBPATH directory.

 Microsoft has confirmed this to be a problem with CodeView Version
 2.30. We are researching this problem and will post new information as
 it becomes available.

 When tracing a program under CodeView that calls DLLs, the only way to
 trace into the code of a particular DLL is if the DLL was specified
 ahead of time on the command line with /L when CVP was invoked. If a
 program statement is traced that calls a DLL that was not specified by
 /L, then CodeView executes all the code in the DLL and returns control
 back at the line following the call to the DLL. Thus, the call is
 handled as if the step command, rather than the trace command, had
 been used.

 You can indicate only one DLL with the /L switch, so debugging
 multiple DLLs requires multiple /L switches. Normally, the switch is
 followed by a space and the name of the DLL to be debugged, and if the
 DLL is not located in the current directory, a path may precede the
 DLL name. It is only with CVP 2.30 that this becomes a problem because
 a pathname is not recognized with this version, so tracing into the
 DLL is prevented.

 Unfortunately, CodeView does not display error messages for improper
 use of the /L switch, so if the DLL is not found, there is no message
 indicating this. Instead, CodeView does not allow debugging of the
 improperly specified DLL. Use of a pathname with /L with CVP 2.30
 causes this same behavior.

 The only workaround for DLL debugging with CVP 2.30 is to keep a copy
 of the DLL in the current working directory from which CodeView is
 invoked. Thus, if the current directory is not a directory specified
 on the LIBPATH, there must be two copies of the DLL on the disk. It is
 very important that the two copies are exactly the same because
 differing code makes any attempts at debugging very difficult and
 confusing.

 A common practice is to put a period (.) as the first directory on
 the LIBPATH because this makes the current working directory a LIBPATH
 directory, eliminating the need for two copies of the DLL. More
 information on this practice can be found by querying on the
 following words:

    CodeView DLL debugging and libpath


 24. Label Finding Command Does Whole Word Search, Not Text Search

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 27-OCT-1989    ArticleIdent: Q49378

 In CodeView Versions 2.20 and 2.30, under the Search menu is the Label
 option for searching for a label. Unlike the Find option, which
 searches the source code for any regular expression, the Label option
 searches the executable code for an assembly language label.

 This search is not a text search and does not accept regular
 expressions. The only way to find a label is to specify the entire
 label name as the search string. In addition, if the Case Sense option
 is selected on the Options menu, the label is found only if the case
 of each character matches exactly.

 For example, if you want to find the code for the standard C
 stack-checking function "_chkstk", choose Search Label, and type in
 "__chkstk" (without the quotation marks), and press ENTER. This
 switches you into assembly mode, if you weren't there already, and
 puts the line with the __chkstk label at the top of the window. The
 two underscores are required since C appends an underscore to the
 front of all labels and the original function name is "_chkstk".

 You will receive the error message "Unknown Symbol" if the label
 cannot be found or if you mistype or incompletely type the correct
 name. For example, "_chkstk", "chkstk", "__chk", and "__chkstks" all
 fail to find a match in the above example. If Case Sense is on,
 searching for the label "__CHKSTK" also results in failure.


 25. The Assemble Command with ADD Instructions

 Product Version(s): 2.20 2.30  | 2.20 2.30
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist2.20 buglist2.30
 Last Modified:  9-AUG-1989    ArticleIdent: Q40225

 Problem:

 In CodeView, I'm using the assemble command to change my ADD
 instruction, and it changes all the code from that point on.

 Response:

 If you had the instruction ADD AL,44, for example, and you wanted to
 change the 44 to 45 (or any other number), you could use the Assemble
 command to do it. The Microsoft Macro Assembler generates a 04 44 for
 that instruction; however, when changing the 44 to 45, CodeView
 generates an 80 C0 45, which is still the correct instruction of ADD
 AL,45. However, it's a 3-byte instruction. Inserting one extra byte
 into your code will cause each op code from that point on to be off by
 one.

 Microsoft has confirmed this to be a problem in Versions 2.20
 and 2.30 of CodeView. We are researching this problem and will
 post new information as it becomes available.



 26. CV Prior to 3.00 Needs /S for Mouse to Appear in OS/2 DOS Box

 Product Version(s): 1.00 1.10 1.11 2.00 2.10 2.20 2.30 2.35
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-FEB-1991    ArticleIdent: Q23646

 With all versions of real-mode CodeView (CV) earlier than version
 3.00, the mouse cursor does not display when running in a DOS session
 under OS/2 in the DOS compatibility box.

 The situation exists because the mouse draws the pointer only in video
 page zero, while CodeView uses video page one. This problem is caused
 by OS/2 itself because the mouse cursor works normally under DOS.

 To work around this limitation with CV 1.x or 2.x, invoke CodeView
 with the /S switch so screen swapping is used as the method of screen
 exchange. This method forces CodeView to swap in and out of page zero.

 Beginning with version 3.00, CodeView detects whether it is running in
 a DOS session under OS/2, and if so, automatically starts up with /S
 as the default in order to make the mouse visible.


 27. CVPACK /p Causes a More Complete Packing

 Product Version(s): 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 28-MAR-1989    ArticleIdent: Q38020

 When you are unable to load your program into CodeView, try packing
 the program with CVPACK.EXE. If you want a more complete packing of
 your executable, then run CVPACK.EXE with the /p option. This option
 will take longer to run, but it will generate better results.

 The /p option for CVPACK.EXE is documented on Page update-17 in the
 "Microsoft C 5.1 Optimizing Compiler, CodeView and Utilities,
 Microsoft Editor Mixed-Language Programmer's Guide."

 Normally, CVPACK discards unused debugging information and appends
 it to the file. With the /p option, CVPACK discards the unused
 debugging information, then proceeds to sort it throughout the
 executable file.


 28. Mouse Cursor Disappears After Right Click

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 14-AUG-1989    ArticleIdent: Q38021

 Problem:

 I have just clicked my right mouse button to acknowledge a pop-up
 message and my mouse cursor has disappeared. I had just clicked my
 right mouse button before for another operation.

 Note: This also occurs when you hit any button on the three button
 Logitech mouse.

 Response:

 To get your mouse cursor back again, redraw the screen with the "@"
 command.


 29. CVP 2.30 Hangs When /O Is Specified, but Child Is Not Debugged

 Product Version(s): 2.30
 Operating System:   OS/2
 Flags: ENDUSER | buglist2.30
 Last Modified: 27-OCT-1989    ArticleIdent: Q49381

 Beginning with protected-mode CodeView (CVP) Version 2.30, you can
 debug child processes from within a parent process's CodeView session
 by invoking CodeView with the /O switch. When the program is executed
 to the point where the child process is invoked, CodeView displays a
 prompt showing you the child's process ID (PID) and asks, "Do you wish
 to debug (y/n)?". Entering "y" brings up the child process and allows
 you to debug it. Pressing "n" should cause the child to execute
 without any debugging.

 Unfortunately, there is a problem in CVP 2.30 that causes CodeView to
 hang if you answer no to debugging the child. The only workaround is
 to always answer yes when prompted to debug a child process, or to
 invoke CodeView without the /O switch because this prevents the prompt
 entirely.

 Microsoft has confirmed this to be a problem with CodeView Version
 2.30. We are researching this problem and will post new information as
 it becomes available.

 If the program you are debugging is not a Presentation Manager (PM)
 application, you may be able to kill the CodeView session if it should
 hang as a result of answering "n" to the debugging child process. You
 must switch to the Task Manager and use it to close the hung CodeView
 session. If you are working on a PM application, the only workaround
 may be to reboot the computer.


 30. Cannot Debug Code in Overlays in Small or Compact Model

 Product Version(s): 2.10 2.20 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 14-AUG-1989    ArticleIdent: Q27128

 Question:

 I have a C program, compiled with Microsoft C Version 5.00, which
 consists of several modules linked together as overlays. I am not able
 to trace into code in the overlays. I compiled in the default memory
 model. What is wrong?

 Response:

 The modules must be compiled in medium or large memory model to be
 overlaid. In the default model (small), or in the compact model, there
 is only one code segment, which cannot be overlaid. The main module is
 always resident and cannot be overlaid. You must use the compile
 option /AH, /AL, or /AM.


 31. Code that Will Hang IBM XTs or Compatibles

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR57675 buglist1.00
 Last Modified:  8-NOV-1988    ArticleIdent: Q23856

 Problem:

 The following code will hang IBM XTs or compatibles if specific
 commands are issued when inside of CodeView:

    #include <stdio.h>
    main()
    {
         int n;
         double f;

         while(1)   {
                    scanf("%d",&n);
                f=1.0;
                while (n>1) f=f*n--;
                   printf("%.101g%c",f,'\n');
                    }
    }

 For the program to fail in CodeView, first set a breakpoint at
 instruction f=1.0. Issue the Go command, then the P command.

 Response:

 This is corrected in CodeView version 2.20.

 A workaround is to place a breakpoint at the instruction before or
 after the assignment to f.


 32. /DOSSEG Link Switch Fails to Make CodeView .exe

 Product Version(s): 2.20 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  9-AUG-1989    ArticleIdent: Q38163

 Question:

 CodeView is failing on an .exe produced using the /DOSSEG linker
 switch. CodeView responded to an attempt to run with this .exe
 with a "not enough space" diagnostic. What is the problem?

 Response:

 The modules below demonstrate the problem. In this case, compiling the
 C source module and assembling the MASM source module with the
 appropriate CodeView switches, then linking with the /CO /DO switches
 generates a bad .exe. The problem is that CodeView displays source
 with extended ASCII characters.

 To work around this problem, put .DOSSEG in the MASM modules
 being linked, and omit the /DO switch rather that trying to
 force the linker to do the work. Also, switching the order of
 the linker switches may solve the problem.

 The following example demonstrates the problem:

 #include <stdio.h>
 main ()
   {
   long int getds(void), getdsq(void);
   printf("ds.DATA  = %lX\nds.DATA? = %lX\n",getds(),getdsq());
   }

 **************************************************************
 ;        DOSSEG could be put here
         .MODEL  small
         .DATA
 array   dd      0
         .DATA?
 arrayq  dd      ?
         .CODE
         PUBLIC  _getds,_getdsq
 _getds  PROC
         mov     ax,SEG array
         mov     dx,ds
         ret
 _getds  ENDP
 _getdsq PROC
         mov     ax,SEG arrayq
         mov     dx,ds
         ret
 _getdsq ENDP
         END


 33. 3270 ERMA Emulator

 Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  9-AUG-1989    ArticleIdent: Q24200

 Question:
    Does CodeView support the 3270 ERMA emulator?

 Response:
    CodeView does not directly support any other program. In this case,
 the 3270 ERMA emulator would have to accommodate CodeView. CodeView
 performs some hardware specific routines (e.g. checking to see if an
 EGA is present) and makes some assumptions on the state of the
 machine. If another program changes the state of the machine, it may
 not work with CodeView. It has been reported that CodeView will hang
 if the 3270 ERMA emulator is enabled; we recommend you disable the
 emulator before running CodeView.


 34. Flipping and Swapping Screens

 Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  9-AUG-1989    ArticleIdent: Q24201

 Question:
    What is the difference between flipping and swapping in CodeView?

 Response:
    Both are ways of maintaining two alternate screens for display on
 one monitor. The difference is in the way the task is accomplished.
    When swapping is selected, CodeView allocates a 16K buffer (a 4K
 buffer for a monochrome adapter) to hold the alternate screen. When
 the other screen is required, CodeView swaps the screen into the
 display buffer and places the other screen into the storage buffer.
 Swapping takes memory and time, but it does not have the limitations
 of flipping.
    Flipping uses the video-display pages of the graphics adapter to
 store each screen of text. When the alternate screen is required, the
 other page is selected. Flipping is much faster than swapping and does
 not require the 16K buffer. However, it cannot be used with a
 monochrome adapter, or with programs that display graphics or use the
 video pages.


 35. CODEVIEW.DOC Incorrectly States /E Uses Extended Memory

 Product Version(s): 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 10-NOV-1988    ArticleIdent: Q27763

 The CODEVIEW.DOC file included in Microsoft C Version 5.10 states that
 the /E switch enables use of extended memory for CodeView's symbol
 table.

 This is a documentation error in the CODEVIEW.DOC file. CodeView uses
 expanded, not extended memory.


 36. WINDOWCOMPAT Directs CodeView to Create a Window

 Product Version(s): 2.20 2.30
 Operating System:   OS/2
 Flags: ENDUSER | S_C
 Last Modified: 10-NOV-1989    ArticleIdent: Q49423

 The WINDOWCOMPAT directive in a linker definition file can cause
 strange behavior in non-Presentation Manager (PM) programs being
 debugged under CodeView. WINDOWCOMPAT is one of three application
 types that can be specified after the NAME directive. WINDOWCOMPAT is
 used for OS/2 programs that use VIO, MOU, and KBD calls and can be
 used inside a PM window or as a separate screen group.

 Debugging a non-PM application that was linked with the WINDOWCOMPAT
 option instructs CodeView to create a PM window to run the program. In
 some cases this feature could be desirable, but for most debugging, a
 PM window is only cumbersome. The way to work around this feature is
 to relink without the WINDOWCOMPAT directive.


 37. The CodeView Port Input Command Example Is Unclear

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | H_MASM H_FORTRAN S_Pascal
 Last Modified: 27-OCT-1989    ArticleIdent: Q49537

 The CodeView example for port input command is unclear in the
 following manuals:

 1. Page 150 of Microsoft C 5.10 "CodeView And Utilities, Microsoft
    Editor, Mixed Language Programming Guide"

 2. Page 150 of Microsoft Macro Assembler 5.10 CodeView and Utilities

 3. Page 150 of Microsoft Pascal 4.00 CodeView and Utilities

 4. Page 127 of Microsoft FORTRAN 5.10 CodeView and Utilities

 The example assumes the radix is in hexadecimal. To set the radix to
 hexadecimal, type in the following command:

    >n16

 After setting the radix to hexadecimal, the example works properly.

 If the radix is not in hexadecimal, a "0x" must be present for
 CodeView to recognize the value as a hex format. The following example
 shows how to use the port input command if CodeView is not in
 hexadecimal radix:

    >I 0x2f8


 38. The Difference Among Watch, Watchpoint, and Tracepoint

 Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS                        | OS/2
 Flags: ENDUSER |
 Last Modified: 14-AUG-1989    ArticleIdent: Q24225

 Question:

 What is the difference between a watch, a watchpoint, and a
 tracepoint?

 Response:

 A "watch" command will monitor an expression or a range of memory
 addresses, and update the watch window each time the expression or any
 location in the range changes. Using a watch never will cause program
 execution to stop; it simply "watches" unconditionally.

 A "watchpoint" monitors an expression (and an expression only) during
 program execution. It will update its value in the watch window
 whenever it changes. However, when the watchpoint expression becomes
 true (nonzero), program execution is stopped.

 A "tracepoint" monitors an expression or a range of memory addresses
 and displays the expression or the range being monitored in the watch
 window. It will stop program execution when the expression or any
 location in the range changes. Please note that writing over the old
 value at a memory location with the same value is not considered a
 change.

 The following example summarizes this information:

 Command     Object To Watch          Conditionally    Condition To
                                      Stops            Stop On
 -------     ---------------          -------------    ------------

 WATCH       expression or            No               (none)
             range of memory

 WATCHPOINT  expression               Yes             expression becomes
                                                      true (nonzero)

 TRACEPOINT  expression or            Yes             expression or
             range of memory                          in range changes
                                                      location

 Note: the "monitoring" described above is done in only window mode. If
 sequential mode is being used, you must use the Watch List command to
 see the values of any of the three types of watch statements.


 39. Tracking Down a Null Pointer Assignment Error

 Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS                        | OS/2
 Flags: ENDUSER | S_C
 Last Modified: 21-AUG-1989    ArticleIdent: Q24270

 Question:

 I consistently get the error number R6001 "null pointer assignment"
 when I run my program. How can I use CodeView to determine the point
 at which the null pointer assignment is occurring?

 Response:

 Use a tracepoint, which can be set to watch a range of memory up to
 128 bytes. It will halt the execution of the program when any value in
 this range is changed. If you set a tracepoint over the entire range
 of the null segment, the program will halt immediately after the
 instruction that wrote over the null segment.

 The location of the null segment is available in the link maps of
 Microsoft compilers. It starts at DS:0 and is 42H bytes long. The
 Microsoft copyright notice is written there at program startup and
 if this area is written to during the course of the program, the
 error r6001 is generated. The most common cause of this error is
 using a pointer that has not been initialized to point to a memory
 area. Pointers that have not had space allocated for them (using
 malloc for example) or that have not been assigned to a specific
 data element (arrays or structures for example) are considered
 uninitialized.

 An example of using CodeView to determine where an unitialized pointer
 is being used follows:

 g main                  /* go to the beginning of main() */
 n16                     /* switch to hexadecimal (base 16) */
 tpb DS:0 DS:42          /* set a Trace Point of type Byte starting
                               at address DS:0 and extending to DS:42 */

 When any value in the specified range changes, CodeView will stop the
 execution of your program. The previously executed line was probably
 the line that caused the R6001 error.


 40. How to Successfully Debug VioPopUp() Code with CodeView

 Product Version(s): 2.20 2.30 2.35
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 27-FEB-1990    ArticleIdent: Q58647

 Debugging programs that take advantage of OS/2's VioPopUp() call can
 present a potentially dangerous situation. Due to the nature of the
 VioPopUp() call, any attempts to trace into the VioPopUp call will cause
 your machine to hang. The workaround for this difficulty is to set a
 breakpoint outside of the VioPopUp() call [after the VioEndPopUp()], and
 then press F5 to instruct CodeView to execute to the next breakpoint.

 The VioPopUp() call brings forward a temporary pop-up text screen group
 that can be used to display text information without altering the
 context of the foreground screen. When a VioPopUp() call is executed, the
 current foreground screen group loses the keyboard focus to the pop-up
 screen. Therefore, when you trace into a VioPopUp() call, the pop-up
 text comes forward and CodeView, running in the foreground, loses the
 keyboard focus and cannot execute a trace instruction. At this time,
 CTRL+ESC or ALT+ESC will not change the deadlock situation and the
 only alternative is to reboot.

 To work around this problem, it is essential that you do NOT step into
 a VioPopUp call. Instead, press F5 to execute to the next breakpoint.
 Setting the breakpoint AFTER the VioEndPopUp() call is critical.


 41. Capabilities of Real Mode CodeView and the 386

 Product Version(s): 2.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_c, h_masm, h_fortran, s_pascal
 Last Modified:  1-DEC-1988    ArticleIdent: Q38205

 The information below discusses the CodeView debugger and its use
 of 80386 hardware capabilities.

 The DOS CodeView does not keep track of any of this information because
 DOS does not use any of these features. Essentially, a 386 running DOS
 is just a very fast PC and CodeView treats it as such.

 The OS/2 CodeView does not have the privilege to track many of the
 OS/2 functionality.

 The following is a list of CodeView behaviors:

 1. CodeView does not keep track of task states.

 2. CodeView does not handle privilege levels.

 3. CodeView Version 2.20 makes limited use of the 386 debug
    registers. Previous versions do not use these registers.

 4. CodeView does not keep track of interrupt gates and trap gates.

 5. CodeView cannot operate in both real and Virtual 86 mode.

 6. CodeView cannot trace to protected mode and back to real mode.

 7. CodeView does not handle traces in protected mode.


 42. Flip/Swap Setting Crucial to Debugging PM Apps with Children

 Product Version(s): 2.30
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 10-NOV-1989    ArticleIdent: Q50514

 Using protected mode CodeView (CVP) to debug Presentation Manager (PM)
 programs that spawn one or more child processes can be rather
 difficult. CVP works correctly for debugging just the parent PM
 process, but once you begin CodeView with the /O option to specify
 that you also want to debug child processes, you may find that you
 hang the computer quite regularly during your debugging session.

 CodeView itself does not have a problem with PM programs even if they
 do invoke child processes. It is only when you use the /O switch to
 debug the children at the same time that you run into difficulty. This
 is because of problems with CodeView conflicting with the OS/2 kernel
 as you bring a process to the foreground for debugging, while a
 system-dependent process like the PM parent is relegated to the
 background where it can become blocked.

 For example, if the parent gets to a point where it is waiting on a
 message, but it is not in the foreground, there is no way to get the
 focus back to this waiting process and you are essentially hung. The
 parent cannot process the message because it must be in the foreground
 to do so, and CodeView cannot continue until the message is processed,
 so it just waits.

 The key to debugging the parent and child processes of a PM program at
 the same time is the setting of Flip/Swap on the Options menu. Under
 CodeView, Flip/Swap ON forces messaging, Flip/Swap OFF does not.
 Therefore, you must turn Flip/Swap on and off as you go, depending on
 which particular part of the program you are currently debugging. The
 Flip/Swap setting is crucial in determining whether you hang the
 system or not.

 The ability to debug child processes from the parent's CodeView
 session became an available option beginning with CVP Version 2.30. By
 specifying the /O switch on the command line, CVP allows you to trace
 into child processes. (See the CVP 2.30 Note below if you are using
 that particular version of CodeView.)

 As far as actually debugging child processes in PM programs, you must
 proceed in an exacting manner. Unfortunately, the specifics are
 different for every program, so an all-encompassing set of debugging
 procedures cannot be devised. Nevertheless, the following general
 guidelines can be used for debugging most PM applications with their
 accompanying child processes:

  1. It is only with the /O option that any of this becomes critical.

  2. You need to debug in a full screen and not a PM window.

  3. Remember, Flip/Swap ON forces messaging, Flip/Swap OFF does not.
     Therefore, while you begin debugging in the parent program, you
     should have Flip/Swap ON, since you need messaging whenever you
     are doing any of the window initialization routines.

  4. Set a breakpoint in the parent somewhere after the window
     initialization code, but before the call to start the child
     process. It varies, but it usually works to put the breakpoint at
     the "while get message - dispatch message" loop or in the
     ClientWndProc procedure at the main switch statement.

  5. You must make sure that the breakpoint is placed in a position
     where you will stop at it before the prompt appears to ask you if
     you want to debug the child, but after ALL the window
     initialization has been completed. You will also probably need to
     set another breakpoint at the point where the parent program is
     going to begin executing again after you have finished working
     with the child.

  6. Do a GO, and when the breakpoint is reached, turn Flip/Swap OFF.
     Make sure that the prompt to debug the child is not already
     visible or you will lock up.

  7. Do a GO (or some traces) and you should get the prompt to debug
     the child. Answer "Y" and you should be able to debug the child
     process at this point.

  8. Use the Process command (the "|") to gain access to the child.
     Never use CTRL+ESC or ALT+ESC to switch to the other processes
     because these will almost assuredly cause you to hang.

  9. Go ahead and set breakpoints, watches, etc. in the child and do
     your debugging.

 10. After the child process is completed, use the Quit command to exit
     the child process's CodeView screen or use the Process command to
     reselect the parent process.

 11. Once you have returned to the parent process, and before you do a
     Restart (or load), or before you do ANY other window
     initialization, you MUST turn Flip/Swap ON again.

 12. Remember to always be aware of where you are in the program and
     what the current state of Flip/Swap is, since turning Flip/Swap on
     or off at the wrong time will almost always cause you to hang.

 Again, this is only the general outline of steps to follow and each
 application requires different specific steps. Don't be too surprised
 if you still run into occasional lock-ups.

 CVP 2.30 Note: When using the /O switch with CVP Version 2.30, there
 is a bug that may also cause you to hang. The problem involves using
 /O on the command line and then saying "No" when asked if you want to
 debug the child. So, with this version of CodeView, you should always
 answer "Yes" when asked if you wish to debug the child.

 For more information on this problem, use the following query:

    CodeView 2.30 hangs debugging child processes


 43. Can't Debug .COM Files in Source Mode

 Product Version(s): 2.00 2.10 2.20 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  9-AUG-1989    ArticleIdent: Q38288

 The .COM format files created with the Microsoft Macro Assembler
 cannot contain symbolic and source-line information for the CodeView
 debugger. You can only debug these files in assembly mode.


 44. CODEVIEW.DOC File Error: Mouse Works with the /2 Option

 Product Version(s): 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  8-NOV-1988    ArticleIdent: Q27764

 Question:
    The CODEVIEW.DOC file included with Microsoft C Version 5.10 states
 that using the /2 switch disables mouse support on the debugging
 display. Is this true?

 Response:
    This is an error in the CODEVIEW.DOC file.
    CodeView does support the mouse when using the /2 switch. In fact,
 if you are debugging a program which itself uses the mouse, using the
 /2 switch will allow you to use the mouse on CodeView's debugging
 screen as well as your application's output screen.


 45. "?CANNOT DISPLAY" After Column 135 in Command Window

 Product Version(s): 3.00 3.11 | 3.00 3.11 3.50
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified:  6-FEB-1991    ArticleIdent: Q68696

 The code below demonstrates a limitation of the CodeView debugger.
 When the command "?y" is executed in the COMMAND window, the structure
 "y" is displayed. However, CodeView displays the structure only to
 column 135 and then prints "?CANNOT DISPLAY," ignoring the rest of the
 elements in the structure. The output appears as follows:

    --------------------------command----------------------------
   |>?y                                                          |
   |{this_field_01=0x0000, ... ,this_field_07=?CANNOT DISPLAY    |
   |                        ^                 ^                  |
   |                        |                 |                  |
   |                  Fields 2-6 displayed    Column 135         |
   |                                                             |
    -------------------------------------------------------------

                       CodeView Command Window

 To view all elements of a structure, you should use the QUICK WATCH
 function. In the example below, the contents of the whole structure
 can be seen by typing "??y". A dialog box will appear on the screen
 showing the contents of the structure. By scrolling down in the dialog
 box, the contents of every element of the structure can be seen. The
 structure contents are displayed as follows:

           --------------- Quick Watch -----------------
          |                                             |
          |-y                                           |
          |   this_field_01=0                           |
          |   this_field_02=0                           |
          |   this_field_03=0                           |
          |   this_field_04=0                           |
          |   this_field_05=0                           |
          |   this_field_06=0                           |
          |   this_field_07=0                           |
          |   this_field_08=0                           |
          |   this_field_09=0                           |
          |   this_field_10=0                           |
          |   this_field_11=0                           |
          |   this_field_12=0                           |
          |   this_field_13=0                           |
          |   this_field_14=0                           |
          |   this_field_15=0                           |
           ---------------------------------------------

                       Quick Watch of Variable

 Sample Code
 -----------

 struct x {
    int this_field_01;
    int this_field_02;
    int this_field_03;
    int this_field_04;
    int this_field_05;
    int this_field_06;
    int this_field_07;
    int this_field_08;
    int this_field_09;
    int this_field_10;
    int this_field_11;
    int this_field_12;
    int this_field_14;
    int this_field_15;
    int this_field_16;
    int this_field_17;
    int this_field_18;
    int this_field_19;
    int this_field_20;
 };

 main()
 {
     struct x y;
 }


 46. Debugging PM Apps with Two Monitors Does Not Require /2 Switch

 Product Version(s): 2.20 2.30
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 17-JUL-1990    ArticleIdent: Q49824

 Problem:

 I am using CodeView to debug my Presentation Manager (PM) program and
 I am using the /2 switch to redirect the CodeView screen to a
 monochrome monitor. When I press F5 to start my program, a protection
 violation occurs, but it works correctly when I run it from the OS/2
 command line.

 Response:

 The /2 switch for CodeView is not supported for Presentation Manager
 application debugging. However, you may redirect the CodeView screen to
 a monochrome monitor if you do the following:

 1. Start a full-screen command prompt.

 2. At the prompt, type the following command (this puts the prompt on
    the monochrome monitor):

       mode mono

    Note: You must be in a 25-line screen mode before you attempt the
    mode mono. If you are in a 43- or 50-line mode, the display is
    corrupted.

 3. At the prompt, type the following command, where "appname" is your
    application's name:

       cvp appname

 4. After you are finished debugging, you can return the prompt to your
    primary display by typing the following command:

       mode co80


 47. How CodeView Interprets Values (octal, decimal, hexadecimal)

 Product Version(s): 1.x 2.00 2.10 2.20 | 2.20
 Operating System:   MS-DOS             | OS/2
 Flags: ENDUSER |
 Last Modified: 23-NOV-1988    ArticleIdent: Q38299

 Problem:

 When trying to watch a portion of memory, I have a problem with
 the following command at the dialog prompt:

    WW DS:0050 L 4.

 I thought this should have created a watch on the four words starting
 at offset 0x50. It actually set the watch starting at 0x28, CodeView
 interpreted the number as if it had been in base 8. Using the N
 command to change the radix doesn't make any difference.

 Response:

 In this case, the 0's before the offset cause CodeView to evaluate the
 expression in octal. CodeView provides three different prefixes for
 numbers to use an explicit base: 0 signifies octal, 0n signifies
 decimal, and 0x signifies hexadecimal. The current radix setting will
 have no bearing on numbers entered with these prefixes; however, it
 will affect those without prefixes.

 The lines below have different meanings when setting watches.
 The left column is the command, while the right column is an example
 of the display produced in the watch window. Radix is assumed to be 10.

 The following is an example:

 1. ww 50               50    :  0067:0032  6942

 2. ww 050              050   :  0067:0028  6328

 3. ww 0n50             0n50  :  0067:0032  6942

 4. ww 0x50             0x50  :  0067:0050  6163

 The first command sets the watch at the address specified using the
 current radix. This address will change when you use the N command to
 change the radix; the 50 on the left of the watch remains the same;
 however, the offset in the address will change to watch 50 in the new
 base. This address will always be displayed in hexadecimal, but 50
 will be evaluated differently.

 Examples 2 through 4 show watches being set in octal, decimal, and
 hexadecimal modes, respectively. These addresses will never change
 with a change of radix.

 Notice that watches 1 and 3 match. This is because by default CodeView
 is in base 10, so 50 and 0n50 evaluate to the same thing. Using N 8 will
 cause watches 1 and 2 to match, and N 16 will match 1 and 4.


 48. Interrupt Conflict with Greenleaf Libraries

 Product Version(s): 2.20    | 2.20
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER | CV CVP
 Last Modified: 23-NOV-1988    ArticleIdent: Q38314

 The Greenleaf Comm Library, a collection of asynchronous
 communications functions for use with the C compiler, causes severe
 complications with CodeView (e.g. crashes, lockups) due to interrupt
 conflicts. Greenleaf Software is aware of this difficulty and will
 advise customers of the incompatibility.

 No workarounds are available. Greenleaf Software is located in
 Carrollton, TX, and can be reached at (214) 248-2561.


 49. CodeView Gives "Illegal Instruction" on Clone 386

 Product Version(s): 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER | CV
 Last Modified: 23-NOV-1988    ArticleIdent: Q38317

 Some clones that are not entirely IBM-compatible under CodeView may
 give an "illegal instruction" message upon executing Go (F5), and then
 hang, requiring a warm boot. If the instruction being called illegal
 is FINIT or FNINIT, the particular ROM BIOS probably has a built-in
 387 emulator. Either turn off the emulator, or set the environment
 variable SET NO87=(some string).



 50. Thirty-Two-Bit Register Not Visible under OS/2

 Product Version(s): 2.20
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 23-NOV-1988    ArticleIdent: Q38375

 Thirty-two-bit registers are not viewable (using F2) under CVP even if
 you have an 80386-based machine. This is not a problem with CodeView;
 it is a limitation.

 Real mode CodeView (CV) DOES support viewing 32-bit registers. This
 is because of the unprotected and generally more flexible nature of
 DOS. Using the full 32-bits of the 80386 under OS/2 is considered
 hazard-prone and is not supported by CVP.



 51. CodeView Instruction Pointer Miscounts Very Long Lines

 Product Version(s): 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist2.20
 Last Modified:  1-DEC-1988    ArticleIdent: Q38382

 CodeView may display the "current instruction" highlight on the wrong
 line if the source file contains lines that are very long.

 The compiler counts the long lines as one line, but CodeView counts
 the very long lines as two lines. This makes the line number
 calculations incorrect and causes the "current line" highlight to
 appear on the wrong line. This problem does not occur if the source
 lines are less than 251 characters in length.

 Because the Microsoft Editor breaks lines that are longer than 250
 characters, this problem does not occur if you create and maintain
 your source files with the Microsoft Editor.

 Microsoft has confirmed this to be a problem in CodeView Version 2.20.
 We are researching this problem and will post new information as it
 becomes available.


 52. CodeView Requires PUBLIC to Trace MASM Program in Source Mode

 Product Version(s): 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER | H_MASM
 Last Modified:  3-MAY-1989    ArticleIdent: Q44006

 A MASM program that runs perfectly from a DOS prompt refuses to trace
 in source mode inside of CodeView. The program single-steps in
 assembly mode, but an attempt to trace into the code in source mode
 results in the program terminating upon reaching the first data
 declaration.

 In addition, the program does not come up in source mode when CodeView
 is started, but can be changed into source mode with "View" "Source".

 This problem happens when the code and data segments are not declared
 as "PUBLIC". The code is valid and executes perfectly inside of
 CodeView or from a DOS prompt. However, CodeView cannot follow the
 logic at a source level.

 A program constructed in the following manner exhibits the symptoms
 described above:

 TITLE    myprog

 StackSeg Segment STACK
 .
 .
 .
 DataSeg  Segment DATA
 .
 .
 .
 CodeSeg  Segment CODE
 .
 .
 .
 END      myprog

 However, if the following minor changes are made to the program, and
 the segments are declared as "PUBLIC", CodeView can trace through the
 program in source mode:

 TITLE    myprog

 StackSeg Segment STACK
 .
 .
 .
 DataSeg  Segment WORD PUBLIC 'DATA'
 .
 .
 .
 CodeSeg  Segment WORD PUBLIC 'CODE'
 .
 .
 .
 END      myprog


 53. Cannot Use /2 Switch on IBM PS/2 in CodeView

 Product Version(s): 2.10 2.20  2.30 | 2.20 2.30
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | SR# G881031-5515
 Last Modified:  9-AUG-1989    ArticleIdent: Q38865

 To use the /2 switch with CodeView, your computer must be equipped
 with a monochrome display (MDA) and a color display (CGA/EGA/VGA). The
 IBM PS/2 computers aren't currently configurable this way because they
 come with built-in VGAs or MDAs, but not both.

 If a hardware vendor starts selling MDAs that can be added to systems
 with built-in VGAs, this problem will be solved. An MDA card is
 needed that plugs into the PS/2 and works correctly in conjunction
 with the built-in VGA so that PS/2 owners can have a dual-monitor
 system.

 Currently, there is no solution to this debugging restriction other
 than using CodeView through the com port in sequential mode (/T) with
 a debugging terminal.


 54. CodeView Does Not Support Debugging Spawned Process

 Product Version(s): 2.20 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 26-FEB-1990    ArticleIdent: Q58653

 The following are several reasons why CodeView doesn't provide
 debugging support for spawned processes under DOS:

 1. DOS is not a multitasking operating system. CodeView cannot start
    another thread/process to watch the execution of the spawned
    process.

 2. DOS does not provide debugging support for the DOS BIOS calls (int
    21h). Since all spawn() and exec() functions under DOS have to go
    through the BIOS to run, CodeView cannot follow the spawned
    program.

 3. DOS only recognizes 640K of memory; therefore, there is
    insufficient memory to debug a large program, since both the parent
    and child processes have to reside in memory at the same time.


 55. Display Settings for Compaq Gas Plasma Screen

 Product Version(s): 1.00 2.10 2.20 | 2.20
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER |
 Last Modified:  6-DEC-1988    ArticleIdent: Q38866

 The default monitor settings for CodeView do not work properly with
 the Compaq gas plasma display adapter. Invoking CodeView with the /b
 switch corrects the problem.


 56. CodeView: Watchpoints and Tracepoints with Enumerated Types

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_c
 Last Modified: 28-MAR-1989    ArticleIdent: Q42601

 CodeView will not display the members of an enumerated type as they
 are declared in a C program. Only the integer representations of these
 types of variables can be shown. The following is an example:

 /*  Example enumerated type.
  */

 enum e_type
 {
     var1,
     var2,
     var3
 };

 enum e_type foo = var1;

 CodeView will not display "var1", "var2", or "var3" when watching a
 variable of type e_type, such as foo. CodeView will instead show the
 integer values of the variable: 0, 1, and 2, respectively. In order to
 watch the variable foo, you must explicitly display its value as an
 integer. The following command will add the proper watch:

     w? foo,d

 To set a watchpoint or a tracepoint on the same variable, further type
 casts must be made. These lines will produce watchpoints and
 tracepoints on foo, as follows:

     wp? *(int *)&foo == 1
     tp? *(int *)&foo

 Trying to set a watchpoint without the proper type cast will result in
 the following error:

     Operand types incorrect for this operation

 Setting a tracepoint on foo without this type cast will set the
 tracepoint but will only show "?CANNOT DISPLAY" in the watch window.
 Going through the right steps will display the current integer value
 of the variable, as it should.


 57. "?CANNOT DISPLAY" Error Not Documented in CodeView Documents

 Product Version(s): 2.00 2.10 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER | TAR64267 docerr
 Last Modified: 21-AUG-1989    ArticleIdent: Q24877

 Problem:

 When trying to evaluate (?), a function that returns void, I get the
 error "?CANNOT DISPLAY". I cannot find this error message in the
 "Microsoft CodeView Utilities and Editor" manual.

 Response:

 This error message is not contained in the CodeView manual.

 The "?CANNOT DISPLAY" error message will be displayed in cases where
 the expression evaluator cannot return a value, such as a function
 returning void.


 58. Watch Bytes (wb) Command Can Be Used to Watch a Buffer in HEX

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 17-JUL-1990    ArticleIdent: Q50224

 Question:

 Is there a way to keep tabs on the contents of a buffer via a watch
 command? We want to observe the contents of a 20-character buffer in
 HEX. The buffer is not necessarily null terminated.

 Response:

 The way to watch a buffer in CodeView in hexadecimal with the Watch
 command is to use Watch Bytes (wb) as follows:

    >wb *buffer L 10  ; this will watch the first 10 bytes of
                        buffer in HEX

 For the given example, you should follow the previous command with the
 following:

    >wb *(buffer + 10) L 10  ; this will watch the next 10
                               bytes in HEX.

 Please note that both the length specifier as well as the number 10
 used to offset the pointer in the second command are taken in the
 current radix. The example above assumes a radix of 10. You can
 explicitly specify the base of the number in hex as follows:

    >wb *buffer L 0x0a
    >wb *(buffer + 0x0a) L 0x0a

 For more information on the wb command in CodeView, see the "Microsoft
 CodeView and Utilities, Microsoft Editor, Mixed-Language Programming
 Guide" manual.


 59. Specifying Both /T and /W Disables Mouse

 Product Version(s): 2.20    | 2.20
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER |
 Last Modified:  6-DEC-1988    ArticleIdent: Q38867

 If you invoke CodeView with the following, the use of your mouse is
 disabled:

    CV /T /W program

 Don't specify the /T switch. Using /T with /W produces mutually
 exclusive modes of operation.


 60. Illegal Instruction in CodeView

 Product Version(s): 1.x 2.00 2.10 2.20 | 2.20
 Operating System:   MS-DOS             | OS/2
 Flags: ENDUSER | S_C h_fortran S_PASCAL
 Last Modified:  6-DEC-1988    ArticleIdent: Q38868

 Question:

 When I compile and link my C program and try to run it under CodeView,
 execution stops on the open curly brace of main. The view then goes to
 assembly, and the message "Illegal instruction" appears in the dialog
 window. Is there something wrong with the startup code?

 Response:

 This error can be produced when the main module of a program is
 compiled for one memory model and is then explicitly linked with a
 library for a different model. When the startup code is linked to the
 entry point of the program, different size instructions are used for
 the different memory models. If the program expects one size and the
 linker links in a different size, the startup instructions will be
 misinterpreted and result in this error.


 61. Entering Double Words at a Prompt Prevents Reloading Program

 Product Version(s): 2.20 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER| | S_C S_PASCAL H_FORTRAN H_MASM buglist2.30
 Last Modified: 30-NOV-1989    ArticleIdent: Q50410

 When using the Enter Double word (ED) command within the CodeView
 symbolic debugger and allowing the debugger to prompt, you will
 prevent the debugger from reloading your executable (using the L
 command). This problem occurs only when you allow the debugger to
 prompt you for the double word and you enter a double word.

 This problem can manifest itself in several ways, depending on the
 version and on other unpredictable circumstances. Symptoms of the
 problem include the following:

 1. Giving the message "No such file/directory"

 2. Giving the message "Arg list too long"

 3. Generating an internal debugger error 7

 Valid workarounds consist of entering words (not double words) at the
 prompt, or entering double words on the command line (without being
 prompted).

 Microsoft has confirmed this to be a problem with CodeView Version
 2.30. We are researching this problem and will post new information
 here as it becomes available.


 62. CodeView 2.20 Does Not Allow Routine.Variable Specification

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | S_PASCAL S_C H_FORTRAN H_MASM DOCERR
 Last Modified: 10-NOV-1989    ArticleIdent: Q50698

 On Pages 91-92 of the "CodeView and Utilities" manual that accompanied
 C 5.10 and Pascal 4.00 for CodeView Version 2.20, the period is
 documented as being useful as a specifier of local variables in parent
 functions. The syntax is stated to be as follows:

    routine_name.variable_name

 However, this feature was not implemented in Version 2.20 of CodeView.
 It was implemented in CodeView Version 2.30 (which accompanied FORTRAN
 5.00).

 This feature is useful in all languages, but particularly helpful in
 Pascal because of the "nested-scoping" (the ability of a function to
 access variables from the routine that called it) that occurs in
 Pascal.

 To use this feature in CodeView 2.30, you must be in either the
 routine where the variable is defined or in a routine that is a child
 (or grandchild, etc.) of that routine. After entering the proper
 routine, any variable name can be referenced with a routine and
 variable name (see example below).

 program first (input, output) ;
 var a: integer ;            { Available throughout the program }

     procedure second ;
     var b: integer ;        { Available in second and third }

         procedure third ;
         var c: integer ;    { Available in third }

         begin
             a := 3 ;
             b := 3 ;
             c := 3 ;
         end ;

     begin
         a := 2 ;
         b := 2 ;
         third ;
     end ;

 begin
     a := 1 ;                { Cannot watch second/third variables }
     second ;
 end.

 When in procedure third, you can place a watch on the variables in
 procedure second in the following manner:

 w? second.b

 This will display the variable in procedure second. This variable
 cannot be displayed from the main program, however.


 63. Using a Debugging Terminal with CodeView

 Product Version(s): 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 12-JAN-1989    ArticleIdent: Q39179

 It is possible to use either a dumb terminal or another machine (PC or
 Macintosh, running a communications package at 9600 baud) as a
 debugging terminal for CodeView. To take advantage of this option, do
 the following:

 1. Connect the second terminal to the com port (COM1 or COM2).

 2. Initialize the communications package to set up the
    second machine as a dumb terminal. Set the baud rate at
    9600.

 3. Start CodeView in either window or sequential mode.

 4. Redirect either the output ( >COM1 ) or both input and output
    ( =COM1 ) to the second terminal.

    If you redirect just the output to the second terminal, you will
    see the debugging output on the second terminal, and program output
    on the primary terminal. If you redirect input and output, you will
    also be able input program information (responses to prompts,
    input from the keyboard, etc.) on the primary terminal, and input
    CodeView information on the secondary terminal.

 5. Set your options and run the program.


 64. Pascal Version of CodeView Version 2.20

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | S_PasCal
 Last Modified: 14-AUG-1989    ArticleIdent: Q39181

 CodeView Version 2.20 is different for Pascal then the rest of the
 languages. The Pascal version of CodeView 2.20 is the only version
 that has the Pascal Expression Evaluator. The way you can determine
 whether you are running the Pascal version is that Pascal will appear
 under the Languages menu.

 If you have multiple Microsoft Languages, you do not have to keep
 multiple versions of CodeView on your system. CodeView Version 2.20 is
 compatible with all of our languages. However, there is one exception
 -- if you are using Microsoft Pascal, make sure you use the version
 that came with Pascal. It is the only version that has the Pascal
 Expression Evaluator and all of the other language evaluators.

 To check if the version you have is the Pascal version, invoke
 CodeView and pull down the Languages menu. If it lists Pascal in the
 menu, you are using the Pascal version that is compatible with all of
 the Microsoft languages.


 65. "." on the LIBPATH Eases DLL Debugging, But Not for CVP 2.20

 Product Version(s): 2.20 2.30
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 10-NOV-1989    ArticleIdent: Q50711

 When debugging OS/2 DLLs with protected mode CodeView (CVP), you must
 specify each DLL on the command line with an /L switch, and the DLL
 must be in the current directory as well as in a directory on the
 LIBPATH as set in CONFIG.SYS.

 For ease of debugging, if you put a period ("."), which means the
 current directory, as one of the directories on your LIBPATH, then a
 DLL in the current directory will also be on the LIBPATH and you won't
 need to have two copies of a DLL present on disk for debugging.

 This method only works for versions of CVP beginning with 2.30. CVP
 Version 2.20 will not recognize DLLs in a "." LIBPATH directory.

 If a copy of the DLL called by the program being debugged is not in
 the current working directory, you will not be able to trace into the
 DLL. If a copy of the DLL is not in a LIBPATH directory, CodeView will
 not be able to find the DLL. In this case, instead of coming up in the
 usual "debugging mode," CodeView immediately exits and returns to the
 command prompt after several seconds.

 Many DLL debugging problems arise from the fact that the copy of a DLL
 that is on the LIBPATH may be inadvertently out of date compared to
 the version in the current directory that is being used for debugging.
 By putting a period on the LIBPATH, the current directory becomes a
 LIBPATH directory and only one copy of the DLL needs to exist, thus
 eliminating any DLL update inconsistencies.


 66. CodeView Trace Skips Statement Following Switch Statement

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist2.20 buglist2.30
 Last Modified:  7-MAR-1990    ArticleIdent: Q59315

 CodeView incorrectly maps assembly level instructions to source code
 in the first statement following a switch statement with seven or more
 cases.

 As shown in the code sample below, the statement following the switch
 is executed correctly, but CodeView steps over the statement while
 tracing in source mode. In mixed source and assembly mode, the
 statement following the switch may be traced into.

 Sample Code
 -----------

 # include<stdio.h>

 void main(void)
 {

    short tag, marker;

    marker = 0;
    tag = 5;

    switch(tag){
       case 1:
          break;
       case 2:
          break;
       case 3:
          break;
       case 4:
          break;
       case 5:
          break;
       case 6:
          break;
       case 7:
          break;
       default:
          break;
    }

       marker = 2;

 }


 67. Using CodeView to Create Disassembled Program Listings

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 12-APR-1990    ArticleIdent: Q51323

 The following steps can be used to create an assembly listing of a
 program with CodeView:

 1. Begin CodeView in sequential mode by using the /T command-line
    switch.

 2. Specify a listing file to redirect CodeView output to by typing the
    redirection operator ">" followed by a filename at the dialog
    prompt. You may redirect the output directly to a printer by
    specifying the printer after the ">" (e.g., >PRN).

    (Note: From this point on, commands will not be viewable.)

 3. Use the Unassemble command "U" to disassemble the code and send a
    listing of the program to the output file. If you do not specify
    the starting address and the range to unassemble, CodeView will
    unassemble the next eight lines of code. See the CodeView
    documentation for more information on the Unassemble command.

 You can use this method on any files, whether or not they contain
 CodeView information. In this regard, you can create assembly listings
 of programs that were not created with a Microsoft compiler. Please
 also note that you cannot create assembly listings of instructions
 other than 8086 instructions.


 68. Debugging DLLs with Codeview

 Product Version(s): 2.20 2.30
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 18-DEC-1989    ArticleIdent: Q51764

 To debug most DLLs (Dynamic Link Libraries) in CodeView, CVP
 (protected mode CodeView) Version 2.20 or later is required. For DLLs
 loaded via DosLoadModule(), CVP Version 2.30 or later is required.

 Invoke CodeView with the /L switch as follows:

    cvp /L dll1name /L dll2name main.exe

 Make sure that each DLL you want to trace into is specified by the /L
 option.

 CodeView cannot debug DLLs that have either IOPL or EXECUTEONLY
 specified with the CODE directive in the associated definition (.DEF)
 file. For DLLs that require these controls, the Kernel Debugger
 supplied with the SDK is required.

 Note: With CVP 2.30, pathnames cannot be specified for DLLs;
 therefore, the DLL must reside in the current directory. For more
 information, query on the following:

     CODEVIEW DLL LIBPATH


 69. Debugging Bound Applications

 Product Version(s): 1.00 1.10 2.00 2.10 2.20 | 1.11 2.02.02 2.20 2.30
 Operating System:   MS-DOS                   | OS/2
 Flags: ENDUSER | TAR63888
 Last Modified: 14-AUG-1989    ArticleIdent: Q25219

 CodeView does not support the debugging of bound applications in real
 mode. However, CVP in protected mode will allow you to debug such
 applications.


 70. No Symbolic Information Generated for Pascal Units

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_pascal
 Last Modified: 12-JAN-1989    ArticleIdent: Q39811

 The Microsoft Pascal Compiler Version 4.00 generates no symbolic
 debugging information for Pascal Units. As a result, when tracing
 through a Pascal program Unit, attempting to access any local
 variables by using trace/watchpoints, dumps, examines, etc. yields a
 "symbol unknown" error.

 The only workaround is to transform the program Units into Modules.


 71. "Internal Debugger Error: 0" When Watching Structure Members

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist2.30 cv
 Last Modified: 29-DEC-1989    ArticleIdent: Q51834

 When watching a member of a structure using the "w?" or "?" commands,
 it is possible to get the message "internal debugger error: 0". When
 this happens, the only way to view the contents of the member is to
 use the "D" or "??" commands.

 Code Example
 ------------

 typedef struct {
    char *(*instruction)[];
    } *structype;

 structype mac;

 void main (void)
 {
 }

 If you set a watch on an element of the structure variable in the
 above program such as "w? mac->instruction[0]" (without the quotation
 marks) you'll get the message "internal debugger error: 0." Use the
 dump command "D" or the special "??" structure viewing command to look
 at the contents of the member.

 Microsoft has confirmed this to be a problem in CodeView Version 2.30.
 We are researching this problem and will post new information here as
 it becomes available.


 72. Incorrect Error Generated for Very Small COM Files

 Product Version(s): 2.00 2.10 2.20 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR65183 buglist2.00
 Last Modified: 21-AUG-1989    ArticleIdent: Q25365

 Problem:

 If my COM file is less than 8 bytes long and I try to load it into
 CodeView, I get the error message "Invalid executable file format -
 please relink."

 Response:

 This problem occurs only on COM files less than 8 bytes in length.

 Microsoft has confirmed this to be a problem with CodeView Version
 2.00. We are researching this problem and will post new information as
 it becomes available.


 73. Dual-Monitor Setup Requires 8-Bit Data Paths for Both Monitors

 Product Version(s): 1.00 2.00 2.10 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS                   | OS/2
 Flags: ENDUSER | s_c s_pascal h_fortran h_masm b_basiccom
 Last Modified: 21-MAR-1990    ArticleIdent: Q51870

 When writing to a system that has a dual-monitor setup, you must make
 sure that both the monochrome monitor and the color monitor are using
 an 8-bit data path. In any dual-monitor write scheme, both display
 cards must be configured to write to a common data path (either both
 8-bit or both 16-bit mode). Today's monochrome adapters use 8-bit
 paths exclusively.

 Most display cards that use a 16-bit mode can autosense whether they
 are being written to in a dual-monitor mode, but some cards, such as
 the ATI VGA Wonder card, do not sense for this situation; therefore,
 you must set the card to an 8-bit path manually.

 If you are using dual monitors and you experience strange behavior
 such as garbage or blinking characters on the monochrome screen, make
 sure that your 16-bit video card is running in 8-bit mode.

 The most common use for a dual-monitor setup is for debugging graphics
 applications in CodeView.


 74. Retrieving Previously Entered Commands

 Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS                        | OS/2
 Flags: ENDUSER | TAR65921
 Last Modified: 14-AUG-1989    ArticleIdent: Q25539

 Question:

 Is there a method to retrieve commands after typing them in once? For
 instance, if I type "d some_data_area l 40", I would like to retrieve
 the command without having to retype it. A suggested method would be
 to allow the user to scroll on the command, then press a key to make
 the command active.

 Response:

 The only way to retrieve commands is to highlight them with the mouse
 and press the INS key. This method inserts the command into the
 command line. We are considering making an easier way to scroll
 through the commands and may implement it in a future version.


 75. system() Call May Cause CodeView to Terminate Process

 Product Version(s): 2.20 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist2.20 buglist2.30
 Last Modified: 22-JAN-1990    ArticleIdent: Q57867

 Using real-mode CodeView to trace over the system() run-time function
 will cause the debugger to terminate the parent process upon return
 from the child process in certain situations where the child does a
 multiple directory-level traversal.

 Instead of tracing, use the "Go" Command (F5) to run past the system()
 call. This procedure allows the program to run to completion.

 The program below demonstrates this problem, but it requires that
 TREE.COM be somewhere in the path. Compile the code with the /Zi and
 /Od options and use CodeView to trace into the program, using F8.
 After TREE.COM executes, CodeView will display the "Program terminated
 normally" message, preventing the last printf() from being executed.

 Microsoft has confirmed this to be a problem with CodeView Versions
 2.20 and 2.30. We are researching this problem and will post new
 information here as it becomes available.

 Code Example
 ------------

 #include <process.h>
 #include <stdio.h>

 void main (void)
 {
         printf ("This is the beginning of the program\n");
         printf ("Calling TREE.COM\n");
         system ("tree");

         /* This line will never be executed */
         printf ("Back from spawn\n");
 }


 76. CodeView Versions 2.10 to 2.30 Use Four Extra File Handles

 Product Version(s): 2.30 2.20 2.10 2.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-JAN-1990    ArticleIdent: Q25950

 Problem:

 CodeView Versions 2.00 to 2.30 seem to be using four additional file
 handles. The following program attempts to open 20 files, reporting
 its success or failure after each attempt:

     #include <stdio.h>
     #include <string.h>
     #include <stdlib.h>

     main()
     {
             FILE *streams[20];
             int i;
             char buffer[12];
             char *p;

             for (i = 0; i < 20; i++) {
                     p = itoa(i, buffer, 10);
                     p = strcat(buffer, ".dat");
                     streams[i] = fopen(buffer, "w+");
                     printf("streams[%d] = %d\n", i, streams[i]);
             }
     }

 Running outside of CodeView, the call to fopen() fails after 15
 streams have been opened. Running in CodeView Versions 1.x, the call
 fails after 15 files have been opened. However, in CodeView Versions
 2.00 to 2.30, it fails after 11 file handles have been opened.

 Response:

 CodeView Versions 2.00 to 2.30 require four file handles for their own
 use. Remember that MS-DOS itself has five preopened file handles. If
 you want to open more than 15 files, follow the steps specified in the
 C Version 5.10 README.DOC to modify the C start-up code to allow
 opening more than 20 files.


 77. Copying Text from Display Window to Dialog Window

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 12-JAN-1989    ArticleIdent: Q40110

 Question:

 Is it possible to copy text from the display window down to the dialog
 window to use at the command line in Microsoft CodeView?

 Response:

 Yes, if you have a mouse. You can highlight with the mouse the section
 of text you would like to copy and press the INSERT key. The
 highlighted text will appear in the dialog box.

 This is very useful if you have very long variable names that you want
 to watch and don't want to retype the long variable name each time.
 Simply type a w? on the command line, then highlight the variable name
 with the mouse and press the INSERT key.

 Strange behavior can occur if you use the SHIFT key in combination
 with the INSERT key. For example, if you use the INSERT key on the
 extended keyboard along with the SHIFT key, it works the same as using
 INSERT alone. However, if you turn NUM LOCK off on the keypad so you
 can you the INSERT key with the SHIFT key, you will get a zero instead
 of the string of text. To get the string of text, you have to turn NUM
 LOCK on. This seems backwards because with NUM LOCK on you would
 expect to get a zero, but you get the text.

 The workaround is not to use the SHIFT key in conjunction with the
 INSERT key. INSERT alone works correctly.


 78. OS2PATCH for CVP Not Needed in OS/2 Version 1.10.

 Product Version(s): 2.20 2.30
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 14-NOV-1988    ArticleIdent: Q30976

    The OS2PATCH supplied with CodeView (protected) Versions 2.20 and
 2.30 allows you to use command 7 on machines with math coprocessors.
 This patch works only with OS/2 Version 1.00. The PTRACE feature was
 updated in Version 1.10, so this patch is not needed in OS/2 Version
 1.10.
    This patch only works on IBMs version of OS/2 1.00.  If they have
 a different version have them talk to the people who they received
 OS/2 from.  If it was from us then they need to systems languages
 support.
    Please refer to the file OS2PATCH.DOC for more information.



 79. I/O Redirection Under CV Not Supported Prior to Version 2.30

 Product Version(s): 1.x 2.10 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS             | OS/2
 Flags: ENDUSER |
 Last Modified: 23-JAN-1990    ArticleIdent: Q57870
 In versions of CodeView earlier than Version 2.30, it was not possible
 to redirect the input or output of the program being debugged. For
 example, a "filter" program that takes input from a file specified by
 the input redirection operator ("<") is hindered by this limitation
 under pre-2.30 CodeView because there is no way to specify that you
 want the redirection to apply to the application rather than to
 CodeView itself.

 In CodeView (CV) or protected-mode CodeView (CVP) Version 2.30,
 redirection on the command line following the program name is directed
 to the program being debugged. For example, invoking CodeView 2.30
 with the following command line

    CV test < test.dat

 causes all input to the program TEST.EXE to be read from the file
 TEST.DAT.

 Redirecting I/O to CodeView itself is useful for involved debugging
 sessions where many CodeView dialog commands can be put into a
 separate text file that is automatically read by CodeView during
 debugging. For instance, this method will allow a complicated
 debugging scenario to be accurately repeated any number of times.
 Prior to CV and CVP 2.30, this was the only type of redirection
 supported while debugging.

 Starting with CodeView 2.30, you can redirect I/O to both the
 application being debugged and to CodeView. The CodeView redirection
 is done with the /C command-line option, or from within CV itself with
 the redirection dialog commands ("<" and ">"). Since the /C switch
 allows you to specify CV dialog commands on the command line, you can
 specify the redirection at this point. For example, the following
 command line

    CV "/C<cv.dat" test < test.dat

 brings up CodeView with TEST.EXE as in the example above (with the
 TEST.EXE input coming from TEST.DAT), but this time CodeView also
 reads the debugging instructions to perform from the file CV.DAT.


 80. /2 and /O Switches Not Compatible

 Product Version(s): 2.30
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified:  9-NOV-1988    ArticleIdent: Q30978

    The UTILITY.DOC states that the /O switch is not compatible with
 the /2 switch. However, the SDK Installation Notes file uses the
 following code as the example of how to debug child processes:

     cvp /2 /O <program> <program arguments>

    This file recommends that the /2 switch be used when debugging PM
 applications. The UTILITY.DOC file is correct. You cannot use the /2
 and /O switches at the same time.


 81. CVP Prompts "SYS0197 OS/2 Not Configured..." Error Message

 Product Version(s): 2.20
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified:  9-NOV-1988    ArticleIdent: Q31658

    When loading CodeView protected mode (CVP), the "SYS0197 OS/2 not
 configured to run this application" error message may appear. A
 request for help on 0197 prompts the "requires input/output privilege"
 message. You need to set IOPL=YES in CONFIG.SYS to run CVP.

    The following information is from the section titled "Microsoft(R)
 CodeView(R) Debugger" of the Microsoft C Version 5.10 UTILITY.DOC
 file, the FORTRAN Version 4.10 CVREADME.DOC file, and the Microsoft
 Macro Assembler Version 5.10 README.DOC file.

 CONFIG.SYS Setting for CVP
    To run the protected-mode CodeView debugger (CVP.EXE), you must
 have the following line in your CONFIG.SYS file:

    IOPL=YES



 82. Methods for Debugging Large Programs within the 640K DOS Limit

 Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 12-FEB-1990    ArticleIdent: Q57941
 Because of the 640K limit under DOS, it is common to run out of memory
 when trying to debug large programs with CodeView. CodeView requires
 over 200K of RAM, not including the program being debugged. In
 addition, the symbolic information added by compiling with the /Zi
 switch greatly increases the executable size of the program you are
 trying to debug.

 The following is a list of the possible ways of getting around the
 limited memory problems for debugging:

 1. Include full symbolic information only in those modules that
    contain source code that you are currently trying to debug. In
    other words, compile only those modules with the /Zi switch. For
    the other modules, compile with the /Zd option, to put only line
    number information in the object files.

 2. Use overlays to swap parts of your code in and out, even if it is
    just during the development process. You can always link without
    overlays once your application is debugged.

 3. If you have expanded memory, use it by invoking CodeView with the
    /E switch. To work properly with CodeView, you should have LIM EMS
    3.2 or (preferably) 4.0. Expanded memory is used for storing the
    symbolic information, which can be a great percentage of your .EXE
    size.

 4. Use the CVPACK utility, which is documented in the Update Section
    of the C 5.1 "Microsoft CodeView and Utilities Software Development
    Tools for MS OS/2 and MS-DOS Operating Systems Update" manual.
    CVPACK will compress the debug information in the file by removing
    duplicate references. Use the /p option to achieve maximum
    compression.

 In trying to obtain a workable solution, you can use any combination
 of the above methods. If adequate debugging is still impossible, then
 you might look into the following possibilities:

 5. Switch to the OS/2 operating system. This may be limited as far as
    how much real mode program debugging you can do, depending on how
    compatible your application is with protected mode requirements.

 6. You might look into MagicCV from Nu-Mega Technologies of New
    Hampshire. MagicCV requires a 386-based computer because it uses
    virtual-86 mode of the processor to run CodeView in extended
    memory. This method reportedly allows CodeView to use only about 8K
    of conventional DOS memory. It should be noted that Microsoft does
    not endorse MagicCV or make any claims as to its usage. The
    information is offered only as a potential option. Nu-Mega can be
    reached at (603) 888-2386.


 83. Problems with CodeView and Logitech Mouse with Older Drivers

 Product Version(s): 2.00 2.10 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 23-JAN-1990    ArticleIdent: Q31918

 Incompatibility problems have been reported with Logitech's mouse and
 CodeView. Some of the problems encountered are as follows:

 1. The Logitech mouse fails to function correctly with CodeView
    Version 2.20 when in 43-line mode. The characters within
    highlighted cells are incorrect until they are unhighlighted.

 2. When in either 43-line or 25-line mode, garbage characters are
    occasionally found at the DOS prompt following an exit from
    CodeView.

 The problems seem to be with Versions 3.20 and earlier of the Logitech
 mouse driver. An update of the mouse driver is available that corrects
 these problems. Logitech can be reached at (415) 795-0427. Logitech
 also has a bulletin board service, which may contain the latest driver
 and can be reached at (415) 795-0408.

 A Microsoft Mouse or 100 percent Microsoft-compatible mouse is
 required for use with CodeView. In addition, you must use Microsoft's
 mouse driver Version 6.00 or later, or a driver that exactly emulates
 these Microsoft drivers.


 84. Using the T Command to Echo CodeView Output

 Product Version(s): 2.00 2.10 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 16-NOV-1988    ArticleIdent: Q31919

    To generate and record a history of the source lines stepped
 through in the course of a debugging session, do the following:

    1. Start CodeView in sequential mode using the /T option.
    2. While in sequential mode, enter the Redirect Output (>) command,
 followed by a filename. If no filename is specified, then stdout will
 be assumed.
    3. If you wish to view the output as it is redirected, precede the
 redirection operator with the echo command (T).
    4. If a second redirection operator is specified, the redirection
 file is appended to rather than truncated before output.

    For more information on output redirection, refer to the "System
 Commands" section of the "Microsoft CodeView and Utilities" manual.

    The following example demonstrates this process:

 CV> T > log.dat  or T >> log.dat
 CV> t
 CV> t
 CV> t
 CV> .
 CV> .
 CV> .
 CV> q

    The lines traced will be written both to the console and to the log
 file.


 85. CHAIN Statement in Compiled BASIC Not Supported by CodeView

 Product Version(s): 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER | B_QuickBas B_BasicCom
 Last Modified: 16-NOV-1988    ArticleIdent: Q32265

    In Microsoft CodeView, when debugging compiled BASIC programs that
 CHAIN, you can view only the first program executed (the one given in
 the CV command line). The modules that are CHAINed-to cannot be viewed
 or stepped through, and their variables cannot be looked at, even if
 these modules are successfully executed. In fact, you cannot gain any
 information about the CHAINed modules, other than whether or not they
 execute correctly, unless you execute them separately in CodeView.
    This information applies to QuickBASIC Versions 4.00 and 4.00b,
 and the Microsoft BASIC Compiler Version 6.00 for MS-DOS and OS/2.



 86. CodeView Cannot Debug Source Code in Include Files

 Product Version(s): 1.00 1.10 1.11 2.00 2.02.02 2.10 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  9-NOV-1988    ArticleIdent: Q34922

 CodeView cannot debug source code in include files. This information
 is documented on Page 7 of the "Microsoft CodeView and Utilities"
 manual. The explanation for the restriction on include files says "You
 will not be able to use the CodeView debugger to debug source code in
 include files."

 This information means programs with include files that contain
 executable statements cannot be debugged with CodeView.

 The usual symptom of this problem is that after tracing or otherwise
 trying to execute your program, you will be viewing one of your
 include files instead of your normal source code. Repeated attempts
 to view the main or other source files will result in viewing the
 include file again.

 This is program design for the product. Microsoft's compilers do not
 generate symbolic information for code in include files. As a result,
 CodeView is confused by the discrepancies, and the subsequent behavior
 is unpredictable. Include files only can contain prototypes,
 declarations, #defines or #includes, etc.

 (Note that these items are all "nonexecutable" statements )

 Although it is valid C code, include files must not contain
 initializations or function definitions or other executable statements
 for CodeView to be able to debug your programs properly.


 87. No Symbolic Information Generated for Pascal Units

 Product Version(s): 2.10 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER | s_pascal
 Last Modified:  8-MAR-1990    ArticleIdent: Q57943

 The Microsoft Pascal Compiler Version 4.00 does not generate symbolic
 debugging information for Pascal units. As a result, when tracing
 through a Pascal program unit, any attempt to access local variables
 by using trace/watchpoints, dumps, examines, etc. yields a "symbol
 unknown" error.

 The only workaround is to transform the program units into modules.


 88. CVP Accessing I/O Ports

 Product Version(s): 2.20 2.30
 Operating System:   OS/2
 Flags: ENDUSER | buglist2.20 buglist2.30
 Last Modified: 14-AUG-1989    ArticleIdent: Q36885

 In the "Microsoft CodeView and Utilities Software Development Tools
 for the MS-DOS Operating System," Sections 6.6 and 10.5 discuss the
 Port Input and Port Output commands respectively. These commands
 function correctly in CV under MS-DOS. However, CVP under OS/2
 generates a protection violation when trying to access a port. The
 port input and output commands do not function in CVP Version 2.20
 under OS/2.

 Microsoft has confirmed this to be a problem in Version 2.20. We are
 researching this problem and will post new information as it becomes
 available.


 89. Using CodeView to Examine FORTRAN Arrays

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 14-AUG-1989    ArticleIdent: Q37548

 Question:

 I have allocated memory for a three-dimensional array in FORTRAN. How
 can I examine the contents of a row using CodeView?

 Response:

 You can use CodeView to display a single element of the array using
 ?arrayname(x,x,x), where "arrayname" consists of the first six
 characters of the array name and "(x,x,x)" must be a valid cell in the
 array.

 There is no way to display more than one cell of the array using this
 command. To display many cells, you must do a memory dump of the
 addresses where the array is stored. Use the examine command (X) to
 get the starting address of the array, and dump (D) to dump the
 elements.

 FORTRAN stores array elements in column-major order. Use the following
 formula to determine the address where any cell (i,j,k) is stored,
 where Max_Row is the maximum i possible and Max_Col is the maximum j
 possible:

     MemAddr = start_addr+(size of elements)*
                      (Max_Row((k-1)(Max_Col)+(j-1))+(i-1))

 "Size of elements" is the number of bytes of each element in the
 array.


 90. CodeView Unexpectedly Exits to DOS

 Product Version(s): 2.10 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  8-APR-1990    ArticleIdent: Q37566

 When debugging a program with CodeView, certain operations cause it to
 exit to DOS without giving any warning or error message. Some of the
 things that cause this behavior are trying to access help, setting a
 watch variable, and returning from a DOS shell.

 This problem occurs because not enough file handles are being
 allocated at boot time with "files=XX" in CONFIG.SYS. An error message
 is printed, but then over written before most people can see it.

 The solution is to make sure files are set to 20 in CONFIG.SYS.


 91. How CodeView Handles DosExitList Routines

 Product Version(s): 2.20
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 12-JAN-1989    ArticleIdent: Q40270

 Question:

 CodeView does not seem to be executing my DosExitList. What should I
 do to execute the exit list?

 Response:

 If you are in your program and issue the GO command, your program
 executes to the end of your application, giving the message "Thread
 terminated normally." At this point, you can use the GO command or
 trace into your exit routine. However, if you would like to quit your
 program and go to your exit handler in the middle of executing your
 program, you have two choices.

 When you quit CodeView ("q"), your code including your DosExitList
 will not be executed. The first method to execute your DosExitList is
 the safest, but you are not able to trace through your exit routine.
 When you want to exit, type the following:

    ? myexithandler()

 This command executes the function "myexithandler", which is your
 DosExitList routine. After this command has been performed, you can
 quit CodeView ("q") because all of your cleanup has been accomplished.

 The second method, which is less reliable, is to modify the instruction
 pointer (IP) so that you can effectively jump to the end of your
 program. Before you do this, make certain that you are not in a
 subfunction. If you are not in main(), jumping to the end of the
 program causes problems with the stack. While in your main() routine,
 enter the following at the CodeView command line, where XXXX is the
 value of the IP when you are at the last curly brace at the end of
 your program:

    R IP XXXX

 This command causes a jump to the last curly brace; you can step
 through your program from there. This method allows you to step
 through your exit routine, but it is a little more risky.


 92. You Cannot Display Past Column 71 in CodeView

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 20-JAN-1989    ArticleIdent: Q40428

 Can I view my code beyond column 71 in CodeView like I can in the
 Microsoft editor?

 In CodeView Version 2.20, you cannot scroll your code to the right.
 You should either rewrite the source code or, if you used tabs in the
 source code, reduce the tab size with the # dialog command, as
 described on Page 240 of the "Microsoft CodeView and Utilities"
 manual.



 93. Display Command Returns Incorrect Result for FORTRAN Function

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist2.20 buglist2.30
 Last Modified: 14-AUG-1989    ArticleIdent: Q40586

 The display command does not return correct values for the
 user-defined FORTRAN real functions in Microsoft CodeView.

 The display command calls integer functions and returns correct
 results.

 Microsoft has confirmed this to be a problem in Version 2.20. We are
 researching this problem and will post new information as it becomes
 available.

 The display command is discussed in Chapter 6 of the "Microsoft
 CodeView and Utilities" manual. The valid FORTRAN expressions for
 CodeView are discussed in the Chapter 4 of the same manual.


 94. CodeView Does Not Work with Grouped Code Segments

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | H_MASM
 Last Modified:  9-FEB-1989    ArticleIdent: Q40784

 When using MASM it is possible to associate various segments into a
 group; DGROUP is an example of this technique. Grouped data or stack
 segments do not affect CodeView, but CodeView does not recognize
 grouped code segments. The program will execute correctly under
 CodeView, but none of the CodeView functions will be available on the
 second and subsequent segments in the code group.

 The following code segment illustrates this behavior:

 codegroup  GROUP ASEG,BSEG
         assume cs:codegroup

 ASEG    SEGMENT WORD PUBLIC 'CODE'
 A:
         mov ax,1
         mov ax,1
         JMP B
 ASEG    ends

 ;   Will not be able to single step through this section
 BSEG    SEGMENT WORD PUBLIC 'CODE'
 B:      mov ax,1
         mov ax,1
         mov ax,1
         int 21h
 BSEG    ends
         end A

 Once the program executes into the BSEG segment, all CodeView
 functionality will be lost. You cannot set any breakpoints or single
 step through the BSEG segment of code. It appears that CodeView does
 not store any symbolic information for the BSEG segment. Any attempt
 to single step through this section of code will result in CodeView
 executing the BSEG segment of code until the program is completed.

 Microsoft is researching this problem and will post new information as
 it becomes available.


 95. CodeView and Video Pages

 Product Version(s): 2.00 2.10 2.20 | 2.20
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER |
 Last Modified:  2-MAR-1989    ArticleIdent: Q41101

 Question:

 Is there anyway to specify which video page CodeView uses? I have an
 application that uses video page one; I am not able to use CodeView
 with it because CodeView also uses video page one.

 Response:

 CodeView does not allow you to specify which video page it will use.
 As a result, any application that uses video page one conflicts with
 CodeView and the screen becomes corrupted.

 The recommend work around in this situation is to use the two monitor
 option for CodeView. This option allows CodeView to send the
 application's output to one screen while using the first screen for
 its own output.

 Another less desirable workaround would be to avoid the use of video
 page one in programs that will be used under CodeView.



 96. Removing CodeView Information from .LIBs and .EXEs

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | SR# G890207-11424
 Last Modified:  2-MAR-1989    ArticleIdent: Q41371

 Question:

 Is there a way to remove CodeView symbols from a .LIB or .EXE file?

 Response:

 Although there is no utility that removes CodeView information from
 libraries, EXEPACK will remove CodeView information from .EXE files in
 the course of packing them. You can also remove information from an
 .EXE file by relinking it without the /CODEVIEW option.

 The only way to remove CodeView information from a library is to
 recompile the source modules and use the LIB utility to rebuild the
 library.


 97. CodeView: Debugging Presentation Manager Printer Drivers

 Product Version(s): 2.20 2.30
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 28-MAR-1989    ArticleIdent: Q42780

 To debug OS/2 Presentation Manager (PM) printer drivers, you must use
 the kernel debugger. Currently, PM printer drivers fall under the same
 category as lower-level device drivers. These device drivers cannot be
 debugged using the current version of CodeView.


 98. Dump Command on Arrays in FORTRAN Gives Syntax Error

 Product Version(s): 1.10 2.20 | 2.20
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | H_FORTRAN buglist2.20 buglist2.30
 Last Modified: 21-AUG-1989    ArticleIdent: Q42942

 Microsoft CodeView Versions 2.20 and 2.30 gives a "Syntax error" when
 attempting to use the Dump command on an array of dimension greater
 than 1.

 For example, issuing the DI i(1,3) command to dump the contents of an
 array element fails.

 To work around this problem use one of the following methods:

 1. Use the "?" command, as follows:

       ? i(1,3)

 2. Enclose each dimension index within parentheses and omit the comma,
    as follows:

       DI i((1)(3))

    DI i(1(3)) and DI i((1)3) are also acceptable.

    A three dimensional example would look like the following:

       DI j(1(2)3)

    Any permutation of the parenthesis around the index is sufficient.

 Microsoft has confirmed this to be a problem in Versions 2.20 and
 2.30. We are researching this problem and will post new information as
 it becomes available.


 99. CodeView Protect: /43 Switch Doesn't Work on VGA Adapters

 Product Version(s): 2.20
 Operating System:   OS/2
 Flags: ENDUSER | buglist2.20
 Last Modified: 18-APR-1989    ArticleIdent: Q43043

 The /43 switch for CodeView, used to debug in 43 line mode, is ignored
 when a VGA video adapter is being used under OS/2. This switch works
 properly as documented in DOS, or when an EGA adapter is being used.
 The /50 switch, used to debug in 50 line mode, also works properly as
 documented.

 If you wish to use CodeView Version 2.20 in 43 line mode under OS/2,
 the MODE command can be used first to set the entire screen group into
 43 line mode. Using MODE 80,43 at the OS/2 prompt will accomplish this
 result. Starting CodeView without any switches will then cause it to
 use the current video mode.

 Microsoft has confirmed this to be a problem in CodeView Protect
 Version 2.20. This feature is under review and will be considered for
 inclusion in a future release.


 100. CV: K Command in Secondary Module Sets Breakpoints in Main

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist2.20
 Last Modified:  6-APR-1989    ArticleIdent: Q43170

 In some cases the K (call stack) command will cause CodeView to become
 uncertain as to where to set breakpoints.

 If an attempt to set a breakpoint is made in a module of a
 multi-module program immediately after using the K command then the
 breakpoint will be set in the module containing main() instead of in
 the current module.

 If the corresponding line in the first module is not an executable
 line then CodeView will issue the expected beep to indicate that the
 breakpoint could not be set.

 If the corresponding line is an executable line then there will be no
 indication at all that the breakpoint has been set until that module
 is again in view. At that point the breakpoint will be highlighted as
 usual. This behavior will occur in any module accessed after the one
 containing main().

 Breakpoints will be set properly after using the K command if any
 stepping is performed, the view is changed, or the Calls menu is
 accessed.

 Microsoft is researching this problem and will post new information as
 it becomes available.


 101. Vertical Scroll Inactive with MODE CO40 and Dual Monitors

 Product Version(s): 2.x
 Operating System:   MS-DOS
 Flags: ENDUSER | S_C buglist2.20
 Last Modified: 18-APR-1989    ArticleIdent: Q43260

 While debugging a program using Microsoft CodeView and dual monitors,
 the vertical scroll bar is disabled when the video mode is set to
 40-line color text. This occurs if the mode is set either at the
 command line

    MODE CO40

 or from within a program as follows:

    _setvideomode(_TEXTC40);

 The scroll bar remains inactive until the mode is changed. This
 problem does not occur on a single monitor system or in any other
 video modes.

 Microsoft has confirmed this to be a problem in Version 2.20. We are
 researching the problem and will post new information as it becomes
 available.

 The following program demonstrates the problem:

 #include <graph.h>

 void main (void)
 {
   _setvideomode(_TEXTC40);
   _setvideomode(DEFAULTMODE);
 }



 102. Selecting Text for Use with Commands

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | docerr insert
 Last Modified:  9-APR-1990    ArticleIdent: Q59408

 In CodeView Versions 2.20 and 2.30, you supposedly can press the left
 mouse button to highlight the command to be copied, and then press the
 INS key to copy the command. However, this method works only with the
 mouse and not with the keyboard.

 On Page 64 of the "Microsoft FORTRAN CodeView and Utilities User's
 Guide" Version 5.0 manual, it incorrectly states that you can copy any
 text that appears in any window. This is incorrect because you can
 only copy text in the command window.


 103. CodeView: View Command Fails with Underscore in Filenames

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist2.20
 Last Modified:  3-MAY-1989    ArticleIdent: Q43508

 Assume that two source files, MAINPROG.C and FILE_NAM.C, have been
 compiled with CodeView information. The main function in MAINPROG.C
 calls a function in FILE_NAM.C.

 When the following command is executed in CodeView, CodeView responds
 with "syntax error":

    V.FILE_NAM.C

 When FILE_NAM.C is renamed and recompiled as FILENAM.C, the following
 command works properly, and the source code in FILENAM.C is displayed:

    V.FILENAM.C

 Attempts to open a file with an underscore character will work
 correctly through the "Open" menu in CodeView, but will fail with the
 View command.

 Microsoft has confirmed this to be a problem in Version 2.20. We are
 researching this problem and will post new information as it becomes
 available.


 104. Cannot Set Breakpoint on an Executable Line with CodeView 3.00

 Product Version(s): 3.00   | 3.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 19-APR-1990    ArticleIdent: Q60338

 If you cannot set a breakpoint on a particular line of code, make sure
 you have used the -Zi and -Od options to create executable code that
 has full CodeView debugging capabilities.

 Some code in the executable is concatenated if the -Od option is not
 used.

 Sample Code
 -----------

 #include <stdio.h>

 int foo();

 void main (void)
 {
    int a,b,c;

    a = foo();/* this line would be concatenated into the next */
    b = a + c;/* line to look like b=(a=foo())+c.              */
 }

 int foo()
 {
    return(10);
 }


 105. Commands Invoked with "?" Command Must Be Compiled with /Zi

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  3-MAY-1989    ArticleIdent: Q43556

 Invoking C functions in CodeView using the "?" command works as
 expected as long as the function is contained in a module that was
 compiled with /Zi for the CodeView information. However, if you invoke
 a run-time library function, CodeView returns the error message
 "syntax error."

 The reason for the error message is that the module containing the
 library function is not compiled with the CodeView option /Zi. The
 error message is not dependent on the fact that the function is in the
 library rather than being user-defined. If a user-defined function is
 contained in a module that is compiled without /Zi for the CodeView
 information and you try to invoke it with the "?" command, CodeView
 will return the same error message.

 The "?" command is formally referred to in the CodeView Utilities
 menu as the Display Expression command.


 106. CodeView May Single Step onto a Comment Line

 Product Version(s): 2.20   | 2.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist2.20
 Last Modified:  2-JUN-1989    ArticleIdent: Q43601

 When using CodeView to single step the following program, the current
 execution line will be put on the first comment line. CodeView should
 always skip over the comment line.

 The program is compiled as required for running in CodeView. The
 compiling command used could be the following:

    cl /Zi /Od test.c

 Microsoft has confirmed this to be a problem with CodeView Version
 2.20. We are researching the problem and will post new information as
 it becomes available.

 This problem has no effect on the application program's performance.

 The following is the program:

 /*   test.c   */
 #include <stdio.h>
 int i = 1 ;
 void main (void)
 {
 if ( i )
      i = 0 ;
      /* first comment line */
 else
      /* more comment */
      i = 1 ;
 }


 107. Returning Control to CodeView

 Product Version(s): 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER | CONTROL-C CONTROL+C CONTROL+BREAK CONTROL-BREAK ^C ^BREAK
 Last Modified:  3-MAY-1989    ArticleIdent: Q43648

 The following are two software methods of returning control to
 CodeView during program execution:

 1. Use the debug interrupt, interrupt 03, in your code. Interrupt 03
    is called a microprocessor (or logical) interrupt. It is the
    interrupt that CodeView uses to make breakpoints. Hard code
    interrupt 03 into your code in selected places where you want to
    return control to CodeView. The following sample program will
    demonstrate the technique. Note that a macro could easily be
    constructed to insert breakpoints where desired.

         #include <dos.h>
         #include <stdio.h>

         void main()
         {
             union REGS    inregs;
             int           i = 1;

             for( ;; )
             {
                 printf( "Loop iteration: %d\n", i++ );
                 int86( 0x03, &inregs, &inregs );
             }

 2. Use CTRL+C and CTRL+BREAK to return control to CodeView. This is
    a useful method for breaking out of a program is currently running
    or that has locked up.  The position in the source code to which
    you are returned depends on when you hit the ^C and what caused
    the system to hang, e.g. an infinite loop, a bad pointer, etc.
    Execution may be continued from this point in the usual manner
    (F5, F8, F10, etc.).

    Under OS/2 CTRL+BREAK does not return control to CodeView. CTRL+C
    may be used to abort a normally executing program but you cannot
    continue to debug from that point as you can in DOS.

 There is no hardware interrupt that will return control to CodeView.


 108. Cannot Open Source File Under CVP

 Product Version(s): 2.20
 Operating System:   OS/2
 Flags: ENDUSER | buglist2.20 buglist2.30 buglist2.4.1
 Last Modified: 18-SEP-1989    ArticleIdent: Q45135

 Problem:

 When using CodeView Protect (CVP) Version 2.20, I trace my program
 through a number of source files and after some number of files CVP is
 no longer able to open source files. When CVP gets into this
 situation, it automatically goes into mixed mode -- displaying line
 numbers but no source text. In this state, trying to use the "v"
 command to look at another (not previously looked at) file results in
 a red message box telling me that CVP can't open the file.

 Response:

 This is a problem with CVP Version 2.20 and 2.30. CVP is running into a
 file limit. To work around this problem, before you step out of the first
 module, open the source file containing the code you wish to debug and
 set a breakpoint there. Now "go" to this location by pressing the F5
 key. This procedure allows you to start debugging at a location deep
 into the file without opening multiple source files.

 Microsoft has confirmed this to be a problem with CodeView versions
 2.20 and 2.30. We are researching this problem and will post new
 information as it becomes available.


 109. Incorrect Handling of SP Can Cause CodeView to Corrupt Stack

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified:  7-JUN-1989    ArticleIdent: Q45183

 CodeView will use your program's stack for temporary variables in
 between assembly instructions. Thus, when writing an assembly language
 program, if you forget to increase the stack pointer (SP) to point
 beyond the memory locations you are using on the stack, CodeView will
 overwrite that memory.

 This is expected behavior. Even if CodeView did not use the stack, you
 would still have to increment the stack pointer to keep your program
 from overwriting your variables when you make a call, or with any
 operation that pushes values on the stack.


 110. Switching Out of PM Application Hangs System under Codeview

 Product Version(s): 2.20
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 16-MAY-1989    ArticleIdent: Q44418

 Question:

 I am using CodeView to debug my Presentation Manager (PM) application.
 Why does my machine sometimes hang when I use CTRL+ESC to switch to
 the OS/2 program selector?

 Response:

 Presentation Manager applications require the use of the Presentation
 Manager shell. To debug PM applications, CodeView must put hooks into
 the Presentation Manager before the PM application is executed. This
 process works properly while inside CodeView, but if you try to switch
 back to the program selector, PM is in an unknown execution state.

 Therefore, to switch out of CodeView while debugging a PM application,
 you must first restart or end the program inside CodeView. This tells
 CodeView to restore the Presentation Manager to its original
 condition.


 111. SYS0317 Caused by Running CVP on a DOS Application

 Product Version(s): 2.20
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 31-MAY-1989    ArticleIdent: Q44707

 The following message results from running a DOS application under
 Microsoft CodeView Version 2.20 or 2.30 for protected mode:

    SYS0317: The system cannot find message 0491
    in message file OSO001.MSG

 The screen is then cleared and the OS/2 prompt returns.


 112. /43 Starts CodeView with Screen Swapping Enabled

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified:  7-JUN-1989    ArticleIdent: Q45185

 When CodeView is started with the /43 switch to bring it up in 43-line
 mode, screen swapping is automatically enabled. This behavior is by
 design, although it is not stated in the documentation for the
 product.


 113. Setting a Breakpoint Highlights More Than One Line

 Product Version(s): 2.20
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist2.20
 Last Modified:  7-JUN-1989    ArticleIdent: Q45241

 When setting a breakpoint, CodeView may highlight two or more lines of
 code when you do the following:

 1. Compile C program (e.g., "Hello, world") with /Zi /Od.

 2. Load CodeView with 50 line mode (in VGA mode) as follows:

       cv /50 hello.c).

 3. Display mixed source and assembly.

 4. Move the cursor to the edit window and scroll down two or three
    pages of start-up assembly code.

 5. Set and remove breakpoints at arbitrary locations. In some cases,
    multiple lines will be highlighted and the display altered. The
    code itself is not changed. To restore the altered display, page
    down and then page up to the altered location.

 CVP does display this problem.

 Microsoft has confirmed this to be a problem in CodeView Version 2.20.
 We are researching this problem and will post more new as it becomes
 available.

 After setting a breakpoint that highlights more than one line of code,
 using the BL command will list only the one breakpoint you set.


 114. "No Symbolic Information" May Be Caused by Using Wrong Linker

 Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 2.35 | 2.20 2.30 2.35
 Operating System:   MS-DOS                             | OS/2
 Flags: ENDUSER | S_LINK
 Last Modified: 19-SEP-1990    ArticleIdent: Q59540

 To debug programs at the source level with CodeView, it is critical
 that a proper version of LINK be used. Particular versions of CodeView
 are matched to particular versions of LINK and using a version of LINK
 newer than the versions matched to a particular version of CodeView
 will prevent CodeView from recognizing the symbolic information in the
 .EXE file.

 This mismatch will cause CodeView to come up in assembly mode and
 produce the message "No Symbolic Information," even though the source
 files may have been compiled and linked with the correct options for
 CodeView symbolic debugging.

 The difference between the linkers is in the way they store symbolic
 information in .EXE files. A newer version of CodeView generally can
 always display symbolic information for programs produced with
 previous versions of LINK, but the opposite is NOT true. Using a more
 recent linker with an older version of CodeView is where potential
 problems arise.

 The following information applies to both real-mode CodeView (CV) and
 protected-mode CodeView (CVP).

 Versions of CodeView prior to Version 3.00 cannot display symbolic
 information for .EXE files produced with LINK 5.10. In other words,
 if LINK 5.10 (supplied with C 6.00) is used for linking, then
 CodeView 3.00 is the ONLY matched version of CodeView that can
 display the program's symbolic information.

 CodeView Version 2.35 is matched to LINK 5.05 (both were released with
 BASIC 7.00). Therefore, CodeView 2.35 is the ONLY version of CodeView
 that can display symbolic information for a program linked with LINK
 5.05.

 For CodeView Versions 2.00, 2.10, 2.20, and 2.30, any linker with a
 version number from 3.60 to 5.03 is acceptable.

 For CodeView Versions 1.00 and 1.10, LINK versions later than or equal
 to 3.51, but earlier than 3.60, must be used.


 115. Mouse Disabled When Single-Stepping over Video Mode Change

 Product Version(s): 2.20 2.30
 Operating System:   OS/2
 Flags: ENDUSER | buglist2.20 buglist2.30
 Last Modified: 21-JUN-1989    ArticleIdent: Q45617

 When CodeView is run in the OS/2 compatibility box with screen
 swapping enabled (started with either /s or /43), single-stepping (F8)
 over a _setvideomode() call or an INT 10 call to change the video mode
 to a graphics mode causes the mouse cursor to disappear. Exiting
 CodeView and running another mouse-driven program reveals that the
 mouse has been completely disabled in the compatibility box. The only
 way to regain the mouse is to reboot the computer. Attempting to
 reload the mouse by typing "mouse" at a prompt results in the
 following message:

    Session Title: DOS Command Prompt

 This error occurs because a DOS mode program changes an interrupt
 vector that is owned by the system causing the program to end.

 The behavior described above applies to tracing in SOURCE mode.
 Attempting to trace in assembly language or mixed mode through the
 code that changes the video mode produces erratic results, which range
 from hanging the DOS box to halting the entire system with an
 "internal processing error."

 Microsoft has confirmed this to be a problem in CodeView Versions 2.20
 and 2.30. We are researching this problem and will post new information
 as it becomes available.

 The following program illustrates the problem:

 #include <graph.h>

 void main(void)
 {
   _setvideomode(_ERESCOLOR);    /* when this line is executed, the  */
                                 /* mouse cursor will disappear.     */
   _setvideomode(_DEFAULTMODE);

 }


 116. CodeView "??" Command Can't Show All of Large Structures

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | SR# G890607-19918
 Last Modified:  8-AUG-1989    ArticleIdent: Q45624

 Question:

 How can I view structures with many members in CodeView with the "??"
 command? It shows only those members that fit on the screen. Is there
 some trick I haven't found?

 Response:

 Unfortunately, the "??" command is limited in this respect -- there is
 no way to view the last members of a large structure with this
 command. This feature is under review and will be considered for
 inclusion in a future release.

 Instead, however, you can view each element of the structure by itself
 by dereferencing the struct and element, i.e., "?structname.field".

 There are at least two ways to work around the problem in CodeView
 Versions 2.20 and 2.30. One way is to shrink or nest the structures.
 Another workaround is to use the "?" or Watch command to look at the
 individual member(s) you want to see.


 117. Problem Debugging StartSession from a Child Process

 Product Version(s): 2.30
 Operating System:   OS/2
 Flags: ENDUSER | buglist2.30
 Last Modified:  9-AUG-1989    ArticleIdent: Q45707

 When a program spawns another program that starts a new session,
 CodeView has difficulty stepping into that new session. This process
 is shown graphically in the following diagram:

        --------------        -------------------
    A --| DosExecPgm |--> B --| DosStartSession |--> C
        --------------        -------------------

 The following describes how to duplicate this process and re-create
 the problem:

 1. Invoke CodeView on Program A with offspring debugging enabled, as
    follows:

       CVP /O A

 2. Program A calls DosExecPgm to spawn Program B. Trace into Program B
    by pressing F8 on the DosExecPgm function. You will be informed
    that a new process has begun and you will be asked if you wish to
    debug it. Answer yes and switch to the newly created CodeView
    session.

 3. Program B calls DosStartSession to begin a new session. The program
    that will execute in that session is Program C. Attempt to trace
    into the new session by pressing F8 on the DosStartSession function.

 The problem is demonstrated in Step 3. CodeView does not give you the
 opportunity to debug Program C as it should. Further, when Program B
 has completed execution and CodeView returns back to Program A, the
 first single step will inform you that a new process has been started.
 This message should have been presented on the call to
 DosStartSession.

 CodeView has no difficulty stepping into a new session when the
 initial program being debugged is Program B. To work around this
 problem, invoke CodeView on Program B with the /O switch.

 Microsoft has confirmed this to be a problem with CodeView Version
 2.30. We are researching this problem and will post new information
 as it becomes available.

 The following three modules demonstrate this problem:

 //***********************************************************
 // A.C - spawn a child from here.

 #define INCL_BASE
 #include <os2.h>

 void main (void)
 {
   char        failbuf[80];
   RESULTCODES ExecCode;

   DosExecPgm (failbuf, 40, EXEC_ASYNC, NULL, NULL, &ExecCode, "B.EXE");
   VioWrtTTY ("End of A.\r\n", 11, 0);
 }

 //***********************************************************
 // B.C - start a new session from here.

 #define INCL_BASE
 #include <os2.h>
 #include <string.h>

 void main (void)
 {
   USHORT    Disk;
   ULONG     Drives;
   BYTE      SessionProg [80];
   USHORT    MaxLen = sizeof(SessionProg)-14;
   STARTDATA StartData;
   USHORT    Session;
   USHORT    Process;

   // Build program name to run in new session.
   DosQCurDisk (&Disk, &Drives);
   strcpy (SessionProg, "*:\\");
   SessionProg[0] = (char) ('A' + Disk - 1);
   DosQCurDir (0, SessionProg + strlen(SessionProg), &MaxLen);
   strcat (SessionProg, "\\C.EXE");

   StartData.Length      = sizeof(STARTDATA);
   StartData.Related     = 1;
   StartData.FgBg        = 0;
   StartData.TraceOpt    = 0;
   StartData.PgmTitle    = "Test Session";
   StartData.PgmName     = SessionProg;
   StartData.PgmInputs   = "sample param";
   StartData.TermQ       = NULL;
   StartData.Environment = NULL;
   StartData.InheritOpt  = 0;
   StartData.SessionType = 1;
   StartData.IconFile    = NULL;
   StartData.PgmHandle   = 0;

   DosStartSession (&StartData, &Session, &Process);
   VioWrtTTY ("End of B.\r\n", 11, 0);
 }

 //***********************************************************
 // C.C - the test session.

 #define INCL_VIO
 #include <os2.h>

 void main (void)
 {
   VioWrtTTY ("In test session", 15, 0);
 }


 118. CodeView Skips Over a Line of Source Code

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | S_QuickC
 Last Modified: 14-AUG-1989    ArticleIdent: Q46010

 After setting a breakpoint on the indicated line in the program below
 and executing the program, CodeView executes that line without
 stopping. Likewise, if you single step through the code, CodeView
 steps past that line. This problem also occurs in the QuickC
 integrated debugger.

 The workaround is to flip your source into mixed mode and set the
 breakpoint on the correct assembly line.

 This is due to the fact that CodeView is line-based and the C compiler
 is token-based. This will not be corrected; it is a restriction.

 Sample Program
 --------------

 int i, j, k, l;

 void main(void)
 {
     for(i = 0; i < 20; i++)
     {
         j = 0;
         for(k = 0; k < 20; k++)
             if(j == 0)
                 break;

         j = 1; /*** set breakpoint here ***/
     }

     l = 0;
 }


 119. Capabilities and Limits of the /R switch on 80386 Machines

 Product Version(s): 2.20 2.30 2.35 3.00 | 2.20 2.30 2.35 3.00
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER | 386
 Last Modified: 12-APR-1990    ArticleIdent: Q46448

 The /R command line switch for CodeView beginning with Version 2.20 is
 used only on 80386 machines. The /R switch tells CodeView to use the
 four debug registers available on the 80386 chip, and also allows
 hardware breakpoints. This causes CodeView to run faster when
 performing debugger-intensive steps such as monitoring a tracepoint.

 The /R switch works under DOS and OS/2's DOS compatibility box. It is
 an unrecognized switch under OS/2. The /R switch speeds operation of
 Tracepoint but not Watchpoint or Breakpoint commands.

 Note: because there are only four debug registers, only four
 tracepoints (of up to 4 bytes each) may be specified when utilizing
 these registers. Specifying any combination of tracepoints greater
 than 16 bytes will require CodeView to use software tracepoints rather
 than the debug registers and all performance gains will be lost.


 120. Using CodeView /2 with Hercules Graphics Cards and Libraries

 Product Version(s): 2.20 2.30
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 16-OCT-1990    ArticleIdent: Q46949

 Using CodeView in the dual-monitor mode with a Hercules graphics card
 as the primary (application) monitor requires the Hercules card to be
 configured in the half mode. Using the Hercules graphics library, the
 monitor must be configured using the config(0) function call. This
 function call is a part of the Hercules graphics library and does not
 use Microsoft graphics library or the MSHERC.COM program. Therefore,
 this information applies only if you are using the Hercules graphics
 libraries. This is NOT the same as using the /h switch with CodeView.

 The first page of the Hercules graphics display card is mapped to
 memory location B0000 (same as MDA), and the second page is mapped to
 B8000. The CGA/EGA/VGA also use B8000 as the beginning of their video
 memory. CodeView uses these two different address to run in the
 dual-monitor mode, sending the application output to the primary
 address, usually located at B8000, and the CodeView information to the
 secondary monitor, usually located at B0000.

 This works well until a Hercules graphics card is used as the primary
 monitor (in graphics mode) and the CGA/EGA/VGA card is used as the
 secondary monitor. The Hercules graphics card uses both pages (one at
 B0000 and the other at B8000) in the full mode. Therefore, use
 config(0) and only the first page (B0000) will be used and CodeView
 will function properly in dual-monitor mode.


 121. DEF File Entry of EXECUTEONLY Causes Problems with CVP

 Product Version(s): 2.20 2.30
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 30-AUG-1989    ArticleIdent: Q47103

 Question:

 When I step into my DLL, I can see and step through the source code
 correctly. I also can look at local variables. However, I cannot set
 breakpoints in the DLL. Also, when I try to look at the disassembled
 code I see the following:

    ??? No Code ???

 I am using the correct Compile and Link options. Why is CodeView
 acting strangely?

 Response:

 In the .DEF file for the DLL, you had the EXECUTEONLY attribute as
 opposed to the default EXECUTEREAD. When you choose EXECUTEONLY,
 CodeView cannot read the code segment as it must to work correctly.
 Removing the EXECUTEONLY attribute corrects the problem.


 122. OS/2 SDK Version of CVP 2.30 Won't Debug DosLoadModule DLLs

 Product Version(s): 2.30
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 11-JUL-1990    ArticleIdent: Q59610

 The OS/2 version 1.10 Software Development Kit (SDK) includes a
 prerelease version of protected-mode CodeView (CVP) version 2.30. This
 version is identical to the regular retail release of CVP 2.30, except
 that it does not allow the debugging of DLLs loaded with
 DosLoadModule. The regular retail version of CVP 2.30 is included with
 FORTRAN 5.00 and the OS/2 Presentation Manager Toolkit for OS/2
 version 1.10. This release DOES support debugging DLLs loaded at run
 time with DosLoadModule.

 The prerelease version of CVP 2.30 released in the OS/2 SDK may be
 identified by a file date of 2-24-89. The regular release version is
 dated 3-21-89. The file date is the only discernible difference
 between these two versions since the files themselves are exactly the
 same size.


 123. Minimum Extended Memory (384K) Causes CV 3.00 to Use Extra RAM

 Product Version(s): 3.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr HIMEM
 Last Modified: 27-SEP-1990    ArticleIdent: Q59890

 Real-mode CodeView (CV) Version 3.00 is documented as being able to
 run in extended memory as long as there is at least 384K of extended
 memory available. This 384K minimum is accurate as far as CV being
 able to utilize the extended memory, but it is not enough for CodeView
 to remove all of itself from conventional RAM. In fact, a system
 configuration with only 384K extended memory will result in LESS
 memory being available for the debuggee (the program being debugged)
 than if no extended memory is utilized at all.

 The CodeView 3.00 documentation states that "if HIMEM.SYS or another
 extended-memory driver is installed, all but 16K of CodeView, plus all
 of the symbolic information for the program you are debugging, are
 placed in extended memory." But, for CodeView to truly work with this
 16K "footprint" in conventional memory, a minimum of approximately
 600K extended memory must be available.

 When no extended memory is available, CodeView normally utilizes
 overlays to keep as much of itself out of memory as possible, so that
 the debuggee can have more space to load. (The new /Dnnn option
 actually allows you to specify the size of the overlays -- a bigger
 overlays means CV runs faster, but a smaller overlays mean a bigger
 program can be loaded for debugging.)

 Once CodeView detects extended memory, it assumes that overlays are no
 longer needed, since CV itself and the debuggee's symbolic information
 will both (supposedly) be loaded into extended memory. However, the
 result may be that CodeView seems to get bigger because what Codeview
 can't fit into extended memory is loaded into conventional memory.

 Since no overlays are used, this can result in a much larger
 footprint. For instance, if the minimum of 384K extended memory is all
 that is available, then the footprint will be well over 200K.
 Obviously, as the amount of extended memory is increased from 384K,
 the footprint will shrink accordingly.

 The /X command-line option instructs CodeView to use extended memory.
 However, CV will automatically detect extended memory and use it if it
 is available. Consequently, if the /X option is not specified, CodeView
 will still use extended memory.

 Thus, if you have a limited amount of extended memory and decide to
 run CodeView in conventional RAM only, you have two options. You can
 explicitly specify /D (for example, /D16) to tell CodeView to use
 overlays, or you can remove (or comment out) the line in your
 CONFIG.SYS file that loads the extended memory driver (HIMEM.SYS) and
 reboot.


 124. If COMSPEC Is Invalid, Invoking DOS Shell May Hang Machine

 Product Version(s): 2.x 3.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_quickc s_pwb s_quickasm s_editor
 Last Modified: 19-APR-1990    ArticleIdent: Q60748

 If you set your COMSPEC environment variable to point to an invalid
 command interpreter, and then shell out of any DOS application, your
 machine will hang. This problem occurs because the file that COMSPEC
 points to is assumed to be a valid command interpreter and cannot be
 checked for validity.

 This is expected behavior. Because .COM files have no standard file
 header structure, they cannot be checked for validity. Therefore, DOS
 must assume that whatever the COMSPEC environment variable points to
 must be a valid command interpreter, and can do no further error
 checking.

 This behavior can easily be demonstrated in any program that allows
 you to access a DOS shell, including CodeView, Programmer's WorkBench
 (PWB), the Microsoft Editor (M), and the Quick environments. Type the
 following line at the DOS prompt:

    set comspec=a:\foo.c ; Invalid command.com file

 Then enter a DOS application and shell out. Your machine will hang,
 and you may receive strange error messages.

 If you are running under OS/2, you will be warned about an invalid
 command interpreter when you attempt to shell to the operating system.
 Under OS/2, the system expects an .EXE file to be the command
 interpreter, and .EXE files have a standard, recognizable structure
 that can be checked.


 125. /I Documented Incorrectly in "Advanced Programming Techniques"

 Product Version(s): 3.00   | 3.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 19-APR-1990    ArticleIdent: Q60829

 In Section 9.7, "Controlling CodeView with Command-Line Options," on
 Page 204 of the "Microsoft C Advanced Programming Techniques" manual,
 it incorrectly states that the /I switch (used to turn the nonmaskable
 interrupts and 8259 interrupts on or off) is followed by either a 1 or
 a 2 (either /I1 or /I2).

 The correct switch options are /I0 to trap these interrupts, or /I1 to
 ignore these interrupts. Both the online documentation and the
 "Microsoft C Reference" give this correct usage of the /I switch.


 126. OS/2 1.20 Requirements for Dual-Monitor Debugging

 Product Version(s): 2.x 3.00
 Operating System:   OS/2
 Flags: ENDUSER | PM
 Last Modified: 17-JUL-1990    ArticleIdent: Q60866

 To do dual-monitor debugging under OS/2 Version 1.20 with CodeView,
 make sure that you have the correct display DLLs specified in your
 CONFIG.SYS file.

 For example, the following three lines in your OS/2 CONFIG.SYS file
 specify the device drivers needed to use a VGA and a monochrome
 adapter:

    set video_devices=bvh_vga,bvh_mpa
    set bvh_vga=device(bvhvga)
    set bvh_mpa=device(bvhmpa)

 If you have a CGA or an EGA monitor and adapter for your primary
 (color) display, replace device(bvhvga) with device(bvhcga) or
 device(bvhega), depending on your adapter type.

 Next, make sure that both of the BVH*.DLL files (in the above case,
 BVHVGA.DLL and BVHMPA.DLL) specified in the device(name) section are
 in your LIBPATH. OS/2 setup places these files in your C:\OS2\DLL
 directory by default.

 Note: You can substitute any name for bvh_vga or bvh_mpa, as long as
 those two placeholders match up with the name tab in the set
 <name>=device... lines.

 Remember, the two monitors must be unique for OS/2 to determine which
 monitor is which. For instance, debugging with two VGA monitors will
 not work because OS/2 and, therefore, CodeView will be unable to
 determine which adapter/monitor is the primary adapter/monitor and
 which is the secondary adapter/monitor.

 This point is critical to remember when considering dual-monitor
 debugging on a microchannel machine (for example, an IBM PS/2 Model 50
 and above). Since there are currently no microchannel monochrome
 adapter cards on the market, the only alternative is to use a VGA and
 an 8514 as the two monitors. The following are the matching three
 lines for your OS/2 CONFIG.SYS file for that scenario:

    set video_devices=bvh_vga,bvh_8514
    set bvh_8514=device(bvh8514)
    set bvh_vga=device(bvhvga)

 Using this setup, the 8514 monitor displays the graphics output (or
 the Presentation Manager screen) and the VGA is the debug monitor and
 displays all text output.


 127. Debugging Large DOS Applications in CodeView 3.0 with /X /E /D

 Product Version(s): 3.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 15-MAY-1990    ArticleIdent: Q61473

 CodeView version 3.00 includes enhanced support for debugging
 applications under DOS. CodeView 3.00 may access extended memory or
 expanded memory, or the size of the overlay swap area that CodeView
 uses may be adjusted.

 CodeView 3.00 offers three command-line parameters (/X, /E, and /D)
 for specifying memory utilization. If you DO NOT specify the /X, /E,
 or /D options when you start a CodeView session, CodeView will
 automatically search for extended memory. If CodeView finds extended
 memory, it will place the symbolic information and most of itself into
 extended memory (as long as enough extended memory is available).

 If there is no extended memory on your system, Codeview will search
 for expanded memory. If there is expanded memory, Codeview will place
 the symbolic information for your program in expanded memory.

 If there is no extended or expanded memory on your machine, CodeView
 will load itself, your application, and symbolic information for your
 program in base memory.

 Since CodeView does this automatic scan for extended and expanded
 memory, the /X and /E switches are needed only if you explicitly want
 to specify the use of one form of memory or the other and you do not
 want to enter CodeView if this memory type is not available.

 CodeView's /X option tells the debugger to load into extended memory
 ONLY, and to return an error message if extended memory is not
 available on your system. This message has the following form:

    CV1302 Error: /X : HIMEM.SYS not loaded

 CodeView's /E option tells the debugger to access expanded memory
 ONLY, and to return an error message if there is no expanded memory on
 your machine. This message has the following form:

    CV1304 Error: /E : EMM driver not loaded

 CodeView's /D option specifies that CodeView should use disk overlays.
 When you use this option, you can also specify a decimal size in
 kilobytes between 16K and 128K to explicitly set the overlay swap area
 size. The default size of the swap area is 64K if /D is used but no
 size is explicitly specified. If extended and expanded memory are not
 available, /D will not need to be specified for the default 64K
 overlay swap area to be used.

 A larger overlay swap area allows CodeView to run faster because it
 doesn't have to swap to disk as frequently as with a smaller swap
 area, but it means more memory is used up by CodeView itself. A
 smaller swap area allows you to debug larger applications under DOS,
 but CodeView runs slower because of the more frequent need to swap
 code from disk to memory.


 128. P70 Display Creates Problems Under CodeView and PWB

 Product Version(s): 3.00
 Operating System:   OS/2
 Flags: ENDUSER | buglist3.00 S_PWB S_Editor
 Last Modified: 15-AUG-1990    ArticleIdent: Q61557

 CodeView version 3.00 and Programmer's WorkBench (PWB) version 1.00
 have problems recognizing the built-in monitor of IBM P70 portables
 under OS/2. Symptoms of this problem include the following error
 messages:

    Product     Error Message
    -------     -------------

    CodeView    Internal Debugger Error 0 at load time
    PWB         Inability to change from 43-line mode

 Microsoft has confirmed this to be a problem with CodeView version
 3.00. We are researching this problem and will post new information
 here as it becomes available.

 This problem is directly related to the video configuration of the IBM
 P70. In its documentation, IBM mentions briefly that it might be
 necessary to type MODE CO80 to make some software recognize the
 built-in plasma display. An added condition for PWB and CodeView is
 the necessity of being in 43-line mode. PWB automatically places you
 in 43-line mode no matter what you previous mode was and thus gets
 around this limitation. If you attempts to change the height switch
 while editing, PWB doesn't complain but still stays in 43-line mode.

 CodeView cannot make the mode change in the same way that PWB can. If
 invoked without the above considerations, CodeView will crash with an
 Internal Debugger Error 0. The following are several ways to work
 around this problem if want to use CodeView with this type of
 configuration.

 1. Type MODE CO80 or BW80 and invoke CodeView with the /43 switch.

 2. Type MODE CO80,43 or BW80,43 before invoking CodeView.

 3. Use an external monitor with the built-in VGA port.

 4. Invoke CodeView from PWB, which makes the change automatically.


 129. CodeView Does Not Reset Initial Graphics Mode on Exit

 Product Version(s): 2.x 3.00    | 2.x 3.00
 Operating System:   MS-DOS      | OS/2
 Flags: ENDUSER |
 Last Modified: 29-MAY-1990    ArticleIdent: Q61611

 When CodeView exits, it leaves the screen in the current video mode
 and does not reset the mode to the mode that was active when CodeView
 was initially loaded.

 This behavior is by design. However, if you start CodeView with the /s
 option to enable screen swapping, the video mode that was active when
 CodeView was loaded will be reset because CodeView has separate
 swappable video memory pages to hold the output screen as well as the
 CodeView screen.


 130. CV 3.00 Gives R6000, Hangs When Accessing Help During Start-Up

 Product Version(s): 3.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist3.00 fixlist3.10
 Last Modified:  5-FEB-1991    ArticleIdent: Q61919

 Accessing help in the "Enter directory for filename.c (cr for none)?"
 window results in the following error in CodeView version 3.00:

    run-time error R6000
    -stack overflow

 Then, the machine hangs requiring a cold reboot.

 To reproduce the error, do the following:

 1. Compile and link a program with symbolic information for CodeView.

 2. Delete or rename the source file and then go into CodeView. A
    window will appear asking you to "Enter directory for filename.c
    (cr for none)?".

 3. Choose the Help option at the bottom of the window. The run-time
    error message will be printed over the CodeView screen and the machine
    will be hung.

 The problem does not occur under OS/2.

 Microsoft has confirmed this to be a problem in CodeView version 3.00.
 This problem was corrected in CodeView version 3.10.


 131. CodeView 3.00 Fades with Monochrome VGA

 Product Version(s): 3.00   | 3.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 11-JUL-1990    ArticleIdent: Q61970

 If you invoke CodeView version 3.00 on certain machines with
 monochrome VGA monitors and then trace through several lines of code,
 the screen will fade and become unreadable. Exiting and re-entering
 CodeView refreshes the screen, but the screen immediately starts to
 fade again.

 This problem is caused by an error in the video ROM BIOS and has been
 verified to occur on the following machines:

 l. PS/2 Model P70 with monochrome VGA

 2. Siemens with Video 7 monochrome VGA

 3. Northgate 386 with Video 16 monochrome VGA

 The following are different methods of working around this problem:

 1. Switch into color mode using the mode CO80 command (may not have
    any effect).

 2. From the options menu inside Codeview, turn flip/swap off using
    the screen-swap option.

    If you don't want to give up flip/swap functionality, try option 3.

 3. If the video BIOS is replaceable, replace it with an updated video
    BIOS.

 4. If the video BIOS is not replaceable, replace the card.


 132. CodeView 3.00 Hangs on gets() with Screen Swap Off

 Product Version(s): 3.00   | 3.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_c s_quickc s_quickasm
 Last Modified: 25-JUL-1990    ArticleIdent: Q62663

 CodeView 3.00 will hang if you step or execute past a call to the
 gets() run-time routine if the Screen Swap option is turned off.

 Sample Code
 -----------

 #include <stdio.h>

 char string[256];

 void main (void)
 {
     printf ( "Enter a string: ") ;
     gets ( string ) ;
     printf ( "Echoing : %s\n", string) ;
 }

 Compile the above file with the following:

    cl /Od /Zi test.c

 Bring the file up in CodeView, then select the Options.Screen Swap
 option. Next, step past the gets() call. Under DOS, your machine will
 hang, and under OS/2, the current screen group will be hung.


 133. DosSetMaxFH Between 0-39 Fails Under CodeView 3.00

 Product Version(s): 3.00
 Operating System:   OS/2
 Flags: ENDUSER | buglist3.00
 Last Modified: 25-JUL-1990    ArticleIdent: Q62666

 OS/2's DosSetMaxFH routine can be called to reset the OS/2 default
 limit of a maximum of 20 open file handles to a larger number. By
 definition, DosSetMaxFH fails when trying to set the number smaller
 than the current maximum amount of handles. Under OS/2, the default
 maximum number of files is 20, so a DosSetMaxFH to a number between
 0-19 should fail.

 However, under CodeView 3.00, calling DosSetMaxFH with a number
 between 0-39 will return a fail value.

 Sample Code
 -----------

 /* compile with : cl /Od /Zi file.c */

 #define INCL_DOSFILEMGR

 #include <stdio.h>
 #include <os2.h>

 void main(void)
 {
    int i;
    for ( i = 0 ; i < 1000 ; i ++ )

    if ( DosSetMaxFH ( i ) )
    {
       printf ( " DosSetMaxFH to %d failed!\n ",i ) ;
    }
 }

 This program prints the error message on parameters from 0 to 39.

 You can call the DosSetMaxFH routine to set at least 40 file handles
 to work around this problem.


 134. CV Limits Input of Period Character (2Eh) into Memory Window

 Product Version(s): 3.00 3.10 | 3.00 3.10
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist3.00 buglist3.10 decimal point dot
 Last Modified: 31-AUG-1990    ArticleIdent: Q65241

 When viewing memory in byte format in a memory window in CodeView
 version 3.00 or 3.10, you cannot change the value of a byte in memory
 to the hexadecimal value 2E. The hex value 2E has an ASCII character
 equivalent of the period ("."). In CodeView, a period is used to
 display any nondisplayable character (for example, null, a carriage
 return, control characters, etc.), which means the period character
 can sometimes have special meaning to CodeView when it appears in a
 memory window.

 Because of the special usage of the period character in a memory
 window, CodeView does not allow periods to be typed directly into
 memory. In CodeView 3.00, attempts to change a byte value to 2E
 results in either the 2 or the E being entered and the other digit
 being ignored, depending on which value you enter first. In CodeView
 3.10, both the 2 and the E are returned to their original values once
 they have both been entered. If you move to the right side of the
 memory window where the ASCII equivalents are shown and you try to
 type in a period there, CodeView will also ignore that input.

 If you switch the memory window so that you are viewing memory in
 ASCII mode, actual periods can be typed in to any memory location.
 However, there is a problem with this because ALL other periods on the
 same line, which really represent various nondisplayable ASCII
 characters, are all converted to 2Es.

 If you use are viewing memory in a format other than bytes or ASCII,
 CodeView will allow a 2E to be entered. The workaround, then, if a
 period needs to be entered into memory, is to choose a different
 viewing mode other than ASCII or byte-mode, and then enter the period
 in the desired location as the value 2E. You can cycle through the
 available memory viewing modes by repeatedly pressing SHIFT+F3, or you
 can select the desired mode from the Memory Window option on the
 Options menu.

 Microsoft has confirmed this to be a problem in CodeView versions 3.00
 and 3.10. We are researching this problem and will post new
 information here as it becomes available.


 135. CV 3.00 Incorrectly Documents helpbuffer Switch as helpbuffers

 Product Version(s): 3.00   | 3.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 25-FEB-1991    ArticleIdent: Q63236

 In the "Configure CodeView" section of the online help for CodeView
 version 3.00, the "helpbuffer" switch is incorrectly listed as
 follows:

    helpbuffers:<size>

 This switch should be spelled as follows:

    helpbuffer:<size>

 CodeView will not recognize the first spelling. The correct spelling
 was incorporated into the online help beginning with CodeView version
 3.10.


 136. CodeView Crashes in DOS on "Drive Not Ready" Error

 Product Version(s): 3.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist3.00
 Last Modified: 25-JUL-1990    ArticleIdent: Q64026

 CodeView version 3.00 may hang after encountering a "Drive Not Ready"
 error. This error may occur if a file is opened on Drive A and a disk
 is not in the drive.

 To reproduce this problem, compile the following program with CodeView
 options (cl /Zi /Od):

    main () {
      FILE *fp;
      fp = fopen("a:\readme.doc","r");
    }

 If you run the program in CodeView version 3.00 without a disk in
 Drive A and press F5 to run the program, the following error will
 appear:

    Not ready reading drive A
    Abort, Retry, Fail?

 Regardless of what is typed, the machine will hang and you must do a
 cold reboot to remedy the crash.

 Note: CodeView versions 2.20 and 2.30 do not hang the machine if the
 above steps are executed. The fopen() just returns a NULL. OS/2 also
 handles the error correctly in versions 2.20, 2.30, and 3.00 of
 CodeView.

 Microsoft has confirmed this to be a problem with CodeView version
 3.00. We are researching this problem and will post new information
 here as it becomes available.


 137. CV1319 Error May Be Caused by CodeView DOS Extender

 Product Version(s): 3.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist3.00 fixlist3.10
 Last Modified: 31-AUG-1990    ArticleIdent: Q65242

 Real-mode CodeView (CV) version 3.00 (shipped with Microsoft C 6.00)
 may encounter problems on certain computers when extended memory is
 utilized for debugging programs. These problems involve the processing
 of interrupts while CodeView 3.00's internal DOS extender is being
 used to run CodeView in protected mode in conjunction with HIMEM.SYS,
 the extended memory (XMS) driver.

 The problems manifest themselves in various ways, due to both the
 varied interrupt handling speeds of different machines and the varied
 interactions of CodeView itself running in protected mode while the
 DOS program being debugged is still being run in real mode. The most
 common error is a protection violation, which shows up in CodeView as
 either a CV1319 error (internal error - unrecoverable fault) or as a
 system hang. The errors usually occur when you are paging through the
 code or manipulating the mouse.

 Registered Microsoft C 6.00 owners who are experiencing any of these
 problems with CodeView version 3.00 are encouraged to call Microsoft
 Technical Support at (206) 637-7096 to obtain information concerning a
 possible correction for these errors. However, there may be some cases
 where the only solution is to obtain a newer computer BIOS or to use
 CodeView without extended memory.
 Most reported problems have involved IBM PS/2 computers, but a number
 of these problems have also been reported on computers with an AMI
 BIOS. Note that CodeView version 3.10 includes modifications that are
 expected to eliminate most of these interrupt problems, but in some
 instances (especially with older AMI BIOS machines), an update of the
 BIOS may be the only solution.

 The easiest workaround to these protected-mode errors is to start
 CodeView without the use of extended memory. This can be done by
 removing the line in CONFIG.SYS that loads the HIMEM.SYS driver (and
 then rebooting the computer). Another option, if HIMEM is already
 loaded, is to start CodeView with the /D command-line option to
 specify explicitly that CodeView should use disk overlays, rather than
 extended or expanded memory. (Otherwise, if extended memory is
 available, CodeView will use the /X option by default.)

 Because these problems can occur only when CodeView is running in
 protected mode in extended memory, and because CodeView 3.00 requires
 HIMEM.SYS in order to run in protected mode, the problems are often
 mistakenly attributed to HIMEM.SYS. In reality, HIMEM.SYS is not
 responsible for the errors because it is just the memory manager that
 CodeView utilizes to get at extended memory. The errors are the result
 of an interrupt handling incompatibility between certain hardware
 configurations and the DOS extender built into CodeView.

 Microsoft has confirmed this to be a problem in CodeView version 3.00.
 This problem has been corrected in version 3.10.


 138. Label/Function Search Command Fails Under Codeview 3.00/3.10

 Product Version(s): 3.00 3.10 | 3.00 3.10
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist3.00 buglist3.10
 Last Modified: 31-AUG-1990    ArticleIdent: Q65312

 Under CodeView versions 3.00 and 3.10, the Label/Function search
 command is described in the online help as performing a search of the
 current source window for an assembly-language label or function name.
 If the label is found, the debugger should switch from source to
 assembly mode to display a label in a library routine or assembly
 language module.

 In reality, this command fails with a message "Error - Unknown
 Symbol". The debugger does not switch into assembly mode. This problem
 can be reproduced by selecting Search from the CodeView menu, then
 selecting Label/Function and typing in "__chkstk" (without the
 quotation marks).

 Microsoft has confirmed this to be a problem with CodeView Versions
 3.00 and 3.10. We are researching this problem and will post new
 information here as it becomes available.


 139. Cannot Enable A20! with Orchid 386s

 Product Version(s): 3.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 17-DEC-1990    ArticleIdent: Q65360

 Using HIMEM.SYS version 2.50 with Orchid 386/25 motherboards with the
 caching controllers can cause the following error message:

    Cannot enable A20!

 Orchid Technology has verified that this is a problem with the PAL
 chip on these motherboards. Customers who are experiencing this
 problem should call Orchid Technology at (415) 683-0300 for an update
 of their PAL chip. Please have the revision of the motherboard on hand
 when calling.


 140. Mouse Cursor on Wrong Monitor During Dual-Monitor Debugging

 Product Version(s): 3.00 3.10
 Operating System:   MS-DOS
 Flags: ENDUSER | H_MOUSE
 Last Modified: 17-SEP-1990    ArticleIdent: Q65528

 Under certain conditions, when invoking real-mode CodeView (CV) in
 dual-monitor mode with /2, the mouse cursor appears on the wrong
 monitor. When this occurs, a "sprite" mouse cursor appears on the
 monitor that the application is to run on, while the secondary monitor
 where CodeView is running does not have a mouse cursor. Several
 workarounds to this problem are given below.

 The sprite mouse cursor is a "graphic" arrow cursor similar to that in
 Windows 3.00 or OS/2 Presentation Manager (PM), as opposed to the
 traditional "text" block cursor that usually appears when running
 CodeView or the Programmer's WorkBench (PWB).

 The problem of the mouse appearing on the wrong monitor occurs only on
 computers that have "extended register" video boards, such as some of
 the Video 7 VGA cards. Certain mouse drivers enable the sprite cursor
 when they detect these extended video registers. Because a monochrome
 monitor cannot support this extended mode mouse cursor, the cursor
 fails to switch to the secondary monitor when focus is switched to
 that monitor after CodeView is invoked with the /2 switch.

 The following are three possible workarounds to this problem:

 1. Upgrade to mouse driver version 7.04 or later. This version
    provides a new switch, /Y, which can be used with either the
    MOUSE.COM program or the MOUSE.SYS device driver. The /Y switch
    tells the mouse driver to disable the sprite cursor. The mouse
    driver update can be obtained free of charge by contacting
    Microsoft Product Support Services at (206) 637-7096.

 2. If a mouse driver earlier than version 7.04 is used, the problem
    may be worked around by creating a batch file or adding the
    following commands to the AUTOEXEC.BAT file:

       mode mono
       mouse
       mode co80

    These commands will switch focus to the monochrome monitor while
    the mouse is being invoked and then will switch the focus back to
    the color monitor. This method will prevent the mouse driver from
    detecting the extended registers and using the sprite cursor.

 3. Disable the extended video registers. Check the video card
    documentation to see if this method is possible with your
    particular card.


 141. CV May Come Up Only in Monochrome with 8514/A Display Adapter

 Product Version(s): 3.00 3.10
 Operating System:   MS-DOS
 Flags: ENDUSER | appnote SV0337.ARC B_QuickBas
 Last Modified: 16-OCT-1990    ArticleIdent: Q65701

 Real-mode CodeView (CV) may display only in monochrome (black and
 white) mode on some systems with an 8514 or color VGA monitor attached
 to an 8514/A display adapter. On these systems, the installation of an
 8514/A video card causes the BIOS video functions to return an
 incorrect value indicating that a monochrome VGA monitor is attached,
 rather than a color monitor.

 This same BIOS information contributes to the way in which these
 versions of CodeView (and various other programs) detect the type of
 video adapter present; thus, CodeView may incorrectly determine that
 it is running on a monochrome system and may display the screen only
 in black and white.

 Workaround
 ----------

 As a workaround, an application note titled "8514/A Monochrome to
 Color Patch" is available from Microsoft Product Support Services by
 calling (206) 637-7096. This application note contains a program,
 which may be run before CodeView is invoked and which will configure
 the BIOS information correctly for CodeView to come up in color.
 The program is also available in the Software/Data Library by querying
 on SV0337, the Q number of the article, or S12719. SV0337 was archived
 using the PKware file-conversion utility.

 This monochrome video problem is specific to DOS, and therefore, does
 not occur with protected-mode CodeView (CVP) under OS/2. However, the
 problem may appear if real-mode CodeView is run in the DOS
 compatibility box under OS/2. In addition, the problem may occur with
 other software, such as Microsoft QuickBASIC.

 With CodeView, another symptom of this problem is that the program
 output screen (which can be accessed by pressing F4) will usually
 appear as dark blue characters on a black background. This screen is
 essentially unreadable and remains this way even after CodeView is
 terminated. Typing MODE CO80 at the DOS prompt after exiting CV should
 restore the system to the default colors.

 Microsoft intends to change the video detection routine in future
 software releases in order to circumvent this problem. Although the
 problem is not specifically caused by CodeView, a more sophisticated
 video detection routine will determine what video adapter and monitor
 are present without relying on the possibly inaccurate BIOS data.


 142. CV /E Avoids Windows 3.00 386 Enhanced Mode Protection Error

 Product Version(s): 2.35 3.00 3.10
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# S900919-57 B_QuickBas B_BasicCom W_Win3
 Last Modified: 24-OCT-1990    ArticleIdent: Q65934

 When you start Microsoft CodeView under Windows 3.00 in a 386 enhanced
 mode DOS box, the following error message is displayed:

    You have attempted to run protected-mode application under 386
    enhanced mode. To run the application, exit and run Windows using
    either the WIN /s or the WIN /r command.

 However, using WIN /s or /r is unnecessary. To avoid the error
 message, start CodeView with the /E option to tell CodeView that
 expanded memory is available, as follows:

    CV /E

 This information applies to Microsoft CodeView versions 2.35, 3.00,
 and 3.10 for MS-DOS.
 Note that CodeView version 2.35 is shipped with Microsoft BASIC
 Professional Development System (PDS) version 7.00; CodeView version
 3.00 is shipped with Microsoft C Compiler PDS version 6.00; and
 CodeView 3.10 is shipped with Microsoft BASIC PDS version 7.10.

 You may find that after the error message is generated, if you return
 to the DOS box and wait a few seconds, CodeView will start up. To
 avoid the error message, start CodeView as follows with the expanded
 memory (/E) switch (where <filename.exe> is the name of the program
 you want to debug):

    CV /E <filename.exe>

 To increase the size of programs that can be loaded into CodeView in
 conjunction with the /E switch, you can create a PIF file for CodeView
 and specify -1 for the Expanded Memory KB Limit, which instructs
 Windows to give the program all the EMS that it needs.

 CodeView will run without the above error message in a Windows 3.00
 DOS box in standard mode, WIN /S.


 143. CV1319 Error May Be Caused by Generic Breakpoints

 Product Version(s): 3.00   | 3.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 24-OCT-1990    ArticleIdent: Q66215

 In some situations a program will hang with the CodeView
 initialization error CV1319 even though the program runs correctly
 outside of CodeView. Deleting any generic breakpoints in the
 CURRENT.STS file may resolve this problem. The following is an
 example:

    [debug-]
          genericbp='E 0x47:0x0007

 The problem is that when you recompile your program, the code moves
 and the absolute breakpoint may now be set in the middle of a
 multibyte instruction rather than the beginning of the instruction.

 Additional Workaround
 ---------------------

 Invoke CodeView with the /TSF ("Toggle StateFileread") option. This
 option will either read or ignore the CURRENT.STS file based on what
 the statefileread switch is set to in the TOOLS.INI file.

 For example, if the statefileread switch is set to "yes" (the default)
 and CodeView is invoked with the /TSF option, the CURRENT.STS file
 will be ignored.


 144. Running Out of Memory in CodeView with /X

 Product Version(s): 3.00 3.10 3.11
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 24-OCT-1990    ArticleIdent: Q66230

 Under some circumstances, CodeView may still run out of memory while
 debugging large applications with the /X switch invoked to take
 advantage of extended memory with HIMEM.SYS. The debug information
 gets expanded when CodeView loads the program, so the following
 suggestions may help the problem:

 1. Don't use the quick compile (/qc) option. The symbolic information
    created by the quick compiler may expand much more when loaded by
    CodeView than the symbolic information created by the standard
    compiler. In addition, the quick compiler may create some duplicate
    debug references in the executable file. These duplicate references
    can take up significant memory when CodeView loads the program.

 2. Use the CVPACK utility, which is documented in the online
    documentation and on Page 21 of the "Microsoft C Reference" manual.
    CVPACK will compress the debug information in the file by removing
    duplicate references. Use the /P option to achieve maximum
    compression.


 145. CodeView Fails to Return Value in ES

 Product Version(s): 3.00 3.10 3.11
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist3.00 buglist3.10 buglist3.11
 Last Modified:  9-NOV-1990    ArticleIdent: Q66507

 When CodeView is running in extended memory and a call is made to
 interrupt 15h function C0h, the value in the ES register is not
 changed. This interrupt call should return the segment of the system
 configuration table in the ES register. If CodeView is run with the /D
 or /E option, a value is returned in the ES register as it should be.

 Microsoft has confirmed this to be a problem in CodeView versions
 3.00, 3.10, and 3.11. We are researching this problem and will post
 new information here as it becomes available.

 Sample Code
 -----------

 main ()
   {
    _asm mov ah, 0xC0
   _asm int 0x15
   }


 146. Memory Requirements for Real-Mode CodeView (CV.EXE)

 Product Version(s): 3.00 3.10 3.11 | 3.00 3.10 3.11
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER |
 Last Modified: 11-NOV-1990    ArticleIdent: Q66513

 Real-mode versions of CodeView (CV) beginning with version 3.00 offer
 a number of ways to utilize available memory in order to make the
 greatest amount of conventional memory available to the program being
 debugged. The amount of memory actually used depends on the
 command-line options specified as well as the configuration of the
 system used for debugging.

 The following table shows the size of CodeView in standard DOS memory
 with each of the memory-specific command-line options (see the "More
 Information" section below for further details):

    Option  RAM Usage                   Option  RAM Usage
    ------  ---------                   ------  ---------

     /X       16K                       /D16     210K
     /E      192K                       /D32     225K
     /D      256K (same as /D64)        /D128    320K

 The following descriptions of the three memory-related CodeView
 options explain the ways in which each option affects memory
 utilization in addition to the respective amounts of conventional
 memory that CodeView requires with each. (This information pertains
 only to CodeView versions 3.00 and later -- versions of CodeView
 earlier than 3.00 require approximately 230K of RAM specifically for
 CodeView.)

 /X - Specifies that CodeView should utilize extended memory. Assuming
      that enough extended memory is available, this option moves both
      the symbolic information and most of CV itself into extended
      memory. Allowing CV to be loaded into high memory requires that
      approximately 16K to 19K of "control" code remain in conventional
      memory, thus all free conventional RAM over 19K is available to
      load the program to be debugged (the "debuggee").

 /E - Specifies that CodeView should utilize expanded memory. Assuming
      that enough expanded memory is available, this option moves both
      the symbolic information and CodeView's own overlays into
      expanded memory. The size of the CV "root" without the extra
      overlayed code is approximately 192K. Since the overlays do not
      cause any additional overhead with /E, all free conventional RAM
      over 192K is available to load the debuggee.

 /D - Specifies that CodeView should utilize disk overlays in
      conventional memory. By default, this option creates a 64K buffer
      area for loading disk overlays. With the 192K root, the 64K
      buffer means CV will take about 256K of conventional memory with
      /D. In addition, the symbolic information must also be loaded
      into conventional memory; therefore, since symbolic data varies
      with each program, it is not possible to specify the amount of
      memory available for the debuggee alone.

      The /D option can also be specified with a value that indicates
      the size of the overlay buffer area. This parameter can be any
      value from 16 to 128, which represents an overlay buffer size
      from 16K to 128K. Specifying /D16 will minimize CodeView's size
      with disk overlays to approximately 210K. This maximizes the
      amount of conventional memory that will be available to load the
      debuggee and the symbolic information. At the other extreme,
      /D128 causes CV to use approximately 320K of conventional RAM.
      This provides faster CodeView execution speed, but it will only
      work with smaller debuggees.

 Note: CodeView will default to the best memory usage possible. In
 other words, if NO memory usage option is specified, CV will try to
 use extended memory. If extended memory is unavailable, CV looks for
 expanded memory. CV will use disk overlays on its own only if expanded
 memory is not found.


 147. CV2206 Warning: Corrupt OMF Detected in <filename>

 Product Version(s): 2.x 3.00 3.10 | 2.x 3.00 3.10
 Operating System:   MS-DOS        | OS/2
 Flags: ENDUSER | S_MASM H_MASM
 Last Modified: 11-NOV-1990    ArticleIdent: Q66702

 When trying to debug a Macro Assembler program with CodeView, the
 following message may appear:

    CV2206 Warning: Corrupt debug OMF detected in <filename>,
       discarding source line information

 The error occurs when code segments are not of class "CODE". Page 104
 of the "Macro Assembler 5.10 Programmer's Guide" states the following:

    The CodeView debugger also expects code segments to have the class
    name 'CODE'. If you fail to assign a class type to a code segment,
    or if you give it a class type other than 'CODE', then labels may
    not be properly aligned for symbolic debugging.

 This is also mentioned in the "CodeView and Utilities" manual under
 section 1.3.8 titled "Preparing Assembly Programs."

 The following is an example of the problem:

 _text segment para public   ; 'CODE' should be added to this line

 begin    proc
       mov ah, 4ch
       int 21h
 begin    endp

 _text ends
       end begin


 148. How to Execute a Function From the Command or Watch Window

 Product Version(s): 2.x 3.00 3.10 3.11 | 2.x 3.00 3.10 3.11
 Operating System:   MS-DOS             | OS/2
 Flags: ENDUSER | docerr s_c 6.00 6.00a
 Last Modified:  4-DEC-1990    ArticleIdent: Q67007

 Page 201 of the "Advanced Programming Techniques" (APT) manual that
 accompanies Microsoft C versions 6.00 and 6.00a states that "any C
 function in your program (whether user-written or from the library)
 can be called from the Command window or the Watch window."

 This statement is not completely true. Actually, only functions
 compiled with full CodeView symbolic information can be called. This
 restriction eliminates all of the C run-time functions from being
 executed in this manner because they contain no symbolic information.
 A simple example of how to call a C run-time function is shown below.

 If an attempt is made to execute a function that has not been compiled
 with symbolic information via the Command window, the following error
 will be displayed in the Command window:

    CV1017 Error: Syntax error

 In CodeView versions 2.x, an "unknown symbol" error is displayed in
 the Command window.

 If an attempt is made to add the function to the Watch window via the
 Watch menu and the "Add Watch" command, CodeView will ignore the entry
 and beep. In versions 2.x, CodeView will give an "unknown symbol"
 error.

 The APT gives an example of calling a C function from the Command
 window via the following command:

    ?funcname (varlist)

 This command will only invoke the function and display its return
 value in the Command window. To add the function to the Watch window,
 a slightly different command must be used, as follows:

    w?funcname (varlist)

 The function name can also be added to the Watch window by choosing
 the Watch menu and the "Add Watch" command, and typing only the
 function name plus its variable list enclosed in parenthesis. Neither
 the "w" or the "?" are needed in this situation.

 It is important to note that you should be sure that the screen
 flip/swap option on the Options menu is turned on if the function you
 execute performs any screen input or output.

 For example, if you want to call a C run-time function or any other
 function that does not contain CodeView symbolic information, you must
 create a shell function that calls the desired function itself and
 gives the same return value.

 Therefore, if you wanted to call the C run-time function sqrt()
 directly from the CodeView Command window or Watch window, you would
 create a shell function that resembles the following:

 1. #include <math.h>
 2. double my_sqrt(double x)
 3. {
 4.    return(sqrt(x)) ;
 5. }

 You would then compile this function with CodeView information by
 compiling with the /Zi switch, and then link it into your program
 being sure to include /CO in your link command. Note that your program
 does not need to make a call to the function in order for it to be
 available for direct execution.

 To execute this function from the Command window, enter the following
 command:

    ?my_sqrt(4.0)

 The return value should be displayed on the next line in the Command
 window. In this example, 2.0000000000000 should be displayed as a
 result of the square root of 4.0.

 To add the function to the Watch window via the Command window, you
 would enter the following command:

    w?my_sqrt(4.0)

 The function could also be added to the watch window by choosing the
 "Add Watch" command from the Watch menu and entering the following at
 the Add Watch prompt:

    my_sqrt(4.0)

 When a function is added to the Watch window, that function is
 executed any time the Watch window is updated.

 Although these examples show a constant value as the parameter to the
 function, any variable that is in scope at the time could be entered
 as a parameter.


 149. Syntax Error When Watching Variables That Begin with "P"

 Product Version(s): 2.20 2.30 | 2.20 2.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist2.10 buglist2.20 fixlist3.00
 Last Modified: 18-NOV-1990    ArticleIdent: Q67008

 When the following command is entered in the Command window to watch a
 variable that begins with the letter "p", the result is a syntax
 error:

 > W pvariable

 The syntax for watching a memory location is W[type] range, where the
 type and range specify the format and length of memory to be
 displayed, respectively.

 When no type is declared, as in the above example, the default type is
 used. The default type will be the last type used by a Dump, Enter,
 Watch Memory, or Tracepoint Memory command. If none of these commands
 has been used during the session, the default type is byte.

 The workaround for this problem is to explicitly declare a type in the
 watch statement, for example:

 > WB pvariable.

 Microsoft has confirmed this to be a problem in Microsoft CodeView
 versions 2.x. This problem has been corrected in Microsoft CodeView
 version 3.00.

 Additional keywords: buglist2.30 buglist2.35


 150. CV1017: Syntax Error Can Be Caused by a Leading Zero

 Product Version(s): 3.00 3.10 3.11 | 3.00 3.10 3.11
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER |
 Last Modified:  4-JAN-1991    ArticleIdent: Q67160

 Since CodeView treats all values with a leading zero as octal numbers,
 the following error is reported when the value is not a valid octal
 number:

    CV1017: syntax error

 To enter a number in hexadecimal form, the value must be preceded with
 "0x" (without the quotation marks). If the value is a number in
 decimal form, any leading zeros should be dropped.

 You can also use the "0n" prefix to specify decimal numbers,
 independent of the current radix.


 151. CodeView Asks for Path to a Source File Without Extension

 Product Version(s): 2.x 3.00 3.10 3.11 3.50
 Operating System:   MS-DOS
 Flags: ENDUSER | s_lib s_utility
 Last Modified:  4-DEC-1990    ArticleIdent: Q67271

 If an old version of the LIB utility is used to store OBJ modules in a
 library, the extension may not be stored. This can cause a problem if
 a module is compiled with debug information and an .EXE is built for
 CodeView to debug. When CodeView attempts to open the source file for
 the module in the library, it will fail because there is no extension.
 It will then prompt you for the filename.

 This is a problem with the Microsoft LIB utilities earlier than version
 3.08 and some third-party library managers. Beginning with LIB version
 3.08, the full filename is stored in the library.


 152. CodeView Does Not Debug kbhit() Correctly

 Product Version(s): 3.00 3.10 3.11  | 3.00 3.10 3.11
 Operating System:   MS-DOS          | OS/2
 Flags: ENDUSER | buglist3.00 buglist3.10 buglist3.11
 Last Modified:  4-DEC-1990    ArticleIdent: Q67360

 When setting a breakpoint between the kbhit() function and a function
 to read a character from the input stream, CodeView will grab the
 character from the input stream when the breakpoint is executed.

 The following code example demonstrates the problem. If a breakpoint
 is placed on the line containing the getch() function, the character
 input from the keyboard will be placed in CodeView before the getch()
 function is actually stepped over. You will not be prompted for the
 character when you step over the getch() function. The character you
 typed to stop the kbhit() loop will be used for the getch() function
 call when that line is executed.

 Microsoft has confirmed this to be a problem in CodeView versions
 3.00, 3.10, and 3.11. We are researching this problem and will post
 new information as it becomes available.

 Sample Code
 -----------

 #include <stdio.h>
 #include <conio.h>

 void main(void)
 {
         int a;

         do {
                 printf(".");
         } while(!kbhit());

         a = getch();         // put breakpoint here

         printf("%c\n", a);
 }






 Microsoft Linker
 =============================================================================


 1. Corrupted Library Causes Error L1102

 Product Version(s): 3.61 3.64 3.65 | 5.01.20 5.01.21
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER |
 Last Modified:  6-DEC-1988    ArticleIdent: Q38201

 The link error "L1102: unexpected end-of-file" is generated when the
 linker attempts to resolve externals in a corrupted or null-length
 library.

 This error most commonly occurs with a combined library, mlibx.lib,
 that is corrupted during the library creation stage of SETUP. Make
 sure to check the \LIB subdirectory for odd or null size libraries.
 Library rebuilding is needed if insufficiently-sized libraries are
 found.

 The L1102 error can also be generated if you inadvertently type in the
 name of a used library at the "list file" prompt, as follows:

    Run File  [SPUD.EXE]:      main.exe
    List File [NUL.MAP]:       libname.lib    (generates faulty library)
    Libraries [.LIB]:          libname.lib
    Definition File [NUL.DEF]: main.def

 This process creates a map listing with the specified library name in
 the current working directory. Because this directory is searched
 before the directory specified in the LIB environment variable, the
 incorrect library containing the map listing is used during linkage,
 causing the error L1102.


 2. /I Linker Option Should Read /INF

 Product Version(s): 3.61 3.65
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 18-OCT-1988    ArticleIdent: Q30515

 Pages 266 and 267 of the "Microsoft C Optimizing Compiler CodeView and
 Utilities" manual for Versions 5.00 and 5.10 incorrectly list the
 shortened name of the /INFORMATION option as /I.

 If /I is given as an option, the result is an error stating that /I is
 an unrecognized option.

 The correct shortened name for /INFORMATION is /INF.


 3. Maximum Libraries LINK Can Handle

 Product Version(s): 3.x 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 18-OCT-1988    ArticleIdent: Q31986

    LINK can handle no more than 32 libraries, i.e., on the LIBRARY
 prompt, you can specify up to 32 libraries.
    If you have more libraries, you have two choices: combine libraries
 or specify some of them at the object modules prompt. In the second
 case, LINK will treat the library as a collection of object modules,
 all of which should be included in your .EXE file.


 4. Maximum Number of Object Modules LINK Allows

 Product Version(s): 3.x 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 18-OCT-1988    ArticleIdent: Q31987

    There is no limit to the number of object modules LINK allows;
 however, LINK can operate only in certain limits imposed by the amount
 of available resources.


 5. The Meaning of an Invalid Object Module

 Product Version(s): 3.x 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 13-OCT-1988    ArticleIdent: Q31988

 An invalid object-module error message means that an object module
 does not conform to Microsoft object format. The description of object
 format can be found in "MS-DOS Encyclopedia Part E: Programming Tools
 Article 19: Object Module."


 6. Object Modules Handled by LINK

 Product Version(s): 3.x 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 15-JUL-1988    ArticleIdent: Q31989

    Successive versions of LINK always are backward compatible, but not
 necessarily upward compatible, i.e., the most recent versions should
 link any existing object module, but not necessarily any future object
 module.
    To solve this problem, update to the latest version of LINK.



 7. How LINK Orders and Combines Segments

 Product Version(s): 3.x 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 15-JUL-1988    ArticleIdent: Q31991

    Every segment belongs to a named class such as 'CODE', 'DATA', or
 'BSS'. LINK orders all segments with the same class name contiguously.
    Within each class, segments are placed in the same order as LINK
 encounters them. Segment classes are placed in the order they appear.
 If you do not give a class name when you define a segment in assembly,
 the segment gets the null class, which is treated like any other segment.
 If the /DOSSEG option is given, or one of the Microsoft language run-time
 libraries is used, LINK imposes the following additional order:

       code (class ending in 'CODE')
       far data (everything but DGROUP and 'CODE')
       DGROUP - the default data segment
           class 'BEGDATA' (special runtime segment)
           near initialized data (everything but 'BSS' and 'STACK')
           near BSS--uninitialized data  (class 'BSS')
           stack



 8. Link Error L1053 Symbol Table Overflow

 Product Version(s): 3.x 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 13-OCT-1988    ArticleIdent: Q31992

 Question:

 I am receiving link error L1053: symbol table overflow. What is the
 limit of the symbol table?

 Response:

 Under MS-DOS, this limit using the DOS-only linker (Versions
 3.x) is dependent on the amount of available memory in your computer.
 LINK can use all conventional memory available under DOS (up to 640K).

 Under OS/2, the segmented-executable linker (Versions 5.x and above)
 has no limit on the size of the symbol table because it extends the
 symbol table in virtual memory.


 9. Temporary Files Created at Link Time

 Product Version(s): 3.x 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 22-JUL-1988    ArticleIdent: Q31993

    The linker creates a temporary file when it runs out of memory to
 hold the symbol table or the load image and run-time relocations of
 the program being linked.



 10. How Overlays Are Set Up By the Linker

 Product Version(s): 3.x 4.06 4.07 5.01.20 5.01.21 5.03
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 26-JAN-1990    ArticleIdent: Q31994

 The overlay linker uses an interrupt to call in overlaid files. By
 default, the interrupt number used for passing control to overlays is
 63 (3f hex).

 The linker links the Microsoft overlay manager from the standard
 Microsoft language run-time libraries. The linker assigns segments to
 overlays based on the grouping you indicate. It replaces
 overlay-to-overlay far calls and root-to-overlay far calls with an
 interrupt sequence that calls the overlay manager. The overlay manager
 swaps overlays if necessary and returns control to the program.

 The linker replaces root-to-overlay and overlay-to-overlay far calls
 with the following sequence:

    INT     3Fh         ; can change # with /OVERLAYINTERRUPT:#
    DB      ?           ; target overlay segment number, where
                        ; every non-root code segment is numbered
                        ; starting at 1
    DW      ?           ; target offset within segment

 The interrupt handler is set to the overlay manager code that swaps
 out the resident overlay if necessary and swaps in the target overlay,
 then jumps to the target address. The overlay manager does nothing
 unusual in servicing the interrupts; it does not disable interrupts.
 However, it may issue INT 21h calls to swap overlays.

 The overlay manager assumes that once your initialization code has
 been executed, DS and SS will always be the same. Furthermore, it
 assumes you will initialize DS and SS to the value of DGROUP (the
 default data segment defined by Microsoft languages). Note that your
 program also must have a stack segment.

 A more detailed description of the overlay manager can be found on
 Page 715 of the "MS-DOS Encyclopedia," "Article 20: The Microsoft
 Object Linker."


 11. Why the First Module in the Code Segment Starts at Offset 16

 Product Version(s): 3.x 4.06 4.07 5.01.21 5.03 | 5.01.21 5.03
 Operating System:   MS-DOS                     | OS/2
 Flags: ENDUSER | s_c s_quickc s_quickasm h_masm h_fortran
 Last Modified: 14-FEB-1990    ArticleIdent: Q58688

 Question:

 Under some circumstances, I get 16 zero bytes at the beginning of my
 code segment. I'm linking with my own replacement C library with
 start-up code. The entry point to this start-up module is the first
 item in the module, and it always ends up at offset 16. Why is this?

 Response:

 The linker will insert 16 bytes at the beginning of the code segment
 if it determines that you are using standard segment naming
 conventions (/MS-DOSSEG) and the NULL segment is not explicitly
 removed (/NONULLSMS-DOSSEG). In your case, the linker assumes that you
 need support for signal() and allocates the first 16 bytes for it.

 Note: This will always be done for C programs by the compiler.


 12. Linker Outputs Information with Invalid Object Module

 Product Version(s): 3.x 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 15-JUL-1988    ArticleIdent: Q31999

    When an invalid object-module error message occurs, some
 information about the record and the position is printed.
    This information includes the object record type and the relative
 position of the record in the .OBJ file. There is little you can do
 with this information; it is mainly for compiler and assembler
 developers to point to the wrong object record.


 13. Incremental Linking

 Product Version(s): 3.x 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 15-JUL-1988    ArticleIdent: Q32000

    The following is a description of the incremental-linking process.
    Your file is built from a set of .OBJ files. Each .OBJ file is
 produced by the compiler or assembler from a source file. If a set of
 .OBJ files is large, then linking time can be long. If you change only
 one source file (i.e., in your set of .OBJ files you have one new .OBJ
 file), you can link all .OBJs one more time, or patch your .EXE file
 with the new .OBJ file. This patching is called incremental linking.
    Incremental linking only is supported for OS/2 and Windows
 programs.



 14. Explanation of a MAP File

 Product Version(s): 3.x 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 15-JUL-1988    ArticleIdent: Q32001

    A MAP file gives you a picture of how your code and data are
 arranged in memory when the program is loaded.
    First you get the list of segments in the order in which they will
 be loaded into memory. For each segment, you have its starting
 address, length, name, and class. Following the segments are groups,
 each specifying the starting address of the group.
    If you specify the /MAP switch and list filename, in the MAP you
 will get two lists of public symbols in your program. The first list
 will be sorted alphabetically, the second by addresses.
    If you specify the /LINENUMBERS switch, then in the MAP, you will
 get line numbers and the associated addresses of your source program.
 To produce line numbers in the MAP, give LINK an object file with
 line-number information. Use the /Zd option with any Microsoft
 compiler to include line numbers in the object file.
    Information from the MAP will help you debug your program and
 understand how the program is loaded into memory.


 15. L1087: "Unexpected End-of-File on Scratch File"

 Product Version(s): 3.x 5.x  | 5.10
 Operating System:   MS-DOS   | OS/2
 Flags: ENDUSER |
 Last Modified: 13-OCT-1988    ArticleIdent: Q34669

 The Link Utility generates the error message L1087: "unexpected
 end-of-file on scratch file" when a disk with the temporary linker
 output file has been removed. This information is documented in the
 "Microsoft Macro Assembler CodeView and Utilities Guide."

 The error message L1087 also can be caused by insufficient memory
 available on the disk that contains the temporary linker output file.
 The disk can be a hard disk, floppy disk, or RAM disk.


 16. Assigning Addresses to Overlay Segments

 Product Version(s): 3.x 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 15-JUL-1988    ArticleIdent: Q32003

    The linker assigns only code segments (identified by class names
 ending in "CODE") to overlays. Data segments go in the root. The
 particular overlay the segment goes in is determined by the module
 that first defines the segment.

    Note that the linker assigns segments, not object modules, to
 overlays. Therefore, if you have the following command

     LINK A+(B+C)

 where

     A   defines public SEG1
     B   defines public SEG2
     C   defines public SEG1

 then C's contribution to SEG1 goes in the root, not in the first
 overlay, because SEG1 was first defined in a root module.
    The linker orders all segments as it normally would, ignoring the
 overlays and using the class and combine-type rules described
 elsewhere. The linker then assigns addresses for every segment in the
 root up to the first overlay segment. Before the first overlay
 segment, it defines a special empty segment called OVERLAY_AREA. Then
 for each overlay it assigns addresses for every segment in the overlay
 so that the first segment in the overlay starts at OVERLAY_AREA. One
 particular overlay will end at a higher address than all the others;
 at this address, the linker defines a special empty segment called
 OVERLAY_END. Finally, the linker assigns addresses for all remaining
 segments in the root so that the first one starts at OVERLAY_END. The
 load image looks like the following:

         ------------+-> 0000
         |           |
         |  root     |
         |           |
         +-----------+-> OVERLAY_AREA
         |  overlay  |
         |  area     |
         |           |
         +-----------+-> OVERLAY_END
         |  root     |
         +-----------+

    The resultant MAP file has some different contents than the
 pre-overlay file. All items listed are declared as "res", meaning
 resident. The items contained within the overlay modules are also
 declared as "res".
    At the top of the MAP file, the segments are listed in the exact
 order in which they will be in the load image, and each segment is
 identified as being in a particular overlay or the root.
    Every symbol marked "res" is in a root segment and every symbol
 marked "ovl" is in an overlay segment. If symbols are not where you
 think they ought to be, remember the linker assigns segments, not
 modules, to overlays.
    For more information on overlays, refer to the 1988 "MS-DOS
 Encyclopedia."


 17. Link Error L1089

 Product Version(s): 3.51 3.55 3.60 3.61 3.64 3.65 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 22-JUL-1988    ArticleIdent: Q32829

    If you are receiving the following error message, check to see if
 the TMP environment variable is set correctly:

    L1089   'filename' : cannot open response file

   If the TMP variable is not set, temporary files cannot be created
 and this error may occur.



 18. Cannot Overlay Small-Model Code

 Product Version(s): 3.60 3.61 3.64 3.65 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 12-OCT-1988    ArticleIdent: Q34294

 Problem:

 I have specified overlays for my small-model code, but the link map
 shows that no overlays are produced.

 Response:

 You cannot overlay small-model code. You must change the memory model
 to medium, large, or huge. Page 285 of the "Microsoft CodeView
 Utilities" manual that comes with C Versions 5.00 and 5.10, MASM
 Versions 5.00 and 5.10, and Pascal Version 4.00, and Page 135 of the
 "Microsoft FORTRAN Optimizing Compiler User's Guide" states that you
 can overlay only modules to which control is transferred and returned
 by a standard 8086 long (32-bit) call/return instruction.


 19. Link Error 4051

 Product Version(s): 3.60 3.61 3.64 3.65 5.01.20 5.01.21
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 22-JUL-1988    ArticleIdent: Q32831

    If you receive link error 4051, check the following:

    1. Is the LIB environment variable set correctly? Check
       for spaces around the equal sign or any extra characters
       at the end of the line.
    2. Which version of the linker is being used? Old versions of
       the linker do not recognize the LIB environment variable.
          Make sure the linker being used is the one that came with
       the product.
    3. Are the library names being asked for component libraries or
       combined libraries? Libraries compiled under C Version 4.00 or
       earlier have component library names embedded in the .OBJ files.
       With later versions of the C compiler, combined libraries are used
       and the component libraries will not be found.
          This behavior also exist when upgrading from Pascal Versions 3.32
       or earlier to Pascal Versions 4.00 or greater.
          The work-around for this behavior is to recompile all .OBJ file
      (and libraries) with the new compiler or to use the /NOD switch
      when linking, and specify all the libraries (combined and otherwise)
      to be used. The following is an example:

             link /NOD  test,,,llibce.lib;

    4. Is the correct library available for the math option chosen?
    FORTRAN defaults to the co-processor library (e.g. LLIBFOR7.LIB).
    C and Pascal default to the emulator math library (e.g. SLIBCE.LIB
    and LIBPASE.LIB)



 20. LINK /CO /DO in OS/2 Gives Protection Violation

 Product Version(s): 5.01.21 | 5.01.21
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER | buglist5.01.21
 Last Modified: 13-OCT-1988    ArticleIdent: Q34374

 The Microsoft Segmented Link Utility Version 5.01.21 will
 incorrectly generate a protection violation under OS/2 when the
 command line uses the options /CO /DO, respectively.

 OS/2 gives the message SYS1943: "A program caused a protection
 violation." The SYS1811 violation follows, indicating the process has
 stopped.

 The work around for this problem is to order the switches differently.
 Instead of including /CO /DO in the command line, the command line can
 be reorder to /DO /CO.

 Microsoft has confirmed this to be a problem in Version 5.01.21. We are
 researching this problem and will post new information as it becomes
 available.


 21. /NOE Option for Redefinition Error L2044

 Product Version(s): 3.x 5.x | 5.10
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER |
 Last Modified: 13-OCT-1988    ArticleIdent: Q34502

 The /NOEXTDICTIONARY switch tells the linker NOT to take advantage of
 additional information recorded in Extended Dictionary in the library
 file. This additional information describes which module in the library
 calls any other module from the same library, saving linker number
 of passes through the library file to pick up all required modules.

 If you have a call in your code to the library function FOO and FOO
 calls another function BAR from the same library, then at processing
 time of FOO, the linker will pull out BAR. This process occurs because
 the extended dictionary has a link between FOO and BAR.

 Linking without /NOE causes the following error if you want to pull
 FOO in from the library but you want to provide its own BAR:

 L2044 BAR : symbol multiply defined, use /NOE

 This error resulted from the linker pulling FOO and BAR from the
 same library, then later it sees BAR coming from user .OBJ file.

 Using /NOE in this case prevents the linker from pulling out
 BAR from the library, so your BAR routine is used instead.

 If you have genuine symbol redefinition, then when linking with /NOE
 you will see the following error:

 L2025 BAR : symbol defined more than once


 22. L2001 Fixups without Data

 Product Version(s): 3.65 5.01.21 | 5.01.21
 Operating System:   MS-DOS       | OS/2
 Flags: ENDUSER |
 Last Modified: 12-OCT-1988    ArticleIdent: Q35155

 The Link Utility can generate the linker error message L2001:
 fixup(s) without data. In the manual, the linker error is described
 as follows:

 A FIXUPP record occurred without a data record immediately
 preceding it. This is probably a compiler error. (See
 the "Microsoft MS-DOS Programmer's Reference" for more information
 on FIXUPP.

 In most cases, the error message is generated from an
 assembly-language program that doesn't make sense from the linker's
 point of view, but is convenient for users. The following is an
 example:

     extrn   foo:word

     ABSEG   segment at 123          ; absolute segment

     dw      offset DGROUP:foo       ; offset portion of address of "foo"

     ABSEG   ends

 This tells the linker to fix up a location in ABSEG with the address
 of foo. But ABSEG is an absolute segment and has no data to be fixed
 up.

 Another example is when you include the same STRUC definitions in both
 absolute and non-absolute segments, so that the STRUC definitions
 contain relocatable addresses.



 23. Setting the Overlay Interrupt (/O) in LINK

 Product Version(s): 3.61 3.65
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 20-JAN-1989    ArticleIdent: Q40408

 Question:

 Page 272, Section 12.2.12, of the "Microsoft CodeView and Utilities
 Software Development Tools for the MS-DOS Operating System" manual
 states that you can change the default overlay interrupt. The default
 interrupt is 3F hexadecimal. Is the manual correct? Do you have to
 change the interrupt if you have a program that uses overlays and it
 spawns a program that also uses overlays?

 Doesn't the compiler save interrupts? Suppose both Programs A and B
 use overlays and A spawns B. If B is a Microsoft C Version 5.00 or
 5.10 program, shouldn't it restore the original INT 3F address when it
 exits? Thus, everything should work correctly without
 /OVERLAYINTERRUPT.

 Response:

 You are correct; the C Versions 5.00 and 5.10 compiler saves and
 restores the interrupt so there should be no conflict. The C Versions
 5.00 and C 5.10 manual is incorrect. This switch need only be used if
 you are linking a program with overlays, and INT 3F is being used by
 something else when you run the program. For example, INT 3F might be
 used to communicate with a hardware board or a TSR might use it;
 however, this is unlikely.

 This option is for advanced users who know their configurations well
 enough to know who is using which interrupt vectors and know there is
 a conflict.


 24. LINK Environment Variable Ignored When Linking Through CL

 Product Version(s): 5.00 5.10 | 5.10
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | S_C S_QuickC
 Last Modified: 15-AUG-1989    ArticleIdent: Q47503

 Problem:

 To increase the size of my stack, when I set an environment variable
 called LINK equal to /ST:4096, it doesn't work correctly when I link
 using CL.

 Response:

 Before CL spawns the linker, it clears the environment of all
 variables except LIB. Consequently, the LINK environment variable
 doesn't exist when the linker is invoked, and any options that were
 specified by it are not seen. When linking with CL, any desired linker
 options should be specified on the CL command line after the /link
 switch.

 The same behavior is seen with the command line compilers from QuickC
 Version 1.00 and 1.01, but not with QuickC 2.00 or QuickAssembler.


 25. Why Unitialized Global Variables Don't Appear in C 5.10

 Product Version(s): 3.65
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# G881021-5044
 Last Modified:  6-DEC-1988    ArticleIdent: Q38725

 Questions:

 Why don't uninitialized global variables show up in the library
 listing when the module containing them has been placed in the
 library? It appears that the librarian does not "see" uninitialized
 global variables.

 If my main program declares an extern, and an .OBJ with which its
 linked declares it globally (without extern), but doesn't initialize
 it, the symbol appears in the link map and space is allocated for it
 in the .EXE. This behavior seems different from previous versions of
 the compiler. If the .OBJ file is placed as a library rather than
 linked explicitly, the symbol does not appear in the .EXE. Why does it
 behave differently?

 Response:

 In Version 5.00 of the C Compiler, we introduced a new concept into
 our linking process called "communal data." Communal data can be
 declared in many modules, but only one copy of the data will exist
 in the linked .EXE file. (It is similar to the concept of COMMON
 blocks in FORTRAN.)

 In C, data declared outside of a function without a storage class is
 now considered to be communal data. (This is a change from previous
 versions.) Communal data declarations generate no definitions, just
 declarations; whereas initialized, or global, data declarations
 generate both definitions and declarations.

 Communal declarations may refer to a global definition. If they do,
 the linker simply adjusts the address as necessary. However, if
 there is no global definition of the variable, the linker combines
 the declarations into one definition and allocates the appropriate
 amount of space. For example, it is legal to declare

    int x;

 in several different modules without a corresponding

    int x = 0;

 Communal declarations are NOT copied into libraries. (This is
 documented on Page 84 of the "Microsoft C Language Reference Manual.")
 If you want the variable to appear in a library, it MUST be
 initialized so that it is global rather than communal. Communal
 variables are not included in libraries because they can cause
 strange conflicts. For example, let's suppose you
 unwittingly used a variable name that was also the name of a communal
 variable in your library. At link time, the linker would allocate
 only ONE copy of that variable without generating any warning.

 The symptom would be that your variable would mysteriously change
 every time you called the library function that used the communal
 variable. This problem would be a very difficult to trace.

 Now that we understand communal variables and how they interact with
 libraries, we can answer your questions.

 The first question was basically, "Why don't my communal variables
 show up in the library listing?" Because communal data is not placed
 into the library, it won't show up in the listing.

 The second question was, "How come the communal variable shows up in
 the .EXE file if I link it from an .OBJ file but not from a .LIB
 file?" It shows up from the .OBJ file because the communal variable
 is allocated space by the linker if it doesn't resolve to a global
 definition. It does NOT appear in the link produced by the .LIB file
 because it does not appear in the library dictionary.

 Note: this behavior is the result of doing something we ask you not to
 do; namely, putting communal data in a library. Data intended to be
 placed in a library must be initialized.


 26. Example of Using a Response File with LINK

 Product Version(s): 3.65   | 5.01.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 20-JAN-1989    ArticleIdent: Q40429

 The following is a small example of using a response file with LINK.

 A response file contains responses to the LINK prompts. The responses
 must be in the same order as the LINK prompts.

 LINK treats the input from the response file just as if you had
 entered it in response to prompts or in a command line. It treats any
 carriage-return-linefeed combination in the response file the same as
 if you had pressed the ENTER key in response to a prompt or included a
 comma in a command line.

 Note: You cannot put comments in response files.

 The following is an example of a file named RESPONSE.ONE:

 file1 file2 file3 file4
 /pause /map
 filelist
 graphics.lib

 Type the following at the command line:

    LINK @response.one


 27. Error L2025: Symbol Defined More than Once

 Product Version(s): 5.10   | 5.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 20-JAN-1989    ArticleIdent: Q40485

 Problem:

 I cannot link a function name in my object file with a library
 containing that same function name and have the resulting EXE call my
 function and not the library's.

 I am using /NOE; however, I receive the following error:

 (...): error L2025: (my function name) : symbol defined more than once
  pos: (some number) Record type: 53E8

 Response:

 You can only perform this task if the function name is an individual
 module. The following procedure demonstrates the error:

 1. Create a file CALL.C that calls functions A() and B().

 2. Create functions A() and B() in fileA.c and fileB.c, and compile
    them to objects.

 3. Do the following to create TEST.LIB:

       LIB TEST +fileA +fileB, test.lst

 4. Change B() in fileB.c and compile the following:

       cl call.c fileB.c test.lib /link /NOE /INF

    You will have an EXE that calls A() from the library and B() from
    your modified fileB.c.

 5. Combine fileA.c and fileB.c into one file called TEST.C.

 6. Compile to object code.

 7. Delete the old TEST.LIB, and do the following:

       LIB TEST +test, test.lst

    (Normally you would change fileB.c, but this is not necessary here.)

       cl call.c fileB.c test.lib /link /NOE /INF

 You will receive the following error:

 TEST.LIB(test.c) : error L2025: _B : symbol defined more than once
  pos: 13E Record type: 53E8
 There was 1 error detected

 When you encounter this error, it is usually because the function you
 are trying to overwrite is part of a set appearing in one module.

 The library listing looks as follows in the first case:

 _A................fileA             _B................fileB

 fileA             Offset: 00000010H  Code and data size: 95H
   _A

 fileB             Offset: 000002a0H  Code and data size: 92H
   _B

 You will be able to replace A() or B(). The listing in the
 second example looks as follows:

 _A................test              _B................test

 test              Offset: 00000010H  Code and data size: deH
   _A                _B

 You will not be able to replace either A() or B() without removing the
 TEST module with the LIB utility. You may have to provide replacements
 for both functions and not just the one you want to change. For more
 information, query on the following words in this KnowledgeBase:

    L2029 unresolved externals


 28. Default for NODATA When Using the _export Keyword

 Product Version(s): 5.01.21 | 5.01.21
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER | buglist5.10.21 buglist5.02 fixlist5.03
 Last Modified: 21-AUG-1989    ArticleIdent: Q47826

 Question:

 What is the default for NODATA when using the _export keyword? The
 _export keyword is used to mark functions in DLLs for export. It
 appears that for real-mode windows, for normal applications, _export
 does not use NODATA. However, for DLLs (also for real-mode windows)
 _export marks the function NODATA. How does the keyword _export mark
 functions (NODATA or not).

 Response:

 The default as issued by the compiler is not NODATA, i.e., the
 exported routine is assumed to use the shared data segment.
 Unfortunately, the linker has a problem that causes it to mistakenly
 assume NODATA for all exports declared from the .OBJ file.

 Microsoft has confirmed this to be a problem with LINK Version 5.01.21
 and 5.02. The problem was corrected in LINK Version 5.03 and later.

 In OS/2 this should not make any difference. In Windows, the program
 loader looks for the -Gw sequence in the prolog of the exported entry
 and replaces it with a sequence to load DS. The _loadds keyword will
 generate the load-DS sequence in the first place.

 In any case, a workaround is to not use the _export keyword and
 declare the routine in EXPORTS in the .DEF file.


 29. No Default Extension for a Linker Response File

 Product Version(s): 3.55 3.60 3.61 3.64 3.65  | 5.01.21 5.01.21
 Operating System:   MS-DOS                    | OS/2
 Flags: ENDUSER |
 Last Modified:  2-MAR-1989    ArticleIdent: Q41611

 The Microsoft Overlay Linker does not have a default extension for a
 response file; unlike Phoenix's PLINK, which uses a default .LNK
 extension.

 This information also applies to the Microsoft Segmented-Executable
 Linker.


 30. Ambiguous Switch /PAC with QuickC 2.00 Linker

 Product Version(s): 4.06
 Operating System:   MS-DOS
 Flags: ENDUSER | s_quickc b_quickbas docerr
 Last Modified: 22-JAN-1990    ArticleIdent: Q42027

 Using the /PAC switch with LINK Version 4.06 results in the
 following error:

    fatal error L1001: PAC : option name ambiguous

 This same option works correctly on Versions 3.65 and 5.01.21, and is
 documented as being a valid shorthand name for /PACKCODE on Page 131
 of the "QuickC Tool Kit."

 The problem is due to a conflict with an option that is not documented
 in the Tool Kit, but is displayed when LINK is invoked with /HELP. The
 option that causes the ambiguity is /PACKDATA, which causes data
 segments to be combined.

 The shortest version of /PACKCODE that can be used is /PACKC.
 Similarly, /PACKD is the shortest version of /PACKDATA that can be
 used.


 31. /CO before /DO Causes Problems in LINK

 Product Version(s): 3.65 4.06 5.01
 Operating System:   MS-DOS
 Flags: ENDUSER | h_masm s_pascal h_fortran buglist3.65 buglist5.01
 Last Modified: 28-MAR-1989    ArticleIdent: Q42212

 When compiling or assembling with the /Zi switch to include CodeView
 symbolic information and linking with /CO to preserve it, the
 placement of the /DO switch is crucial. If the /CO switch is specified
 before /DO, the following behavior may occur when running CodeView:

    Message                                Behavior

    Enter directory for  (cr for none)?    When CodeView is executed,
                                           no source code will appear.

    Unable to open file

    Internal debugger error: 13            When attempting to change
                                           from assembly view to source
                                           CodeView. Hanging of the
                                           machine when executing
                                           CodeView.

 If switching the order of the /CO and the /DO switches does not
 take care of the problem then you have to put the .DOSSEG into
 your MASM routines and not use the /DO switch.

 Microsoft has confirmed this to be a problem in Versions 3.65 and
 5.01. We are researching this problem and will post new information as
 it becomes available.

 While LINK Version 5.01 may be used in OS/2, the /DO switch has no
 meaning. Using it, however, causes the linker to GP fault if /CO
 precedes /DO.



 32. Unimplemented Switch /BI with QuickC 2.00 Linker

 Product Version(s): 4.06
 Operating System:   MS-DOS
 Flags: ENDUSER | S_QUICKC
 Last Modified: 24-JAN-1990    ArticleIdent: Q42849

 The /BINARY switch for Link Version 4.06 is documented on Page 122 of
 the "Microsoft QuickC Tool Kit" as a switch used to create .COM files
 for assembly-language programs. Its shorthand version is /BI. This
 switch is an alternative to creating .EXE files and then running them
 through EXE2BIN.

 This switch is currently not implemented, a fact documented in the
 README.DOC on line 665, "Creating a .COM file." Using it will result
 in the following error:

     fatal error L1002: BINARY : unrecognized option name


 33. How /NOE (No Extended Dictionary) Is Used by the Linker

 Product Version(s): 3.65 4.06 5.01 | 5.01
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER | S_C H_FORTRAN S_QUICKC
 Last Modified:  6-APR-1989    ArticleIdent: Q43009

 This article contains information about the LINK option /NOE and how
 it relates to the three following topics:

 1. The Extended Dictionary and how LINK uses it

 2. The definition of genuine redefinition

 3. Why redefinitions are not detected in some situations

 The LINK option /NOE stands for No Extended Dictionary.

 What is the extended dictionary and how does LINK use it? How does
 LINK use the extended dictionary?

 LINK uses the extended dictionary to speed up library searching. For
 example, if the library module A calls functions in module B and
 module C, the extended dictionary tells LINK that, if your program
 requires module A from library, it will also require modules B and C.
 According to this information, LINK pulls in the three modules A, B,
 and C all at once. This way, LINK doesn't have to search the library a
 second time to resolve references from module A to modules B and C.

 What is a genuine redefinition?

 The ERRMSG.DOC file states that when linker error L2044 occurs, the
 /NOE switch should be used. When linker error L2025 occurs, the
 program has a genuine redefinition problem.

 A genuine redefinition is any redefinition that has nothing to do with
 the extended dictionary. A redefinition error that occurs when you
 specify the /NOE switch indicates a genuine redefinition, as in the
 following example:

     FOO.OBJ:
         defines "_foo"
         calls "_libfunc"

     Module A: (in XYZ.LIB):
         defines "_libfunc"
         defines "_foo"

 If you run "LINK foo /NOE,,,xyz.lib", the L2025 error will be produced
 because module A is pulled in and redefines the symbol "_foo".

 When LINK encounters the redefinition while processing a library
 module, it assumes that the error might go away if you were to add the
 /NOE switch. This would be true if the symbols were defined like this
 as follows:

     FOO.OBJ:
         defines "_foo"
         calls "_libfunc"

     Module A (in XYZ.LIB):
         defines "_libfunc"
         calls "_foo"

     Module B ( in XYZ.LIB ):
         defines "_foo"

 The extended dictionary tells LINK to link modules A and B, even
 though module B should not be linked because "_foo" is already
 defined. In this case, the /NOE switch will eliminate the error.

 LINK cannot figure out when the error is due to the extended
 dictionary and when it is not; therefore, it assumes that the extended
 dictionary will cause a redefinition error when processing a library
 module.

 Please note that redefinitions not detected in some situations. For
 example, when the function 'printf' is redefined in a program module
 and the module is linked with SLIBCER.LIB without using the /NOE
 switch, LINK does not complain about the redefinition at all. LINK
 does not detect a redefinition because the module that defines printf
 in the library is not pulled in; thus, there is no redefinition.

 If your program module redefines a library function that is also
 called by other library functions used by your program, you will get a
 redefinition error. The extended dictionary specifies which library
 modules call routines in other library modules. Consider a
 "second-level" function to be any library function called by a library
 function in another module. For example, spawnve and _setargv are
 second-level functions because they are called by other library
 functions; printf is not. You can get a redefinition error only if you
 redefine a second-level library function called by some first-level
 routine being linked into your program.


 34. Producing an _TEXT Segment for Multiple Object Modules

 Product Version(s): 3.x 4.06 | 5.01.20 5.01.21
 Operating System:   MS-DOS   | OS/2
 Flags: ENDUSER | S_C
 Last Modified:  6-APR-1989    ArticleIdent: Q43128

 In a map file, a <modulename>_TEXT will be produced for each logical
 code segment in your program. Since small and compact model programs
 have only one code segment, you only get one logical segment, _TEXT.
 Medium- and large-model programs, however, will have a separate
 logical segment for each object module in the program, and thus produce
 a <modulename>_TEXT for each logical segment.

 To generate a map file, use the /M option with LINK or the /Fm option
 with CL.

 The following is an example map file generated when compiling a
 program with two object modules in small-memory model:

  Start  Stop   Length Name                   Class
  00000H 016EAH 016EBH _TEXT                  CODE
  ...

 The following is an example map file generated when compiling the same
 program with two object modules in large-memory model:

  Start  Stop   Length Name                   Class
  00000H 0000DH 0000EH MAPL_TEXT              CODE
  0000EH 00023H 00016H MAP2_TEXT              CODE
  00024H 01B2CH 01B09H _TEXT                  CODE
  ...

 MAPL_TEXT and MAP2_TEXT come from the files MAPL.OBJ and MAP2.OBJ,
 respectively. The _TEXT is the Microsoft run-time library and any
 third-party libraries.



 35. LINK: Renaming Overlayed Executables Will Cause Problems

 Product Version(s): 5.01.21
 Operating System:   DOS
 Flags: ENDUSER | s_C s_Pascal h_FORTRAN
 Last Modified:  6-APR-1989    ArticleIdent: Q43139

 When the Microsoft linker creates an executable file with overlays,
 the name of that EXE is hard coded into the file for use by the overlay
 manager. The Microsoft linker only creates internal overlays, i.e.,
 rather than producing FOO.EXE, FOO1.OVL, and FOO2.OVL, the two
 overlays are contained in FOO.EXE.

 If the executable is renamed at any point after linking, the overlay
 manager will still use the hard-coded name found in the EXE to locate
 the overlays, and will fail with the following prompt:

    Cannot find <oldname>
    Please enter new program spec:

 In order to change the name of the executable without receiving this
 error, it must be relinked and given the new name at that time.


 36. LINK: Creating and Accessing _edata and _end

 Product Version(s): 3.X 4.06 | 5.01.20 5.01.21
 Operating System:   MS-DOS   | OS/2
 Flags: ENDUSER | s_c
 Last Modified:  6-APR-1989    ArticleIdent: Q43165

 LINK creates the two symbols _edata and _end when the LINK option
 /DOSSEG is used. If a program is compiled by a Microsoft high-level
 language compiler, or if an assembly program written in Microsoft MASM
 uses .DOSSEG directive, LINK uses this option automatically.

 LINK gives _edata the address of the beginning of BSS segment and
 gives _end the address of the end of BSS segment. Since the STACK
 segment is directly above the BSS segment, the address of _end also
 marks the lowest address of the STACK segment.

 To obtain the addresses for these two symbols, declare the following
 in your C program:

 unsigned char edata, end ;

 The addresses, &edata and &end, can now be used to locate _BSS and
 STACK. They can also be examined in CodeView. Modifying these two
 variables is not recommended.

 Note: The segment BSS referred to in this article actually includes
 the segment C_COMMON. However in a map file created by LINK, BSS and
 C_COMMON are listed as two separate segments.



 37. Linker Options /PADDATA and /PADCODE

 Product Version(s): 4.06
 Operating System:   MS-DOS
 Flags: ENDUSER | S_QuickC docerr
 Last Modified: 18-SEP-1989    ArticleIdent: Q44928

 Question:

 I ran the linker Version 4.06 that comes with the Microsoft QuickC
 Compiler Version 2.00 with the /help option as follows:

    LINK /HELP

 I noticed two switches for which I couldn't find documentation:
 /PADDATA and /PADCODE. What are these options for?

 Response:

 The /PADC[ODE]:padsize option causes LINK to add filler bytes to the
 end of each code module. The option is followed by a colon and the
 number of bytes to add. (Decimal radix is assumed, but you can specify
 special octal or hexadecimal numbers by using a C-language prefix.)
 Thus, the following adds an additional 256 bytes to each code module:

    /PADCODE:256

 The default size for code-module padding is 0 bytes.

 The /PADD[ATA]:padsize option performs a function similar to
 /PADCODE, except that it specifies padding for data segments (or data
 modules, if the program uses small or medium-memory models). Thus,
 the following adds an additional 32 bytes to each data module:

    /PADDATA:32

 The default size for data-segment padding is 16 bytes. Note that if
 you specify too large a value for padsize, you may exceed the 64K
 limitation on the size of the default data segment.

 These two options are quite useful when used in conjunction with
 QuickC Version 2.00's incremental linking option. Using them correctly
 increases the incremental linking speed of a program.

 These two options are documented on Page 64 in the update section of
 the Microsoft C Optimizing Compiler Version 5.10 "CodeView and
 Utilities, Microsoft Editor, Mixed-Language Programming Guide" manual.


 38. Linker Error L2013 May Be a Result of a Problem in MASM 5.10

 Product Version(s): 3.x 4.06 4.07 5.01.21 5.02 5.03 5.05
 Operating System:   MS-DOS
 Flags: ENDUSER | h_masm
 Last Modified: 27-DEC-1990    ArticleIdent: Q59894

 The error message for linker error L2013 is as follows:

    error L2013 LIDATA record too large
       pos: xxx Record type: 743C

 In the README.DOC file that comes with MASM version 5.10, Microsoft C
 version 5.10, and the "Microsoft FORTRAN CodeView and Utilities User's
 Guide" version 5.00 manual, the recommended course of action is to
 call Microsoft Product Support at (206) 637-7096.

 The error is a result of an invalid object module. This is a known
 problem in MASM 5.10. The most likely cause is a duplication of some
 large data item, such as a structure.

 The easiest workaround is to break up the duplication(s) into smaller
 parts.


 39. LINK 5.02 Should Not Be Used with ILINK 1.10

 Product Version(s): 5.02
 Operating System:   MS-DOS
 Flags: ENDUSER | S_QuickC
 Last Modified: 30-AUG-1989    ArticleIdent: Q45536

 LINK Version 5.02, which comes as a secondary linker for QuickC 2.00,
 should not be used with ILINK Version 1.10, which also comes with
 QuickC 2.00.

 Inside the QuickC environment, this combination has caused problems
 with floating point-values being printed with printf. Outside of the
 environment, the same executable results in math error M6104.

 The source code below prints "FP = 0.00000" instead of "FP =
 5.020000". Running from the DOS prompt, in this case, produces the
 same results.

 Source Code
 -----------

     #include <stdio.h>

     void main( void )
     {
         float fp = 5.02F;

         printf( "FP = %f\n", fp );
     }

 LINK Version 4.06 should be used if ILINK is also to be used. If it is
 necessary to use Version 5.02 of the linker, incremental linking
 should be disabled from within the environment.

 Microsoft is researching this problem and will post new information as
 it becomes available.


 40. Linker Errors L4013, L2048, and L4038: Overlaying in OS/2

 Product Version(s): 5.01.20 | 5.03
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER | S_C H_Fortran
 Last Modified: 21-JUN-1989    ArticleIdent: Q45619

 The linker does not overlay files when linking with protected mode
 run-time libraries. If told to overlay a program that is being linked
 with a protected mode run-time library, the linker responds with one
 or more of the following errors:

    LINK : warning L4013: invalid option for new-format executable file
    ignored
    LINK : error L2048: Microsoft Overlay Manager module not found
    LINK : warning L4038: program has no starting address

 possibly followed by (in DOS):

    run-time error R6001
    - null pointer assignment

 or possibly followed by (in OS/2):

    A general protection (GP) fault. It may also go into an infinite
    loop after creating the temporary file (for large executables).

 The workaround is to create two versions of the executable, an
 overlayed DOS version and a non-overlayed OS/2 version.

 Microsoft is researching this problem and will post new information as
 it becomes available.


 41. Link Error L1005: /PACKCODE: Packing Limit Exceeds 65,536

 Product Version(s): 3.65
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 21-JUN-1989    ArticleIdent: Q45724

 The Microsoft Overlay Linker Version 3.65 presents the following error
 message when the /PACKCODE: switch is used with a value greater than
 65,536 (64K):

    Link Fatal Error L1005:

 No error message text is supplied, and the error cannot be referenced
 in the Microsoft C 5.10 "CodeView and Utilities, Microsoft Editor,
 Mixed-Language Programming Guide." The error message should read as
 follows:

    Link Fatal Error L1005: /PACKCODE: Packing Limit Exceeds 65,536

 The error is reported correctly by the Microsoft QuickC Linker Version
 4.06 and all 5.0x versions of the Microsoft Segmented-Executable
 Linker. It is correctly documented in the Version 2.00 "Microsoft
 QuickC Tool Kit," on Page 278, and on Page 373 of the Version 5.00
 "Microsoft FORTRAN, Microsoft CodeView and Utilities User's Guide"
 manual, as follows:

    The value supplied with the /PACKCODE option exceeds the limit of
    65,536 bytes.


 42. What the /HIGH and /DS Linker Options Do

 Product Version(s): 3.65
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# G890607-19979
 Last Modified: 13-JUL-1989    ArticleIdent: Q46745

 Question:

 I would like information on the /HIGH and /DS options of the linker.
 Specifically, what changes are needed in the .EXE file to tell the
 loader to put it high?

 Response:

 Basically, these are hold-over features from DOS Version 1.00 and from
 the original Microsoft/IBM Pascal and FORTRAN Compilers -- they're of
 little or no use under DOS 2.00 and later. Specifically, programs
 linked with the /HIGH switch are allocated all of the memory in the
 machine and cannot release unneeded memory back to DOS; therefore, no
 other program can be loaded into memory.

 The /HIGH switch sets both the minalloc and maxalloc fields in the .EXE
 header to zero. This combination of values causes the loader to load
 the program in high memory.

 /DSALLOCATE (or /DS) causes DGROUP to be "shifted" upwards so that the
 high address in the group is always FFFFh. Offsets into DGROUP are
 adjusted appropriately.

 These switches are strictly incompatible with our current high-level
 languages -- the only possible use for them is in a MASM program.
 Microsoft doesn't recommend using them at all unless you know
 precisely what you're doing.

 There is good documentation on what the /HIGH and /DSALLOCATE switches
 do, as well as how the loader works, in the "MS-DOS Encyclopedia,"
 starting on Page 719. (This excellent reference manual is now less
 expensive and available in paperback).


 43. How Minimum Load Size Is Calculated

 Product Version(s): 3.65
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# G890607-19979
 Last Modified: 13-JUL-1989    ArticleIdent: Q46774

 The MS-DOS program loader uses the following formula to calculate the
 number of 16-byte paragraphs to use when loading a program:

    TotPages * 20h - NumHeader + 10h + MaxAlloc

 The formula calculates the number of 16-byte paragraphs, unless
 there's not enough memory, in which case all the available memory is
 used. If there are not at least

    TotPages * 20h - NumHeader + 10h + MinAlloc

 paragraphs available, DOS cannot and will not load the program.

 The 20h is the size of a page in paragraphs, which is the size of a
 page (512 bytes) divided by the size of a paragraph (16 bytes).

 The 10h is the size in paragraphs of the 256-byte Program Segment
 Prefix that precedes all programs in memory.

 All of the values used in the formulae shown above are words (shown in
 the following) that are stored in standard Intel low-byte-first format
 in the .EXE file header:

    Value           Name used by EXEHDR             Offset in .EXE header
    -----           -------------------             ---------------------

    TotPages        Pages in file                   4 - 5
    NumHeader       Paragraphs in header            8 - 9
    MinAlloc        Extra paragraphs needed         0Ah - 0Bh
    MaxAlloc        Extra paragraphs wanted         0Ch - 0Dh

 For more information, refer to a good MS-DOS reference such as the
 "MS-DOS Encyclopedia."


 44. L1074 Name: Group Larger Than 64K Bytes

 Product Version(s): 4.06
 Operating System:   MS-DOS
 Flags: ENDUSER | S_C S_QuickC
 Last Modified: 24-JUL-1989    ArticleIdent: Q46996

 The Microsoft QuickC Compiler Version 2.00 returns the following
 linker error message when the size of DGROUP (the default data
 segment) exceeds 64K:

    L1074 name: group larger than 64K bytes

 This error is documented on Page 282 of the "Microsoft QuickC Tool
 Kit" manual as follows:

    The given group exceeds the limit of 65,536 bytes.

    Reduce the size of the group, or remove any unneeded segments from
    the group (refer to the map file for a listing of segments).

 There are four ways to resolve this data segment overflow when using
 QuickC:

 1. Reduce the stack size in order to reduce the size of DGROUP. In the
    environment this can be done in the Options.Make.Linker Flags menu.
    Outside the environment this can be done at compile time with the
    "/F hexnum" switch, where hexnum is the size of the requested stack
    in hexadecimal format. Outside the environment, at link time, this
    can be done with the "/ST:decnum" switch, where decnum is the size
    of the requested stack in decimal format.

 2. Declare data with the FAR keyword to move it out of DGROUP.

    Note: In the small and medium memory models the Microsoft run-time
    library functions can no longer be used with this data. You must
    copy this far to a near heap location, before you use the run-time
    routines on this data.

 3. Outside the environment, compile in the compact, large, or huge
    memory models with the "/GtX" switch, where X is a data threshold.
    All data items larger than X bytes are moved out of DGROUP into a
    far data segment.

 4. Reduce the amount of data declared in the program. In the compact,
    large, and huge memory models, try dynamically allocating space for
    the data. Memory can also be dynamically allocated outside DGROUP
    in the small and medium memory models by using _fmalloc() but, as
    stated in Number 2, the run-time library functions do not work with
    this data.

    Reduce the amount of string literals in this default data segment by
    reading from a data file at run time, or in C 5.00, by using the
    /Gt patch to allow string literals to be moved from the _CONST
    segment in DGROUP into a far segment.


 45. /CP:X Is Not Valid When Linking Protected-Mode Programs

 Product Version(s): 5.01.21 | 5.01.21
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 26-JUL-1989    ArticleIdent: Q47036

 Question:

 I cannot seem to get the /CPARMAXALLOC linker option to work when I
 link for OS/2 protected mode. When linking a real-mode application, it
 works correctly. Also, when I type "link /help" in protected mode, the
 output indicates that this is a valid option. However, when I try to
 use this option for a protected-mode application, the linker produces
 the following warning:

    LINK : warning L4013: invalid option for new-format executable file
                          ignored

 What am I doing wrong and what does this error message mean?

 Response:

 As documented on Page 27 in the update section of the Microsoft C
 Optimizing Compiler Version 5.10 "CodeView and Utilities, Microsoft
 Editor, Mixed-Language Programming Guide" manual, the /CPARMAXALLOC
 option is for real-mode applications only. The "link /help" indicates
 that this is a valid option because this option IS valid whenever
 you're linking real-mode applications, regardless of whether the
 linker is running under OS/2 or DOS. (By the same token, it is invalid
 when you're linking a protected-mode application, regardless of which
 operating system you're using.)

 This error message was omitted from the documentation. It indicates
 that one of the options that the linker was passed is invalid.

 This option is not supported in a protected-mode application because
 the functionality of it is done automatically by the linker.
 Protected-mode applications are not given a 64K default data segment;
 they are only allocated the space that they need. This is documented
 on Page 33 of the same section and manual listed above.


 46. Cannot Use Overlays in a Bound Application

 Product Version(s): 5.01.21 5.03 | 5.01.21 5.03
 Operating System:   MS-DOS       | OS/2
 Flags: ENDUSER |
 Last Modified: 30-AUG-1989    ArticleIdent: Q47104

 Question:

 How can I incorporate overlays into my bound application?

 Response:

 You cannot use overlays in a bound application. To bind an
 application, you must first have a runnable OS/2 executable; then, you
 use the BIND utility to make it run in both OS/2 and DOS. OS/2
 executables do not understand overlays so you cannot incorporate them
 into an OS/2 executable. Hence, you cannot use overlays in a bound
 program.


 47. Linker Error L1063 and Linking Over 1000 Object Modules

 Product Version(s): 5.01.21 5.03
 Operating System:   OS/2
 Flags: ENDUSER | S_C S_CodeView
 Last Modified: 16-AUG-1989    ArticleIdent: Q47931

 Question:

 When attempting to link a large OS/2 application consisting of over
 1500 object modules with C 5.10's Link 5.01.21 or FORTRAN 5.00's Link
 5.03 by using the options /co /map:2078 /noe /se:2078 /packcode, I get
 the link error "L1063 out of memory for CodeView information." Only
 one of the .C source files was compiled with /Zi. All were compiled
 with /AL. Linking without /co (CodeView information) successfully
 produces a 700K executable file (.EXE), but I need to do some
 debugging with CVP.

 What is the L1063 error, and how can I work around it?

 Response:

 Information on L1063 is not in the C 5.10 text files or documentation,
 but it is in Pascal 4.00's README.DOC and in FORTRAN 4.10's
 CVREADME.DOC as noted in another article in this knowledge base. The
 following reiterates the error message and its description:

    L1063 out of memory for CodeView information

    The linker was given too many object files with debug information,
    and the linker ran out of space to store it. Reduce the number of
    object files that have debug information.

 In this case, it is not the number of modules with CodeView
 information that is causing the problems exactly; it is the great
 number of modules and trying to link in any CodeView information.

 The following are ways to workaround this linker limitation:

 1. The most effective method is to demodularize your application. That
    is, put more functions into fewer .C source files.
 2. Reduce the linker option /se: value to as low as possible for the
    number of logical segments in the application.
 3. Link the object files from the current working directory. If you
    must use different directories for your .OBJs, make the pathnames
    as short as possible.


 48. Description of a Linker .MAP File

 Product Version(s): 3.60 3.61 3.64 3.65 5.01.20 5.01.21 5.03  | 5.01.20 5.01.
 Operating System:   MS-DOS                                    | OS/2
 Flags: ENDUSER | S_C S_PasCal H_FORTRAN
 Last Modified: 19-SEP-1989    ArticleIdent: Q47960

 A .MAP file generated by the linker is a listing of the addresses and
 names of a program, as follows:

    Logical Segments
    Groups (defined collections of logical segments)
    Public Symbols listed by name
    Public Symbols listed again by their relative address
    Entry Point address (first executable instruction)

 A linker .MAP file (with a .MAP file extension) contains the address,
 size, name, and class of logical code and data segments. (One or more
 logical segments of either code or data can be combined into a
 physical segment of either code or data, respectively, by the linker.)

 In DOS or real-mode OS/2, the addresses are 20-bit hex addresses that
 are RELATIVE to the beginning of the program's load image. In
 protected-mode OS/2, the hex addresses are in 32-bit segment
 selector:offset notation (16 bits for the segment selector and 16 bits
 for the offset) starting with segment selector 1.

 The _TEXT segment names of class CODE are the code in your object
 files. The various forms of near logical data segments are described
 in the DGROUP diagram, which you probably already have. (Briefly,
 _DATA is initialized near global data, _BSS is uninitialized near
 "static" data, C_COMMON is uninitialized near data, and CONST is for
 floating point constants. FAR_DATA and HUGE_DATA are global
 initialized far and huge data, respectively, and FAR_BSS is global
 unitialized far or huge data.)

 Next in the .MAP is the ORIGIN (address) and name of the defined
 groups of logical segments, notably DGROUP, which is used in our
 high-level languages for grouping many logical data segments into the
 "default" physical data segment. The name "default" data segment
 refers to the fact the the DS register will point to this segment by
 default so that offset (near) addressing can be used without loading
 the DS register. Groups allow multiple logical segments to be
 associated with the same starting address, so near (non-far) data in
 Microsoft high-level languages is addressed relative to DGROUP.

 Following the segment descriptions, under the heading of "Publics by
 Name", the names of Public symbols (i.e., global or extern functions,
 including numerous internal C library functions, and variables) are
 listed in ASCII order (capital letters first, then lowercase letters,
 and finally underscores) along with their hex relative segment:offset
 addresses (or segment selector:offset in protected-mode OS/2). Public
 symbols are then listed again, in order of their relative
 segment:offset addresses under the heading "Publics by Value".

 Only Public (e.g. global) symbols such as function and variable names
 appear in the .MAP. No "static" functions or data, "auto" storage
 class data (e.g. local function data), or data types are listed in the
 .MAP.

 A high-level language such as C creates many logical segments in
 DGROUP for "internal" (e.g. undocumented) purposes, calls numerous
 internal library functions, and refers to variables for the main
 program initialization and start-up code. C refers to additional
 initialization functions and variables for the library functions that
 your program explicitly calls, still more for floating point
 functions, as well as termination functions.

 To get an idea of the functions automatically linked in from the C
 library, generate and compare .MAP files for simple source modules
 such as foo(){} or main(){}, main(){puts("hi");}, and a small program
 that performs floating point arithmetic or calls a C library floating
 point math function that calls "fp..." routines.

 The "Program entry point" is the last item in the .MAP file. It refers
 to the segment:offset address of the first instruction of the program
 to be executed, relative to the lowest memory address in the .EXE load
 image.

 For more information on the entry point, please use the following
 query:

    .map file's program entry point


 49. Linker Can Indiscriminately Bind Different Types

 Product Version(s): 1.x 2.x 3.x 4.x 5.01 5.02 5.03 | 5.01
 Operating System:   MS-DOS                         | OS/2
 Flags: ENDUSER | S_C S_QuickC S_QuickASM S_Pascal S_QuickPas
 Last Modified:  2-AUG-1990    ArticleIdent: Q48204

 The object module format used by the Microsoft languages contains a
 record type that is used to bind symbol definitions to symbol
 references in other modules. This record is known as a "fixup." As
 defined by Intel, the fixup record type contains no information as to
 the type of data that is to be fixed up. Under certain circumstances,
 this can cause unexpected and undesired binding at link time. The code
 below demonstrates such an instance:

     /*----- FILE1.C -----*/

     void bar( void );

     void main( void )
     {
         bar();
     }

     /*----- FILE2.C -----*/

     int bar;

 These files both compile without error. When compiled for a model with
 a single code segment, linker error L2003 is produced saying that an
 intersegment self-relative fixup was attempted. If a multiple code
 segment model is used, no link errors are produced. Although a clean
 link can be obtained, the resultant EXE does not perform as expected
 due to the fact that the function reference of bar in FILE1.C has been
 bound to the integer definition of bar in FILE2.C.

 The linker has no way of determining the types of the reference to,
 and definition of, bar. This is a limitation of the object file
 format. If an include file was used to prototype bar and was then
 included in both files, the compiler could have detected the
 redefinition of bar.

 This information applies to all 1.x, 2.x, and 3.x versions of LINK
 including 3.60, 3.61, 3.64, and 3.65, as well as LINK Versions 4.06,
 4.07, 5.01, 5.02, and 5.03.


 50. Novell Network Software May Cause L1084 Error

 Product Version(s): 5.03
 Operating System:   MS-DOS
 Flags: ENDUSER | h_fortran h_masm s_c s_pascal
 Last Modified: 23-JAN-1990    ArticleIdent: Q57304

 The resident software used to access a Novell network may cause the
 following error when linking large programs:

    L1084:  Cannot create temporary file

 This problem was observed with Netware versions 2.10 SFT and 2.15 of
 the Novell network software.


 51. Relationship between Map File Addresses and Location in Memory

 Product Version(s): 3.61 3.65
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1989    ArticleIdent: Q48241

 In situations where memory is very short or where CodeView interacts
 with your program, it is sometimes necessary to use the DEBUG.COM
 program supplied with DOS.

 Using DEBUG is more difficult than using SYMDEB or CodeView because
 DEBUG has no symbolic features. You must use the map produced by the
 /M option when you link with a standard DOS overlay linker (i.e., not
 a segmented executable linker) to locate specific parts of your
 program.

 However, since DOS relocates programs when it loads them, the
 addresses given in the map need conversion before you can use them.

 This conversion is simple: DOS adds the address of the start segment
 (defined below) to each segment address in the load map. The offsets
 never change from the values shown in the link map -- only the
 segments change.

 The start segment is the base address of the Program Segment Prefix
 (PSP) plus the size of the PSP in paragraphs. Since the PSP is always
 100h (256) bytes long, the size of the PSP is 10h paragraphs.

 Note: DOS puts the base segment address of the PSP in DS and in ES
 when a program begins execution.

 For example, assume that the link map says that the function _funct is
 at 0004:05A0 (all values in hex) and that the global variable _errno
 is at 0192:00E3. Suppose further that when the program is loaded into
 DEBUG, the DS and ES registers contain 2BA5 -- the segment address of
 the PSP. (Use the R command to display the values of the registers.)

 The start segment for loading the program will be 2BB5 -- the value of
 the PSP base address (2BA5) + 10h to allow for the 10h paragraph
 length of the PSP (100h bytes).

 Thus, the function _funct will be located as follows:

    0004:05A0   -- address of _funct in the link map
    2BB5        -- start segment address (PSP + 10h)
    ---------
    2BB9:05A0

 And _errno will be located as follows:

    0192:00E3   -- address of _funct in the link map
    2BB5        -- start segment address (PSP + 10h)
    ---------
    2D47:00E3

 Use this calculation on any address in the link map to find where the
 symbol is located in memory when actually loaded.

 The H (Hex Arithmetic) command in DEBUG can be helpful when performing
 these calculations, as can a hex calculator with constant feature.


 52. Warning L4014: /PACKDATA: Option Ignored for Real Mode

 Product Version(s): 4.06 4.07 5.02 5.03 | 5.02 5.03
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER |
 Last Modified: 21-SEP-1989    ArticleIdent: Q48839

 /PACKDATA is incorrectly listed as an available switch for LINK
 Versions 4.06 and 4.07. LINK Version 4.06 comes with the QuickC
 compiler, and LINK Version 4.07 comes with the QuickAssembler.

 The /PACKDATA option is valid ONLY for segmented-executable files --
 OS/2 or Windows; it has no meaning for DOS. Real mode executable means
 a DOS-only program. To use the /PACKDATA switch, create a .DEF file
 with at least the following statement:

    NAME    MyProtectModeProgram

 This switch is implemented in segmented-executable LINK Versions 5.02
 and later.


 53. /NOI Switch May Cause L2022 and L2029 in PM Programs

 Product Version(s): 5.10   | 5.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 27-OCT-1989    ArticleIdent: Q49008

 I am compiling and linking a Presentation Manager (PM) program from
 Charles Petzold's "Programming the OS/2 Presentation Manager" and I
 get the following link errors:

    LINK : error L2022: ClientWndProc (alias ClientWndProc) : export
           undefined

         : error L2029 : 'ClientWndProc' : unresolved external

 I get the same errors when compiling WELCOME1.C from the companion
 disk to "Programming the OS/2 Presentation Manager."

 The /NOI switch instructs the linker to preserve case. If you are
 using the /NOI switch, the linker will generate these errors because
 EXPENTRY (the export entry point) is defined in OS2DEF.H as follows:

    #define EXPENTRY far pascal

 The "pascal" keyword instructs the compiler to use the left-to-right
 calling sequence for the functions that it modifies. The keyword also
 causes the conversion of the function's name to uppercase letters.

 All window procedures are defined as EXPENTRY. Thus, the name of your
 window procedure is converted to uppercase letters. In your .DEF, you
 export your window procedures as follows:

    EXPORTS         ClientWndProc

 Because of the /NOI switch, the linker does not view ClientWndProc and
 CLIENTWNDPROC as being equal. Consequently, you get the first error
 message "export undefined."

 The second error message is generated because ClientWndProc (mixed
 uppercase and lowercase letters) is not recognized as being defined,
 so the linker considers it an "unresolved external."

 Removing the /NOI switch from your link line corrects both errors.


 54. LINK 5.03 and Later Require EXETYPE WINDOWS in .DEF File

 Product Version(s): 5.03
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 17-JUL-1990    ArticleIdent: Q49445

 Microsoft LINK (LINK.EXE) versions 5.03 and later require that the
 WINDOWS descriptor be placed in the EXETYPE section of your project's
 .DEF (definitions) file if you are developing a Windows' application.

 This marks a change from previous linkers' behavior, which would allow
 the programmer to fail in specifying the type of executable to be
 created, but still produce a Windows-compatible .EXE file. This
 failure is no longer acceptable to LINK Versions 5.03 and later.

 If you fail to inform the linker (via the .DEF file) that you are
 creating a Windows executable, the linker reaches completion but the
 resulting .EXE does not execute.

 To specify the executable type, you must create a .DEF file and submit
 this to the linker at link time. For example, if you had a project
 called WINTEST.C, you must modify WINTEST.DEF so that it contains the
 following line:

    EXETYPE   WINDOWS

 The default EXETYPE is OS/2, as stated in the "Microsoft FORTRAN,
 CodeView and Utilities User's Guide" packaged with FORTRAN Version
 5.00.

 For further information regarding the definitions file and other
 descriptors, consult Section 7, "Using Module-Definition Files," in
 the "CodeView and Utilities, Microsoft Editor, Mixed Language
 Programming Guide" (Update Section) for C 5.10.

 LINK Version 5.03 is shipped with the FORTRAN version 5.00 package.


 55. Long TMP Environment Variable Causes L1089

 Product Version(s): 5.03   | 5.03
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | h_fortran
 Last Modified:  6-DEC-1989    ArticleIdent: Q48869

 L1089 occurs when the LINK Utility Version 5.03 is called from FORTRAN
 Version 5.00 and the TMP environment variable is set to a long
 pathname.

 Normal troubleshooting indicates that the TMP variable is corrupt, but
 this is not the case. It seems that the temporary filename is being
 truncated.

 The following sequence produces the error if the subdirectory
 D:\COMPILER\FORTRAN5\TMP\ already exists:

 SET TMP=d:\compiler\fortran5\tmp
 fl sieve.for

 LINK : fatal error L1089: D:\COMPILER\FORTRAN5\TMP\000054l
 : cannot open response file

 This problem occurs in FORTRAN 5.00 and Link 5.03.


 56. L2041: Stack Plus Data Exceeds 64K -- Documentation Supplement

 Product Version(s): 3.65 4.06 | 5.01.21
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER  | s_pascal h_fortran h_masm s_c s_quickc s_quickasm s_error d
 Last Modified: 30-NOV-1989    ArticleIdent: Q50130

 The following indicates that there is more than 64K of stack and data
 to be put into the 64K DGROUP (default data segment):

    L2041    stack plus data exceeds 64K

             The combined size of the program stack segment plus DGROUP
             was greater than 64K; as a result, the program will not
             load up correctly.

 To correct this problem, do the following:

 1. If the file(s) was compiled with C 5.00, a large amount of string
    literal data in the program may cause this error. Unlike C 5.10,
    5.00 cannot move string literals out of DGROUP with the /Gt option.
    This problem can be corrected with the "C 5.00 /Gt Fix" application
    note, which is available from Microsoft Product Support Services by
    calling (206) 454-2030.

 2. Reduce the stack size.

 3. Use a large data model (compact, large, or huge). Try applying the
    /Gt compilation option to lower the threshold.

 4. Use the FAR keyword to move data out of DGROUP.

 This error is documented in "Linker Error Messages" in the "Microsoft
 QuickC Compiler for IBM Personal Computers and Compatibles
 Programmer's Guide," Section D.4, Page 374. It is also in the file
 ERRMSG.DOC on Compiler Disk 1 for Microsoft C Version 5.10, on the
 Setup disk for Microsoft C Version 5.00, in the file README.DOC on
 Disk 1 for Microsoft Macro Assembler Version 5.10, and in the file
 CVREADME.DOC on the CodeView for MS-DOS disk for Microsoft FORTRAN
 Version 4.10. It is not found in the "CodeView and Utilities,
 Microsoft Editor, Mixed-Language Programming Guide" manual.

 Nonfatal errors indicate problems in the executable file. LINK
 produces the executable file. Nonfatal error messages have the
 following format:

    location : error L2xxx: messagetext

 In these messages, location is the input file associated with the
 error, or LINK if there is no input file. If the input file is an .OBJ
 or .LIB file and has a module name, the module name is enclosed in
 parentheses.

 Additional reference words: appnote


 57. Link Error L2028 Caused by HEAPSIZE, STACKSIZE and DGROUP Size

 Product Version(s): 5.01.21 | 5.01.21
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 17-JUL-1990    ArticleIdent: Q49935

 The error L2028 "Automatic data segment plus heap exceeds 64K" was
 omitted from the linker error messages in the "CodeView and Utilities,
 Microsoft Editor, Mixed-Language Programming Guide" manual that
 accompanies Microsoft C 5.10. This error occurs when the stack and
 data plus the near heap exceeds 64K. The near heap size is set with
 the HEAPSIZE option in the .DEF file.

 The error can be corrected by using one of the following methods:

 1. Reducing the amount of data in the default data segment.

 2. Decreasing the stack size that was set by /ST:xxxx at the link line
    or by the STACKSIZE option in the .DEF file.

 3. Decreasing the amount of near heap that is being requested with the
    HEAPSIZE option in .DEF file.


 58. Specifying Link Options with "-" Causes L4046, L1083, or U1013

 Product Version(s): 5.01.21
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 10-NOV-1989    ArticleIdent: Q50333

 LINK command line switches must begin with the linker's option
 character, the forward slash (/). While it is valid to begin
 compilation switches with a dash (-), the same is not true for the
 linker.

 Code Example
 ------------

 #--------------------
 # test make file
 #--------------------

 test.obj : test.c test.h
      cl -c -Zi -G2sw -W3 test.c

 test.exe : test.obj test.def
      link test, -CO -align:16, NUL, os2, test

 You type:
         make test

 Microsoft (R) Program Maintenance Utility  Version 4.07
 Copyright (C) Microsoft Corp 1984-1988. All rights reserved.

   link test, -CO -align:16, NUL, os2, test

 Microsoft (R) Segmented-Executable Linker  Version 5.01.21
 Copyright (C) Microsoft Corp 1984-1988.  All rights reserved.

 TEST.DEF(12) : warning L4046: module name different from output file name
 LINK : fatal error L1083: cannot open run file
 test(16) : fatal error U1013: 'link test, -CO -align:16, NUL, os2, test'
          : error 2


 59. /PACKCODE Incompatible with IOPL Segments with LINK 5.01.21

 Product Version(s): 5.01.21
 Operating System:   OS/2
 Flags: ENDUSER | S_C
 Last Modified: 10-NOV-1989    ArticleIdent: Q50702

 LINK Version 5.01.21 does not support the combination of using the
 /PACKCODE switch and having code segments declared as IOPL (i.e., as
 having I/O privilege).

 When combining segments as directed by the /PACKCODE option, LINK
 5.01.21 will combine the IOPL segment(s) with other segments that do
 not have I/O privilege. The result is an invalid executable that
 returns the system error SYS1059 when it is invoked.

 The lack of ability to combine these options is a limitation of this
 particular linker version. LINK Version 5.03 allows the combination of
 /PACKCODE and IOPL segments without a problem.


 60. LINK : Warning L4011 Caused By Invalid /PACKCODE Group Size

 Product Version(s): 3.65 4.06 4.07 5.01.21 5.03 | 5.01.21 5.03
 Operating System:   MS-DOS                      | OS/2
 Flags: ENDUSER | S_C S_QUICKC S_QUICKASM S_PASCAL DOCERR
 Last Modified: 10-NOV-1989    ArticleIdent: Q50705

 The LINK code packing option, /PAC[:n], groups together neighboring
 code segments into the same segment of maximum size "n" bytes. The
 results of using /PAC will only be reliable when "n" is in the range
 of 0 to 65500. Page 278 of the "Microsoft C 5.1 CodeView and
 Utilities" reference manual states the default value for "n" is 65530.
 This is incorrect.

 The linkers from the following products were tested with the /PAC
 option to determine their behavior with various values of "n":

    C 5.10
    Pascal 4.00
    FORTRAN 5.00
    QuickC 1.01
    QuickC 2.00
    QuickASM 2.01

 Note: Linkers were checked in both real and protected mode where
 appropriate.

 The following table shows the acceptable values that can be used with
 the /PAC[:n] option and what error message will occur when the value
 of "n" is out of range:

 ----------------------------------------------------------------------
 Value of "n"      LINK Vers.   Error Message
 ----------------------------------------------------------------------
 0 to 65500        3.65         No Errors/Warnings
                   4.06         No Errors/Warnings
                   4.07         No Errors/Warnings
                   5.01.21      No Errors/Warnings
                   5.03         No Errors/Warnings

 65501 to 65536    3.65         LINK : warning L4011:
                   4.06         LINK : warning L4011: PACKCODE value
                                exceeding 65500 unreliable
                   4.07         (same as above)
                   5.01.21      (same as above)
                   5.03         (same as above)

 65537 and over    3.65         LINK : fatal error L1005:
                   4.06         LINK : fatal error L1005: packing limit
                                exceeds 65536 bytes
                   4.07         (same as above)
                   5.01.21      (same as above)
                   5.03         (same as above)
 ----------------------------------------------------------------------

 Note : With LINK Version 5.03 and later, the /PAC option has been
 changed to /PACKC to differentiate /PACKC[ODE] from the new
 /PACKD[ATA] option.


 61. How and When to Specify Stack Size (Clarification)

 Product Version(s): 3.65 4.06 4.07 | 5.01.21
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER |
 Last Modified: 30-NOV-1989    ArticleIdent: Q50950

 Question:

 When I want to specify a certain stack size for a program, should I
 use the /F compiler option, the /ST linker option, or both?

 Response:

 This depends on how you are compiling and linking. If you using the CL
 command to compile and link, the /F compiler option is all that is
 necessary. This option will pass the correct size of the stack to the
 linker.

 On the other hand, if you are invoking the compiler and the linker
 separately (as in a make file), the /ST link option can be used to get
 the desired stack size. The /ST link option is documented on Page 123
 of the "Microsoft C Optimizing Compiler User's Guide."

 No stack information is stored in the object module. Therefore, using
 the /F and /c (compile only) options together and then invoking link
 separately will not generate the desired stack size. The /F compile
 option is documented on Page 102 of the "Microsoft C Optimizing
 Compiler User's Guide."


 62. Linking Method May Result in Unexpected Increase in .EXE Size

 Product Version(s): 3.x 4.06 4.07 5.01.21 5.03 | 5.01.21 5.03
 Operating System:   MS-DOS                     | OS/2
 Flags: ENDUSER |
 Last Modified: 21-FEB-1990    ArticleIdent: Q58689

 Question:

 When my program is linked in the following manner

    link  file1.obj file2.obj library.lib;

 the resulting executable file is much larger than if the program is
 linked this way:

    link  file1.obj file2.obj,,,library.lib;

 What causes the difference in size?

 Response:

 This is expected behavior, the difference in size is due to the
 difference in linking method.

 The first method has the library name in the same field as the object
 files. Libraries entered in this field are called "load libraries" as
 opposed to "regular libraries." Link automatically links in every
 object module in a load library; it does not search for unresolved
 external references first.

 The effect of using a load library is exactly the same as if you had
 entered all the names of the library's object modules as separate
 object files on the link command line. This feature is useful if you
 are developing software using many modules and want to avoid having to
 retype each module on the LINK command line.

 With the second method, LINK links in only the objects from the
 library that are required for program execution.

 Please see documentation on LINK, such as Section 12.1.2 of the
 Microsoft C 5.1 "CodeView and Utilities Software Development Tools for
 the MS-DOS Operating System" manual (Page 257) for more information.


 63. Linker Uses Library Sequence to Resolve External References

 Product Version(s):
 Operating System:   1.x 2.x 3.x 4.06 4.07 5.01.21 5.02 5.03 | 5.01.21 5.02 5.
 Flags: MS-DOS                                  | OS/2
 Last Modified: 26-FEB-1990    ArticleIdent: Q57706
 ENDUSER |

 "The MS-DOS Encyclopedia," Pages 407 and 408, states the following:

    When a public symbol required to resolve an external reference is
    declared more than once among the object modules in the input
    libraries, LINK uses the first object module that contains the
    public symbol. This means that the actual executable code or data
    associated with a particular external reference can be varied by
    changing the order in which LINK processes its input libraries...

    Each individual library is searched repeatedly (from first library
    to last, in the sequence in which they are input to LINK) until no
    further external references can be resolved.

 The following simple case demonstrates the concept:

    Module MAIN   Library A     Library B1    Library C     Library B2
    +---------+   +----------+  +----------+  +----------+  +----------+
    | calls A |   | contains |  | contains |  | contains |  | contains |
    +---------+   |    A,    |  |    B     |  |    C,    |  |    B     |
                  | calls  C |  +----------+  | calls  B |  +----------+
                  +----------+                +----------+

 The linker determines which copy of Module B to use depending on the
 library sequence. For example, when you link with the following, the
 Module B from Library B2 is selected:

    LINK MAIN,,,A B1 C B2;

 The linker looks first in Library C and, unable to resolve the
 reference, proceeds to the next library, B2. If the linker is still
 unable to resolve the reference, it continues searching at Library A.

 A slightly more complex case, when Library A contains both Module A
 and Module B, produces different results, as shown below:

    Module MAIN   Library A     (remove B1)   Library C     Library B2
    +---------+   +----------+                +----------+  +----------+
    | calls A |   | contains |                | contains |  | contains |
    +---------+   |    A,    |                |    C,    |  |    B     |
                  | calls  C |                | calls  B |  +----------+
                  +----------+                +----------+
                  | contains |
                  |    B     |
                  +----------+

 Link with "LINK MAIN,,,A C B2;". In this case, Module B from Library A
 is selected.

 Although the linker always follows the same rules for resolution, it
 gets more difficult to determine which version of a module will be
 selected in more complex cases. When feasible, you can avoid this
 problem by putting your selected versions in an .OBJ instead of an
 .LIB. The linker uses any .OBJs to resolve references before it
 uses libraries.

 For more information, refer to "The MS-DOS Encyclopedia," Article 20:
 "The Microsoft Object Linker," in the "Object Module Order" section,
 Pages 703-706.


 64. Calling Overlaid Functions Through Pointers Not Supported

 Product Version(s): 1.x 2.x 3.x 4.06 4.07 5.01.21 5.02 5.03
 Operating System:   MS-DOS
 Flags: ENDUSER | S_C S_QuickC
 Last Modified: 30-JAN-1990    ArticleIdent: Q58098

 LINK does not support using function pointers for calling functions in
 overlays unless the function is being called from within the same
 overlay. If an overlaid function is being called from the root or from
 a different overlay, then the call must not be made through a pointer.

 LINK cannot support calling overlaid functions indirectly through
 pointers because the address of the indirect function is determined at
 load time.

 In a program with overlays, a normal function call (that is, not a
 call through a pointer) is recognized by the linker and an interrupt
 call is placed into the .EXE in place of the function call. When the
 function is called at run time, the interrupt directs control to the
 overlay manager. The overlay manager checks whether the right overlay
 is loaded into memory, loads it if necessary, and calls the function.
 Because there is a fixup record in the .OBJ for the function call, the
 linker can set everything up correctly.

 On the other hand, with a function pointer, the compiler creates a
 fixup record for the address that the pointer references. However,
 there is no indication in the fixup record that this address is for a
 function. Therefore, if you link the function in as an overlay, the
 linker does not insert a call to the overlay manager and instead does
 a standard fixup.

 As a result, if you indirectly call a function located in a not-as-yet
 loaded overlay, the overlay does not get loaded. Nevertheless, control
 is still transferred to the address at which the function is thought
 to reside, which can only mean disaster for the executing program.


 65. /PAU Linker Option Doesn't Function in Some Versions of LINK

 Product Version(s): 3.61 3.65 3.69 5.01.20 5.05 | 5.01.20 5.05
 Operating System:   MS-DOS                      | OS/2
 Flags: ENDUSER |
 Last Modified: 21-FEB-1990    ArticleIdent: Q58781

 The /PAU (PAUSE) linker option tells LINK to pause in the link session
 and display a message before it writes the executable file to disk,
 allowing you to insert a new disk on which to store the executable
 file.

 In Microsoft LINK.EXE Versions 3.61, 3.65, 3.69, 5.01.20, and 5.05,
 the /PAU linker option does not pause the link session.

 Microsoft is researching this problem and will post new information
 here as it becomes available.

 In versions where the /PAU linker option functions correctly, LINK
 displays the following message before it creates the executable file:

    About to generate .EXE file
    Change diskette in drive ___ and press <ENTER>

 LINK resumes processing after the ENTER key is pressed.


 66. /INC and Overlays Are Not Supported at the Same Time

 Product Version(s): 5.01.20 5.01.21 5.02 5.03
 Operating System:   MS-DOS
 Flags: ENDUSER | docsup
 Last Modified: 15-MAY-1990    ArticleIdent: Q59279

 LINK.EXE does not support the use of /INCREMENTAL (or /INC) switch and
 overlays at the same time. This is because ILINK.EXE, which is invoked
 by the /INC option, does not support overlays. One of the two
 operations is ignored.

 The linker produces a working executable file, but one of the
 following WARNING messages may be produced:

    L4013: Overlays: option ignored for segmented-executable file
    L4014: /INCREMENTAL : Option ignored for realmode executable file

 If no warning message is produced, the linker takes an unpredictable
 path. If this is the case, the executable file that is produced could
 be corrupted and should NOT be relied upon.


 67. Incomplete EXPORTS List May Cause L2022 and L2029

 Product Version(s): 3.65
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 12-MAR-1990    ArticleIdent: Q59385

 Compiling and linking a Windows program and receiving the following
 two link errors can be caused by an incomplete EXPORTS list:

    LINK : error L2022: ProcedureName : export undefined
    LINK : error L2029: 'ProcedureName' : unresolved external

 Windows programming involves the creation of a .DEF (definitions)
 file. All Windows procedures to be exported must be listed in this
 file. The following is an example:

    EXPORTS     ProcedureName

 When this list is incomplete, the L2022 error is generated. The L2029
 error can be generated if the case of the EXPORT line doesn't match
 the case of the actual function.

 Listing all procedures to be exported in the .DEF file prevents both
 of these errors.

 Note: These errors can also occur with Presentation Manager programs
 or programs that use DLLs under OS/2.


 68. Why the /HIGH Switch Is Not Used with High-Level Languages

 Product Version(s): 3.65
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 15-MAR-1990    ArticleIdent: Q59535

 The linker option /HIGH is used with assembly language programs to
 load an .EXE file as high as possible in memory. Without the /HIGH
 option, LINK places the .EXE file as low as possible.

 /HIGH is not used with high-level languages because it prohibits the
 use of dynamic memory allocation by the program. Furthermore, C
 run-time start-up code specifies /DOSSEG, which forces low load and
 Microsoft run-time segment layout.

 When a program is linked with /HIGH, MS-DOS loads the program at the
 highest possible memory location available, usually 0xFFF0. All memory
 between the program's segments (which are high) and the program's PSP
 (which is low) is now considered program RAM, owned by the program.
 You can no longer allocate or free that memory.

 Therefore, calls to routines such as malloc() and free() fail. This
 causes problems for the following reasons:

 1. Some memory is dynamically allocated during function calls from
    high-level languages.

 2. The memory structure required by Microsoft high-level languages for
    tracking used/freed memory is not available.

 You can use /HIGH if you write your own start-up code, but your
 programs cannot call most of the routines from the C run-time library.

 The only reason /HIGH is still available to the linker is that early
 versions of Microsoft FORTRAN and Microsoft Pascal generated code that
 had to be linked with /DSALLOCATE, which relocates all addresses
 within DGROUP in such a way that the last byte in the group has the
 offset 0xFFFF. The /HIGH switch is used in conjunction with the
 /DS(ALLOCATE) switch.

 For more information, search the knowledge base with the following
 query:

    S_LINK and /HIGH and /DS

 You can also read the section "Using the /HIGH and /DSALLOCATE
 Switches" on Page 719 ff in the "MS-DOS Encyclopedia."


 69. OS/2 Module Definition File Syntax

 Product Version(s): 5.01.21 5.02 5.03 5.05
 Operating System:   OS/2
 Flags: ENDUSER | S_C
 Last Modified: 16-MAR-1990    ArticleIdent: Q59536

 The following is extracted from Ray Duncan's "Advanced OS/2
 Programming," Page 737:

    Module definition (DEF) files are simple ASCII text files that are
    interpreted by the linker during the construction of an application
    program, dynlink library, or device driver. The directives in DEF
    files cause information to be built into the executable file's
    header, which is later interpreted by the system when the program,
    library, or driver is loaded.

    Enter all DEF file directives and keywords in uppercase letters.
    File, segment, group, and procedure names can be lowercase or
    uppercase. Lines beginning with a semicolon (;) are treated as
    comments.

    Figure E-1. DEF file directives documented in Appendix E
    --------------------------------------------------------

    CODE        Assigns characteristics to code segments
    DATA        Assigns characteristics to data segments
    DESCRIPTION Embeds text in executable file
    EXETYPE     Specifies host operating system
    EXPORTS     Names functions exported for dynamic linking by other
                programs
    HEAPSIZE    Specifies initial size of local heap (C programs only)
    IMPORTS     Names functions that will be dynamically linked at load
                time
    LIBRARY     Builds dynlink library or device driver
    NAME        Builds application program
    OLD         Specifies ordinal compatibility with previous version of
                dynlink library
    PROTMODE    Flags file as executable in protected mode only
    REALMODE    Allows file to be executed in real mode
    SEGMENTS    Assigns characteristics to selected segments
    STACKSIZE   Specifies size of stack used by primary thread
    STUB        Embeds MS-DOS-compatible program in new executable file

 For further information, refer to Appendix E, Module Definition File
 Syntax, in "Advanced OS/2 Programming" or Chapter 19, Using Module-
 Definition Files, in the "Microsoft FORTRAN CodeView and Utilities
 User's Guide," packaged with FORTRAN Version 5.00.


 70. Linker Error L4047 May Be Benign

 Product Version(s): 5.10    | 5.10
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER |
 Last Modified: 18-APR-1990    ArticleIdent: Q59936

 The following linker error may be a benign error if it occurs with an
 application that links with the C Version 6.00 start-up code:

    L4047 - Multiple code segments in module of overlayed program
            incompatible with /CO

 This is a new error for LINK Version 5.10 and is to be expected.

 If an application is built with the C Version 6.00 run-time library,
 there is a second segment to hold floating-point math routines. This
 segment (EMULATOR_TEXT) does not have any CodeView information in it.
 However, from the linker's perspective, the extra segment MAY be an
 error and it is warning the user of such. In this case, it is a benign
 warning message.


 71. NODATA and pwords Parameters Reversed in EXPORT Statement Docs

 Product Version(s): 5.01.21 5.02 5.03 5.05 5.10 | 5.01.21 5.02 5.03 5.05 5.10
 Operating System:   MS-DOS                      | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 25-MAY-1990    ArticleIdent: Q61605

 The EXPORT statement used in module definition (.DEF) files is
 incorrectly documented in several places with the last two parameters
 reversed. The "pwords" parameter should be the last parameter, but it
 is listed second from the end. The "NODATA" parameter is listed last,
 but should be second from the end. The correct EXPORT statement syntax
 is as follows:

    entryname [=internalname] [@ord[RESIDENTNAME]] [NODATA] [pwords]

 Note that the "pwords" parameter is listed as "iopl-parmwords" in some
 of the documentation.

 The documentation with the incorrect EXPORT statement syntax with
 reversed parameters is as follows:

 - The C version 6.00 online help for LINK under the EXPORT statement
   syntax

 - On Page 334 of "The Microsoft CodeView and Utilities User's
   Guide" for version 2.30 in Section 19.9, "The EXPORTS
   Statement" (shipped with FORTRAN 5.00 and BASIC PDS 7.00)

 - On Page Update-52 of "The Microsoft CodeView and Utilities
   Update" for version 2.20 in Section 7.8, "The EXPORTS
   Statement" (shipped with C 5.10, MASM 5.10, and Pascal 4.00)


 72. Fatal /nologo and /e Switch Interaction

 Product Version(s): 1.20   | 1.20
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.20
 Last Modified: 22-JUN-1990    ArticleIdent: Q62375

 Using the /nologo switch in conjunction with /e switch can cause ILINK
 version 1.20 to fail. The problem will occur when an incremental link
 cannot be performed and the command specified by the /e switch is
 performed instead. If the /e switch is preceded anywhere on the
 command line by /nologo, then the link will fail.

 For example, the following command line

     ILINK /nologo /e "link hello;" hello.exe

 where hello.obj exists but hello.exe doesn't, will produce the
 following messages:

    Microsoft (R) Segmented-Executable Linker  Version 5.10
    Copyright (C) Microsoft Corp 1984-1990.  All rights reserved.

    LINK : fatal error L1089:  : cannot open response file
    ILINK : warning L4252: file '/e.exe' does not exist
    ILINK : performing full link
    ILINK : fatal error L1233: 'link' returned 2

 Placing the /nologo switch after the /e switch on the command line
 will alleviate the problem.

 Microsoft has confirmed this to be a problem with LINK version 1.20.
 We are researching this problem and will post new information here as
 it becomes available.


 73. L4050 Incorrectly Documented in Online Help

 Product Version(s): 5.10   | 5.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr buglist5.10 S_PWB
 Last Modified: 24-JUL-1990    ArticleIdent: Q63235

 When linking a very small program with /EXEPACK, Microsoft LINKer
 version 5.10 sometimes gives the following error message:

    LINK: warning L4050: file not suitable for /EXEPACK; relink without

 The online Help documentation returns the following incorrect
 information:

    LINK warning L4050

    too many public symbols for sorting

    The linker uses the stack and all available memory in the near
    heap to sort public symbols for the /MAP option. If the number of
    public symbols exceeds the space available for them, this warning
    is issued and the symbols are not sorted in the map file but are
    listed in an arbitrary order.

    Reduce the number of symbols.

 The correct documentation for this error (except the number) is as
 follows and can be found in the online Help under L1114:

    Fatal LINK error L1114

    file not suitable for /EXEPACK; relink without

    For the linked program, the size of the packed load image plus
    packing overhead was larger than that of the unpacked load image.

    Relink without the /EXEPACK option.

 Because of its noncritical nature, this LINKer error was changed from
 its previous status of a fatal error to a simple warning in LINK
 version 5.10. The warning associated with L4050 in earlier versions of
 the LINKer will rarely appear in LINK 5.10, but if it does, it will
 have the number L4070.



 74. Parenthesis in Filename May Cause L1027: Unmatched Parenthesis

 Product Version(s): 3.x 4.06 4.07 5.01.21 5.03 5.05 5.10 | 5.01.21 5.03 5.05
 Operating System:   MS-DOS                               | OS/2
 Flags: ENDUSER |
 Last Modified: 10-JUL-1990    ArticleIdent: Q63624

 When linking object files into executable programs, the error L1027:
 "Unmatched left/right parenthesis" may be incorrectly generated for
 files that contain a parenthesis in the filename. This will only occur
 when the object module is in the current directory and either of the
 following conditions is true:

 1. If the object module being linked has a left parenthesis as the
    first character in its name, but NOT a right parenthesis as the last
    character.

 2. If an object filename has a right parenthesis as the last
    character in the name, but NOT a left parenthesis as the first.

 If the object module is NOT in the current directory, then the L1027
 error will occur only if the second condition above is true.

 This information applies to all versions of LINK.EXE that support
 overlays.

 Normally, parentheses are put around the names of one or more object
 modules when linking to inform LINK that the enclosed modules are to
 be in an overlay. Therefore, if a left (or right) parenthesis comes
 immediately before (or after) the name of an object module, LINK will
 expect a right (or left) parenthesis immediately after (or before) the
 name. If the parentheses do not match, a fatal L1027 error will be
 generated.

 For example, the following LINK command line causes an "Unmatched left
 parenthesis" error when the object module ABC.OBJ is in the current
 directory:

    link (abc;

 However, if ABC.OBJ is in a subdirectory, then the parenthesis is
 embedded in the middle of the path/filename string and no error is
 generated, as shown below:

    link temp\(abc;

 For the same reason, a file ABC).OBJ will NOT give an error if linked
 with the following line:

    link abc).obj;

 On the other hand, leaving off the .OBJ extension will result in the
 L1027 error:

    link abc);

 By the same reasoning, the placement of a left or right parenthesis in
 the middle of an object filename does not cause an error. The
 following three LINK lines all work correctly:

    link a(bc;
    link a()bc;
    link a)bc;


 75. ILINK 1.20 and 1.21 Are Not Backwards Compatible

 Product Version(s): 1.20 1.21 | 1.20 1.21
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 24-OCT-1990    ArticleIdent: Q65817

 Using ILINK version 1.20 or 1.21, after doing a full link using a
 bound linker earlier than version 5.10 or a DOS linker earlier than
 version 4.10, causes the following message:

    ILINK : warning L4267: invalid .ILK file
    ILINK : performing full link

 If you use the ILINK version that came with the linker you are using,
 the .ILK file will be recognized correctly. ILINK versions 1.20 and
 1.21 are not "backwards compatible" and will not work correctly with
 earlier .ILK files.


 76. Unexpected DOS Error: 14 Generated by Using /INC

 Product Version(s): 5.10
 Operating System:   MS-DOS
 Flags: ENDUSER | s_quickc s_c
 Last Modified: 24-OCT-1990    ArticleIdent: Q66055

 Programs linked with the /INC (Prepare for Incremental Link) switch
 cause the following error if the program is executed using the
 Microsoft Windows version 3.00 Run command:

    Unexpected DOS error: 14.

 The Run command is located on the File menu in both the Windows
 Program Manager and the File Manager. If the program is run from a
 prompt in real DOS or in a DOS session of Windows 3.00, it executes
 properly.

 While this seems like a problem with the Microsoft Linker, Windows 3.0
 is actually at fault here. The use of the /INC switch causes the
 linker to create a segmented executable. When Windows attempts to run
 this .exe, it fails to recognize that it is a full screen application
 (ie: not a windows app) and subsequently tries to execute it as a
 Windows application. This bug has been entered into the Windows bug
 database and should be fixed in a future release.

 Note: This may appear to be a problem with QuickC and/or C version
 6.00 if the incremental link option is turned on. In fact, it is a
 linking issue, not a compiler issue.

 To workaround this problem, turn off the /INC switch.


 77. Response Filename Cannot Exceed 32 Characters

 Product Version(s): 5.01.21 5.03 5.05 | 5.01.21 5.03 5.05
 Operating System:   MS-DOS            | OS/2
 Flags: ENDUSER | buglist5.01.21 buglist5.03 buglist5.05 fixlist5.10
 Last Modified: 12-NOV-1990    ArticleIdent: Q66698

 When using a complete path specification for a response file with
 LINK.EXE versions 5.01.21, 5.03, and 5.05, there is a limit of 32
 characters that cannot be exceeded. The following example illustrates
 this:

    LINK @d:\c600\files\project\test\myfile.lnk

 This will fail with the following error:

    LINK : Fatal error L1089 : D:\C600\FILES\PROJECT\TEST\MYFIL :
         cannot open response file

 In LINK version 5.10, this limit has been increased to 255 characters.


 78. Linker Does Not Search Specified Drive for Libraries

 Product Version(s): 5.01.21 5.03 5.05 5.10 5.11  | 5.01.21 5.03 5.05 5.10 5.1
 Operating System:   MS-DOS                       | OS/2
 Flags: ENDUSER | buglist5.01.21 buglist5.03 buglist5.05 buglist5.10 buglist5.
 Last Modified: 12-NOV-1990    ArticleIdent: Q66699

 A library name can be embedded into an .OBJ module for the linker to
 search to resolve external references. This library name can either be
 the library name itself or the full path to the library. In the case
 of the full path to the library, the linker cannot handle a drive
 specifier.

 For example, with Microsoft C, the #pragma comment command is used to
 specify the library. If the following line is used

    #pragma comment (lib, "c:\C600\LIB\graphics.lib")

 the compiler will add a COMENT record to the .OBJ instructing the
 linker to search the C600\LIB subdirectory on drive C for the
 GRAPHICS.LIB library.

 The problem is that the linker will not search drive C but will
 instead search the default drive. When the library and/or path is not
 found, it will prompt for the path to the library. This is an error.

 Microsoft has confirmed this to be a problem in the Segmented Linker
 versions 5.01.21, 5.03, 5.05, 5.10, and 5.11. We are researching this
 problem and will post new information here as it becomes available.


 79. L2002 When Creating a Dynamic Link Library

 Product Version(s): 5.10 5.11
 Operating System:   OS/2
 Flags: ENDUSER | buglist5.10 buglist5.11
 Last Modified:  4-DEC-1990    ArticleIdent: Q67004

 The code sample below produces the following error when compiled and
 linked with the following switches:

 cl /c /Gs /Alfu /ML foo.c

 link foo.obj, foo.dll,,, foo.def;

 Error
 -----

    L2002: fix-up overflow at 2 in segment FOO_TEXT
     frm seg _DATA, tgt seg _DATA, tgt offset 0

 This error is produced when creating a dynamic link library and
 specifying _loadds on function entry (either with the /Au switch or
 the _loadds keyword). If each segment that comprises the default data
 segment is of zero length, the linker will return this error. In
 earlier linkers, the error wasn't generated.

 The following are three possible workarounds:

 1. If the function does not contain any static data, compile with the
    option /Aw (DS not reloaded on function entry) and/or remove the
    _loadds keyword from the function declaration.

 2. Turn on stack checking (compile without /Gs option).

 3. Declare data so at least one of the segments in DGROUP is not zero
    length.

    a. For _DATA, declare initialized global or static data.

    b. For _CONST, declare a constant in the program.

    c. For _BSS, declare uninitialized static data.

 Microsoft has confirmed this to be a problem in versions 5.10 and
 5.11. We are researching this problem and will post new information
 here as it becomes available.

 Sample Code
 -----------

 void foo(int i)
 {
    char c;

    c=i;
 }


 80. NOF Is Default for LINK, Not /F as C "Reference" States

 Product Version(s): 5.10   | 5.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr S_C
 Last Modified:  4-JAN-1991    ArticleIdent: Q67085

 On pages 30 and 31 of the "Microsoft C Reference" manual shipped with
 C versions 6.00 and 6.00a, there are contradictory references to the
 far-call translation options available for LINK. On page 30 under the
 /F[ARCALLTRANSLATION] option, far-call translations are listed as
 being "turned on by default." On the other hand, on page 31 under the
 /NOF[ARCALLTRANSLATION] option, far-calls are listed as being "off by
 default."

 The statement on page 30 is the one that is incorrect because the
 correct default for far-call translations is "off." Far calls are done
 only when /F is explicitly specified to LINK.

 Note that when the CL command is used to invoke LINK, CL itself is
 responsible for passing the /F option to the linker.


 81. EXE Checksum Incorrect If linked with /CO or /E

 Product Version(s): 3.xx 4.0x 4.10 5.0x 5.10 5.13 | 5.0x 5.10 5.13
 Operating System:   MS-DOS                        | OS/2
 Flags: ENDUSER |
 Last Modified:  6-FEB-1991    ArticleIdent: Q67795

 According to "The MS-DOS Encyclopedia," a DOS .EXE file contains a
 checksum value in the .EXE file header. This checksum value should
 allow the summation of all words in the .EXE file to equal FFFFh.
 However, if you use the /Exepack or the /COdeview options when linking
 a program, the checksum value will not be calculated correctly.
 Current versions of MS-DOS ignore this checksum so this will not cause
 any noticeable problems.

 Sample Code:
 ------------

 #include <stdio.h>
 #include <stdlib.h>

 main (int argc, char * argv[])
 {
    FILE * fp;
    unsigned int nxt= 0, sum= 0;
    unsigned char bl, bh;

    if (argc != 2)
       exit (-1);
    if ((fp= fopen (argv[1], "rb"))== NULL)
       exit (-1);
    while (! feof(fp))
    {
       bl= fgetc (fp);
       if (! feof(fp))
          bh= fgetc (fp);
       else
          {
          bl= 0;
          bh= 0;
          }
       sum= sum+ nxt;
       nxt= (unsigned int) bh* 256U+ (unsigned int) bl;
    }
    nxt&= 0xFF;
    sum+= nxt;
    printf ("sum = %X\n", sum);
 }


 82. L1008: "Segment Limit Too High" May Be Caused by Missing Colon

 Product Version(s): 3.x 4.06 4.07 5.01.21 5.03 5.05 5.10 | 5.01.21 5.03 5.05
 Operating System:   MS-DOS                               | OS/2
 Flags: ENDUSER |
 Last Modified: 17-DEC-1990    ArticleIdent: Q46733

 When linking, the following error may be caused by incorrectly
 specifying the parameters for the /SE switch on the link command line
 with the colon:

    LINK : fatal error L1008: SE: segment limit set too high

 To generate the error, link using the /SE switch, then insert a space
 and the number of segments for the linker to use, such as the
 following:

    LINK /SE 1024

 The correct syntax for the /SE option is with a colon separating the
 switch from the numeric argument as follows:

    LINK /SE:1024


 83. The Purpose of Module Definition Files

 Product Version(s): 5.01.21 5.02 5.03 5.05 5.10 5.13 | 5.01.21 5.02 5.03 5.05
 Operating System:   MS-DOS                           | OS/2
 Flags: ENDUSER |
 Last Modified: 17-DEC-1990    ArticleIdent: Q27134

 Module-definition files (.DEF) are used by LINK when building Windows
 and OS/2 programs and dynamic-link libraries (DLLs). A .DEF file
 describes the name, size, format, functions, and segments of an
 application or DLL.

 A module-definition file contains one or more module statements. Each
 module statement defines an attribute of the executable file. The
 module statements and the attributes they define are listed below:

 Statement         Attribute
 ---------         ---------

 NAME              Name and type of application
 LIBRARY           Name of dynamic-link library
 DESCRIPTION       One-line description of the module
 CODE              Default attributes for code segments
 DATA              Default attributes for data segments
 SEGMENTS          Attributes for specific segments
 STACKSIZE         Local-stack size, in bytes
 EXPORTS           Exported functions
 IMPORTS           Imported functions
 STUB              Adds a DOS Version 3.x executable file to the beginning
                   of the module, usually to terminate the program when
                   run in real mode
 HEAPSIZE          Local-heap size, in bytes
 PROTMODE          Specifies that the module runs only in OS/2 protected
                   mode
 REALMODE          Specifies that the module is for real-mode Windows.
 OLD               Preserves export ordinal information from a previous
                   version of the library

 The following rules govern the use of these statements in a module-
 definitions file:

 1. If you use either a NAME or a LIBRARY statement, it must precede
    all other statements in the module-definition file.

 2. You can include source-level comments in the module-definition
    file, by beginning a line with a semicolon (;). The OS/2 utilities
    ignore each such comment line.

 3. Module-definition keywords (such as NAME, LIBRARY, and SEGMENTS)
    must be entered in uppercase letters.

 For more information, refer to the utility reference or online help
 that accompanied your particular compiler or assembler.


 84. Working Around Link Error "L1064: Out of Memory"

 Product Version(s): 5.03 5.05 5.10 5.13 | 5.03 5.05 5.10 5.13
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER |
 Last Modified: 17-DEC-1990    ArticleIdent: Q45718

 The linker error "L1064: Out Of Memory" is new with LINK version 5.03,
 which was first shipped to individuals using IMSL libraries with
 FORTRAN 4.10, and was then shipped with FORTRAN 5.00. The description
 of the error is as follows (from the "Microsoft FORTRAN, Microsoft
 CodeView and Utilities User's Guide"):

    The linker was not able to allocate enough memory from the
    operating system to link the program. On OS/2 try increasing the
    swap space. Otherwise, reduce the size of the program in terms of
    code, data, and symbols. On OS/2, consider splitting the program
    into dynalink libraries.

 In DOS, the only ways to work around the error are the following:

 1. Remove any memory-resident software or device drivers that may be
    limiting the available memory of the machine.

 2. Reduce the program size, as described above.

 In OS/2, the easiest way to work around the error is to increase the
 swap space, as follows:

 1. Close other screen groups and remove other processes from
    memory to free up both RAM and swap space on the swap drive.

 2. Create more free disk space on the drive that is pointed to by
    the SWAPPATH setting in the CONFIG.SYS file. (Delete or move files,
    or change the setting to a drive with more free space.)

 3. Possibly DECREASE the swap value set by the SWAPPATH variable (do
    this with caution -- read below).

 Explanation of the SWAPPATH Setting in CONFIG.SYS
 -------------------------------------------------

 Swapping must be enabled via the MEMMAN setting in CONFIG.SYS for the
 SWAPPATH setting to be acknowledged at all (usually "MEMMAN=SWAP" or
 "MEMMAN=SWAP,MOVE").

 The default setting for SWAPPATH after setting up OS/2 is usually as
 follows:

    SWAPPATH=C:\OS2\SYSTEM 512

 The drive setting indicates the drive and directory where the space
 for the swapper file will be allocated. If no SWAPPATH variable is
 set, the swapper file is allocated in the root directory on the boot
 drive. The number that follows indicates the amount of free space
 which must be left on this drive when the swapper file has grown to
 its maximum size. (This number, by itself, says nothing about the
 maximum size of the swapper file.) Given the settings above, the
 maximum size of the swapper file can be easily calculated by the
 following:

    (free space on Drive C) - (SWAPPATH value) = max. swap file size

 Therefore, increasing the SWAPPATH value DECREASES the amount of space
 available for the swapper file.

 The swapper value can be decreased, and the system will allow values
 down to 0 (zero). However, because OS/2 does time-slicing between
 processes and may need to write to the disk in question, decreasing
 the swapper value below 512K (the system default) is not recommended.
 This workaround should be used only if you have the value set to
 greater than 512K (the range of valid values is from 0 to 32,767). If
 this is the case, set the SWAPPATH value to 512 and reboot the
 machine. If this method does not solve the problem, you must clear
 space on the hard disk by deleting or moving files.


 85. Patches Available for Running Utilities Under Novell NetWare

 Product Version(s): 5.10
 Operating System:   MS-DOS
 Flags: ENDUSER | appnote SC0381.ARC s_codeview s_pwb s_c
 Last Modified:  6-FEB-1991    ArticleIdent: Q68659

 When LINK version 5.10 is run under a Novell network, LINK may fail
 with the following error:

    L1085: cannot open temporary file

 In addition, the C version 6.00 Setup program (SETUP.EXE), the
 Programmer's WorkBench (PWB) for DOS versions 1.00 and 1.10, and
 real-mode CodeView (CV.EXE) versions 3.00, 3.10, and 3.11 may all hang
 when run under some Novell NetWare software.

 These problems are directly related to the network software, but may
 be corrected with a set of patch files available from Microsoft as an
 application note titled "Network Patches for Utilities" (SC0381).
 Application notes can be obtained by calling Microsoft Product Support
 Services at (206) 637-7096.

 The "Network Patches for Utilities" application note can also be found
 in the Software/Data Library by searching on the keyword SC0381, the Q
 number of this article, or S12898. SC0381 was archived using the
 PKware file-compression utility.

 The following is the complete text of the application note, which
 includes the details of the problems mentioned above:

 ======================================================================
                     Network Patches for Utilities
 ======================================================================

 The enclosed Network Patches for Microsoft Utilities disk contains the
 following five files:

    README.DOC
    CVPATCH.EXE
    PWBPATCH.EXE
    SETUPFIX.EXE
    LINK.EXE

 These files solve conflicts with certain network setups. Please be
 sure to make backup copies of the original files.

 Network Patch Files
 -------------------

 When run under certain network software, some Microsoft utilities may
 hang. The enclosed patch files are designed to correct these problems
 for CodeView versions 3.00, 3.10, and 3.11; the Programmer's WorkBench
 (PWB) versions 1.00 and 1.10; and the C 6.00 Setup program.

 To install the patches, first copy the patch files (PWBPATCH.EXE,
 CVPATCH.EXE, and SETUPFIX.EXE) to the directories where you have
 installed PWB, CodeView, and Setup, respectively. Each patch assumes
 that the utility file it is to patch is in the same directory.

 Run SETUPFIX.EXE to patch SETUP.EXE. The original file will be saved
 as SETUP.BAK. Run CVPATCH.EXE to patch CV.EXE. The original file will
 be saved as CV.BAK. Run PWBPATCH.EXE to patch PWBED.EXE. The original
 file will be saved as PWBED.BAK. The patched utilities should run free
 of network interference.

 Microsoft LINK Version 5.13
 ---------------------------

 LINK version 5.13 includes code to work around another problem that
 sometimes occurs when running on a network. On large projects, the
 linker needs to open some temporary files to work around DOS memory
 limitations. LINK version 5.10 (supplied with C 6.00) will sometimes
 fail in its attempts to open a temporary file when run under certain
 network software.

 The problem actually lies in the network software, not the linker.
 When the network is loaded, the return value from an open call
 sometimes gets corrupted. When the call fails, it is because an "Out
 of handles" error (EMFILE) is returned as a "No such file or
 directory" error (ENOENT). If this occurs, LINK 5.10 halts with an
 "L1085: cannot open temporary file" error.

 LINK 5.13 includes a change to correct for the above situation (even
 though the problem is in the network software). When LINK version 5.13
 receives an ENOENT error on a failed open call, it will still try to
 free some file handles and reopen the temporary file, regardless of
 the error returned.

 To make the correction, locate LINK version 5.10 and replace it with
 LINK version 5.13 from the enclosed disk. Again, be sure to save a
 backup copy of the original file (LINK 5.10).


 86. L2025 LINK Error May Be Caused by Conflicting Library Routines

 Product Version(s): 3.x 4.06 4.07 5.0x 5.10 5.13 | 5.01.21 5.02 5.03 5.10 5.1
 Operating System:   MS-DOS                       | OS/2
 Flags: ENDUSER | s_lib
 Last Modified: 24-JAN-1991    ArticleIdent: Q44465

 All variables and routines in a module within a library will be linked
 into a program when any single variable or routine residing in that
 module is referenced. This can cause the following linker error if two
 or more modules contain definitions for the same symbol:

    L2025  symbol defined more than once

 For example, in the diagram below, module1 contains routines "a", "b",
 and "c". The module2 contains routines "c", "d", and "e". When main()
 references "a" and "e", the linker links module1 and module2 from the
 library. This results in "c" being defined twice. Removing "c" from
 one of the modules, recompiling the module, and replacing the module
 in the library with the LIB utility operator "-+" will prevent "c"
 from being multiply defined.

                         +-----------+
                         |           |
                         | calls "a" |
                         | calls "e" |
                       / |           | \
                      /  +-----------+  \
                     /       main()      \
                    v                     v
                +-------+             +-------+
                |   a   |             |   c   |
                |   b   |             |   d   |
                |   c   |             |   e   |
                |       |             |       |
                +-------+             +-------+
                 module1               module2

 For each routine you want to be linked separately, compile a separate
 object file and add it to the library.






 Microsoft `M' Editor
 =============================================================================


 1. How to Put Microsoft Editor (M or MEP) into 43-Line Mode

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  1-SEP-1988    ArticleIdent: Q28580

 To use the Microsoft Editor (M.EXE or MEP.EXE) in EGA 43-line mode,
 the TOOLS.INI file must be modified to include the following
 statement:

 HEIGHT:41

 (The number 41 is used because the last two lines are used by the
 editor as status/error lines. See Page 59 of the "Microsoft Editor for
 MS OS/2 and MS-DOS: User's Guide".)

 Once the TOOLS.INI is modified, the editor must be re-initialized.
 This process is done with the Initialize command. The default key
 stroke for this command is SHIFT+F8. Appendix A lists the values for
 the other .INI files provided with the editor. The following example
 demonstrates this process:

 1. Load TOOLS.INI.
 2. Modify TOOLS.INI.
 3. Save the file (ARG ARG SETFILE or leave and re-enter).
 4. Use the Initialize command (SHIFT+F8).

 After the initialization, the changes in the TOOLS.INI become active
 and the 43-line mode is in use.

 M.EXE runs in MS-DOS real mode, and MEP.EXE runs in OS/2 protected
 mode.


 2. Creating Macros for the Microsoft Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  1-SEP-1988    ArticleIdent: Q23051

 Macros for the Microsoft Editor are sequences of editor functions. For
 example, a macro to delete the word to the right of the cursor is
 defined as follows:

 worddelete:=arg meta pword sdelete

 The above macro is named "worddelete". To associate "worddelete" with
 a particular keystroke, the following command is needed:

 worddelete:ALT+W

 The macro "worddelete" is now bound to the keystroke "ALT+W". Note
 that the macro definition (i.e., ":=") resembles a Pascal assignment
 statement, but the keybinding uses a colon to delimit the macro name
 from the key to which it is assigned. The following is another
 example:

 filestamp:=curfilenam curfileext " - " curdate " " curtime
 filestamp:ALT+S

 This macro creates a file-time stamp that contains the filename, the
 current date, and the current time; it is assigned to the keystroke
 "ALT+S".


 3. File Size Limitations for the Microsoft Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | TAR62237
 Last Modified: 29-AUG-1988    ArticleIdent: Q23609

 Question:

 What is the largest file the Microsoft Editor can load?

 Response:

 The size of the file is controlled by the operating system, not by
 the editor. The editor will read in a file of any number of bytes;
 however, you are limited by the temporary file space.

 The size of the drive pointed to by the TMP variable is the limiting
 factor. Because TMP often points to a (relatively small) RAM drive,
 such as VDISK or MS-RAMDRIVE, this is the most common file size
 limitation.

 A safe rule-of-thumb is that your TMP drive may need to be up to
 two times the size of the file being edited.

 The maximum number of lines a file can contain is 0x7FFFFFFF, but you
 will run out of disk space before you have too many lines.

 Both MS-DOS and OS/2 currently limit disk size (hence, file size)
 to 64K sectors, which normally is 32 megabytes.


 4. Unassigning Predefined Keys

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | TAR62300
 Last Modified:  1-SEP-1988    ArticleIdent: Q23754

 The following are two ways to unassign a predefined key:

 1. Assign the key to a different function.
 2. Assign the key to the "unassigned" function.

 If ALT+A currently is assigned to the ARG function, you can assign
 it to another function by putting the following line in your
 TOOLS.INI file:

 NewFunct:ALT+A

 If you don't want ALT+A to be assigned to any function, place the following
 line in your TOOLS.INI file:

 Unassigned:ALT+A.


 5. Error C1015 "Can't Open Include File" with MEP

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | S_C buglist1.00
 Last Modified:  2-NOV-1988    ArticleIdent: Q35140

 The example program below generates the following error:

 Error C1015 "Can't open include file"

 The program must be compiled with one of the output-file switches
 (such as /Fc) or through a make file to generate this error.

 The include file os2.h opens two other include files: os2def.h and
 bse.h. The bse.h include file, in turn, opens three other include
 files: bsedos.h, bsesub.h, and bseerr.h.

 Microsoft has confirmed this to be a problem in Version 1.00. We are
 researching this problem and will post new information as it becomes
 available.

 The compiler attempts to open the last include file and generates the
 C1015 error. The total file count at this point is 15, as follows:

  1. stdin
  2. stdout
  3. stdprn
  4. stderror
  5. stdaux
  6. MEP
  7. source
  8. listing file
  9. os2.h
 10. os2 def.h
 11. bse.h
 12. bsedos.h
 13. bsesub.h
 14. bseerr.h
 15. tmp file

 The following sample code demonstrates the problem:

 #define INCL_BASE
 #include <os2.h>

 void main (void)
 void main (void)
 {
 }



 6. Maximum Number of Defined Macros Allowed in TOOLS.INI File

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | TAR63148
 Last Modified: 17-MAY-1988    ArticleIdent: Q24696

 Question:
    Is there a maximum number of macros, predefined and user-defined,
 allowed in the TOOLS.INI file?

 Response:
    The maximum number of defined macros allowed is 1024.


 7. BRIEF TOOLS.INI File Assigns Two Commands to F5 in M.EXE

 Product Version(s): 1.00    | 1.00
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER |
 Last Modified:  1-SEP-1988    ArticleIdent: Q30474

 Problem:

 After I configure the Microsoft M.EXE Editor in the BRIEF mode and
 invoke Psearch (F5 key), I receive the following error message:

 "Invalid argument."

 However, Msearch (ALT+F5) functions correctly.

 Response:

 The BRIEF TOOLS.INI file assigns two commands to F5. The first
 occurrence in the file is for Psearch and the second is for
 DeleteWindow.

 To correct the problem, one of the commands should be mapped to a
 different key. Make sure the new key is not already in use.

 The following is an example of the incorrect portion of the
 BRIEF.INI file:

    ; TOOLS.INI file for BRIEF(tm) configuration
    [M]
           .
           .
           .
    Psearch:F5
           .
           .
           .
    ; WINDOWS
    ;
    ; Delete Current Window is F5
    DeleteWindow:=meta window
    DeleteWindow:F5
    ;
    ;
    ;
    ; BRIEF is a trademark of UnderWare, INC.


 8. Assigning Key Sequence to ENTER and BACKSPACE Keys

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 29-AUG-1988    ArticleIdent: Q25407

 Functions can be assigned to the ENTER and BKSP (BACKSPACE) keys in
 the TOOLS.INI file, as in the following example:

 emacsnewl:enter
 emacscdel:bksp

 Consult Chapter 6 of the "Microsoft Editor User's Guide," titled
 "Function Assignments and Macros."


 9. CALLTREE Ignores Conditional Compilation Statements in Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | S_C H_MASM
 Last Modified: 17-MAY-1989    ArticleIdent: Q44417

 The CALLTREE utility provided with the Microsoft Editor can be used to
 produce a graphical call-tree listing of a project. The following
 command line is an example of this utility. This command line creates
 a file called CALLS.TXT showing the relationship of the functions
 found in the four C source files shown below:

    calltree /c calls.txt main.c sub1.c sub2.c sub3.c

 If any of the files use conditional compilation directives, these are
 disregarded by CALLTREE and any functions that would not have been
 called appear in the call listing. An example of code that produces a
 misleading call listing is shown below. Although only one set of calls
 is compiled, both sets show up in the file produced by CALLTREE.

     void main( void )
     {
     #ifdef DEBUG
         dshow();
         ddone();
     #else
         fshow();
         fdone();
     #endif
     }

 To avoid this situation, a preprocessor listing should be produced
 using the /P switch with CL, and CALLTREE should then be run on the
 resultant file.

 This is a limitation of the utility. CALLTREE is meant to be a
 general-purpose tool for C and assembly programs, and is not designed
 to do any parsing or syntax checking.


 10. Microsoft Editor Fails to Find TOOLS.INI Using DOS Version 2.x

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 20-OCT-1988    ArticleIdent: Q28590

 Problem:

 When running the M.EXE editor under DOS Versions 2.x, the editor does
 not find the TOOLS.INI file. The error reported is "Unable to Read
 TOOLS.INI[]".

 The following demonstrates the problem:

 1. Rename QUICK.INI to TOOLS.INI.
 2. Set the environment variable INIT to the directory c:\mytools
    as follows:

    SET INIT=c:\mytools

 3. Load the M.EXE editor. It will come up with default settings,
    instead of reading TOOLS.INI.

 When running DOS Version 3.20 on an IBM PC AT, M.EXE correctly finds
 the TOOLS.INI file.

 Response:

 M.EXE and MEP.EXE use their startup name to find the right section in
 TOOLS.INI. For example, if you rename the editor to Z, it will look
 for [z] instead of [m] in the editor's section in TOOLS.INI.

 This process occurs in all cases except under DOS Versions 2.x. Under
 any 2.x version of DOS, the name of your program is not available, and
 instead, the compiler provides the arbitrary name "C".

 To work around this limitation in DOS Versions 2.x, change the
 editor's tagged section in TOOLS.INI file to use the tag [c] instead
 of [m]. If it is necessary to share files with DOS Versions 3.x
 systems, the editor's section in TOOLS.INI can be tagged [m c].

 The editor uses the same method to name the following, where * is
 replaced by the editor name or by "C" under DOS Versions 2.x:

 1. The virtual memory file, *-XXXX.VM
 2. The history-and-state file, *.TMP
 3. The compiler message file, *.MSG


 11. Using Full Pathnames to Compile Programs with M or MEP

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | TAR75085
 Last Modified: 20-OCT-1988    ArticleIdent: Q29150

 The full pathname of a file is not transferred to the compiler when an
 ARG COMPILE is executed in the Microsoft Editor for MS-DOS and OS/2.
 The following is an example:

 1. Invoke M.EXE as follows:

 M \c5\source\test.c

 2. Compile the program with ARG COMPILE. (The default value is
    ALT+A SHIFT+F3). The following line is displayed:

    CL /c /Zep /D LINT_ARGS test.c

    The full pathname is not given.

 If you plan on compiling from other directories, you should define
 the compile command using the %|F option. The default option %s uses
 only the filename. For example, the TOOLS.INI file could be modified
 as follows to get the default compile with the full pathname:

 extmake:c cl /c /Zep /D LINT_ARGS %|F

 You also can select portions of the full pathname, and use the name
 more than once, as in the following example:

 %d|F - obtains the drive (and colon)
 %p|F - obtains the path
 %f|F - obtains the filename (no extension)
 %e|F - obtains the extension

 You can combine the "dpfe" any way you wish, as in the following:

 %dpf|F.xyz

 This combination produces the drive, path, and filename, with the
 extension .XYZ added to the filename.


 12. Editor "User's Guide" C-Extension Sample Generates Warnings

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 12-JUL-1988    ArticleIdent: Q29730

 Problem:
     When I compile the sample program on Page 85 of the "Microsoft
 Editor for MS OS/2 and MS-DOS: User's Guide," I get two warning
 messages.
    These warning messages are generated on the following two sections
 of the sample program:

    1. struct swiDesc swiTable [] = {
             { NULL, NULL, NULL }
        };

    2. struct cmdDesc cmdTable [] = {
             { "Upper", Upper, 0, BOXSTR | TEXTARG },
             { NULL, NULL, NULL, NULL }
        };

 Response:
   These warnings will not cause a problem. You can, however, make the
 following two changes:

    1. struct swiDesc swiTable [] = {
             { NULL, NULL, 0 }
        };

    2. struct cmdDesc cmdTable [] = {
             { "Upper", Upper, 0, BOXSTR | TEXTARG },
             { NULL, NULL, 0, 0 }
        };


 13. Missing Semicolon on Line 17 of Example on Page 85 in Manual

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 29-AUG-1988    ArticleIdent: Q29731

    On Page 85 of the "Microsoft Editor for MS OS/2 and MS-DOS: User's
 Guide," there is a missing semicolon on line 17.
    The following line is incorrect:

    cfile = FileNameToHandle("", NULL)

    It should read as follows:

    cfile = FileNameToHandle("", NULL);


 14. M.EXE Editor Macro to Join Current Line with Next Line

 Product Version(s): 1.00    | 1.00
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER |
 Last Modified: 29-AUG-1988    ArticleIdent: Q30030

    The following macro will join the current line with the following
 line, leaving one space between the last character on the current line
 and the first character of the next line.
    Place the following three lines in the [M] and/or [MEP] section(s)
 of your TOOLS.INI file, or enter them from the keyboard using the
 ASSIGN function (ALT+= in the default keyboard setup):

    ;Macro to join current line with next line.
        join:=endline right arg down begline sdelete
        join:alt+j

    The following is a description of how the join macro works:

    1. Endline moves one place beyond the last character on the current
       line.
    2. Right moves one character further, to insert a space.
    3. arg introduces the argument to the next command (in this case,
       sdelete).
    4. down begline moves to the first character on the next line.

    This process defines a Streamarg for the command sdelete (S stands
 for Stream).
    Note that sdelete should be used, not ldelete, because the down
 begline sequence would have defined either a Linearg or a Boxarg,
 neither of which would join the lines.
    Use sdelete because it closes the stream of characters and/or white
 space between the starting cursor position and the ending cursor
 position.


 15. Microsoft Editor Macro Moves Text with TAB Key

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  6-JAN-1989    ArticleIdent: Q30033

 The TAB key only moves the cursor. It does not move both the cursor
 and the text under the cursor (as it does in QuickC, Word, and many
 other editors).

 To move text and the cursor, put the following macro in your TOOLS.INI
 file in the [M] and/or [MEP] section(s):

    ;Macro to tab with insertion, as in QuickC and Word
        emacstab:=arg tab sinsert tab
        emacstab:ctrl+tab

 The "emacstab" macro (there is no significance to the name other than
 its similarity to M.EXE's EMACSNEWL and EMACSDEL functions) is invoked
 by pressing CTRL+TAB.

 Note: assigning this macro to CTRL+TAB will only function on
 enhanced-style keyboards. Older-style keyboards must use another set
 of keys for this macro assignment. On the older keyboards, assigning
 this macro to CTRL+TAB causes the macro to be ignored.

 The emacstab macro functions as follows:

 1. The Arg command introduces the argument (in this case, a
    "stream" arg).

 2. The Tab command moves you one tab stop to the right.

 3. The Sinsert command moves the highlighted text over to the tab
    stop.

 This macro leaves your cursor back where it started, so one more TAB
 moves your cursor to the right (on top of the shifted text).


 16. C Extension to Make Psearch Prompt for an Input in M.EXE

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 23-MAY-1988    ArticleIdent: Q30285

 Question:
    I wish to emulate the Brief Psearch (Plus Search) with the M.EXE
 editor. I want Psearch to prompt me to enter a search string. Can this
 be done with a macro or do I have to use a Microsoft C extension?

 Response:
     This emulation cannot be done with macros. However, it can be done
 with Microsoft C extensions.
     The following is an example of how to do so in a Microsoft C
 extension:

     1. Use DoMessage() to output a string saying something similar to
 the following:

     "Please enter the search string:"

     2. Use KbUnHook() to disable M.EXE's "logical keyboard." This
 gives you the "focus" of the keyboard so that keyboard input is no
 longer read by the editor, thus freeing you to input a string from the
 user.
     3. Parse the keyboard input and then process it appropriately by
 invoking the Psearch function.
     4. Use KbHook() to reenable the logical keyboard in M.

     The following is an alternate method:

     Use "ReadChar()" instead of "KbUnHook()" and "KbHook()."
 (Mentioned in steps two and four above.)

     For more information on the functions available for writing C
 extensions, please read the files EXT.DOC and EXT.H that are included
 with the Microsoft Editor Version 1.00.
     For general information on programming C extensions, please
 consult Chapter 8 of the "Microsoft Editor User's Guide."
     Appendix A of the "Microsoft Editor User's Guide" provides a
 comprehensive list of editing functions such as Psearch.
     Psearch searches forward for the previously defined string or
 pattern. Msearch (Minus Search) searches backward for the previously
 defined string or pattern.


 17. Debug Shown on M.EXE Help Screen Is Not a Supported Switch

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 15-JUN-1988    ArticleIdent: Q30365

    The Debug numeric switch that appears in the information file of
 the help screen in the Microsoft Editor Version 1.00 has not been
 implemented.
    There is no function associated with Debug.


 18. M.EXE C Extensions Documented in UTILITY.DOC, Not README.DOC

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | docerr
 Last Modified: 26-MAY-1988    ArticleIdent: Q30534

    Page 70 of the "Microsoft Editor User's Guide" incorrectly states
 the following:

    "To create a successful C extension, you need to follow these
 guidelines:
        1. Check the README.DOC file to see what functions you can call
 from the standard C run-time library."

    Contrary to the above manual statement, C extensions are documented
 in UTILITY.DOC on the release disk, not in the README.DOC.



 19. Making Assignments to PLUS, MINUS and PRINT SCREEN Keys

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | tar66615
 Last Modified:  1-SEP-1988    ArticleIdent: Q31485

 It is possible to make key assignments to the PLUS, MINUS, and
 PRINT SCREEN keys on the numeric keypad.

 For more information on function assignments, macros, and keystrokes,
 consult section 6.2.1 of "The Microsoft Editor User's Guide."


 20. How to Load a C Extension that Is Not in Current Directory

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | TAR75933 docerr
 Last Modified:  8-JUN-1988    ArticleIdent: Q30826

    Page 84 of the "Microsoft Editor for OS/2 and MS-DOS User's Guide"
 incorrectly infers that the M.EXE editor will search for a C-extension
 module along the DOS PATH under MS-DOS or OS/2 real mode when you
 place the following statement in the TOOLS.INI file:

    load:myext.exe

    To search for a C-extension module along the DOS PATH, you must
 instead use the following load switch syntax in the TOOLS.INI file:

    load:{$ENVAR: | dos path}filename.ext

 where you have the option of using $ENVAR: (a DOS environment
 variable) or an explicit directory path specification.
    You can prefix your filename with $PATH: or $INIT:. For example,
 "$PATH:filename.ext" means the "filename.ext" is to be found in the
 directories in the DOS PATH. This format is valid in any filename
 context. The following example will go to the STDIO.H file that
 actually is being used by the compiler:

    <arg> "$INCLUDE:stdio.h" <setfile>

    Also, when operating under OS/2, $ENVAR:, the explicit DOS path,
 and the extension on the filename are ignored. Instead, filename.DLL
 is searched for in your LIBPATH. Please note that LIBPATH under OS/2
 is not an environment variable. LIBPATH is a directive in the
 CONFIG.OS2 file.
    The following are examples of using the load switch in TOOLS.INI:

    ; load 'my.ext' from the current directory.
    ; Under OS/2, load my.dll from LIBPATH.
    load:my.ext

    ; load 'your.ext' from either the current directory or one
    ; of the directories on path
    ; Under OS/2, load 'your.dll' from LIBPATH
    load:$PATH:your.ext

    ; load 'c:\init\ourext'.
    ; Under OS/2, load 'ourext.dll' from LIBPATH
    load:c:\init\ourext



 21. An Example Where a Protect Mode C Extension Will Not Load

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | TAR76121 TAR76251
 Last Modified:  8-JUN-1988    ArticleIdent: Q30827

 Problem:
    I am trying to create an extension to the MEP.EXE editor. I am
 unable to get the editor to load my C extension. To simplify things I
 tried to get the editor to load the sample SKEL; however, I was
 unsuccessful. I receive the following error messages when loading:

    "cannot load skel - invalid argument"
    "skel is an illegal setting"

    My LIBPATH is c:\os2\dll and skel.dll is placed there. If skel.dll
 is not in my libpath I would get the error "no such file or
 directory". My MAKE and DEF files for SKEL are as follows:

 SKEL MAKE FILE
 #
 # Makefile for the MEP Editor Extensions
 #
 SYS=\os2\dll

 .c.obj:
  cl -c -Gs -Asfu -G2 -Lp $*.c

 .obj.dll:
  link  /NOI /NOD exthdrp.obj $*.obj,$*.dll,nul.map,,$*.def;

 skel.obj:    skel.c skel

 skel.dll:    skel.obj skel.def

 $(SYS)\skel.dll:  skel.dll
        copy skel.dll $(SYS)

 SKEL DEF FILE

 LIBRARY  SKEL

 EXPORTS
  _ModInfo
  SKEL

 Response:
    The extension is not loaded because the DEF file is incorrect. The
 file should be as follows:

 SKEL.DEF:
    LIBRARY

    EXPORTS
            _ModInfo
            EntryPoint

    This file should be used with all the extensions that are written.
 It need not be modified.



 22. Tags Let You Use the Same TOOLS.INI File for M and MEP

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | TAR76127
 Last Modified:  8-JUN-1988    ArticleIdent: Q30828

 Question:
    I have the same commands for M and for MEP. I want to load the
 QUICKHELP utility if I am running OS/2. However, in my TOOLS.INI file,
 if I put in the following information, MEP never reads the rest of
 the TOOL.INI file:

    [mep]
     load:qhmep
    [m mep]
     rest of the commands
     .
     .

    How should I do this without making two (almost identical) files,
 one for [m] and one for [mep]?

 Response:
    Through the use of tags, it is possible to use the same TOOLS.INI
 file in both protect mode and real mode/DOS. The tag must specify the
 program name along with the version of the operating system as in the
 following example:

    [m-3.2]    => MS-DOS 3.2
    [m-10.0]   => OS/2 1.0 protect mode
    [m-10.0R]  => OS/2 1.0 real mode
    [m-10.10]  => OS/2 1.1 protect mode
    [m-10.10R] => OS/2 1.1 real mode

    The following change should be made to your TOOLS.INI file:

        [m mep]
                 commands that are non operating system dependent
             .
             .
             .

        [mep-10.0]
             load:qhmep

    The number used in the tag is the major and minor version number of
 of the operating system being used. Under OS/2 this information can be
 found by calling the API routine DosGetVersion. The call can be made
 from any language that supports the use of the API,including C Version
 5.10, MASM Version 5.10, FORTRAN Version 4.10, PASCAL Version 4.10,
 and BASCOM Version 6.00. Under DOS, this information is displayed with
 the DOS VER command.


 23. Setting TMPSAV in TOOLS.INI file; M.TMP Cannot Be Suppressed

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | TAR76606
 Last Modified:  8-JUN-1988    ArticleIdent: Q30829

 Question:
    How do I get the Microsoft Editor (both ME and MEP) to not create
 and use the M.TMP to record past editing sessions?
    I have tried setting the switch tmpsave:0 in the TOOLS.INI file,
 but this does not solve the problem. Is there some other switch I have
 not set properly or a way to exit without creating M.TMP?

 Response:
    There is no way to prevent the creation of the temporary file.
    The TMPSAV switch is used to control the maximum number of files
 about which information is kept between editing sessions. This
 information includes the cursor position and window layouts.
    When you edit one of these files again, the screen starts up as you
 left it. The default value is 20. If TMPSAV is set to 0, it causes all
 files to be saved. All other numeric values refer to the number of
 files that will be saved. The /t option specifies that any files
 edited are temporary; they are not saved in the M.TMP file.



 24. Protected-Mode C Extensions Fail with "Protection Fault"

 Product Version(s): 1.00 | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 29-AUG-1988    ArticleIdent: Q31009

 Problem:
    I am writing C extensions for the protected mode of OS/2. All my
 extensions fail with a general-protection fault. The sample program on
 Page 85 of the "Microsoft Editor for MS OS/2 and MS-DOS: User's Guide"
 also fails.

 Response:
    Page 78 of the "Microsoft Editor for MS OS/2 and MS-DOS: User's
 Guide" incorrectly states that the second argument is a NULL pointer.
    The programs are crashing because the incorrect value is being
 passed to the FileNameToHandle routine. This routine requires a
 pointer to a null string, not a null pointer.
    For example, the following statement

    cfile=FileNameTohandle("",NULL);

 should read as follows:

    cfile=FileNameTohandle("","");


 25. Two Toned Colors in <assign> Pseudo File Can Occur

 Product Version(s): 1.02    | 1.02
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER | buglist1.02
 Last Modified: 29-JAN-1990    ArticleIdent: Q58029

 The <assign> pseudo file can consist of lines in blocks that alternate
 in color starting at the middle of the file. This appears as if you've
 changed multiple editor options, which have just been activated, when
 no changes were actually made. This does not affect the way M.EXE (or
 MEP.EXE) operates.

 To see the blocks of alternating color, follow the steps below:

 1. Invoke the editor.

 2. Press ALT+A <ASSIGN> F2, which implies ARG <ASSIGN> SETFILE.

 3. Press ALT+BACKSPACE, which implies UNDO.

 4. Press F9 ALT+BACKSPACE, which implies META UNDO.

 5. Page down until you see the colored blocks.

 Microsoft has confirmed this to be a problem with the Microsoft Editor
 Version 1.02. We are researching this problem and will post new
 information here as it becomes available.


 26. Return Type for ReadCmd Is PSWI, Not PCMD

 Product Version(s): 1.00 | 1.00
 Operating System:   OS/2 | MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 12-JAN-1989    ArticleIdent: Q31143

 Page 7 of the EXT.DOC file, located in the SOURCE\ME\EXT directory of
 the Microsoft C Optimizing Compiler Version 5.10, incorrectly lists
 the return type for the ReadCmd command as being PCMD.

 The correct return type is PSWI, which is documented in the EXT.H
 file.


 27. MEP Crashes OS/2 when Switching from Real-Mode Screen Group

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |  TAR75546 TAR76522
 Last Modified: 28-OCT-1988    ArticleIdent: Q31144

 When running in OS/2 protected mode, the system may crash when
 switching between protected mode and real mode and using the ALT+ESC
 sequence. It may take several iterations of ALT+ESC before the failure
 occurs.

 The system crashes when switching from the real-mode session into a
 protected-mode session that is running MEP. When the system crash
 occurs, the following message appears:

     TRAP 000D

     <register contents>

     The system detected an internal processing error
     at location # 3430:0590
     Exception while in kernel mode

     The system is stopped

 This is not a problem in MEP; it is a problem in OS/2.

 You can work around this problem by not running MEP in the original
 ("default") protected-mode screen group. Instead, start a second
 protected-mode screen group and run MEP there. To move to the second
 protected-mode screen group, do the following:

 1. Press ALT+ESC from real mode to get to the original
    protected-mode screen group.

 2. Press ALT+ESC again to get to the MEP screen group.

 Running MEP in a second screen group prevents you from switching
 directly from real mode into the MEP screen group.

 Another workaround for this problem is to use the CTRL+ESC hotkey
 rather than the ALT+ESC command to leave the real-mode screen group.
 The CTRL+C hotkey brings you back to the program selector. Once
 there, you can select the next screen group by using the mouse or
 cursor keys.


 28. "Unable to Read TOOLS.INI" Message Appears in OS/2 with MEP

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified:  8-JUN-1988    ArticleIdent: Q31155

     MEP.EXE, the OS/2 version of the Microsoft editor, will give the
 following message when the INITIALIZE function is invoked (i.e.,
 SHIFT-F8 in the default keyboard setup):

    "Unable to read TOOLS.INI"

    This message will appear if the editor's name is left as MEP while
 the TOOLS.INI tag for the editor is labeled [M]. The two names must
 match.
    To correct the problem, either rename the editor to M, or label the
 tag [MEP].
    The tag can be set to [M MEP] if you wish to use the same TOOLS.INI
 settings for both real-mode and protected-mode versions of the editor.


 29. Purpose of ECH.EXE with the Microsoft Editor

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified:  8-JUN-1988    ArticleIdent: Q31280

    ECH.EXE is used by the editor to generate the list of files you
 receive when you do <arg> "*.C" <setfile>.



 30. NOSOFTCR Parameter in TOOLS.INI Disables Auto Indentation

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | tar69375
 Last Modified: 14-JUN-1988    ArticleIdent: Q31486

    The automatic indentation at the beginning of lines can be
 disabled.
    The NOSOFTCR parameter prohibits the Microsoft Editor from making
 indentation "guesses." NOSOFTCR is specified in the TOOLS.INI file, as
 follows:

    nosoftcr:



 31. Features Supported when Editing TextArgs in Microsoft Editor

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | tar69726
 Last Modified:  6-JAN-1989    ArticleIdent: Q31487

 When editing TextArgs, not all editing features are supported. The
 following features are supported:

 QUOTE, INSERT, SDELETE, RIGHT, LEFT, UP, DOWN, HOME, and END

 When an unsupported feature is entered, the editor will beep. Macros
 may be used, but they can contain only supported features.

 The END key allows you to find the length of the search/replace
 string; pressing ARG clears the entire string.


 32. UTILITY.DOC: Filetab Switch Expands Tabs

 Product Version(s): 1.00 | 1.00
 Operating System:   OS/2 | MS-DOS
 Flags: ENDUSER | tar71845
 Last Modified: 16-JUN-1988    ArticleIdent: Q31488

    Information about the filetab switch can be found in the
 UTILITY.DOC file that comes with the Microsoft BASIC Compiler Version
 6.00, the Microsoft C Compiler Version 5.10, the Microsoft FORTRAN
 Compiler Version 4.10 and the README.DOC for Microsoft MASM Version
 5.10.
    The filetab switch is a numeric switch that determines how the
 editor translates tabs when loading a file into memory. The value of
 the switch gives the number of spaces associated with each tab column.
    For example, the setting "filetab:4" assumes a tab column every four
 positions on each line of a file.
    Every time the editor finds a tab character in a file, it loads the
 buffer with the number of spaces necessary to get to the next tab
 column. Depending on the value of the entab switch, the editor also
 uses the filetab switch to determine how to convert spaces into tabs
 when writing a file.
    The default value of filetab is eight (8).



 33. Tabs Expanded to Eight Spaces; Filetab Switch Changes Spacing

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | Tar70793
 Last Modified:  1-SEP-1988    ArticleIdent: Q31489

 Question:

 Why are tabs expanded to eight spaces even though I set the tabstop
 variable and the entab switch?

 Response:

 Neither the tabstops or the entab switch affect how tabs are expanded
 when the file is read. The filetab switch is used to determine how
 many spaces to expand each tab. For example, "filetab:4" will expand
 each tab in the file to four spaces.

 The entab switch controls how the editor converts multiple spaces
 into tabs when a line is changed or a file is saved. The default is
 one (1). The following chart shows different values and their
 meanings:

 Value   Meaning

 0       Tabs are not used to represent white space.
 1       All multiple spaces outside of quoted strings
         are converted to tabs (default).
 2       All multiple spaces are converted to tabs.

 Tabstops control the number of spaces between each logical tabstop
 for the editor. The default is four (4).


 34. Resizing Windows

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | tar63957
 Last Modified:  1-SEP-1988    ArticleIdent: Q31490

 It is not possible to directly resize windows in the Microsoft Editor.
 A window can only be opened or closed. To resize a window, it must be
 closed and then reopened. Direct resizing of windows is not currently
 possible.

 This feature is under review and will be considered for inclusion in a
 future release.


 35. Parentheses Matching in Microsoft Editor; Arg Meta PBal

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | tar63957
 Last Modified: 31-OCT-1988    ArticleIdent: Q31491

 The Microsoft Editor has the capability of matching parentheses
 without altering the current file. Meta PBal prevents the file from
 being edited while balancing parentheses and brackets.

 The following are various other options for Pbal:

 1. Pbal: Scan backwards through the file, balancing parentheses and
    brackets. The first unbalanced one is highlighted when found. If it
    is found and is not visible, the editor displays the matching line,
    with the highlighted matching character. Note that the search does
    not include the current cursor position, and that the scan only
    looks for more left brackets or parentheses than right, not just an
    unequal amount.

 2. Arg Pbal: Performs similarly to Pbal, except that it scans
    forward in the file and looks for more right brackets or parentheses
    than left.

 3. Arg Meta Pbal: Performs similarly to Arg Pbal except that the
    file is not updated.


 36. Editing Nonexisting Files with the Microsoft Editor

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | tar62913
 Last Modified: 16-JUN-1988    ArticleIdent: Q31492

    If the Microsoft Editor is invoked to edit a nonexisting file, it
 creates a file with a length of zero in the DELETED directory in
 addition to creating a new file. This occurs with the backup switch
 set to "undel" (the default) in the TOOLS.INI file.
    This behavior is expected and is program design for the product.
 When the Microsoft Editor is invoked to edit an existing file, the
 previous version is moved to the DELETED directory.
    The EXP command allows you to remove this file, and all other files
 from the DELETED directory.



 37. Macro to Toggle HOME Key

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | tar66615
 Last Modified: 12-JAN-1989    ArticleIdent: Q31493

 You can create a macro to do the following:

 1. Press HOME key (cursor goes to beginning of line).

 2. Press HOME key again (cursor goes to top of window).

 3. Press HOME key again (cursor goes to top of buffer).

 This technique usually is used to create a toggle key, but it is
 equally applicable to the desired three-step toggle. The technique is
 as follows:

 home1:= begline arg "home2:f10" assign
 home2:= home arg "home3:f10" assign
 home3:= mark arg "home1:f10" assign
 home1:f10

 After following this procedure, the F10 key will toggle among begline,
 home, and mark.


 38. Inserting Time and Date into Files

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  1-MAY-1989    ArticleIdent: Q40176

 To write a macro to insert the time and date into your file, use the
 following insert commands:

    Command     Action

    Curdate     Inserts current date
    Curday      Inserts current day of the week
    Curfile     Inserts current filename
    Curfileext  Inserts current file extension
    Curfilenam  Inserts base name of current file
    Curtime     Inserts current time
    Curuser     Inserts name specified in USER environment variable

 The following macro can be inserted into your TOOLS.INI to insert the
 filename, time, and date:

 ;Macro for time and date.
     Header:= Curfilenam tab Curtime tab Curdate
     Header:Alt+H


 39. Macro to Enter Form Feed or Control Characters in Editor

 Product Version(s): 1.00 | 1.00
 Operating System:   DOS  | OS/2
 Flags: ENDUSER | tar62237
 Last Modified:  1-NOV-1988    ArticleIdent: Q31495

 The form-feed characters and control characters below can be entered
 in a file being edited by the Microsoft Editor.

 The following macro inserts a linefeed, (CTRL+L), and a newline, and
 binds it to the F6 key. To enter a CTRL+L, use the Graphic assignment
 on Page 48 of the "Microsoft Editor User's Guide" when editing your
 TOOLS.INI file:

 graphic:ctrl+l

 FFM:="L" newline   ; Instead of the L shown here, insert a CTRL+L
 FFM:F6             ; with the quote function "CTRL+P CTRL+L"

 The macro below allows you to enter control key values. The
 following line binds "quote" to F5. Quote allows you to enter any key
 as input (i.e., control key values, etc). This means if you type "F5"
 followed by a "CTRL+X", you will see a "\030" instead of "arg":

 quote:F5.


 40. "Unsupported Video Mode" When Loading Microsoft Editor

 Product Version(s): 1.00 1.02 | 1.00 1.02
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 28-JUL-1989    ArticleIdent: Q31498

 It is possible when loading M.EXE or MEP.EXE to receive an
 "Unsupported video mode, please change modes and restart" error
 message. This message may mean that the hardware is not supported.

 Graphics cards supported in this situation include IBM's CGA, EGA,
 MCGA, MDPA, and VGA and the Hercules card. An example of an
 unsupported system is the 8514 video adapter.

 In MS-DOS (or OS/2 real mode), the Microsoft Editor (M) supports the
 8514/A graphics card, but in OS/2 protected mode, MEP Version 1.00
 does not support this graphics card. A "video mode not supported"
 error message occurs in protected mode.

 The Microsoft Editor Version 1.02 supports the 8514/A graphics card in
 both real and protected mode. This version is currently available with
 FORTRAN 5.00.


 41. Environment Variables Used by the Microsoft Editor

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 16-JUN-1988    ArticleIdent: Q31547

    The Microsoft Editor uses the following environment variables:

    1. TMP: This directory stores all temporary files.
    2. INIT: This directory stores the TOOLS.INI, M.TMP, and temporary
 files if TMP is not set.

    Please note, if neither environment variable is set, all temporary
 files except M.TMP are written to the root directory of the disk being
 used. M.TMP is written to the current directory.
    The environment variables usually are set in the AUTOEXEC.BAT file.
 For example the following lines can be placed in the AUTOEXEC.BAT
 file:

     SET INIT=c:\init
     SET TMP=c:\temp

    Also, if the TMP environment variable ends with a semicolon, the
 temporary files (i.e., swapping files) will not be created. The editor
 will try to use the semicolon in the name of the file that is created.


 42. Editor Utilities DOS Version 2.x and 8086/8 Corrections

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q31801

 The following files are included in this application note:

    MEGREP.EXE, RM.EXE, UNDEL.EXE, ECH.EXE and EXP.EXE.

 These files are replacements for the original utilities that were
 shipped with the Microsoft Editor Version 1.00. They have been updated
 to correct two specific problems only; they do not include any additional
 functionality over the originals.

 These files correct the problem of embedded 286 instructions that
 prevented the programs from correctly running on 8086 and 8088
 machines (the machines would hang). The files also have been updated
 to correct problems when used with DOS Version 2.x.

 To install the files, copy the files from the appnote disk over the
 files (of the same names) that are installed on the machine.

 This application note can be obtained by calling Microsoft Product
 Support Services at (206) 454-2030.


 43. Preventing Generation of Tabs in the Edited Disk Files

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 25-JUL-1988    ArticleIdent: Q32033

    It is impossible to search for a tab or replace a string with a tab
 in the M editor.
    When a file is being edited, there are no tab characters in the
 file. When the M editor reads from disk to memory, it converts tabs to
 spaces. When it writes from memory to disk, it converts spaces to tabs
 (unless you set the ENTAB switch to 0).
    This may create problems when devices other than your machine
 access the file. For example, if you edit a source file on your IBM PC
 with the M editor, then try to compile the source file on a mainframe,
 the source file may not compile because of the tabs in the disk file
 created by the M editor.
    The solution is to set ENTAB to 0 in the TOOLS.INI file; this value
 will prevent tabs from being used to represent white space when
 writing from memory to disk.
    For more information on the ENTAB switch, please refer to Table 7.2
 on Page 59 of the "Microsoft Editor User's Guide."


 44. M Hangs on Tandy 2000 with MS-DOS Version 2.11

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  1-SEP-1988    ArticleIdent: Q32052

 M, the Microsoft Editor for MS-DOS, hangs when run on a Tandy 2000
 computer running MS-DOS Version 2.11.

 M does not support the Tandy 2000. There is no workaround to this
 incompatibility.


 45. Scrolling One Line at a Time

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |  buglist1.00
 Last Modified: 20-OCT-1988    ArticleIdent: Q32053

 Problem:

 The editor jumps seven lines at a time when I Scroll off the top or
 bottom of the screen. I want it to Scroll one line at a time, but it
 Scrolls four lines at a time when I set VSCROLL to 1.

 Response:

 Hike and Scroll are designed to be independent functions; however,
 they are incorrectly tied together.

 Microsoft has confirmed this to be a problem in Version 1.00 of the
 editor. We are researching this problem and will post new information
 as it becomes available.

 A workaround to this problem is to set both VSCROLL and HIKE to 1 in
 your TOOLS.INI file in the [M] section, as in the following example:

 [M]
     hike:1
     vscroll:1


 46. Installing M with Msetup

 Product Version(s): 1.00    | 1.00
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER | h_fortran
 Last Modified: 19-JUL-1988    ArticleIdent: Q32094

 Question:
    The FORTRAN Version 4.10 setup program did not install the
 Microsoft Editor. I could not find any documentation on how to use
 msetup in the UTILITIES.DOC. How do I set up the Editor?

 Response:
    To run the msetup program, place the "Microsoft Editor" disk in
 Drive A and type "msetup". A help screen will be displayed showing
 the syntax for using msetup. An example of running msetup is as
 follows:

    A:>msetup c: \m \init \binp

    This procedure will install the M Editor and M tools (MEGREP, ECH,
 UNDEL, etc.) in the M directory, TOOLS.INI in the INIT directory, and
 MEP in a BINP directory. If you do not specify any directories, the
 program will use default directories. It will show these default
 directories on the screen and prompt you for any changes. These
 directories must be created before running msetup; otherwise, it will
 not be installed correctly.
    Please note that when the msetup prompts you for the type of
 emulation to use for the TOOLS.INI file, a TOOLS.INI file will not be
 created if you type a "0" for the default tools (the defaults are
 already built into Editor). If any of the other emulations are used,
 msetup will rename the appropriate file to TOOLS.INI and install it.


 47. Exit Does Not Save Files when NoAutosave Is Set

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 31-OCT-1988    ArticleIdent: Q32095

 When the boolean switch Autosave is disabled (by setting it to
 NoAutosave), a file will not be saved when exiting the editor.

 As documented on Page 61 of the "Microsoft Editor User's Guide," when
 the Autosave switch is turned on, the current file is saved when the
 user switches away from it. When Autosave is off (NoAutosave), the
 file must be explicitly saved when desired; this can be done by
 entering Arg Arg Setfile (ALT+A ALT+A F2 in the default keyboard
 setup).


 48. Arg *.* Setfile: "Bad Command or Filename" Error

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | tar78150
 Last Modified: 29-AUG-1988    ArticleIdent: Q32224

    Entering the command Arg *.* Setfile causes M to display a list of
 all files in the current directory.
    ECH.EXE is a utility used to generate the list of files for ARG
 textarg SETFILE. If this utility cannot be found, you will receive a
 message saying "Bad command or filename." ECH.EXE must be located in a
 directory on the path.


 49. Using the SHORTNAMES Switch

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | tar78150
 Last Modified: 31-MAR-1989    ArticleIdent: Q32225

 SHORTNAMES is a boolean switch. When it is set (the default), if you
 type <arg> "foo" <setfile>, you will be sent to the first file in your
 history list with the base name "foo". You do not have to specify the
 full pathname for a file in another directory. If there is no
 d:\path\foo.xxx anywhere in your file history, you only get foo.

 If you have a file "foo" in your current directory, SHORTNAMES still
 tries to find a file in your history list first. The history of files
 is stored in M.TMP. The number of files saved is determined by the
 TMPSAV switch.

 To disable this feature, set noshortnames: in your TOOLS.INI file.

 To avoid this behavior without changing the switch value, include a
 period in the path specification. For example, enter <arg> "foo."
 <setfile>, which will look only in the current directory. The presence
 of any path character (".", etc.) disables the SHORTNAMES feature for
 the file being referenced.


 50. Cancel Clears the Type-Ahead Buffer

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | tar75933
 Last Modified: 19-JUL-1988    ArticleIdent: Q32226

    The Cancel command clears the type-ahead buffer. This is a feature
 of the editor and is not considered a problem.
    Cancel is mapped to the ESC key in the default keyboard setup.


 51. Loading a TAGGED Section Reinitializes the Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.00 tar76973
 Last Modified: 29-AUG-1988    ArticleIdent: Q32228

 When a TAGGED section is initialized (<arg> "section name"
 <initialize>), all current macros are destroyed before
 reinitialization.

 The curdate, curtime, etc., macros are reset, your extmake: settings
 are set to the default, and the OS-dependent and video-dependent
 sections of TOOLS.INI are read in. If you type <initialize>, the main
 section is read in place of the TAGGED section.

 Microsoft has confirmed this to be a problem in Version 1.00. We
 are researching this problem and will post new information as it
 becomes available.



 52. The extmake Compile Switch Is Case Sensitive

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.00
 Last Modified:  1-MAY-1989    ArticleIdent: Q32242

 The following extmake entry will be ignored, causing the default
 command line to be used:

 extmake:C cl /c /Zi /Od %s

 Microsoft has confirmed this to be a problem in Version 1.00. We
 are researching this problem and will post new information as it
 becomes available.

 Although there is no case sensitivity for the extmake switch name, the
 extension specified ("C" in this example) must be in lowercase. If the
 extension is not in lowercase, the help screen will show a separate
 entry for that extension, as follows:

    C   cl /c /Zi /Od %s
    c   cl /c /Zep /D LINT_ARGS %s

 The second command line will be used when compiling a C program.


 53. Loading Tagged Sections in OS/2 Version 1.10

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | docerr
 Last Modified: 29-AUG-1988    ArticleIdent: Q33348

 Problem:

 I have followed the instructions on Page 64 of the "Microsoft Editor
 User's Guide" for loading tagged sections in OS/2, but the editor
 never loads this section. My TOOLS.INI file has a tag titled [M MEP]
 containing assignments for both protected and real modes and a tag
 titled [M-10.0] for OS/2 protected-mode assignments. I am running
 Microsoft OS/2 Version 1.10.

 Response:

 Your [M-10.0] tag is not loaded in OS/2 Version 1.10 because [M-10.0]
 means OS/2 Version 1.00. The version number should be changed from
 10.0 to 10.10; your tag should be [M-10.10]. If you want the tag to
 work correctly for both OS/2 Versions 1.00 and 1.10, create a tag
 titled [M-10.0 M-10.10].

 This information is not contained in the "Microsoft Editor User's
 Guide."


 54. C.TMP Files in Current Directory

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  2-SEP-1988    ArticleIdent: Q34251

 Question:

 Every time I edit a file with the Microsoft Editor, I receive a C.TMP
 file in that directory. I am using DOS Version 2.10. Why is it
 creating this file?

 Response:

 The C.TMP file is where the editor keeps its information about
 previous files that have been edited. This file normally is called
 M.TMP; however, due to a limitation of DOS Versions 2.x, the editor
 believes its name is C rather than M.

 The files are placed in the directory where the file was edited
 because unless the INIT environment variable is set, the .TMP file is
 written to the current directory.

 When using M on DOS Versions 2.x, change the tag field of the TOOLS.INI
 from [M] to [C] and set the INIT environment variable to the directory
 that contains TOOLS.INI.



 55. How to Perform Spell Checking in M

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 29-AUG-1988    ArticleIdent: Q34274

 Question:
    Does the Microsoft Editor have any spell checking capabilities?

 Response:
    The M editor does not have built-in spell checking. If you have a
 separate spell-check program you can write a macro to invoke it on
 your current file.
    For example, you could use the spell checker that comes with
 Microsoft Word Version 4.00 by doing the following:

     [M]
         ...
         Spell:=Arg "spell-am " Curfile Shell
         Spell:ALT+S

    The macro works as follows:

    1. Arg introduces an argument to the shell command.
    2. "spell-am" is the name of the spell-check utility
       included in Word Version 4.00.
    3. Curfile is the name of the current file you are editing. Note
       the space at the end of "spell-am "; this space is needed so the
       argument you pass to Shell is "spell-am YourCurrentFile" instead
       of "spell-amYourCurrentFile".
    4. The Shell command invokes COMMAND.COM and passes it the
       spell-am command. When spell-am completes its spell-check,
       it will return to the editor.


 56. Changing Height Switch Not Sufficient to Change Video Modes

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  1-SEP-1988    ArticleIdent: Q34411

 Microsoft Editor does not immediately change video modes (CGA/EGA/VGA)
 when changing the numeric switch HEIGHT: to either 23, 41, or 48 in the
 TOOLS.INI file.

 For the new height setting to take effect, one of the following must
 be done:

 1. The INITIALIZE function can be invoked to force the editor to
    update its settings based on the switch values in TOOLS.INI. This
    will reset the video-display configuration. (INITIALIZE is ALT+F10
    for Quick and EPSILON emulation, SHIFT+F10 for BRIEF emulation, or
    SHIFT+F8 for the default emulation).

 2. The assignment can be made directly to the editor by invoking
    <arg> height:41 <assign>. In the default keyboard configuration,
    this would be ALT+A "height:41" ALT+=.

 3. While editing the "height:41" line in TOOLS.INI, move to the
    beginning of the line and enter <arg> <assign>, which is ALT+A
    ALT+= in the default keyboard assignments.

 The video mode is stored in the M.TMP file in the directory pointed to
 by the TMP environment variable; if TMP is not set, M.TMP is placed in
 the current default directory. Invoking the INITIALIZE function causes
 M to reset the settings in M.TMP based on the settings in TOOLS.INI.


 57. Accessing Switch Values in C Extensions

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  2-SEP-1988    ArticleIdent: Q35025

 There is no direct function call to access switch values defined in
 the editor, such as rmargin or vscroll or hike, in your C Extension.
 However, you can find the value by using fExecute() to switch to the
 help file, then use the psearch or msearch functions to locate
 rmargin. At the end of that line you will find the value associated
 with rmargin.

 The following is an example:

 fExecute("Arg \"<assign>\" Setfile");  /* switch to "<assign>" file   */
 fExecute("Mark");                      /* go to beginning of it       */
 fExecute("Arg \"rmargin\" Psearch");   /* search for "rmargin"        */
 fExecute("Pword");                     /* get the number after it     */

 You also can use the GetLine() function to read through the <assign>
 file; this method involves more coding, but it will run faster than
 using fExecute() to execute macros.


 58. Passing Textargs to M with the /E Switch

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  1-SEP-1988    ArticleIdent: Q35028

 Question:

 How can I pass textargs to the editor using the /e command-line
 switch?

 Response:

 Type in the name of the function you want the editor to execute. If
 you want to use more than one function, enclose the functions in
 double-quotation marks. If your functions require arguments, use the C
 syntax for specifying quotation marks within strings, i.e., the
 backslash escape character (\). Thus, a double-quotation mark within
 a string is specified with \".

 The following examples demonstrate various methods of passing
 command-line arguments to M:

 m /e psearch myfile

 This example invokes the Microsoft Editor on the file "myfile",
 passing it the command "psearch" to be executed immediately. The
 psearch will search for whatever string was last specified (in the
 search buffer).

 m /e "mark psearch" myfile

 This example again edits "myfile", but this time it passes two
 commands to M: "mark" and "psearch". The Mark command goes to the
 beginning of the file, and psearch searches forward for an occurrence
 of the search-string (which must have been specified in a previous
 search).

 m /e "arg \"search string\" psearch" myfile

 This example passes the editor the following string:

 "arg "search string" psearch"

 The \" characters are a C escape sequence that evaluates to a
 double-quotation mark ("); as a result, the entire string has a string
 embedded in it. The effect of this command is to tell the editor to
 search for the literal text "search string".

 m /e "arg \"\\\"a quoted search string\\\"\" psearch" myfile

 This is the most complicated case of argument passing. It
 passes the following string to the editor:

 "arg "\"a quoted search string\"" psearch"

 This command searches for the QUOTED literal text ""a quoted search
 string"".  The "\" and \"" are necessary to cause M itself to postpone
 evaluation of the double-quotation marks until actual search time.


 59. A Workaround for the MGREP Problem in M/MEP Version 1.02

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 29-JAN-1991    ArticleIdent: Q68386

 In the M/MEP Editor version 1.02, there is a problem in the MGREP
 function; it will fail to find some matches to the query in the file.
 (This is due to certain regular-expression matches failing when they
 shouldn't.) Below is a macro that will use the MEGREP.EXE utility to
 search for a string, and return the results in the compile window. The
 benefits are:

 1. It should be faster, especially under OS/2.

 2. If run under OS/2, it will be a background process enabling you
    to continue working.

 Macro Code
 ----------

 Add the following to your TOOLS.INI file. You can then assign it to a
 keystroke, if desired:

 megreplist:="*.c *.h"
 mg1:=copy arg "<megrep>" setfile mark emacsnewl mark paste begline
 mg2:="arg arg \"megrep \\\"" endline "\\\" " megreplist
 mg3:=" \" compile" begline arg endline execute setfile
 megrep:= mg1 mg2 mg3

 The following is another option, which avoids using an extra
 pseudo-file:

 megreplist:="*.c *.h"
 mg:= copy arg "<clipboard>" setfile            \
      begfile "megrep \"" endline "\" " megreplist  \
      begline arg arg endline compile setfile

 Notes
 -----

 1. The first macro is in three parts due to line-length limits of the
    knowledge base; the macro could be just one line. The second macro
    uses line continuation characters to achieve the same result as
    breaking up the first macro.

 2. The macro assumes that all files on disk are up to date.


 60. MHELP Driver Not Completely Compatible with QuickC Help Files

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_quickc buglist1.02
 Last Modified:  5-MAR-1990    ArticleIdent: Q58603

 The MHELP driver cannot process some cross-references inherent to the
 QuickC Versions 2.00 and 2.01 help files. Results range from the MHELP
 message "Cannot Process Cross Reference," to hanging the computer. In
 general, direct reference to a QuickC help file from within the editor
 is fine. However, moving around within the help file system using the
 built-in cross-references produces unpredictable results.

 The MHELP driver seems unable to access unformatted text files such as
 header, source, and DOC files. For example, QuickC allows you to
 access both the README.DOC file and QuickC header files from within
 the help system. Attempting these feats from within M leads to one of
 the following problems:

 1. "Cannot Process Cross Reference," if file not found.

 2. DOS will hang the machine if the file is found.

 3. OS/2 may cause a SYS 1943 protection violation if the file is
    found.

 The M editor also cannot use the <back> menu option to access a
 previously viewed help file. Attempting this yields the message
 "Cannot Process Cross Reference" at the bottom of the screen. The
 syntax of the <back> cross-reference in unencrypted help form is
 help file to access the previous help screen. This undocumented
 feature is not allowed in MHELP.

 Certain series of cross references cause sporadic errors. You should
 be careful to avoid internal cross-referencing within the QC help
 files. The problem can be shown with the following sequence using the
 QuickC and QuickAssembler help files from within the M Editor.

    <arg> seg <F1> <TAB> <RETURN> <TAB> <RETURN> <TAB>

 This example reaches the help-contents window via the "seg" example
 program. Upon reaching this point, it may hang DOS with the run-time
 error R6003 or R6001. OS/2 displays a black box in the upper-right
 corner of the screen and may crash at this point.

 Microsoft has confirmed this to be a problem with the M Editor Version
 1.02. We are researching this problem and will post new information
 here as it becomes available.


 61. Compiling in M Produces No .OBJ File

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 20-OCT-1988    ArticleIdent: Q35233

 If compilation from within the editor gives no .OBJ file when the
 same compilation outside of M succeeds in creating an object module,
 check the CONFIG.SYS files setting.

 In one case, a user had "files=25" while running under DOS Version
 3.20, which doesn't support a file setting greater than 20. If files
 exceed 20, DOS uses its default of eight files. When the user set
 "files=20" an .OBJ was created from a compilation within M.


 62. Creating Windows in M and MEP

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  1-MAY-1989    ArticleIdent: Q35235

 Question:

 How can I create multiple windows and edit multiple files with the
 Microsoft Editor?

 Response:

 Both horizontal and vertical windows can be created. You can have up
 to eight windows on the screen.

 To create a horizontal window, position the cursor on the screen where
 you would like the window break and press ARG WINDOW (ALT+A F6 in the
 default).

 This process creates a new window with a copy of the file you were
 currently editing. You then can load a different file into that window
 (ARG SETFILE ALT+A F2).

 To create a vertical window, position the cursor on the screen where
 you would like the window break and press ARG ARG WINDOW (ALT+A ALT+A
 F6 in the default). You then can load a different file into the
 window.

 Once you have several windows on the screen you can move around from
 window to window using the WINDOW command (F6 in the default setup).

 See also section 4.6 of the "Microsoft Editor User's Guide."

 Note: Each window must have a minimum of five lines and 10 columns to be
 created.


 63. M Does Not Respond to Changes in the Height Switch

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 31-MAR-1989    ArticleIdent: Q35252

 The Microsoft Editor does not change video modes (EGA/VGA) when
 changing the numeric switch height to either 23, 41, or 48 in the
 TOOLS.INI file.

 The INITIALIZE function must be invoked to reset the video display
 configuration. (INITIALIZE = ALT+F10 for Quick and EPSILON emulation,
 SHIFT+F10 for BRIEF emulation, or SHIFT+F8 for the default emulation).

 The video mode also is stored in the M.TMP file in the directory
 pointed to by the INIT environmental variable or the current default
 directory.


 64. Toggling Display Modes: 25-, 43-, and 50-Row Modes

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | MS-DOS
 Flags: ENDUSER |
 Last Modified: 14-NOV-1988    ArticleIdent: Q37628

 The following Microsoft Editor macro allows you to toggle the EGA
 display between 25-row mode and 43-row mode by pressing ALT+E:

 ;Macro to toggle 25/43 line EGA modes
     to23:=arg "height:23" assign
     to41:=arg "height:41" assign
     toggle23:=to23 arg "toggle41:alt+e" assign
     toggle41:=to41 arg "toggle23:alt+e" assign
     toggle41:alt+e

 The example below is a variation of the above macro. It allows you to
 toggle the VGA display between 25-row mode, 43-row mode, and 50-row
 mode by pressing ALT+E. Instead of switching back and forth between
 two modes, it cycles through all three.

 The macro is as follows:

 ;Macro to toggle 25/43/50 line VGA modes
     to23:=arg "height:23" assign
     to41:=arg "height:41" assign
     to48:=arg "height:48" assign
     toggle23:=to23 arg "toggle41:alt+e" assign
     toggle41:=to41 arg "toggle48:alt+e" assign
     toggle48:=to48 arg "toggle23:alt+e" assign
     toggle41:alt+e

 These macros should be placed in your TOOLS.INI file as described
 in Chapters 6 and 7 of the "Microsoft Editor User's Guide."

 Note: the "toggle" functions in these macros not only set the video
 mode, they also change the assignment of function ALT+E. This makes
 these macros similar to self-modifying code. For example, "toggle23"
 not only sets the video mode to 23-rows (with a call to "to23"), it
 also assigns ALT+E to "toggle41" by using the following sequence:

    arg "toggle41:alt+e" assign

 This technique is very useful in learning to write macros.


 65. "Softer" Should Be "Softcr" in M 1.0 User's Guide

 Product Version(s):
 Operating System:   1.00   | 1.00
 Flags: MS-DOS | OS/2
 Last Modified: 18-DEC-1989    ArticleIdent: Q35256
 ENDUSER | docerr

 On Page 61 of the "Microsoft Editor User's Guide," there is a
 documentation error. Softcr is listed as Softer; the correct listing
 is Softcr.


 66. Why Compiling after Editing in M Shows Old Errors

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 20-OCT-1988    ArticleIdent: Q35258

 When using the M editor (either M.EXE or MEP.EXE) to correct compiler
 or assembler errors, and then compiling/assembling from within M using
 the COMPILE function, it is possible to get the old set of errors
 returned. If the errors occur, check that the autosave switch is set
 correctly. If autosave is off, the corrections are not saved before
 compilation.

 When turned on, the autosave boolean initialization switch causes the
 current file to be saved whenever it is switched away from. The
 default value is on, i.e., the files are automatically saved. The
 setting can be changed from within the editor using Arg textarg Assign
 or else in TOOLS.INI.

 In either case, specify noautosave: to prevent automatic saving of
 files, or autosave: to restore automatic file saving.


 67. How to Read the Contents of the M Editor Clipboard

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 31-MAR-1989    ArticleIdent: Q35259

 The Clipboard is contained in a pseudofile named <clipboard>. It can
 be loaded the same way any other file is loaded. The contents of the
 Clipboard pseudofile can be examined in several ways.

 The pseudofile <clipboard> can be loaded with the command sequence Arg
 textarg Setfile, which is ALT-A <clipboard> F2 in default keystrokes.
 This process loads the named file. The contents of the clipboard then
 can be seen on the screen, and even can be edited and saved as a
 separate file.

 The file also can be loaded by bringing up the information file with
 the INFORMATION function (SHIFT-F1).

 Finally, if the clipboard is the file most recently switched from, the
 SETFILE function (F2) alone will call it up.

 The information file describes the nature of the Clipboard contents in
 two ways. The Clipboard line appears in the form in the list of
 files, as follows:

 <clipboard>                    *n lines

 Additionally, at the bottom of the information file is a line that
 gives information in one of two ways, as follows:

 n lines in line clipboard

 n lines in box clipboard

 This information indicates whether the Clipboard holds a block of text
 or a stream of text.


 68. How to Write Selected Text to a File in M Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  1-NOV-1988    ArticleIdent: Q35260

 To write a block or stream of text from a file currently being edited
 to another file (either new or currently existing), do the following:

 1. Select text by using Arg (ALT+A) and the cursor movement keys.

 2. Put the text block or stream into the Clipboard by using the
    functions Copy (CTRL+INSERT, or + on the keypad) or Ldelete
    (CTRL+Y) or Sdelete (DELETE).

 3. Load the desired new file (see the "Working with Multiple Files"
    section of the "Microsoft Editor" manual).

 4. Paste (SHIFT+INSERT) the contents of the Clipboard into the new
    file.

 When writing to a file that does not yet exist, another procedure can
 be used, as follows:

 1. Write the selected text to the Clipboard as described above.

 2. Use Setfile to load the <clipboard> pseudofile the same way that
    other files are loaded.

 3. When the Clipboard contents appear on the screen, save the file to
    the desired new filename with Arg Arg textarg Setfile (ALT+A ALT+A
    filename F2). If a file by that name already exists, it will be
    overwritten.

 4. Return to the originally edited file with Setfile (F2).

 The second method can be put into a macro in one of the following two
 ways:

 1. Create a macro definition for copying to a file of prespecified name
    by using, for example, the following:

 sendtofil:=copy arg "<clipboard>" setfile arg arg "foo.txt" setfile
 setfile

 Assign the macro to a keystroke with an argument of the following
 form, for example:

 sendtofil:alt+s.

 This macro can be placed in TOOLS.INI, or can be the textarg in the
 command to enter a macro, as follows:

 Arg textarg Assign (ALT+A textarg ALT+=).

 2. Create a macro definition for copying to a file of any name by
    using two macros in sequence, for example, as follows:

 send1:=copy arg "<clipboard>" setfile arg arg
 send2:=setfile setfile

 Enter and assign them as described above. To execute this set of
 macros, select the text block or stream, execute the first macro, type
 the desired filename, then execute the second macro.


 69. Macro to Print Part or All of a File from within M

 Product Version(s): 1.00  1.02 | 1.00 1.02
 Operating System:   MS-DOS     | OS/2
 Flags: ENDUSER |
 Last Modified: 21-AUG-1989    ArticleIdent: Q35261

 Microsoft Editor Version 1.00 contains no built-in primitives for
 printing; there is no actual "print" command. However, a set of steps
 can be performed involving the shell function, and a macro can be
 written to execute the steps conveniently. The 1.02 version of the
 Microsoft Editor does contain a print function. For more information
 on Version 1.02's print function, please see Section 4.9, "Printing a
 File," in the "Microsoft Editor User's Guide for MS OS/2 and MS-DOS
 Operating Systems."

 The following is a sample macro for the 1.00 Editor:

    print1:=copy arg "<clipboard>" setfile
    print2:=arg arg "PRINT.TMP" setfile
    print3:=arg "print PRINT.TMP" shell
    print4:=arg "del PRINT.TMP" shell setfile
    print:=print1 print2 print3 print4

 Note: The DOS PRINT command is a resident program. If you shell out of
 M and invoke the PRINT command for the first time, PRINT will be
 loaded above M and you will fragment memory. To prevent this, invoke
 the PRINT command before entering M, so that it will be loaded into
 low memory.

 The following explains the above example:

 1. copy: This copies the currently selected region into the
    clipboard. This way, you can select a region, using a boxarg or
    linearg, and then execute this macro to print it. Because the
    selected region defines what is to be printed, it can be modified
    to suit your needs.

 2. arg "<clipboard>" setfile: This loads the <clipboard> pseudo file
    as the current file.

 3. arg arg "PRINT.TMP" setfile: This saves the contents of the current
    file (which is now <clipboard>) to the file PRINT.TMP.

 4. arg "print PRINT.TMP" shell: This executes a DOS shell that prints
    PRINT.TMP.

 5. arg "del PRINT.TMP" shell setfile: This executes a DOS shell that
    deletes PRINT.TMP, then uses Setfile to return to the original file.


 70. The Difference between M and MEP

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35522

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 The Difference between M and MEP?

 M.EXE is the Microsoft Editor that runs under DOS or MS OS/2 real
 mode. MEP.EXE runs under MS OS/2 protected mode only. You may want to
 rename MEP.EXE to M.EXE. Functionally, the two editors are the same,
 except for slight differences in background compilation.


 71. Reassigning Default Keystrokes for Editor Functions

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35523

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 Reassigning the Default Keystrokes for Editor Functions

 The function can simply be assigned to an unused keystroke, as
 follows:

 Home:Ctrl+H

 Consult your "Microsoft Editor User's Guide" for valid keystroke
 combinations. If necessary, you can unassign a keystroke by assigning
 it to the function Unassigned, as follows:

 Unassigned:Ctrl+Home


 72. Separating TOOLS.INI Entries for M

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35524

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 Making Separate TOOLS.INI Entries for M if You Want to Have Different
 Configurations for M Running Under DOS, OS/2 Real Mode, or OS/2
 Protected Mode, or a Combination of the Three

 Various combinations of tags can be used in TOOLS.INI to set up
 different configurations for different environments. Each environment
 has its own recognized tag. The following is an example:

 Environment:                  Tag:

 MS-DOS                        [M-3.30] (your particular
                                        DOS version)
 OS/2 real mode                [M-10.0R]
 OS/2 protected mode           [M-10.0]

 The following is an examples of combinations:

 MS-DOS and OS/2 real mode     [M-3.30 M-10.0R]
 OS/2 real and protected mode  [M-10.0R M-10.0]

 If you have renamed M.EXE, the "M" used in the tag must be replaced
 with the name you are using for the editor. However, each M-XX.XX
 sub-tag only can appear once in a tag. For example, if you used the
 double tags above, and you were running M in OS/2 real mode, only the
 information from first tag would be loaded.

 By using these tags, only certain sections will be loaded from
 TOOLS.INI to initialize the editor, depending on the environment in
 which the editor is running. The statements in the [M] section are
 always loaded.


 73. Loading a New File into the Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35525

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note is
 available from Microsoft Product Support Services by calling (206)
 454-2030

 Loading a New File into the Editor

 Loading a new file into the editor can be done by using the keystrokes
 corresponding to the following functions:

 Arg textarg Setfile, where textarg is the name of the file you wish to
 load.


 74. Exiting without Saving

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35526

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 How to Exit without Saving

 Normally, when the keystroke for exit is invoked, the file will be
 saved before exiting. However, typing the keystroke for "Meta" before
 the exit keystroke allows you to exit without saving your file.


 75. Merging Two Files Together

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35527

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 How to Merge Two Files Together

 A separate file can be merged into the current file by using the
 keystrokes corresponding to the following functions:

    Arg Arg textarg Paste, where textarg is the name of file to be merged.


 76. Placing Control Characters in Text of File

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35528

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 Placing Control Characters in the Text of My File

 The editor function "Quote" can be used to place special characters in
 your text. Use the keystroke assigned to "Quote", then enter the
 combination of keys necessary to produce the character. For example, a
 Form Feed would be a combination of the CTRL key and the L key.


 77. Compiling the Program Currently Loaded in Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35529

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 How to Compile the Program Currently Loaded in the Editor

 The current file can be compiled by using the keystrokes corresponding
 to the following functions:

    Arg Arg textarg Compile, where textarg is the compiler command
    line typed as you normally would outside of the editor; however,
    the filename does not have to be the current file.

 The text switch "extmake" can be entered in TOOLS.INI to associate a
 frequently used command line with a particular file extension. The
 following is an example:

    extmake:c cl /Zi /Od %s

 The %s will be replaced with the current filename.


 78. Differences between the vscroll and hike Numeric Switches

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35530

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 The Differences between the vscroll and hike Numeric Switches

 The vscroll switch determines how many lines are vertically scrolled
 when the cursor is moved to a location not visible in (outside of) the
 current window but within vscroll lines of the edge of the current
 window.

 The hike switch determines the cursor position when an editing
 function moves the cursor more than vscroll lines beyond the edge of
 the current window. In this case, the cursor would appear hike lines
 from the top of the window.

 Note: Currently, these switches are broken. Even when vscroll is
 correctly set to 1, hike will overide it if hike has a greater value
 than vscroll. Until this problem is corrected, both switches must be
 set to 1 to scroll one line at a time.


 79. Making the Editor Default to Insert Mode

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35531

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 How to Make the Editor Default to Insert Mode

 The boolean switch "Enterinsmode" can be set in the TOOLS.INI file to
 allow the editor to start up in insert mode rather than overtype mode.
 This switch is off by default, but can be set by adding the following
 entry to TOOLS.INI:

    enterinsmode:


 80. Saving Files Under a Different Name

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35532

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 How to Save Your File Under a Different Name

 Saving a file under a different name can be done by including a
 textarg when saving a file without exiting, as follows:

    Arg Arg textarg Setfile, where textarg is the filename you wish to
    save the file under.


 81. "Unable to Open Swapping File c:\temp\m-0029.vm"

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35533

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 "Unable to Open Swapping File c:\temp\m-0029.vm No Such File or
 Directory" Error

 The editor assumes that environment variables are set so that
 important editor information can be loaded from and saved to your
 disk. The following is an example:

    SET INIT=c:\init
    SET TMP=c:\temp

 In this example, c:\temp would be the directory that would hold
 temporary or swapping files, usually named M-0029.VM. This file is
 used to allow the editor to switch to previous files. C:\INIT would
 hold TOOLS.INI and M.TMP. The swapping file also would be stored here
 if the TMP variable was not set. If neither of these variables is
 set, the swapping file would be stored in the root directory and M.TMP
 would be stored in the current directory.

 However, if the TMP variable is set to a directory that does not
 exist, or if extra characters were included after the "p" in "c:\temp"
 such as a space or a semicolon, the swapping file will not be created
 and the error above will be generated.


 82. Why the Editor Cannot Find or Load TOOLS.INI

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35534

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 Why the Editor Can't Find or Load the TOOLS.INI File

 There are several reasons this problem may occur. First of all, you
 may have never created a TOOLS.INI file. If TOOLS.INI is not in the
 working directory, the INIT environment variable must specify the
 directory that contains this file. Within the TOOLS.INI file, there
 must be a tag that has the same name as the editor (M.EXE), as
 follows:

    [m]

 If you have renamed the editor you also must rename the tag. Entries
 concerning the editor then would follow after this tag. Under DOS
 Versions 2.x, the Microsoft Editor looks for a [c] tag rather an [m]
 tag or whatever you have renamed M.EXE to.


 83. Keeping the Editor from Saving Backup Files

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35535

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 How to Keep the Editor from Saving Backup Files

 The text switch "Backup" determines what happens to old copies of
 files that are modified. If you do not wish to keep any backup files,
 a value of "none" can be given, as follows:

    Backup:none

 Backup files can be saved in two ways. A value of "bak" will save the
 previous version of the file with a .BAK extension. A value of "undel"
 will save a history of old copies of your file in a hidden directory
 disk space.

 Older copies can be restored by using UNDEL.EXE. Typing "undel" will
 list all the backup copies; "undel <filename>" will either restore the
 file, or if there is more than one backup, it will allow you to choose
 which version you would like to restore. Because these files take up
 actual disk space, they should be periodically removed from the disk
 by using EXP.EXE. Typing "exp" will delete these files permanently.


 84. How to Write and Use C Extensions

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35536

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 C Extensions and How to Write and Use Them

 C extensions allow you to further customize the editor by creating new
 editor functions and switches through programs that you write in the C
 programming language. They are much more powerful than macros because
 macros depend on the existence of editor functions.

 C extensions are compiled with a special memory-model that does not
 use a main() function, but rather uses special names and structures
 that the editor alone recognizes. They are linked with an object
 module that makes low-level functions used within the editor itself
 available to be called by your C extension. The file produced from
 linking is separate from the main program but is loaded into memory
 with the editor. The editor then will call your module whenever you
 invoke one of your C extension functions.


 85. Developing Macros

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  4-MAY-1989    ArticleIdent: Q35537

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 Develop my Own Macros

 Developing a macro is similar to programming in a high-level language.
 Each macro represents a command. Instead of a collection of library
 routines, you have a collection of editor functions. You begin with an
 idea of a process that you would like to be performed by simply
 pressing one keystroke.

 Suppose you would like to be able to move the cursor to the lower-left
 corner of the editing window. You know you can do this "manually" with
 the arrow keys that are assigned to the "Left" and "Down" editor
 functions. However, it can be simplified more. "Meta Down" moves the
 cursor to the bottom of the window; "Meta Begline" moves the cursor to
 the first column of the line. Together, these functions will do the
 job.

 This macro must now be given a unique name, for example, "Bottom". The
 TOOLS.INI statement would look as follows:

    Bottom:=Meta Begline Meta Down

 A macro also can be a combination of other macros. The following is an
 example:

    Waydown:=Meta Down
    Wayleft:=Meta Begline
    Bottom:=Waydown Wayleft

 Suppose that the "Meta Begline" command did not exist. You would need
 to find some way to know that the cursor is in the first column.
 Almost all of the editor functions have boolean (TRUE/FALSE) Return
 Values that can be useful in developing macros.

 For the "Bottom" macro, you know that "Begline" will at least move the
 cursor to the first nonblank character on the line. Any further cursor
 movement would have to be done using "Left". "Left" returns TRUE when
 the cursor moves and FALSE when the cursor does not move.

 You would want to move left until the cursor does not move anymore,
 i.e., move left until "Left" returns FALSE. The editor allows you to
 do this with Macro Conditionals. The following is an example:

    Bottom:=Begline :>LT Left +>LT Meta Down

    :>LT   defines a label LT
    +>LT   if Left returns TRUE, go to label LT
           if Left returns FALSE, continue

 Macro Conditionals and a table of Return Values can be found in the
 "Microsoft Editor User's Guide."

 The final step is to assign the macro to a keystroke, as follows:

    Bottom:CTRL+END


 86. Saving without Exiting

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote
 Last Modified:  6-JAN-1989    ArticleIdent: Q35538

 The following information is taken from an application note called
 "Microsoft Editor Questions and Answers." The application note also is
 available from Microsoft Product Support Services by calling (206)
 454-2030.

 Saving without Exiting

 You can save a file without exiting by using the keystrokes
 corresponding to the following functions:

    Arg Arg Setfile.

 A macro can be written to perform these functions in one keystroke
 (Alt+S), as follows:

    Save:=Arg Arg Setfile
    Save:Alt+S


 87. None Assignment Must Be Lowercase

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  1-NOV-1988    ArticleIdent: Q35648

 When using the backup:none option in the TOOLS.INI file, the none
 cannot begin with a capitol N.

 The "None is an illegal setting" error will be generated if you have
 Backup:None (capitol N) in the TOOLS.INI file.

 The correct form is backup:none


 88. Width Function Not implemented

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 20-OCT-1988    ArticleIdent: Q35649

 Some graphics cards allow the monitor to go into modes greater than 80
 columns. The Microsoft Editor has a function called Width to allow
 more than 80 columns, however, this function has not yet been
 implemented.

 This feature is under review and will be considered for inclusion in
 a future release.


 89. M on an AMDEK System 88 XT Clone

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 30-SEP-1988    ArticleIdent: Q35817

 Problem:

 When running M on an AMDEK System 88, which is an XT clone, the M
 editor hangs the machine requiring a warm boot. The machine was using
 an EPC Keyboard that is an AT style keyboard.

 Response:

 This is a known incompatibility with this hardware configuration and M
 Version 1.00. AMDEK is aware of this problem and has a patch that they
 can send you. To obtain a patch, call AMDEK at (408) 435-2832. The
 patch contains the following three files:

 READ.ME
 CLREPC.EXE
 SETEPC.EXE.

 The problem is that M was checking the keyboard, which in this case
 was an AT style keyboard, and assuming it was running on an AT clone.
 This situation caused the hang.

 By running SETEPC.EXE, a switch is set so M sees the keyboard as a XT
 keyboard and everything functions properly. CLREPC.EXE clears this
 switch.


 90. Placing the NULL Character in a File with M/MEP

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 20-OCT-1988    ArticleIdent: Q35819

 Problem:

 I would like to place the null character in a file using M or MEP. I
 have tried using the Quote function and successfully put other
 non-printable characters in the file, such as the bell character.
 However, attempts to place a null in the file with the Quote function
 were ignored. Is this possible?

 Response:

 No. Placing null characters in a file with M/MEP is not possible. The
 editor uses null-terminated strings internally, as well as NULL return
 values from some character functions. Because the editor uses the null
 character, you are not allowed to use null.


 91. Case Sensitivity of Switches

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 31-OCT-1988    ArticleIdent: Q36415

 The BACKUP text switch is case sensitive with the arguments given it.
 The arguments "undel", "bak", and "none" need to be lowercase, otherwise
 an error will be reported.



 92. Intitialize function is Shift+F8

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified:  2-NOV-1988    ArticleIdent: Q36567

 There is a documentation error on Page 64 of the "Microsoft Editor for
 MS OS/2 and MS-DOS Operating Systems User's Guide". The line

 3. Invoke the Initialize function (press F10).

 should read as follows :

 3. Invoke the Initialize function (press SHIFT+F8)

 The F10 should be replaced with SHIFT+F8. SHIFT+8 is the default.


 93. Percent (%) Character in Filenames

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.00
 Last Modified: 20-OCT-1988    ArticleIdent: Q36570

 The Microsoft Editor cannot handle a percent sign as the first
 character in the filename (%test.dat). While this is a valid DOS
 filename, it will cause garbage to be printed on the status line and
 may generate a run-time error.

 Microsoft has confirmed this to be a problem in Version 1.00. We are
 researching this problem and will post new information as it becomes
 available.

 If you fill a line with 250 characters (the maximum), then press HOME
 to go to the beginning of the line and delete the line by pressing
 CTRL-Y, the editor will crash with the following error:

         run-time error R6003
         -integer divide by 0

 Both of the above problems only occur when a percent sign is used as
 the first character in the filename. To work around this problem, do
 not use the percent sign as the first character.



 94. How Tabs Are Treated in the Microsoft Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 14-OCT-1988    ArticleIdent: Q36580

 Problem:

 Some text editors preserve tab characters automatically. These editors
 maintain tabs (ASCII 9 characters) as they are stored in a file, and
 distinguish between tab characters and spaces.

 The Microsoft Editor translates tab characters into spaces. This
 behavior only affects lines that you modify. If you load and save a
 file without changing any lines of text, the lines are written back to
 disk with all tab characters and spaces intact. Only the modified
 lines are affected by this conversion.

 It is not possible to disable this translation of tab characters into
 spaces in a modified line.

 In the Microsoft Editor, "tab"  is both a function name and the name
 of a key. The TAB key is assigned to the tab function by default. As a
 function, tab is nothing more than a move-to-next-column movement
 function. The placement of columns in determined by the TABSTOPS
 switch.

 When ever you edit a line, tab characters are translated to space
 characters using the FILETAB switch. So modified lines in the file are
 stored in the editor with spaces only. The FILETAB switch determines
 how the editor translates tab characters to spaces when reading in a
 line of text. If ENTAB is set to 1 or 2, then FILETAB also determines
 how the editor translates spaces to tabs when you save the file to
 disk. (Again, only modified lines are affected.)

 If you need to view the tabs as they are situated in your file you can
 use the TABDISP switch to show you which spaces will be compressed
 into a tab character at the next write to the disk file.


 95. 43- and 50-Line Modes

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 20-OCT-1988    ArticleIdent: Q36613

 The M editor can make use of the 43-line EGA text mode and 50-line VGA
 text mode. The "height" numeric switch in the TOOLS.INI file specifies
 the number of lines used in the editing window; however, this number
 does NOT include the dialog and status display lines. Thus, to use 43
 lines of text you must set height=41; to use 50 lines you must set
 height=48.


 96. Microsoft System Journal M macros Fail

 Product Version(s): 1.00 1.01 | 1.00 1.01
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 20-OCT-1988    ArticleIdent: Q36798

 In the September 1988 issue of the "MS System Journal," the article
 entitled "Customizing the Features of the M Editor Using Macros and C
 Extensions" contains erroneous examples.

 Both of the macros below fail in Version 1.00. Only the Bigprint macro
 fails in Version 1.01.

 The following is an example:

 Macro 1)

 ;print selected text macro
 print1:= copy arg "<clipboard>" setfile
 print2:= arg arg "TEMP.DAT" setfile setfile
 print3:= arg "PRINT TEMP.DAT" shell
 print4:= arg "DEL TEMP.DAT" shell
 printa:=print1 print2 print3 print4
 Printa:alt+P

 The above macro is supposed to print selected text. In M Version 1.00
 it works correctly the first time it is called from inside a file.
 However, it fails on subsequent calls to the macro prior to exiting
 the file. It does work correctly in the unreleased Version 1.01
 referenced in the article.

 The following macro is supposed to print the entire file. Instead, it
 prints only the line on which the cursor sits when the macro is
 called. As mentioned above, this fails in both Versions 1.00 and the
 unreleased Version 1.01 referred to in the article on Pages 59-72.

 The following is an example:

 Macro 2)

 ;bigprint macro to print entire file
 select1:= arg ppage
 select2:= arg arg "endoffile" mark
 select3:= arg mpage
 select4:= arg "endoffile"
 selectall:= select1 select2 select3 select4
 bigprint:=meta +>nometa cancel selectall meta :>nometa meta printa

 bigprint:Alt+z
 ;end of bigfoot macro.


 97. meta Anomalous Behavior

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.00
 Last Modified: 31-OCT-1988    ArticleIdent: Q37072

 The following macros written for the M editor exhibit anomalous
 behavior for the function modifier meta. It appears that meta cannot
 modify itself, as demonstrated by the following macros.

 Microsoft has confirmed this to be a problem in Version 1.00. We are
 researching this problem and will post new information as it becomes
 available.

 Consider the following macros:

    MetaTest:= meta meta +> "meta off"=>0 :>1 "meta on":>0
    MetaTest:alt+0
    ; the above macro is supposed to check to see if the function
    ; modifier meta, invoked by the F9 key, is on or off. Compare
    ; the results of this macro with the macro immediately following.
    MetaTest1:= meta +> "meta off"=>0 :>1 "meta on":>0
    MetaTest1:alt+1
    ; the MetaTest1 macro fails to differ from the MetaTest macro in
    ; a significant manner. in contrast, consider the following
    ; macro, employing the insetmode function modifier.
    InsertTest:=insertmode insertmode +> "ins off"=>0 :>1 "ins on":>0
    InsertTest:alt+2.


 98. MASM m.exe Is Different than FORTRAN m.exe when Using DOS Comp

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | h_fortran
 Last Modified:  6-JAN-1989    ArticleIdent: Q38015

 Question:

 When I do a Comp command at the DOS prompt, why do the FORTRAN Version
 4.10 and MASM Version 5.10 packages contain m.exe files that differ at
 offset 15F9F, where the MASM m gives 37 and the FORTRAN m gives 38?
 Which one should I use for mixed-language programming?

 Response:

 This behavior is an error that was discovered after MASM Version 5.10
 was released, but before FORTRAN Version 4.10 was shipped. You can see
 this by invoking the editor and entering SHIFT+F1, which gives you
 file information. The date given in the MASM file is Jan. 29, 1987
 (hex37) when it should be Jan. 29, 1988 (hex 38). Other than this
 character in the date, they are identical, so you can use either one
 for mixed-language programming.


 99. Selecting Large Text Blocks with Microsoft Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  4-MAY-1989    ArticleIdent: Q38309

 Question:

 When I want to select a large block of code for the clipboard, I press
 ALT+A, then the DOWN ARROW key until I reach the last line I want to
 select. This process is very slow if the block I am selecting is
 several pages long (almost a whole file). Is there a way to move
 faster to select a block than by using the CURSOR key (such as the
 equivalent of ^K-B and ^K-K in Wordstar)?

 Response:

 CTRL+PGDN (Ppara) serves this purpose, as documented on Pages 91 and
 104 of the "Microsoft Editor for MS OS/2 and MS-DOS Operating Systems:
 User's Guide." This key sequence will move you to a new paragraph each
 time you press the keys. If the movement sequence you want to use
 contains an Arg, it is either used by the command or canceled.

 A faster method is to define a couple of macros to help out. First, we
 need a macro that will mark the beginning spot in the text, as
 follows:

    txtmark:=arg arg "first" mark
    txtmark:alt+t

 The second macro automates using the mark as an argument, as follows:

   callmark:=arg "first"
   callmark:alt+u

 You can put these lines in your TOOLS.INI file.

 To use this pair, move to the first spot, press ALT+T, then move up or
 down using any movement keys to the second spot. Finally, press ALT+U
 and press a key that allows a markarg as an argument. (The Copy and
 Ldelete functions are among these.) Note: no highlighting occurs, so
 you'll have to be careful.

 Note: if you want the argument to be entire lines rather than a box,
 the cursor MUST be in the same column when you press ALT+U as it was
 when you pressed ALT+T. If you put it in a different column, you will
 be selecting a box argument rather than a line argument.


 100. Moving to the Beginning of the Line with Microsoft Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  6-JAN-1989    ArticleIdent: Q38310

 Question:

 Is there a way to go to column 1 of the screen with a key sequence
 instead of pressing the LEFT ARROW key until the cursor stops at
 column 1? I find myself wasting a lot of time doing this repetitive
 chore. The HOME key only takes me to the beginning of the text on the
 line, not the beginning of the line, which is where I want to be if I
 want to delete a line, for example. I currently use ^K-S with the
 Wordstar extension.

 Response:

 Meta Begline (F9 HOME in the standard configuration) will do it. If
 you'd like it on one key, you can assign the functions to a key using
 the macro facility.


 101. Inserting a Line from Clipboard into File with Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 15-MAY-1989    ArticleIdent: Q38311

 Question:

 I am confused by the way a line is inserted from the clipboard into a
 file. It seems to depend on whether Insert is On or Off. Also, it
 sometimes pushes the other lines down and sometimes it pushes the
 existing line to the right. I see no consistency to all this. Can you
 explain the concepts?

 Response:

 The Insert mode has no bearing on line insertion. However, how you
 delete the line has a lot to do with it. In general, don't use the
 DEL key for multiple-character deletions. It is usually assigned to
 the sdelete function, which always deletes a stream of text, as
 documented on Page 107 of the "Microsoft Editor for MS OS/2 and MS-DOS
 Operating Systems: User's Guide."

 A stream is all of the text between the place where the cursor was
 when you typed Arg and where it is when you press sdelete, regardless
 of the beginning and ending cursor columns or how many lines are
 contained in the region. Whenever you mark an area and press sdelete
 (the DEL key), you will delete the STREAM you have marked, even
 though the region highlighted may look different.

 It's usually best to use CTRL+Y (Ldelete) for deletions which begin
 and end on different lines. Note that the COPY key (CTRL+INS) does not
 accept stream arguments, therefore, it always copies the highlighted
 area.


 102. Use a Colon when Assigning a Macro to a Keystroke

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 12-JAN-1989    ArticleIdent: Q39574

 There is a documentation error on Page 50 of the "Microsoft Editor
 User's Guide." Section 6.3.2 incorrectly shows a semicolon when
 assigning a macro to a keystroke as follows:

    Header;ALT+H

 The correct example should contain a colon as follows:

    Header:ALT+H


 103. Quote Function and Typing in Graphic Characters in M

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 16-MAY-1989    ArticleIdent: Q39806

 Question:

 I want to input some graphics characters in the M editor. However,
 when I try to input the ASCII character 31 using the ALT key and the
 numeric keypad, the M editor beeps and displays the following message:

    "ctrl+_ is not assigned to any editor function"

 For the ASCII character 30, the M editor displays the following
 message:

    "ctrl+^ is not assigned to any editor function."

 How can I input those characters?

 Response:

 Use the editing Quote function in the M editor. The Quote function is
 associated with CTRL+P by default. After the Quote function is
 invoked, the following keystroke is taken literally. This function is
 mentioned in the "Microsoft Editor for MS OS/2 and MS-DOS Operating
 Systems User's Guide" on Page 105.

 The first 32 characters in the ASCII character set have two
 conflicting uses. As standard ASCII characters, they are used for
 communications control and printer control. They are also used by IBM
 to represent some useful graphics characters.

 Using the Quote function in the M editor can prevent these ASCII
 characters from being interrupted as control characters.


 104. M Hangs if the textarg Given to ArgCompile Is Incomplete

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 12-JAN-1989    ArticleIdent: Q40235

 If you want to compile a program inside the M editor using the
 following command, textarg should contain the full compile line as
 typed at the DOS prompt:

    Arg Arg textarg ArgCompile

 The following is an example:

    cl /Zi /Od demo.for

 If textarg contains just the name of the program (demo), the hard disk
 light will come on and the message "compilation complete" will appear
 on the bottom of the screen even though demo.for was not compiled.

 If textarg contains the full program name (demo.for), your computer
 hangs if you press SHIFT+F3. Sometimes, there will be lost clusters
 and allocation errors as reported by chkdsk.

 This problem was not encountered under OS/2.



 105. Redirecting Errors to an Error File in M

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  1-MAY-1989    ArticleIdent: Q40177

 Under DOS, M Version 1.00 will store the error messages in the M.MSG
 file. This file is located in the directory the TMP environment
 variable points to. If TMP is not set, this file is located in
 the current working directory. Under OS/2, MEP uses named pipes, so
 there is no file to look at.


 106. FileWrite() Function Fails to Write Back Out to the File

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 15-MAY-1989    ArticleIdent: Q40356

 Problem:

 I have a problem using the FileWrite Function programming with the M
 and MEP Editor Version 1.00. I want to read a file (EXAMPLE.DOC) and
 write exactly the same in a new file (FOO.DOC).

 Response:

 To test the example below, you only have to create a file named
 EXAMPLE.DOC. See the compiler switches at the end of this article. The
 second file FOO.DOC is created, but it is never written to it always
 has zero length.

 This is a problem with MEP Version 1.00's FileWrite() function. This
 is one of the problems that kept the filter extension described in the
 "Microsoft Systems Journal" September 1988 from working in Version
 1.00.

 Microsoft has confirmed this to be a problem in Version 1.00. We are
 researching this problem and will post new information as it becomes
 available.

 The following is a short example where the problem (Function FileWrite
 does not write) occurs:

 #include "ext.h"
 #define TRUE    -1
 #define FALSE   0
 #define NULL    ((char *) 0)

 flagType pascal EXTERNAL Write(
 unsigned int argData,
 ARG far * pArg,
 flagType fMeta)
 {
     flagType flg;
     PFILE pFile;
     char  *p = "EXAMPLE.DOC";
     char  *w = "FOO.DOC";

     if((pFile = FileNameToHandle(p,NULL)) == 0)
     {
         pFile = AddFile(p);
         FileRead(p, pFile);
     }
     flg = FileWrite(w, pFile);
     return (flg);
 }

 struct swiDesc  swiTable[] ={
     { NULL, NULL, 0 }
 };

 struct cmdDesc  cmdTable[] ={
     {"Write", Write, 0, NOARG },
     {NULL,  NULL, 0, 0}
 };

 void EXTERNAL WhenLoaded (void)
 {
     SetKey("Write", "alt+w");
     DoMessage("Write function now loaded.");
 }

 /*

 *** Compiler switches I used ***

 cl /c /Gs /Asfu %1.c
 cl /Lp /AC /Fe%1.dll exthdrp.obj %1.obj skel.def

   */


 107. Optimizing C or QuickC 2.00 Required for Writing C Extensions

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | S_C S_QuickC
 Last Modified: 17-MAY-1989    ArticleIdent: Q39997

 Question:

 I would like to customize the Microsoft Editor by writing C
 extensions. Can I use QuickC Version 1.00, QuickC Version 1.01, or
 QuickC Version 2.00?

 Response:

 No. You must use the Microsoft C Version 4.00 Optimizing Compiler or a
 later version to write C extensions to the Microsoft Editor. QuickC
 Versions 1.00 and 1.01 cannot be used because they do not support the
 required switch /Asfu.

 However, Version 2.00 does support the /Asfu switch when using QCL.
 Therefore, you can use Version 2.00 and QCL to create C extensions.

 For more information, see Pages 68 and 83 of the "Microsoft Editor for
 MS OS/2 and MS-DOS Operating Systems: User's Guide."


 108. Search and Replace Macro for M Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 12-JAN-1989    ArticleIdent: Q39998

 Question:

 Can you write a macro to perform a search and replace on a particular
 string? When I try to do so, the replace function prompts me for a
 string argument. I want the replace function to read the string from
 the macro.

 Response:

 The following is an example of a replace macro that accepts its
 argument from inside the macro:

    myreplace:=replace "oldtext" newline "newtext" newline

 When the myreplace macro is invoked, all the occurrences of "oldtext"
 string, from the cursor position to the end of the file, are replaced
 with the "newtext" string. The use of the newline function allows the
 macro to respond to the replace-function prompt for a string argument.

 To define the myreplace macro and assign it to the F12 key, enter the
 following keystrokes from inside the M editor:

    ALT+A
    MyReplace:=replace "oldtext" newline "newtext" newline
    ALT+=

    ALT+A
    MyReplace:F12

 To execute the myreplace macro, press the F12 key.


 109. M.TMP Reset When Window Closed

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | mep buglist1.00
 Last Modified: 15-MAY-1989    ArticleIdent: Q40681

 Question:

 When I invoke the M editor, open a second window (arg F6 or arg arg
 F6), and close the first window (meta F6), my M.TMP file is reset. The
 only file in my M.TMP file is the one that I edited to perform this
 operation. Is there a way to prevent this from happening?

 Response:

 This phenomena occurs whenever you close a window that has had a file
 opened in it. Hence, if you open a file in the second window, then
 close the second window, M.TMP is reset. To avoid this behavior, don't
 close a window in which a file has been opened.

 Microsoft has confirmed this to be a problem in Version 1.00. We are
 researching this problem and will post new information as it becomes
 available.



 110. QHMEP.DLL Remaps Two Keys in MEP Version 1.00

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | buglist1.00
 Last Modified: 16-MAY-1989    ArticleIdent: Q41324

 Problem:

 I have remapped the keys CTRL+S and CTRL+P in MEP Version 1.00 to the
 psearch and up functions. After loading the extension QHMEP.DLL, which
 comes with the Version 1.06 OS/2 SDK, the two keys CTRL+S and CTRL+P
 are not mapped to psearch and up anymore. Furthermore, these keys
 cannot be reassigned back to psearch and up. I seem to be locked out
 of using these keys.

 Response:

 This problem occurs because the editor is taking over these keys,
 preventing them from being reassigned.

 Microsoft has confirmed this to be a problem in MEP Version 1.00. We are
 researching this problem and will post new information as it becomes
 available.



 111. Useful Macros for the Microsoft Editor

 Product Version(s): 1.00    |  1.00
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER |
 Last Modified: 16-MAY-1989    ArticleIdent: Q40755

 Below are macros for the Microsoft Editor that allow you to save a
 marked portion of a file and insert it into another file. Also, there
 are macros that speed up marking large areas of text.

 To save a marked area of a file, mark the area and invoke this macro
 by typing ALT+V. Note that although the macro is broken onto two lines
 here, you should put it on one line in your TOOLS.INI file.

 savemark:=copy arg "command /c del c:\\t" shell arg "\\t" setfile
           refresh paste setfile
 savemark:alt+v

 A one-key way to include the file in another file is to use the macro
 by typing ALT+I:

 insertmark:=arg arg "\\t" paste
 insertmark:alt+i

 To mark the top and bottom of the text area, use these macros. Type
 ALT+T to place the marker, then ALT+U to use it. Type CTRL+INS or
 CTRL+Y to copy or delete the text. Note that if your cursor is not in
 the same column when you type ALT+U as when you typed ALT+T, the area
 marked will be a box rather than a set of lines. Note also that the
 marked area will NOT show up on the screen.

 tempmark:=arg arg "temp" mark
 usemark:=arg "temp"
 tempmark:alt+t
 usemark:alt+u



 112. Using Brief Emulation and Tags in TOOLS.INI

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.00
 Last Modified: 17-MAY-1989    ArticleIdent: Q41475

 If you invoke a tagged section from your TOOLS.INI when using the
 Microsoft editor with brief keystroke emulation, some of the key
 assignments will revert back to the default.

 Microsoft has confirmed this to be a problem in Version 1.00. We are
 researching this problem and will post new information as it becomes
 available.

 As demonstrated in the following example, some of the keystrokes are
 reassigned to the default keystrokes if you rename the BRIEF.INI file
 to be TOOLS.INI and then add a new tag section:

 [m-mono]
     height:23
     fgcolor:07
     errcolor:0F
     stacolor:70
     infcolor:70

 Start editing a file, then bring in this new tag field by typing the
 following:

    arg "mono" shift+f10

 The following demonstrates this behavior and all compile lines revert
 to default:

    window             will change from F1 to unassigned
    help               will change from ALT+H to F1
    argcompile         will change from ALT+F10 to F5
    save               will change from ALT+W to undefined
    linemark           will change from ALT+I to undefined
    linetotop          will change from CTRL+T to undefined
    leftsideofwindow   will change from SHIFT+HOME to undefined
    rightsideofwindow  will change from SHIFT+END to undefined
    createhorizwindow  will change from F3 to undefined
    createvertwin      will change from F4 to undefined
    deletewindow       will change from F5 to undefined



 113. Minimum Requirements for Writing a M Extension

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 16-MAY-1989    ArticleIdent: Q42241

 Question:

 What files and software do I need to be able to write an extension for
 the Microsoft Editor?

 Response:

 To create C extensions, you need to have the following files and
 software present in your current directory (or directories listed in
 the PATH or INCLUDE environment variables, as appropriate):

 1. The Microsoft C Optimizing Compiler Version 4.00 or later;
    or Microsoft QuickC Version 2.00

 2. The Microsoft Overlay Linker Version 3.60 or later; or the
    Microsoft Segmented-Executable Linker Version 5.01

 3. EXTHDR.OBJ (supplied with the editor) or EXTHDRP.OBJ (a file
    supplied with the editor for creating protected-mode extensions)

 4. EXT.H header file provided with the editor

 5. SKEL.DEF, the standard definitions file supplied with the editor;
    to be used with all extension

 You need a minimum 150K of available memory for the editor to load a C
 extension at run time in addition to the size of the extension itself.


 114. 43- and 50-Line Modes with the IBM 8514 Monitor

 Product Version(s): 1.00 1.02
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00 fixlist1.02
 Last Modified: 28-JUL-1989    ArticleIdent: Q42365

 The Microsoft Editor does not go into 43- or 50-line line mode on the
 IBM 8514 monitor.

 Version 1.00 of the Microsoft Editor does not support higher line
 modes with the IBM 8514 monitor. Regardless of the switch setting you
 give in the TOOLS.INI file, it always comes up in 25-line mode.

 For example, setting the height:41 or height:48 switch in the
 TOOLS.INI file results in the Microsoft Editor coming up in 25-line
 mode.

 Microsoft has confirmed this to be a problem in Version 1.00 of the
 Microsoft Editor. This problem was corrected in the Microsoft Editor
 Version 1.02.


 115. Savecur and Restcur Save Relative Position in File, on Screen

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS2
 Flags: ENDUSER |
 Last Modified: 17-MAY-1989    ArticleIdent: Q42758

 The Microsoft Editor functions Savecur and Restcur save the current
 cursor position relative to the file and the screen. Therefore, the
 screen will be restored exactly as it appeared when the Savecur
 function was invoked.

 The following macros were intended to scroll the screen up and down
 while leaving the cursor position relative to the terminal screen to
 be stationary:

 ReposDown:=Savecur Meta Up Up Restcur
 ReposDown:Ctrl+Down

 ReposUp:=Savecur Meta Down Down Restcur
 ReposUp:Ctrl+Up

 Because Savecur and Restcur preserve and restore the cursor position
 relative to the screen, the macros appear to do nothing. But actually,
 each executes correctly. For example, the ReposDown does the following:

 1. Savecur : saves the current position relative to the file and the
              screen

 2. Meta Up : moves the cursor to the top of the screen

 3. Up      : moves the cursor up one line, (thus scrolling the screen
              down one line)

 4. Restcur : restores the screen to the original configuration
              (appears as if nothing had happened)

 One way to achieve the desired result is to use the Mark function. The
 Mark function saves the current location in the file. The relative
 screen position is not preserved, whereas the Savecur and Restcur
 functions do save the relative screen position.

 The following macros give the desired result:

 ReposDown:=Arg Arg "tag" Mark Meta Up Up Arg "tag" Mark Up
 ReposDown:Ctrl+Up

 ReposUp:=Arg Arg "tag" Mark Meta Down Down Arg "tag" Mark Down
 ReposUp:Ctrl+Down

 The word "tag" is an arbitrary tagname for the Mark function.


 116. Copy Is a Reserved Word

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 17-MAY-1989    ArticleIdent: Q42763

 The word copy is a reserved word in the Microsoft Editor. If you write
 an M extension and name it "copy", the editor will load but not
 execute your extension.

 If you name the function (for example) cpy rather than copy, it will
 work correctly.

 The following declaration incorrectly uses the reserved word "copy."
 Renaming the the function "cpy" will resolve the problem:

 flagType pascal EXTERNAL copy (argData, Parg, fMeta)
 unsigned int argData;
 ARG far *Parg;
 flagType fMeta;



 117. A C Extension to Select an Arbitrary Number of Lines of Text

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | extension highlight select
 Last Modified:  1-JUN-1989    ArticleIdent: Q43006

 To select an arbitrary number of lines of text in the Microsoft
 Editor, I must use the Arg function, then use the DOWN ARROW key until
 the desired number of lines are selected. This is inconvenient if more
 than a few lines are to be selected.

 This article provides a simple editor extension that selects the
 number of lines you specify.

 For information on loading the function, refer to the M editor
 reference manual.

 To invoke the function, use the Arg key to introduce the argument
 (i.e., the number of lines to be selected), then press the key
 assigned to the function. In Version 1.00 of M, the selected text will
 not be highlighted.   In Version 1.02 of M, the selected text will be
 highlighted, however further cursor movements will change the selected
 area without altering the highlighted area.

 ================ Make file ===============

 BASE=select
 CFLAGS=-c -W2 -Asfu -Gs
 LINKFLAGS=/NOI /NOD

 $(BASE).obj : $(BASE).c
     cl $(CFLAGS) $(BASE).c

 $(BASE).exe : $(BASE).obj
     link exthdr.obj $(BASE), $(BASE), \
     $(LINKFLAGS),clibcer.lib;

 ================ select.c ================

 #include "ext.h"
 #include <stdlib.h>

 #define TRUE    -1
 #define FALSE   0
 #define NULL    ((char *) 0)

 flagType pascal EXTERNAL Select (argData, pArg, fMeta)
 unsigned int argData;
 ARG far * pArg;
 flagType fMeta;
 {
     int  nCount, i ;

     if (pArg->argType == TEXTARG)
         if (nCount = atoi (pArg->arg.textarg.pText))
             {
             for (i = 0 ; i < nCount ; i++)
                 fExecute ("Arg Down") ;
             }

     return TRUE;
 }

 struct swiDesc  swiTable[] =
 {
     {   NULL, NULL, NULL    }
 };

 struct cmdDesc  cmdTable[] =
 {
     {"Select", Select, 0, TEXTARG},
     {NULL,  NULL, NULL, NULL}
 };

 WhenLoaded ()
 {
      SetKey("SELECT","ALT+B");
      return TRUE;
 }


 118. Cannot Use Standard Device Names as Filenames

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 17-MAY-1989    ArticleIdent: Q43074

 You cannot use the standard device names (COMx, LPTx, and CON) as the
 base filename in the Microsoft Editor.

 For example, the command "M COM1.C" under DOS will attempt to open the
 communications port for editing and will hang the computer.

 This information has been tested for the following devices: COM1,
 COM2, LPT1, LPT2, CON. The different devices give slightly different
 results. COM1 and COM2 will hang the computer immediately, but the
 others will give errors or hang when the file is saved.

 The protect-mode editor behaves in the same fashion.


 119. Accessing Predefined Switches in C-Extension

 Product Version(s): 1.02   |  1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | FindSwitch
 Last Modified: 17-MAY-1989    ArticleIdent: Q43436

 When writing a C extension for Microsoft Editor Version 1.02, you can
 access the predefined editor switches through the function
 FindSwitch(). FindSwitch() is intended to be used to access the values
 of the predefined editor switches, not to modify the values. Modifying
 the switches through FindSwitch() has undefined results.

 The following code fragment retrieves the value of the switch
 "tabstops" for use in your C extension:

 #include "ext.h"
       .
       .
       .

 PSWI pTabStops ;
 int  nTabStops ;
       .
       .
       .

 pTabStops = FindSwitch ("tabstops") ;
 nTabStops = *(pTabStops->act.ival) ;

 Any change to the value of the switch "tabstops" made outside your
 C extension will be reflected in the value of nTabStops inside your
 C extension.

 You can find the FindSwitch() prototype in the include file EXT.H. The
 function FindSwitch() is not available in the Microsoft Editor Version
 1.00.

 The structure, swiTable, consists of a series of structures, each
 structure describing a user-defined switch. The purpose of swiTable is
 to add user-defined, not predefined, switches. It is incorrect to name
 the predefined switches in the switch table. For that reason the
 following example is incorrect as it names "tabstops," a predefined
 switch:

 struct swiDesc swiTable [] =
  {
   {"tabstops", &nTabStops, NUMERIC | RADIX10}   /*  INCORRECT  */
   { NULL, NULL, 0}
  } ;

 Do not modify the predefined switches through the switch table. You
 can change the values of the predefined switches from within an
 editing session or in TOOLS.INI.


 120. The Editor Can Be Very Slow When MEP Memory Limit Is Pushed

 Product Version(s): 1.00 1.02
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 17-MAY-1989    ArticleIdent: Q44000

 Problem:

 I have a file FOO, which is 21733 bytes long and contains 850 lines.
 When I perform the following steps the compiler appears to hang. In
 fact, however, the compiler is being forced to go to disk for its own
 memory management.

 When performing the steps described below with the README.DOC from C
 Version 5.10 (which is 64964 bytes) and running on a 16mHz machine,
 after Arg Refresh, it took almost 30 seconds for MEP to return
 control.

 This problem is due to the fact that MEP does its own memory
 management. When you do Arg Refresh, MEP must reread the buffer
 containing the modified file from disk. In addition, MEP must store
 back to disk the buffer containing the last block of text pasted to
 the file. This swapping of two large files is what causes the delay.

 Microsoft has confirmed this lack of speed to be a limitation with
 Version 1.00 and 1.02 of the Microsoft Editor. We are researching this
 problem  and will post new information as it becomes available.

 To duplicate this problem, perform the following steps:

 1. Invoke the following to run the editor:

       [C:\]m foo

 2. Make some changes to modify the buffer.

 3. Issue the following command to the editor:

       arg "bar" setfile

    The editor responds "File c:\bar does not exist, create?"

 4. Respond "y" for yes. You are now in bar's buffer.

 5. Issue the following command to read in the original contents of the
    file:

       arg arg "foo" paste

    This process should work correctly.

 6. If you now want to get rid of the new buffer, issue the following
    command:

       arg refresh

    The editor responds with something similar to the following:

       "Do you really want to delete the buffer?"

 7. Respond "y" for yes.

    The editor appears to hang.


 121. Why Syntax Errors Might Not Display While Compiling in M

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  1-MAY-1989    ArticleIdent: Q43647

 Question:

 While inside the Microsoft Editor, I compiled a program that I know
 contained syntax errors. The message "Compilation Complete - return
 code is x" (where "x" is an integer value) appeared, signifying that
 an error had occurred while compiling.

 I pressed SHIFT+F3 to display those errors and the message "No more
 compilation messages" was displayed on the bottom of the screen. Why
 aren't my program's error messages displayed inside the editor?

 Response:

 You see error messages only if the compiler or linker runs correctly
 and passes the error messages in the correct format to the editor; if
 the compiler itself fails, you will not see any messages.

 Because M spawns the compiler, you could be running out of file
 handles. You know that the system has run out file handles if the
 M.MSG file is not created. Setting files=20 in your CONFIG.SYS file
 should correct the problem.

 Other possible causes for not getting error messages are as follows:

 1. You could be running out of memory. You can check this by shelling
    out of M.EXE (with SHIFT+F9) and issuing the DOS CHKDSK command to
    display the available memory.

 2. The compiler might not be able to find the specified file.
    Consider the following example, in which you invoke M.EXE as
    follows:

       C:\> M c:\c5\source\test.c

    If you compile the program with ARG COMPILE, the information line
    displays the following:

       CL /c /Zep /D LINT_ARGS test.c.

    The compiler will not find TEST.C in the current directory, so an
    error is returned.

    For more information, query on the following phrases:

       Microsoft Editor
       full path

 3. The EXTMAKE switches might have been incorrectly modified in the
    TOOLS.INI file, as in the following example:

       EXTMAKE:bas BC /Zi /O %s

    The line above is incorrect because it is missing a semicolon (;)
    at the end. The command line following the extension must be complete.
    Both the Microsoft BASIC Compiler and MASM will prompt you for
    additional information if a semicolon is not at the end of the line.

 4. Make sure the options used are valid for the compiler. In the
    following example, the option /Fa is an invalid option for the
    QCL.EXE compiler:

       QCL /Fa filename.c

 5. The compiler must be in the current path. If the compiler fails to
    execute, due to some problem external to the editor, M will
    display the ambiguous message "No more compilation messages."

    A good way to check the validity of the Compile command and to check
    for the presence of the compiler is to type in the compile line with
    all of the options directly from DOS.


 122. MEP GP Faults After Consecutive Searches.

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | buglist1.00
 Last Modified:  1-JUN-1989    ArticleIdent: Q44887

 MEP gets an access violation and crashes after several searches for a
 string.

 Microsoft has confirmed this to be a problem with MEP.EXE Version
 1.00. This problem was corrected in MEP.EXE Version 1.02.

 Note: Version 1.02 of the Microsoft Editor is only available with
 FORTRAN 5.00. The documentation required for M and MEP Version 1.02
 make it impossible to release except with a major language release.

 The text file that caused MEP to fail was 54400 bytes and contained
 the string "error" in 81 different locations. To reproduce this
 problem, search for the string "error". The default keystrokes are

    Arg "error" F3

 for the first search, and the following for each additional search:

    F3

 On the 81st search, the Microsoft Editor for Protect, generates a
 General Protection Violation.


 123. Status Line Input with a Blinking Cursor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | GETINPUT.ARC S12311.EXE
 Last Modified: 13-SEP-1989    ArticleIdent: Q44925

 Question:

 Is it possible in the Microsoft Editor to write an extension that will
 accept a line of input from the user, preferably from the status line?

 Response:

 Version 1.02 of the Microsoft Editor offers a very convenient way to
 do this. The GetString() callback function performs exactly this type
 of input. Version 1.00 of the Editor, however, does not have such a
 callback. It is possible to put together a routine that reads user
 input using the ReadChar() function in M Version 1.00. However, since
 ReadChar() waits for the next available character, there is no
 convenient way to flash a cursor during input when using this
 approach.

 The function provided below is a status-line input routine that does
 provide a flashing cursor. It uses the KbHook() and KbUnHook()
 functions to prevent the editor from scanning the keyboard and then
 reads the keyboard directly using the kbhit() and getch() functions
 from the C run-time library.

 An example C extension that demonstrates this function is available
 in the Software\Data Library. This file can be found by searching on
 the keyword GETINPUT, the Q number of this article, or S12311.
 GETINPUT was archived using the PKware file-compression utility.

 Status-Line Input Routine
 -------------------------

 #include "ext.h"
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 #include <conio.h>

 #define TRUE            1
 #define FALSE           0

 typedef unsigned        BOOL;

 char *GetInput( int BufLen, char *theBuffer );

 /* GetInput provides a means of getting user input from the status line
  * with a blinking cursor in a manner similar to M 1.02's GetString().
  * KbUnHook is used to capture keyboard input. KbHook restores normal
  * keyboard reading to the editor.
  *
  * Receives:    BufLen - Length of input buffer
  *              theBuffer - Pointer to input buffer
  *
  * Returns:     A pointer to the modified buffer, or NULL if ESC was
  *              used to cancel input.
  */
 char *GetInput(
     int             BufLen,
     char            *theBuffer )
 {
     char            Key;                        /* ASCII code of key */
     int             i = 0;                      /* Position in buffer */
     BOOL            CursorOn = TRUE;            /* State of cursor */
     int             FlashCount = 0;             /* Cursor state counter */
     int             CursorToggleCount = 100;    /* Iterations between changes
                                                    in cursor state */
     char            *r;                         /* Return pointer */

     /* Unhook the keyboard so that the editor no longer intercepts
      * keystrokes.
      */
     KbUnHook();

     /* Get keyboard input from user, stopping when ESC or ENTER is hit.
      * Characters not in the range of 32 to 127 are ignored.  Backspace
      * will work properly.  No more than (BufLen - 2) characters may
      * be entered.
      */
     do
     {
         /* Flash a cursor while waiting for the next keypress.
          */
         while( !kbhit() )
         {
             if( ++FlashCount == CursorToggleCount )
             {
                 FlashCount = 0;
                 CursorOn = !CursorOn;
                 if( CursorOn )
                 {
                     strcat( theBuffer, "_" );
                     DoMessage( theBuffer );
                 }
                 else
                 {
                     theBuffer[i] = '\0';
                     DoMessage( theBuffer );
                 }
             }
         }

         /* Snarf the key
          */
         Key = (char)getch();

         /* Handle backspace.
          */
         if( (Key == 8) && (i > 0) )
         {
             theBuffer[--i] = '\0';
             DoMessage( theBuffer );
         }

         /* Handle normal character.
          */
         if( (Key >=32) && (Key <= 127) && (i < BufLen - 2) )
         {
             theBuffer[i++] = Key;
             theBuffer[i] = '\0';
             DoMessage( theBuffer );
         }
     } while( (Key != 13) && (Key != 27) );

     /* If ESC was pressed, toss the input and NULL the input buffer,
      * else perform a little cleanup.
      */
     if( Key == 27 )
     {
         theBuffer[0] = '\0';
         DoMessage( theBuffer );
         r = NULL;
     }
     else
     {
         if( CursorOn )
             theBuffer[i] = '\0';
         DoMessage( theBuffer );
         r = theBuffer;
     }

     /* Restore normal keyboard input.
      */
     KbHook();

     return( r );
 }


 124. CALLTREE Produces No Warnings When Out of Disk Space

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | S_C H_MASM H_Fortran S_PasCal
 Last Modified: 23-JUN-1989    ArticleIdent: Q45618

 The CALLTREE.EXE utility shipped with the Microsoft Editor (included
 with MASM, Optimizing C, FORTRAN, and Pascal) does not produce a
 warning if it runs out of disk space while writing output files. It
 simply closes the file being currently written and attempts to produce
 the next file. If the disk has no space free, the file will be created
 and closed with a length of 0 (zero) bytes. No error messages are
 produced in any case.

 Microsoft is aware of this limitation of CallTree. The error checking
 and messages features are under review and will be considered for
 inclusion in a future release.


 125. Documentation Errors in "Configuring On-Line Help" for M 1.02

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 11-SEP-1989    ArticleIdent: Q46272

 There are several documentation errors in the section "Configuring
 On-Line Help" on Page 101 of the "Microsoft Editor User's Guide for MS
 OS/2 and MS-DOS Operating Systems." This is the documentation for the
 Microsoft Editor (M) Version 1.02, which first became available with
 FORTRAN Version 5.00. These errors prevent access to M help. The
 documentation says to add the following tagged section to your
 TOOLS.INI file:

    [m-help.mxt mep-help.mxt]
    helpfiles:path\file.hlp

 The tag header should be as follows:

    [m-help mep-mhelp]

 Including ".mxt" prevents M from accessing help.

 Also, in the paragraph labeled Number 2 that describes installation
 for on-line Help when running under OS/2 protected mode only, there is
 a misprint. The following sentence refers to a nonexistent file
 "MHELP.DLL":

    MHELP.DLL is an extension to the editor.

 The correct file is MHELP.PXT, so the sentence should read as follows:

    MHELP.PXT is an extension to the editor.


 126. CMD.EXE Shell Fails with Incorrect COMSPEC

 Product Version(s): 1.00 1.02
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1989    ArticleIdent: Q47763

 Question:

 When I attempt to shell out of the MEP editor environment via the
 Shell editor function (SHIFT+F9), why does the following message
 appear at the bottom of the screen?

    Spawn failed on C:\OS2\CMD.EXE   - No such file or directory

 Response:

 The problem is usually due to an incorrect setting of the COMSPEC
 environment variable in the CONFIG.SYS file. A faulty setting of this
 variable, which informs the operating system of the command
 interpreter's location, prevents the DOS EXEC system call from finding
 and executing the command interpreter. Use the following procedure to
 eliminate the problem:

 1. Verify that the CMD.EXE file is in the directory specified by the
    COMSPEC environment variable.

 2. Ensure the syntax correctness of the COMSPEC setting. There should
    be no spaces on either side of the equal sign, and a carriage
    return must appear immediately following the last character of the
    path and filename setting.

        Correct example:       SET COMSPEC=C:\OS2\CMD.EXE<cr>

        Incorrect examples:    SET COMSPEC = C:\OS2\CMD.EXE<cr>
                               SET COMSPEC=C:\OS2\CMD.EXE;<cr>
                               SET COMSPEC=C:\OS2\CMD.EXE<space><cr>

 Under MEP 1.02, the COMSPEC environment variable is used to locate the
 command interpreter. If the command interpreter is not found according
 to the COMSPEC variable, the "Spawn failed...." error message is
 displayed. MEP Version 1.02 does not use the PATH environment variable
 for additional searching of CMD.EXE.

 Under MEP Version 1.00, however, the PATH variable is used when the
 CMD.EXE is not found via the COMSPEC setting. Hence, if the spawn
 failure error occurs when attempting to shell out of the MEP 1.00
 environment, examine the COMSPEC setting and also verify that CMD.EXE
 is traversed by the search path of the PATH environment variable in
 the CONFIG.SYS.


 127. Curtime Function Pulls In Time Editor Was Invoked

 Product Version(s): 1.00 | 1.00
 Operating System:   OS/2 | MS-DOS
 Flags: ENDUSER | buglist1.00 fixlist1.02
 Last Modified: 28-JUL-1989    ArticleIdent: Q46790

 The Microsoft Editor Version 1.00 does not implement the Curtime
 function correctly. The manual states that the current time will be
 inserted at the cursor when this function is invoked. Actually, the
 time the editor was invoked is inserted at the cursor. To get around
 this problem, simply initialize the editor before calling the Curtime
 function.

 Microsoft has confirmed this to be a problem in Version 1.00. This
 problem was corrected in Version 1.02 of the Microsoft Editor.

 The following macro illustrates how the Curtime function is invoked.
 This macro should be placed in the TOOLS.INI file under the [m] tag.

    time:=Curtime
    time:ALT+T

 When editing a file, pressing ALT+T inserts the time that the editor
 was loaded at the cursor. To obtain the current system time, either
 invoke the Initialize function by pressing SHIFT+F8 before ALT+T, or
 change the macro as follows:

    time:=Initialize Curtime
    time:ALT+T

 Now, pressing ALT+T inserts the current system time at the cursor.

 This function is documented on Pages 30 and 96 of the "Microsoft
 Editor User's Guide," which is contained in the "CodeView and
 Utilities, Microsoft Editor, Mixed-Language Programming Guide" manual
 from the Microsoft C Optimizing Compiler Version 5.10.


 128. QUICK.INI Needs Modification for Use with M 1.02 or MEP 1.02

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 28-JUL-1989    ArticleIdent: Q46802

 To use the QUICK.INI file provided with the Microsoft M Editor Version
 1.02 as the TOOLS.INI file, it is necessary to make two modifications
 to the file. Without the modifications the editor gives the following
 error messages:

    Argcompile is not an editor function               press any key...
    Help is not an editor function                     press any key...

 To get past the Argcompile error message, add the following line to
 the TOOLS.INI file before the Argcompile:F5 line:

    Argcompile:=arg compile

 The Argcompile macro is also defined in the TOOLS.PRE file provided
 with the editor. The Help:F1 line is a leftover from previous versions
 of the editor and is not implemented in this version. To eliminate the
 Help error message, either delete or comment out the Help:F1 line.


 129. Documentation Error for "Mark" Functions in M User's Guide

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified:  2-AUG-1989    ArticleIdent: Q47236

 On Page 179 of the Version 1.02 "Microsoft Editor for MS OS/2 and
 MS-DOS Operating Systems: User's Guide," there is a documentation
 error. In the section of the reference table describing the "Mark"
 function, the marker deletion and marker definition descriptions are
 reversed. To define a marker at the cursor position, the correct
 syntax is Arg Arg textarg Mark. To delete a marker definition, the
 syntax is Arg Arg textarg Meta Mark. The entries SHOULD appear as
 follows:

    Entry                         Function
    -----                         --------

    Arg Arg textarg Mark          Defines a file marker at the
                                  initial cursor position. This
                                  does not record the file marker
                                  in the file specified by the
                                  markfile switch, but allows you
                                  to refer to this position as
                                  textarg.

    Arg Arg textarg Meta Mark     Deletes a marker definition.

 On Page 39, the reference to Arg Arg textarg Mark is correct.


 130. CopyBox Function Doesn't Work Across Files

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | S_C S_Pascal H_Fortran H_MASM
 Last Modified: 26-SEP-1989    ArticleIdent: Q47765

 CopyBox is a C-extension function for the Microsoft editor that is
 designed to copy square regions of text from one location to another,
 including to another file.

 This function works properly when copying to the same file, but fails
 when copying to another file. The function appears to work
 successfully, but the copied text does not appear in the target file.
 This lack of functionality has been corrected in Version 1.02 of the
 editor.

 You can work around this problem by using the GetLine and PutLine
 functions. A line can be read from the source file, trimmed to get the
 proper portion of the line, and then written to the target file. This
 procedure must be followed for each line of the box to copy.


 131. Getting SYS2070 While Using MEP

 Product Version(s): 1.02
 Operating System:   OS/2
 Flags: ENDUSER | MEP
 Last Modified: 26-SEP-1989    ArticleIdent: Q47767

 Problem:

 When I start MEP, I receive the following error:

      |---------------------------------------------------------------|
      | SYS2070: The system could not demand load the                 |
      | application's segment. MSHELP HELPGETINFO is in error.        |
      | For additional detailed information also see message SYS0127. |
      |---------------------------------------------------------------|
      |                     End the program                           |
      |_______________________________________________________________|

 After selecting "End the program," I receive the following message:

    A non-recoverable error occurred.
    The process ended.

 Response:

 The MEP program is picking up an old version of MSHELP.DLL. The likely
 source is from the OS/2 Presentation Manager Toolkit. To correct this
 problem, replace the old MSHELP.DLL with the current MSHELP.DLL.

 If there is no MSHELP.DLL on the LIB path, then MEP loads and seems to
 function correctly, but there will be no help available.


 132. Possible Explanation for "Cannot Close This Window" Error

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1989    ArticleIdent: Q47770

 Problem:

 Under M Version 1.00 I have two horizontal windows open, each viewing
 separate files. When I attempt to close a window (META+WINDOW or F9+F6),
 I sometimes get the error message "Cannot close this window." Under
 seemingly similar conditions, this error message does not occur and
 the window closes properly.

 Response:

 This message occurs when you attempt to close a window that contains
 modified text. If you want to abandon edits on the file, you can
 reread the file using SHIFT+F7 and then successfully close the window.


 133. ECH.EXE Utility Is Used Internally by the Microsoft Editor

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 26-SEP-1989    ArticleIdent: Q47772

 ECH.EXE is a character echoing utility that is included with the
 Microsoft Editor (M) Version 1.00. This utility is mentioned in the
 appendix of the editor's user guide simply because it is an external
 file.

 The file is used with the Setfile command using wildcards. When
 issuing the command "Arg *.* Setfile", M will use ECH.EXE to display
 the files in alphabetical order. If ECH.EXE is not found in the
 current path, the message "NO MATCHING FILES" is generated.

 If this error message occurs in a subdirectory that does contain
 files, then ECH.EXE is not being found.

 M 1.02 does not use this external file. The utility has been
 incorporated into the editor.


 134. Invoking M or MEP with the /D Switch Prevents Initialization

 Product Version(s): 1.00 1.02 | 1.00 1.02
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | reinitialize
 Last Modified: 26-SEP-1989    ArticleIdent: Q48687

 Invoking the Microsoft M editor with the /D switch to prevent it from
 initializing from the TOOLS.INI file also prevents the Initialization
 function (SHIFT+F8) from reading the TOOLS.INI file.

 There is currently no workaround for this designed limitation other
 than to exit the editor and re-invoke M without using the /D switch.


 135. Microsoft Editor (M) Version 1.02: On-Line Help Not Loaded

 Product Version(s): 1.02
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 26-SEP-1989    ArticleIdent: Q48130

 Trying to access on-line help after initializing (reloading the editor
 settings from TOOLS.INI) generates the following message:

    Online Help Not Loaded

 The following steps will demonstrate the problem:

 1. M (Start the editor, with or without a file.)

 2. F1 (Request on-line help -- success.)

 3. SHIFT+F8 (Initialize editor settings.)

 4. F1 (Request on-line help -- receive error message.)

 Microsoft is researching this problem and will post new information
 as it becomes available.


 136. Invalid Arg Filename Followed By F2 Causes Screen Error

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.00
 Last Modified: 26-SEP-1989    ArticleIdent: Q48871

 When trying to read in a file with the Arg Setfile function, an
 improper filename returns an operating system error. If the Microsoft
 editor (M) is in split-screen mode, any horizontal divider bars are
 lost in MEP. The error contains the two following lines, which cause
 the screen to scroll one position erroneously:

    Next filSYS1041: The name specified is not recognized as an
    internal or external command, operable program, or batch file.

 In M, screen integrity is preserved, but the following error is
 returned:

    Bad command or filename.

 For example, invoke arg (ALT+A) to start an argument and enter about
 20 or so shifted numbers (e.g. ^&%$&^%$^%$#^%$#^%$@%(^&*(*^&&*), and
 then invoke Setfile (F2).

 The screen becomes corrupted and the next keystroke may crash the
 editor with an integer divide by 0 (zero).

 Microsoft has confirmed this to be a problem with the Microsoft Editor
 Version 1.00. We are researching this problem and will post new
 information as it becomes available.


 137. How to Search and Replace Control Characters with M Editor

 Product Version(s): 1.00 1.01 1.02 | 1.00 1.01 1.02
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER |
 Last Modified: 10-OCT-1989    ArticleIdent: Q49010

 To search for and replace control characters with the M editor, use
 the following procedure:

 1. Invoke the search and replace function (CTRL+\).

    The editor prompts with "Query Search String:".

 2. Invoke the quote function (CTRL+P).

 3. Type the control character and press ENTER.

    The editor prompts with "Replace string:".

 4. Invoke the quote function.

 5. Type the control character.


 138. Background Color Greater Than Seven Causes Region to Blink

 Product Version(s): 1.00 1.02 | 1.00 1.02
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 26-FEB-1990    ArticleIdent: Q57585

 It is possible to configure both the background and foreground color
 of the various text items that the Microsoft Editor (M) displays. If
 you attempt to set the background color to a color greater than seven,
 the color region blinks. This behavior, however unusual, is expected,
 and is documented in the "Microsoft Editor for MS OS/2 and MS-DOS
 User's Guide" on Page 87.

 The following M Editor color switches control the colors of various
 text display regions:

    Switch        Controls
    ------        --------

    hgcolor       Background and text color
    hgcolor       Search highlight colors
    infocolor     Information message colors
    selcolor      Cursor highlight colors
    stacolor      Status line colors
    wdcolor       Window border colors

 The following are the colors these switches can be set to:

    Black                 0
    Blue                  1
    Green                 2
    Cyan                  3
    Red                   4
    Magenta               5
    Brown                 6
    Light Gray            7
    Dark Gray             8   Will blink when set to background
    Light Blue            9   Will blink when set to background
    Light Green           A   Will blink when set to background
    Light Cyan            B   Will blink when set to background
    Light Red             C   Will blink when set to background
    Light Magenta         D   Will blink when set to background
    Light Yellow          E   Will blink when set to background
    White                 F   Will blink when set to background

 These colors are set in your TOOLS.INI as follows:

                +------------------- Background Color
                |
                v

    colorswitch:BF <---------------- Foreground Color

 The following example, inserted in your TOOLS.INI, sets the foreground
 and background colors of the editing windows (90 percent of the
 screen):

    fgcolor:62 < ------------------- Green

            ^
            |
            +----------------------- Brown


 139. M Editor Version 1.00 Does Not Clear Compiler Error Buffer

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER  | buglist1.00 fixlist1.02
 Last Modified: 11-OCT-1989    ArticleIdent: Q49536

 When using the compile function from within the editor, the errors
 stored in memory are not cleared. Thus, if you do not go through all
 errors with the nextmsg function, the errors remain even if another
 compile is done. Therefore, if the second compile process does not
 produce any errors, the errors from the previous compile show up and
 put the cursor on an unpredictable line.

 To work around this problem, make sure you look at all of your error
 messages from each compile.

 Microsoft has confirmed this to be a problem with the Microsoft Editor
 Version 1.00. This problem was corrected in Version 1.02 of the
 Editor.


 140. Configuring On-Line Help for M 1.02

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 30-NOV-1989    ArticleIdent: Q49576

 The following is the correct way to configure on-line help for the
 Microsoft Editor (M) Version 1.02 for both MS-DOS (real mode) and
 OS/2 (protected mode).

 Copy files from the distribution disk, as follows:

 1. Under MS-DOS real mode, copy M.HLP and MHELP.MXT to any directory
    specified in the PATH environment variable in the AUTOEXEC.BAT
    file.

 2. Under OS/2 protected mode, copy M.HLP and MHELP.PXT to any
    directory specified in the PATH environment variable in the
    STARTUP.CMD file. Also copy MSHELP.DLL to any directory listed in
    the LIBPATH variable in the CONFIG.SYS file.

 3. For both DOS and OS/2, perform both the preceding steps.

 Other Microsoft products include .HLP files that the editor can
 read. If you want to add additional .HLP files to help, you must
 include the following tagged section in your TOOLS.INI:

 1. Include the following tagged section:

       [M-MHELP]                    ; For DOS real mode

       [MEP-MHELP]                  ; For OS/2 protected mode

       [M-MHELP MEP-MHELP]          ; For both DOS and OS/2

 2. Add the following switch to load in the help files:

       Helpfiles: M.HLP .BAS:C:\QB\QB.HLP .C.H:C:\QC\QC.HLP .PAS:C:\QP\QP.HLP

    This is an example of help files that are loaded upon startup of M
    or MEP. Help searches QB.HLP first when the file has a .BAS
    extension, QC.HLP when the current file has a .C or .H extension,
    and QP.HLP when the current file has a .PAS extension. Please note
    that these help files come with their respective language, not M
    1.02.

 For more information on this topic, refer to the Microsoft Editor for
 MS OS/2 and MS-DOS Operating Systems: User's Guide" that accompanies
 with M 1.02.


 141. Undocumented Switch "Sethelp" for M Version 1.02

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 24-JAN-1991    ArticleIdent: Q50012

 If you have the M (or MEP) Editor version 1.02 configured for online
 help, you can use the undocumented "Sethelp" switch to load additional
 help files within the editor by using the following syntax:

    Arg textarg Sethelp      ;ALT+A textarg ALT+S

 Textarg corresponds to the full pathname of the .HLP file you want to
 load. By default, the sethelp function is mapped ALT+S.

 For example, load the QC.HLP help file that comes with QuickC with the
 following command:

    ALT+A D:\QC\QC.HLP ALT+S

 Now you could place the cursor on printf (or any other C language item
 that is in the Help file) and press F1 to get help on that topic.


 142. Printing Double Quotation Marks from within an M Editor Macro

 Product Version(s): 1.00 1.02 | 1.00 1.02
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 30-NOV-1989    ArticleIdent: Q50223

 To get double quotation marks ("") printed from within a macro in the
 M Editor, use the backslash key (\) followed by the double quotation
 marks (""). The following example (placed in the correct section of
 the TOOLS.INI file) demonstrates how this is done:

    text:=arg "say \"hello\"" paste
    text:alt+z

 In this case, pressing ALT+Z inserts the following string into your
 text, with the double quotation marks around the word hello.

    say "hello"


 143. Controlling the Use of Tabs in the Microsoft Editor

 Product Version(s): 1.00 1.02 | 1.00 1.02
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 30-NOV-1989    ArticleIdent: Q50588

 The Microsoft Editor (M) provides the following two ways of using tab
 characters:

 1. Treat tabs as real characters.

 2. Convert each tab into a series of spaces. This is controlled
 through the use of the "realtabs" switch. Other switches may also
 effect the way tabs appear to be handled by the editor.

 The following chart, taken from Section 7.2.6 of "Microsoft Editor for
 MS OS/2 and MS-DOS User's Guide" describes the switches dealing with
 tabs.

 1. realtabs

    On by default, controls whether or not tabs are treated as real tab
    characters.

 2. entab

    Controls the extent to which the editor converts a series of tabs
    and spaces to tabs when saving a file. The following are the valid
    choices:

       0 - The editor does not replace spaces by tabs. If realtabs is off,
           tabs are converted to spaces.

       1 - (default) The editor can replace a series of tabs and spaces by
           tabs when the tabs fall outside of quoted strings.

       2 - The editor will replace all series of tabs and spaces with
           tabs.

    Note: The entab switch only effects the lines you modify during the
    current editing session.

 3. filetab

    Controls the meaning of tab characters on a disk file. If realtabs
    is on, the filetab switch determines tab alignment. If realtabs is
    off, the filetab switch determines how the editor translates tab
    characters to spaces when a line of text is modified.

    If entab, as described above, is set to 1 or 2, filetab also
    determines how the editor translates spaces to tabs when you save
    the file to disk.

    Note: The filetab switch only effects the lines you modify during
    the current editing session.

 4. tabalign

    When off (the default), the cursor may be placed anywhere inside a
    column of a tab character. If turned on, along with realtabs, the
    cursor is placed to the first column position of tab characters.

 5. tabstops

    Determines the size of columns associated with the TAB and BACKTAB
    ( SHIFT+TAB) keys. This only moves the cursor and has no effect on
    the actual tab character. The default value is 4.

    The following example sets up tabs so that they act the same way
    they do in other editors, such as QuickC or Word:

       realtabs:yes
       tabalign:yes
       graphic:tab
       trailspace:yes
       filetab:4

 The trailspace switch is needed to use tabs on blank lines. The
 tabdisp switch may also be used with realtabs to make the tab
 characters visible on the screen.


 144. Mhelp Function Is Always Assigned to SHIFT+F1

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 17-JUL-1990    ArticleIdent: Q50642

 In the Microsoft Editor (M) Version 1.02, the mhelp function is like
 any other function that can be assigned to any key. However, mhelp is
 always assigned to SHIFT+F1 unless this key is unassigned using the
 unassigned keyword in the m-mhelp block of the TOOLS.INI file.

 It is perfectly acceptable to assign the mhelp to any key, and it will
 work properly with that keystroke. However, in addition to the newly
 assigned key, the mhelp function is always assigned to SHIFT+F1. This
 assignment can be taken out by placing the following line in the
 [M-MHELP] section of the TOOLS.INI file:

    [M-MHELP]
    unassigned:shift+f1


 145. Adding helpwindow in TOOLS.INI as a Switch

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 30-NOV-1989    ArticleIdent: Q50644

 To get the Microsoft Editor (M) to recognize helpwindow as a switch in
 the TOOLS.INI file, the switch must be under the [M-MHELP] or
 [MEP-MHELP] tag section. The example below shows what a TOOLS.INI file
 might look like:

    [M-MHELP MEP-MHELP]
    nohelpwindow:

    [M MEP]
      .
      .

 The helpwindow switch can also be set in the environment by typing the
 following:

    <arg> nohelpwindow: <assign>


 146. Searching in the M Editor with Regular Expressions

 Product Version(s): 1.00 1.02 | 1.00 1.02
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 30-NOV-1989    ArticleIdent: Q51324

 Question:

 When using the M Editor, every time I execute a search command using a
 Regular Expression, the editor takes the command literally and doesn't
 recognize the textarg as a Regular Expression. How can I get this
 search to work?

 Response:

 The correct method is as follows:

       arg arg textarg <search_function>

               arg -> ALT+A
           textarg -> A Regular Expression (i.e., ^S[te].*end)
 <search_function> -> Psearch, Msearch, Replace, Qreplace

 For more information, see Chapter 5, Pages 51-63, in the "Microsoft
 FORTRAN Microsoft Editor User's Guide."


 147. mgreplist Incorrectly Documented As megreplist in Example

 Product Version(s): 1.02
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 15-MAR-1990    ArticleIdent: Q51622

 The examples given on Pages 180 and 181 of the FORTRAN "Microsoft
 Editor User's Guide" incorrectly identifies the megreplist command as
 mgreplist. The documentation shows the following:

    megreplist:="DATA.FIL *.FOR $INCLUDE:*.H"

 This should be the following:

    mgreplist:="DATA.FIL *.FOR $INCLUDE:*.H"

 The megreplist macro does not exist and should be changed to
 mgreplist.

 The example above sets mgreplist to a series of files to be searched
 when Mgrep is called. If the textarg string (specified as an argument
 to Mgrep) is found in any of these files, the instance will be
 reported in the pseudo file <compile>. All succeeding calls to Mgrep
 will reset this file.

 The following are the files that are searched in the above example:

 1. DATA.FIL.

 2. Any file in the current directory with a .FOR extension.

 3. Any file along the INCLUDE environment variable path with a .H
    extension.


 148. C Extensions: Link Errors on __acrtused and _main Explained

 Product Version(s): 1.00    | 1.02
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER |
 Last Modified: 21-DEC-1989    ArticleIdent: Q51636
 Question :

 I am writing a C extension for the Microsoft Editor (M). When I link,
 I get the following error message:

    c:\usr\lib\CLIBCE.LIB(dos\crt0.asm)
            error  L2044:  __acrtused
            symbol multiply defined, use /NOE  pos
            1CC Record type: 53E4

    LINK : error L2029: Unresolved externals:
    _main in file(s):  c:\usr\lib\CLIBCE.LIB(dos\crt0.asm)
    Two errors were detected.

 I am compiling and linking as follows:

    cl /c /Gs /Asfu c_extension.c
    link /NOI /NOE exthdr.obj c_extension.obj, c_extension;

 These options seem to be correct according to the Editor manuals. Why
 am I getting these linker errors?

 Response:

 The linker gives these error messages if you are linking with a
 run-time function that must be initialized from the C start-up source
 code. This start-up source code is not used within a C extension.

 The art of writing C extensions for M Version 1.00 is documented in
 Chapter 8 of the Editor section of the "CodeView and Utilities,
 Microsoft Editor, Mixed-Language Programming Guide," which is included
 with C 5.00, C 5.10, Pascal 4.00, FORTRAN 4.10, and MASM 5.10.
 References to M Version 1.02 extensions are discussed in Chapter 8 of
 the "Microsoft Editor User's Guide," which came with FORTRAN 5.00.

 Please contact Microsoft Product Support Services at (800) 454-2030 to
 obtain an application note that discusses further techniques of writing C
 extensions for the Microsoft Editor.


 149. U1013 Link: Error 2: Not Enough Memory for Exec in M

 Product Version(s): 1.00 1.02
 Operating System:   MS-DOS
 Flags: ENDUSER | s_nmake s_make
 Last Modified: 23-JAN-1991    ArticleIdent: Q57653

 Question:

 In DOS, I am spawning either MAKE or NMAKE within the Microsoft Editor
 (M), and I receive an error message from the Editor on the status line
 saying "U1013 : Link file.obj: Error 2." What does this error mean and
 how do I get around it?

 Response:

 The U1013 error means that one of the procedures called by MAKE or
 NMAKE returned a nonzero error code. In this case, the error can be
 understood as M's equivalent of a "Not enough memory for exec" error,
 meaning that there is not enough memory for the parent process to
 execute a child process. The error typically occurs when you spawn
 either MAKE or NMAKE from within the Editor, the compilation is
 complete, and the link process is beginning.

 If you receive this error, you may be able to free up memory by
 removing any TSRs and unnecessary device drivers. However, the best
 workaround would be to use MAKE or NMAKE to link your file outside of
 M, because M will have problems exec'ing the linker in any sizable
 application due to the size of LINK and MAKE.


 150. Mgrep Can Skip Occurrences of Pattern When Using Mgreplist

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.02
 Last Modified: 16-JAN-1990    ArticleIdent: Q57705

 "Mgrep" may find every other occurrence of a search string when used
 to search a list of input files defined my the "mgreplist" macro.

 Mgrep searches all files defined by the mgreplist macro, then writes
 the location of a match to the <compile> pseudo file. When using
 either regular expression search patterns or standard search strings,
 mgrep may post every other occurrence of the matched string to the
 <compile> pseudo file. This also causes SHIFT+F3 to display every
 other match in the file being searched.

 To see the problem, set the mgreplist:="test.dat" where TEST.DAT
 contains the following:

    #include1
    #include2
    #include3
    #include4
    #include5
    #include6
    #include7
    #include8
    #include9
    #include10
    #include11
    #include12

 Invoke the mgrep search on the string "include" and then press
 SHIFT+F3 to view the next match. You will see that only every other
 occurrence of "include" is found. Also, if you view the <compile>
 pseudo file it will only contain a list every other occurrence of
 "include".


 151. M "Keyboard" Switch Doesn't Work As Documented

 Product Version(s): 1.02
 Operating System:   MS-DOS
 Flags: ENDUSER | S_FORTRAN buglist1.02
 Last Modified: 20-JAN-1990    ArticleIdent: Q57750

 The Microsoft Editor (M) Version 1.02 "keyboard" switch, documented on
 Page 198 of the the "Microsoft Editor User's Guide for MS OS/2 and
 MS-DOS Operating Systems," does not work as documented.

 The switch was implemented to allow control of which BIOS keyboard
 calls are used to get keystrokes. The "compatible" setting uses the
 standard INT 16H, AH = 0 to get keystrokes. The "enhanced" setting
 uses INT 10H, allowing the F11 and F12 keys to be read, and allowing
 you to use old versions of packages that may fail when your keyboard
 is treated as enhanced.

 If you set the "keyboard" option in your TOOLS.INI file by adding a
 line reading

    keyboard:"compatible"

 and then bring up the editor, M accepts the setting, but fails to set
 correctly. If you press SHIFT+F1 for help and choose Current
 Assignments, the list of current key assignments is given. The
 keyboard switch will now be set to the following:

    keyboard::enhanced

 Note the double colon, and that the compatible option has been
 changed to enhanced.

 If you try to set the option within the editor by entering the
 following, the editor returns the same options as above:

    ALT+A keyboard:compatible ALT+=

 Microsoft has confirmed this to be a problem in the Microsoft Editor
 Version 1.02. We are researching this problem and will post new
 information here as it becomes available.


 152. Incorrect Message from "searchall" with Regular Expressions

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | M MEP buglist1.02
 Last Modified: 23-JAN-1990    ArticleIdent: Q57932

 The Microsoft Editor searchall function (that is, SHIFT+F6) may return
 the following invalid error message when using regular expressions:

    +'pattern' not found

 'pattern' is the actual regular expression for which the search was
 requested.

 In this situation, searchall still finds all occurrences of the search
 pattern correctly -- only the message is incorrect.


 153. Version 1.02 of M and MEP Incorrectly Reports Version As 1.2

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 26-FEB-1990    ArticleIdent: Q58687

 If you access help for the Microsoft Editor (M/MEP) Version 1.02, the
 version is incorrectly displayed as 1.2, rather than 1.02. This
 incorrect version number appears in both the internal online help and
 when invoking help from the command line with the /? switch.

 The following information is incorrectly displayed when using the /?
 command-line switch for help:

    Microsoft (R) Editor Version 1.2
    Copyright (C) Microsoft Corp 1987-1989. All rights reserved
    Usage: [/D] [/e cmd-string] [/m mark] [/r] [[/t] filename]*


 154. Quote Function (CTRL+P) Can Fail to Work Properly

 Product Version(s): 1.00 1.02 | 1.00 1.02
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist1.00 buglist1.02
 Last Modified: 26-FEB-1990    ArticleIdent: Q58720

 The Quote function (CTRL+P) in conjunction with CTRL+I or CTRL+T fails
 to display the valid character associated with that key sequence. For
 CTRL+P with CTRL+I, a space character (Hex 20) results instead of the
 correct foreground color rectangle with a background color dot (hex
 09). For CTRL+P with CTRL+T, a lowercase "a" with an accent mark (hex
 A0) results instead of the paragraph sign (hex 14).

 The Quote function reads one keystroke from the keyboard and treats it
 literally. This is useful for inserting text into a file that happens
 to be assigned to an editor function. For example, the key sequence
 Quote (CTRL+P) CTRL+A displays a happy face character.

 For the Quote CTRL+I sequence, the only workaround is to use a Quote
 TAB key sequence. This puts the correct hex value in that position
 (09H), but the correct character is not displayed and the tab is
 treated as a tab by the M Editor.

 For the Quote CTRL+T sequence, there is no workaround.

 Microsoft has confirmed this to be a problem with the M Editor Versions
 1.00 and 1.02. We are researching this problem and will post new
 information here as it becomes available.



 155. Replacing Normal String Takes Longer Than Regular Expression

 Product Version(s): 1.00 1.02 | 1.00 1.02
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist1.00 buglist1.02
 Last Modified: 15-MAR-1990    ArticleIdent: Q59085

 Replacing a regular expression takes less time than replacing a normal
 string in the Microsoft M Editor, Versions 1.00 and 1.02. To
 demonstrate the time difference, perform test replacements in the
 following manner:

 1. Load the M Editor with a large file -- greater than 5000 lines.

 2. Perform and time a replacement on a regular expression, one that
    fails to match in the file, for example:

       arg arg CTRL+L     zzzz   <- search for this regular expression
                          zzzz   <- replace with this regular expression

 3. Perform and time a replacement on a normal string (one that fails
    to match in the file), for example:

       arg CTRL+L     zzzz   <- search for this string
                      zzzz   <- replace with this string

 The string replacement may take twice as long as the
 regular-expression replacement. To obtain the higher replace speed,
 use the regular-expression replacement (arg arg CTRL+L) even when you
 are not fully using the regular-expression syntax.

 Note that a psearch on a regular expression psearch is NOT quicker
 than a psearch on a normal string.

 Microsoft has confirmed this to be a problem in Versions 1.00 and
 1.02. We are researching this problem and will post new information
 here as it becomes available.

 For details on regular expression, refer to the "Microsoft Editor
 User's Guide," Chapter 5, "Regular Expressions."


 156. Incorrect Version Numbers Cause Tagged Sections to Be Ignored

 Product Version(s): 1.00 1.02 | 1.00 1.02
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | pwb
 Last Modified: 25-MAY-1990    ArticleIdent: Q59256

 With the Microsoft Editor (M) or the Programmers WorkBench (PWB), it
 is possible to include information in your TOOLS.INI file that is
 specific to the operating system you are using. For information on how
 to create sections with tags, see the "Microsoft Editor User's Guide,"
 Section 7.5.1. However, you must be sure to include a trailing 0
 (zero) on the label for OS/2 versions 1.10 or 1.20. Failure to do so
 causes these sections to be ignored by the Editor.

 The following headers cause the tagged sections to be ignored when
 running under OS/2 version 1.10:

    [M-10.0 M-10.1]
    fgcolor:0B
    hgcolor:30
    stacolor:0E

    [M-3.30 M-10.0R M-10.1R]
    fgcolor:0E
    hgcolor:E0
    stacolor:0B

 The tags must be rewritten as follows:

    [M-10.0 M-10.10]
    fgcolor:0B
    hgcolor:30
    stacolor:0E

    [M-3.30 M-10.0R M-10.10R]
    fgcolor:0E
    hgcolor:E0
    stacolor:0B

 Furthermore, the tagged sections must not be placed in the middle of
 an [M] or [M MEP] tagged section. They must be placed before or after
 the [M] or [M MEP] sections. Failure to do this causes information
 located below these sections to be ignored in the DOS compatibility
 box.

 Note: For the PWB, the above examples would change to PWB-xxxx instead
 of M-xxx.


 157. Unassigning Help Keystrokes Must Be Done Under

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 13-MAR-1990    ArticleIdent: Q59494

 It is possible with the Microsoft Editor Version 1.02 to disable
 an assigned keystroke so that it invokes no editor function at all.
 The keystroke can then be assigned to any other function or macro. By
 putting the disable information in the M Editor section of the
 TOOLS.INI file, the changes will be in effect whenever the Editor is
 invoked. For further information, see the Version 1.02 edition of
 "Microsoft Editor User's Guide," Section 6.2.3, Page 70.

 To regularly disable a keystroke that has been assigned to any preset
 Editor HELP function, such as F1 or SHIFT+F1, the command must be
 placed under the [M-MHELP MEP-MHELP] tag in TOOLS.INI -- not under the
 [M MEP] tag.

 For example, to disable the keystroke for F1, include the following
 line in your TOOLS.INI file:

    unassigned:F1

 Placing this line under the section tagged [M MEP] rather than the
 [M-MHELP MEP-MHELP] tag causes this command to be ignored. This is
 also applicable to the undocumented "sethelp" function, whose default
 keystroke is ALT+S. You can unassign ALT+S, as well as reassign a
 different keystroke to "sethelp", but it must be done under the
 [M-MHELP MEP-MHELP] tag.


 158. Using RIGHT ARROW on Dialog Line Locks Keyboard or GP Faults

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.02
 Last Modified: 15-MAY-1990    ArticleIdent: Q59527

 Manipulating text on the dialog line must be handled differently in
 the Microsoft Editor (M) Version 1.00 than in 1.02. If you use an M
 Version 1.00 procedure in M Version 1.02 under DOS, the keyboard will
 lock up and alternating screens of jumbled characters may appear on
 the screen. Under OS/2, you will get a GP fault resulting in the
 termination of MEP by the operating system.

 The problem can be observed by using the following steps from within
 the editor:

 Note: Remember that under DOS your machine will hang!

 1. Press ALT+A to invoke the <arg> function.

 2. Type any character (for example, the letter "d").

 3. Hold down the RIGHT ARROW key. When the text in the dialog line has
    scrolled off the left side of the screen, in M 1.00 the editor will
    issue a beep. In M 1.02, the machine will lock in DOS or GP fault
    in OS/2. This problem occurs even if you omit Step 2, but it is
    more difficult to see the error.

 To retain the same functionality in M 1.02, instead of using the RIGHT
 ARROW key to move the cursor to the right, use the SPACEBAR. Using
 the SPACEBAR rather than the RIGHT ARROW key allows you to take
 advantage of the maximum arg line limit without the error.

 Microsoft has confirmed this to be a problem in Version 1.02. We are
 researching this problem and will post new information here as it
 becomes available.


 159. Reference to "Push" Function Incorrect Editor User's Guide

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 17-JUL-1990    ArticleIdent: Q60339

 On Page 61 of the "Microsoft Editor User's Guide" for Microsoft C
 5.10, there is a documentation error. It is stated that the Boolean
 switch Savescreen is "for use with the Push and Exit functions." Since
 there is no "Push" function, this should read "for use with the Shell
 and Exit functions."


 160. Prototype in User's Guide for tglcase() Is Incorrect

 Product Version(s): 1.02    | 1.02
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 15-APR-1990    ArticleIdent: Q60487

 In the sample program for a C extension on Page 126 of the "Microsoft
 Editor User's Guide" for Microsoft FORTRAN 5.00 and Microsoft BASIC
 PDS Version 7.00, the prototype for tglcase() is incorrect.

 The function is prototyped as follows:

    flagType pascal EXPORT tglcase (unsigned int, ARG far *, flagType);

 It should be as follows:

    flagType pascal EXTERNAL tglcase (unsigned int, ARG far *, flagType);

 Note: The word EXTERNAL replaces EXPORT.


 161. Creating a Compile Window Macro for the M Editor Version 1.02

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 27-JUL-1990    ArticleIdent: Q63950

 The macro below creates a "compile window" in either the M or MEP
 Editor version 1.02 when you press ALT+C. Note that a compile window
 is helpful for viewing general compilation errors and errors generated
 from utilities that were invoked.

 The following macro, CompWindow, can be added to the [M] or [MEP]
 tagged section of the TOOLS.INI file to create a compile window:

    CompWindow:= savecur home meta down  \
                 up up up up arg window  \
                 window arg "<compile>" setfile  \
                 window restcur

    CompWindow: alt+c

 The CompWindow macro above creates a compile window by performing the
 following steps:

 1. Use the "savcur" function to save the current position of the
    cursor.

 2. Use the "home" function to place the cursor in the upper-left
    corner of the screen. This function guarantees that the cursor will
    be in a left-most position when the compile window is created.

 3. Use the "meta down" function to move the cursor to the bottom of
    the window without changing the column position.

 4. Use "up up up up arg window" functions to create a horizontal
    window four lines above the bottom of the screen. A larger compile
    window can be created by adding more "up" functions to this line in
    the macro.

 5. Use the 'arg "<compile>" setfile' function to create a
    dynamic-compile log. More information concerning the
    dynamic-compile log can be found on Pages 47-48 of the "Microsoft
    Editor User's Guide."

 6. Finally, the original position of the cursor is restored in the
    original window by using the "window restcur" functions.

 7. The macro is assigned to the ALT+C keystroke, although any unused
    keystroke may be used.

 Error messages will now be displayed in the compile window when
 running a compilation or invoking a utility.


 162. C 6.00 UNDEL.EXE Is Not Compatible with the Microsoft Editor

 Product Version(s): 1.00 1.02 | 1.00 1.02
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 25-JUL-1990    ArticleIdent: Q64024

 If backup copies of files are stored in the \DELETED subdirectory by
 the M Editor, typing "undel" should bring up a listing of backup
 copies. However, if the C 6.00 version of UNDEL.EXE is used, the
 following message will be displayed: "

    0(0) bytes in 0 deleted files.

 The C 5.10 version of UNDEL.EXE will successfully bring up a listing
 of backup copies saved by either the M Editor or the Programmer's
 WorkBench (PWB).

 This problem can be reproduced by setting the text backup switch in
 the M section of the TOOLS.INI file to "undel". After saving various
 copies, backups are added to the \DELETED subdirectory and a listing
 can be brought up by using the C 5.10 UNDEL.EXE. Using the C 6.00
 version of UNDEL.EXE causes the erroneous message listed above to be
 displayed. This incompatibility was caused by adding OS/2 version 1.20
 filename support to UNDEL.EXE and EXP.EXE.

 As a workaround, rename the C 5.10 UNDEL.EXE to UNDEL51.EXE and the C
 6.00 UNDEL.EXE to UNDEL60.EXE.


 163. Invalid Switch and Extensions in Brief Emulation

 Product Version(s): 1.02   | 1.02
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  6-FEB-1991    ArticleIdent: Q67762

 The M editor version 1.02 comes with a BRIEF.INI file, which contains
 the key settings for Brief emulation. If you want Brief emulation, you
 must rename this file to "TOOLS.INI". This file will generate the
 following three messages when M loads the TOOLS.INI file during
 initialization:

    mhctx is not an editor switch
    load:$PATH:ulcase - no such file or directory
    load:$PATH:justify - no such file or directory

 The messages are caused by the following three lines:

    Line 223: "mhctx:Alt+H"
    Line 263: "load:$PATH:ulcase"
    Line 369: "load:$PATH:justify"

 Deleting these three lines will not change the performance of the M
 editor, and will eliminate the messages they cause when M is
 initialized.






 Microsoft NMake [Make Utility]
 =============================================================================


 1. NMAKE and the Backslash "\" Character

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  3-MAY-1989    ArticleIdent: Q43064

 The backslash "\" character in NMAKE has two different meanings
 depending on how it is used. One of its uses is as a line-continuation
 character. The other use is as a path specifier.

 The primary use of "\" is as a line continuation-character. For
 example, if you have a dependency line that extends more than one
 line, use the "\" character to continue to the next line. It is
 correct to include a space prior to the "\" or to append it to the
 last dependent, as in the following examples:

 FOO : obj1 obj2 obj3 obj4 obj5 \  (CORRECT)
 obj6 obj7...etc.

 FOO : obj1 obj2 obj3 obj4 obj5\   (CORRECT)
 obj6 obj7...etc.

 The "\" character is also used as a path specifier. When "\" is the
 last character on the line and is meant as a path specifier, you must
 precede it with the caret "^" character to tell NMAKE to override its
 meaning as a line-continuation character.

 The following macro definition is an example demonstrating the use of
 "\" as a path specifier:

 exe_dir = c:\bin^\    (CORRECT)

 exe_dir = c:\bin\     (INCORRECT)

 The following will be interpreted as a line-continuation character.

 exe_dir = c:\bin\     (INCORRECT)

 Preceding the "\" with another "\" will nullify the meaning as a
 line-continuation character. However, when this macro is expanded,
 both backslashes will appear, producing an incorrect path.


 2. NMAKE Is Case Sensitive

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-MAY-1989    ArticleIdent: Q43999

 It is not clearly stated in the manual that NMAKE IS case sensitive.
 Case sensitivity is imposed on the following:

 1. Macros

    For instance, if you define "TEXT" as a macro, you must use $(TEXT)
    to insert it. If $(text) is used, the macro is undefined and
    nothing happens.

 2. Predefined Macros (.SUFFIXES;.PRECIOUS, CC, etc.)

    Predefined macros such as .SUFFIXES must be in all in uppercase
    letters. If you use .suffixes, NMAKE returns the error ".suffixes
    too long: truncated to 8.3".

 3. File extensions

    When adding file extensions to the .SUFFIXES list, you must
    preserve case. For example, to add the file extension .dll to the
    suffix list, you would put the following line in your makefile:

       .SUFFIXES : .dll

    Then, all files with the .dll extension must have the .dll
    extension in lowercase letters.


 3. NMAKE Uses "makefile " Ignoring File Name on Command Line

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | S_QuickC
 Last Modified: 10-NOV-1989    ArticleIdent: Q44777

 When using NMAKE, you normally put the makefile's name on the command
 line as follows:

    NMAKE test.mak

 Although this works correctly for most cases, if there is a file named
 "makefile." in the current working directory, NMAKE uses that file
 instead of the one specified on the command line.

 To be sure NMAKE uses the makefile specified on the command line, you
 must have a /F switch before the makefile name as follows:

    NMAKE /F test.mak

 This is expected behavior, as documented on Page 156 of the "Microsoft
 QuickC ToolKit" manual for QuickC Version 2.00.


 4. Modifications for an Existing Make File Used with MAKE

 Product Version(s): 1.00   | 1.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_quickc  s_c  h_FORTRAN
 Last Modified: 16-JAN-1990    ArticleIdent: Q44130

 Question:

 What modifications need to be made to an existing make file that was
 used with MAKE, and why?

 Response:

 To use NMAKE on make files originally designed for MAKE, the first
 descriptor block (target:dependent) must be a pseudotarget (see QuickC
 Version 2.00 ToolKit, Sections 7.3.5 and 7.5) that lists all of the
 original make targets in the file as the dependent files. The
 following is an example:

    ALL : test.exe test1.exe test2.exe

 The reason you must include a pseudotarget descriptor block as the
 first descriptor block in a make file is that the previous MAKE
 utility tested EACH descriptor block sequentially throughout the file.
 NMAKE, however, tests only the FIRST descriptor block unless targets
 are specifically listed on the NMAKE command line. By using a
 pseudotarget, ALL in the above example, NMAKE must now assume
 that each dependent is out of date and attempt to make it. NMAKE now
 searches the make file for each dependent file listed (test.exe,
 test1.exe, and test2.exe) to see if a descriptor block exists for it.
 This causes NMAKE to behave just like MAKE.

 Example:
 -------

    ALL : test.exe test1.obj

    test1.obj : test1.c
            cl /c test1.c

    test.exe : test.obj test1.obj
            link test test1;

 Without the pseudotarget, NMAKE tests only the first descriptor block
 and ignores any following descriptor block.


 5. How to Specify Paths in Inference Rules in NMAKE

 Product Version(s): 1.00   | 1.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_quickc  s_c  h_FORTRAN
 Last Modified: 23-MAR-1990    ArticleIdent: Q44131

 Question:

 How to I specify paths in inference rules?

 Response:

 Note: For a complete description of this feature, see QuickC Version 2.00
 Toolkit, Section 7.3.3. One of the most powerful new features of
 NMAKE is that it allows paths to be specified in an inference rule.

 The syntax of an inference rule without paths is as follows:

    .fromext.toext:

 This syntax is somewhat limited, however, because both the "fromfile"
 and the "tofile" are evaluated as if they existed in the current
 directory. With NMAKE, a path specifier may be added to an inference
 rule by doing the following:

    {frompath}.fromext{topath}.toext:

 Note: If you use a path on one element of the inference rule, you must
 use it on both. For instance, if you want to compare any .c file in
 the current directory with its .obj file in my object directory, the
 inference rule would look like the following:

 {.}.c{c:\objects}.obj:
         cl /c $<;

 Note that the fromext (.c) has to be preceded with a path. In the case
 of the current directory, the ".", or current directory works nicely.

 When NMAKE encounters a descriptor block that has no commands
 following, it will look for an inference rule that matches the
 descriptor block. When checking for matching, NMAKE expects that the
 base name of both the target and the dependents be the same. Also, the
 paths must match exactly. In other words, the following descriptor
 line would not use the inference rule just defined because the paths
 do not match on the .obj file:

    test.obj : test.c

 In this case, the predefined inference rule for .c.obj: would be
 invoked. To invoke the inference rule just defined, the descriptor
 line would be as follows:

    c:\objects\test.obj : test.c


 6. Multiple Targets in NMAKE Do Not Work

 Product Version(s): 2.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist2.00 docerr S_QUICKC
 Last Modified:  2-JUN-1989    ArticleIdent: Q44757

 Multiple targets in the QuickC Version 2.00 NMAKE utility do not work
 properly. The example on the top of Page 167 of the "Microsoft QuickC
 Tool Kit" manual shows that each target listed before the dependencies
 should be evaluated; however, only the first target is evaluated, and
 the others are ignored. Make files that are simplified even more
 respond the same way.

 The following make file demonstrates the problem:

     target1.exe target2.exe: depend1.obj depend2.obj
         echo $@

 For the make file to work properly, change the file to the
 following:

     BUILD: target1.exe target2.exe

     target1.exe: depend1.obj depend2.obj
         echo $@

     target2.exe: depend1.obj depend2.obj
         echo $@

 Microsoft has confirmed this to be a problem in QuickC Version 2.00.
 We are researching this problem and will post new information as it
 becomes available.



 7. Modifying a QuickC 2.00 Make File to Run MAKE

 Product Version(s): 1.00   | 1.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_quickc  s_c  h_FORTRAN
 Last Modified: 26-MAY-1989    ArticleIdent: Q44133

 Question:

 What modifications must I make to a make file generated by QuickC
 Version 2.00 so that I can run NMAKE on it and use my Microsoft C
 Version 5.10?

 Response:

 Only a few modifications must be made to allow a make file generated
 by QuickC to invoke C Version 5.10. The following three items need to
 be changed:

 1. Change the CC macro from qcl to cl. To do this, locate the
    following line in the make file generated by QuickC and change qcl
    to cl:

       CC=qcl

 2. Take out references to ilink. The ilink references are embedded
    into your make file if you have the ilink option turned on in your
    environment. The following line in the make file

       ilink -a -e "link $(LFLAGS) @$(PROJ).crf" $(PROG)

    must be changed to the following:

       link "$(LFGLAGS) @$(PROJ).crf" $(PROG)

 3. Remove any compiler switches in the make file that cl will not
    recognize. To eliminate this problem, turn off incremental compile
    in the QuickC environment prior to making the make file.


 8. NMAKE Version 1.00 with "!" and User and Predefined Macros

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | S_QuickC buglist1.00 fixlist1.01
 Last Modified: 30-NOV-1989    ArticleIdent: Q48859

 The following NMAKE file does not produce the correct results when
 using NMAKE Version 1.00, which is supplied with the Microsoft QuickC
 compiler Version 2.00. The file replaces the user-defined macro in the
 second command line with the predefined macro in the first command
 line. The workarounds are as follows:

 1. Remove the "!" at the beginning of the first command line, which
    causes the command to be executed for each dependent file if the
    command uses one of the special macros $? or $**.

 2. Do not use a predefined macro for the first command.

 3. Do not use the predefined macro $**, a complete list of dependent
    files, for the dependent files in the first command line.

 4. Do not use a user-defined macro in the second command line.

 5. Update to the Microsoft QuickAssembler package, which is shipped
    with NMAKE Version 1.01, in which this problem is corrected.

 More information on the NMAKE utility can be found starting on Page
 155 of the "Microsoft QuickC Toolkit" manual. The following is the
 NMAKE file that fails:

 SOURCE=test.c

 test.exe: $(SOURCE)
     !$(CC) $**
     copy $(SOURCE) new

 This produces the following output:

 cl test.c
 copy cl new

 The following is the NMAKE file with the first workaround:

 SOURCE=test.c

 test.exe: $(SOURCE)
     $(CC) $**
     copy $(SOURCE) new

 This produces the following correct output:

 cl test.c
 copy test.c new

 The following is the NMAKE file with the second workaround:

 SOURCE=test.c

 test.exe: $(SOURCE)
     !cl $**
     copy $(SOURCE) new

 This also produces the correct output.

 The following is the NMAKE file with the third workaround:

 SOURCE=test.c

 test.exe: $(SOURCE)
     !$(CC) $(SOURCE)
     copy $(SOURCE) new

 This also produces the correct output.

 The following is the NMAKE file with the fourth workaround:

 SOURCE=test.c

 test.exe: $(SOURCE)
     !$(CC) $(SOURCE)
     copy test.c new
     copy $(SOURCE) new

 This produces the following output:

 cl test.c
 copy test.c new
 copy test.c new


 9. Incrementally Updating Libraries with NMAKE

 Product Version(s): 1.00 1.01 1.10 1.11 1.12 | 1.11 1.12
 Operating System:   MS-DOS                   | OS/2
 Flags: ENDUSER |
 Last Modified: 25-FEB-1991    ArticleIdent: Q48862

 The repetition modifier "!" (without the quotation marks) provided in
 NMAKE allows libraries to be maintained and incrementally updated very
 easily. By using this modifier with the special macro for dependents
 out-of-date with the target (for example, "$?"), the library update
 becomes an automated part of modifying a project.

 The following NMAKE makefile keeps FOO.LIB up-to-date based on the
 four object files listed in the OBJS macro. These object files can be
 based on C or assembly source files. The list of source-file types can
 be extended by adding the appropriate inference rules to the
 description file.

 Sample NMAKE Makefile
 ---------------------

     #
     # List of object files to be kept in library
     #
     OBJS = foo1.obj foo2.obj foo3.obj foo4.obj

     .c.obj:
         cl /c $?

     .asm.obj:
         masm $?;

     foo.lib : $(OBJS)
         !lib foo.lib -+ $?;

 The command for the library dependency line uses a predefined macro
 and a special NMAKE directive. Placing "$?" on the end of the LIB line
 expands to the list of all dependents that are out-of-date with the
 target. This list combined with "!" causes the LIB line to be executed
 once for each member in the list.

 If FOO1.OBJ and FOO3.OBJ are out-of-date with respect to FOO.LIB, "$?"
 evaluates to "FOO1.OBJ FOO3.OBJ". With "!", the following commands are
 executed:

    lib foo.lib -+ foo1.OBJ;
    lib foo.lib -+ foo3.OBJ;


 10. Explanation of Why NMAKE May Not Produce .OBJ and .EXE Files

 Product Version(s): 1.00 1.10 1.11 | 1.00 1.11
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER |
 Last Modified: 27-OCT-1989    ArticleIdent: Q49502

 Question:

 When using the NMAKE utility, no warnings occur and the compiler
 appears to execute properly; however, the .OBJ and .EXE files are not
 created.

 If I use the MAKE utility on the same .MAK file, I get the following
 two warnings:

    warning U4000: Target does not exist.

    warning U4001: Dependent does not exist; Target not built.

 The first warning message is a standard warning that I would expect.
 Why is there a second and why aren't the .OBJ and .EXE files created?

 Response:

 Remove unexpected trailing characters from the .MAK file.

 This problem can occur because extra characters occur at the end of a
 line within the .MAK file. Common mistakes such as placing a trailing
 semicolon in the CL compile line or in the dependency line can cause
 this behavior. This applies to any unexpected characters, not just
 semicolons.

 The following example demonstrates the problem:

    file.obj: file.c <ENTER>
       CL /c /Lp file.c;  <-- Semicolon CANNOT be used with the CL command.

    file.exe: file.obj <ENTER>
       LINK file;      <-- OK, Semicolon CAN be used with the LINK command.

 Removing the semicolon at the end of the CL line eliminates the
 problem.


 11. Command Line Too Long in Makefile Can Cause Error: U1082

 Product Version(s): 1.00 1.01 1.10 1.11 1.12 | 1.11 1.12
 Operating System:   MS-DOS                   | OS/2
 Flags: ENDUSER | s_make
 Last Modified: 24-JAN-1991    ArticleIdent: Q49757

 NMAKE and MAKE require that all commands issued after a target
 dependency are less than the DOS command-line limit of 128 characters.
 If the command is too long, you may receive the following error

    U1082:  Not enough memory '...' cannot execute '...'

 where '...' is the command that was attempted. This problem most
 likely occurs with the link command line and can be easily resolved
 with a response file. Response files are documented in the utilities
 manual or the online help supplied with each compiler.


 12. Special Macros Not Recognized in NMAKE Inline Files

 Product Version(s): 1.00 1.01 | 1.00 1.01
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER |
 Last Modified: 10-NOV-1989    ArticleIdent: Q50693

 When you use special macros to indicate targets or dependents in
 inline files, NMAKE Version 1.00 will generate the error message
 U4108, "special macro undefined." These special macros are $@, $*,
 $**, and $?.

 To prevent the problem, avoid use of these special macros in inline
 files. Instead of using those << inline files, create the response
 file in a separate NMAKE target, and redirect TYPE and ECHO commands
 to the desired file.

 $@ refers to the full name of the target, base plus extension. $*
 refers only to the base name of the target.

 $** represents the complete list of dependent files for the target. $?
 represents only the dependents that are out of date relative to the
 target.

 The following makefile will generate U4018 for $**:

 #makefile test
 FOO.EXE: *.OBJ
     LINK @<<FOO.LRF
 $**;
 <<

 To avoid the problem, break this up into two steps, the makefile and a
 linker response file with output redirected:

 #makefile test
 FOO.EXE: *.OBJ FOO.LRF
     LINK @FOO.LRF

 FOO.LRF: *.OBJ
     echo $**; >FOO.LRF


 13. Inference Rule May Fail If Blank Command Line Contains Spaces

 Product Version(s): 1.00 1.01 1.10 1.11 1.12 | 1.11 1.12
 Operating System:   MS-DOS                   | OS/2
 Flags: ENDUSER |
 Last Modified: 24-JAN-1991    ArticleIdent: Q50383

 When using inference rules in an NMAKE description file, the target/
 dependency line must be followed by a blank line (no space
 characters); otherwise, the inference rule commands will not be
 executed. NMAKE checks this line for any ASCII characters; if ANY
 characters exist, NMAKE will ignore the inference rule and try to
 execute the line, even if it contains only a space or spaces.

 The following is a simple example, which demonstrates this problem:

 .c.exe:
   cl $**

 ALL : main.exe

 main.exe : main.c
 <space>

 Nothing happens if this description file is passed to NMAKE because
 the space character will cause NMAKE to assume there are explicit
 commands following the target/dependency line, causing it to ignore
 the inference rule. Note that this is expected behavior for NMAKE.

 MAKE version 4.x inference rules/description blocks do not exhibit
 this behavior. This is something to keep in mind when converting
 description files from MAKE to NMAKE.


 14. Using "." for Path in Inference Rules Causes U1073

 Product Version(s): 1.00 1.01 | 1.01
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist1.01
 Last Modified: 18-DEC-1989    ArticleIdent: Q51723

 NMAKE does not accept a dot (.) to identify the current directory in
 inference rule paths. When specifying paths for each of the
 extensions, using the following form

    {frompath}.fromextension{topath}.toextension

 and using "{.}" (without the quotation marks) to indicate the current
 directory for the "topath", causes the following error:

    NMAKE : fatal error U1073: don't know how to make 'filename.ext'

 To work around this, the current directory for topath must be
 specified with "{}". However, both notations are acceptable when
 specifying the "frompath".

 The following makefile causes the error:

 .SUFFIXES: .h .c .obj .exe

 #macros
 a=tools.h
 jbo=grdemo.obj turtle.obj menu.obj
 cc=qcl -c

 #inference rules
 {d:\qc2\work}.c{.}.obj:          #*** the '{.}' must be '{}' ***
  $(cc) $<

 {}.obj{d:\qc2\lib}.exe:
  link $(**R),,, graphics.lib;

 #target-dependencies
 run: d:\qc2\lib\grdemo.exe

 d:\qc2\lib\*.obj: d:\qc2\work\*.c

 d:\qc2\lib\grdemo.exe: $(jbo)


 15. Redirecting NMAKE 1.00/1.01 Output with -p Gives False Errors

 Product Version(s): 1.00 1.01
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00 buglist1.01 fixlist 1.11
 Last Modified: 24-JAN-1991    ArticleIdent: Q57500

 Redirecting the output of NMAKE version 1.00 or 1.01 can cause
 inference rules to fail if all of the following conditions are met:

 1. The inference rules are in uppercase letters.
 2. The -p option is used.
 3. The output is redirected.

 This problem is somewhat obscure, and it can be frustrating if you
 unwittingly meet all of these conditions. The error message displayed
 depends on the inference rule used, but it resembles the following:

    NMAKE : warning U4017: ignoring rule .C.OBJ (extension not in
            .SUFFIXES)

 The above error message is displayed with the following description
 file initiated with the command "NMAKE -p > out.txt":

 Description File
 ----------------

 # start

 .C.OBJ:
   cl $*

 main.obj : main.c

 # end

 Microsoft has confirmed this to be a problem in NMAKE versions 1.00
 and 1.01. This problem was corrected in NMAKE version 1.11.


 16. Missing Right Parenthesis in Sample NMAKE File Hangs Machine

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | h_fortran s_quickc s_quickasm buglist1.00
 Last Modified: 15-MAR-1990    ArticleIdent: Q59069

 If you forget the right parenthesis in an IF "$(flag)"=="comparison"
 line in a makefile and run the makefile through NMAKE, you can receive
 machine hangs or corrupt COMMAND.COM messages under DOS or an Internal
 Processing Error under OS/2.

 Microsoft has confirmed this to be a problem with Version 1.00. We are
 researching this problem and will post new information here as it
 becomes available.

 The following makefile, simplified from the sample makefile on Page
 172 of the "QuickC ToolKit" manual, demonstrates this problem:

 debug=Y
 CC=qcl
 !CMDSWITCHES +D
 HELLO.EXE : HELLO.OBJ
 !IFDEF debug
 !   IF "$(debug"=="y"
                 LINK /CO hello;
 !   ELSE
                 LINK hello;
 !   ENDIF
 !ELSE
 !   ERROR Macro named debug is not defined.
 !ENDIF

 Adding a right parenthesis after "$(debug solves the problem.

 The error seems to occur because NMAKE does not recognize the end of
 the line and continues to parse the line until the end of the file. A
 customer has reported receiving "U1076, Line too long" messages,
 followed by a DOS level error reading "Invalid COMMAND.COM - system
 halted."

 Testing the same problem under an OS/2 1.20 DOS Box returned Internal
 Processing Errors and halted the system with no other error messages.


 17. NMAKE 1.01 Does Not Properly Expand Wildcard Arguments

 Product Version(s): 1.01   | 1.01
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 15-MAY-1990    ArticleIdent: Q59254

 NMAKE version 1.01 doesn't properly expand wildcard command-line arguments.
 For example, if we were to have a makefile that looked similar to the
 following

 a.exe : a.c
     echo cl a.c

 b.exe : b.c
     echo cl b.c

 And we were to say:

 NMAKE *.exe /A

 NMAKE wouldn't properly expand "*.exe" to equate to both a.exe and
 b.exe; it would merely build only the first target in the list.

 NMAKE versions 1.00 and 1.10 do not exhibit this behavior.


 18. NMAKE /D /C Switches Suppress Modification Date

 Product Version(s): 1.00 1.01 1.10 1.11
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00 buglist1.01 buglist1.10 buglist1.11
 Last Modified: 18-NOV-1990    ArticleIdent: Q59384

 When using the NMAKE /D and /C switches together, the modification
 date of each file will not be displayed when the date is checked. A
 short description of each switch is described as follows:

    /D  Displays the modification date of each file when the date is
        checked.

    /C  Suppresses the NMAKE copyright message and prevents nonfatal
        error or warning messages from being displayed.

 Microsoft has confirmed this to be a problem with NMAKE Versions 1.00,
 1.01, and 1.10. We are researching this problem and will post new
 information here as it becomes available.


 19. Trouble with Filenames Containing a Dollar Sign ($)

 Product Version(s): 1.01    | 1.01
 Operating System:   MS-DOS  | OS/2
 Flags: ENDUSER | buglist1.01
 Last Modified: 14-MAR-1990    ArticleIdent: Q59409

 If you use a filename that contains a dollar sign ($) in a NMAKE
 description file, you can use the escape character (^) to tell NMAKE
 that the dollar sign is part of your filename, not a macro character.
 However, using the escape character within an inline response file
 does not work and you must use the double dollar sign ($$).

 Consider the following NMAKE description file:

     all:test^$.exe;

     test^$.obj: test^$.c
        cl /c test^$.c

     test^$.exe: test^$.obj
        link @<<
              test^$.obj,
              test^$.exe,
              NUL,;
     <<

 In this file, the escape character (^) is used to tell NMAKE that the
 $ is part of the filename TEST$.* and is not denoting the use of a
 macro. When TEST$.C is compiled, everything works correctly until you
 get to the inline response file for LINK. NMAKE does not interpret the
 ^ character, but instead passes it on to LINK.EXE. LINK then tries to
 link TEST^$.OBJ instead of TEST$.OBJ and fails. If you eliminate the ^
 to pass TEST$.OBJ to link, NMAKE fails with an error about an invalid
 macro.

 NMAKE is in error here. NMAKE should do one of two things when parsing
 the inline response file.

 1. NMAKE should interpret the ^ to leave the $ as part of the filename.

 2. NMAKE should ignore the $ so that you can just list TEST$.OBJ
    because it doesn't make sense to have macros in external response
    files when parsing an inline response file.

 Microsoft has confirmed this to be a problem with NMAKE Version 1.01.
 We are researching this problem and will post new information here as
 it becomes available.

 The following are two suggested workarounds:

 1. Use an external response file. Then your link line would appear
    similar to link @FILE.RES and you could put TEST$.OBJ directly in
    the response file.

 2. Use $$ as the escape sequence instead of ^$ in the inline response
    file. For example, change

       link @<<
           test^$.obj,
           test^$.exe,
           NUL,;
       <<

    to the following

       link @<<
           test$$.obj,
           test$$.exe,
           NUL,;
       <<

    and NMAKE will correctly pass TEST$.OBJ to the linker.


 20. In What Order Does NMAKE Build Files?

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 15-MAY-1990    ArticleIdent: Q59420

 Question:

 I need to have my source files built in a particular order but I can't
 get NMAKE to build them that way. NMAKE seems to build the source
 files in the order it wants. What is the order in which NMAKE builds
 files?

 It is definitely possible to specify the order in which NMAKE builds
 your files.

 The first thing NMAKE does is check the command line. You can specify
 the targets in the order you want them built and NMAKE will build them
 in that order. If NMAKE doesn't find any targets on the command line,
 it builds the first target in the description file.

 NMAKE will build all of the dependents in the order in which they are
 specified on the first target line. For most description files, the
 first target in the file is the ALL:FILENAME.EXE pseudotarget. In this
 case, NMAKE will build FILENAME.EXE, and then the order depends on the
 dependency for FILENAME.EXE.

 This can be more clearly explained in the following examples:

 Example 1
 ---------

 Consider the following description file:

             all:three.obj two.obj one.obj main.exe

             one.obj:one.c
                 cl /c one.c

             two.obj:two.c
                 cl /c two.c

             three.obj:three.c
                 cl /c three.c

             main.exe:three.obj one.obj two.obj
                 link one two three, main;

 In this example, the files are compiled in the order: THREE.C, TWO.C,
 ONE.C. After those three files are compiled, the link for MAIN.EXE is
 executed. They are executed in that order because that is the explicit
 order given in the first target in the file and NMAKE builds the first
 target in the file when nothing is specified on the command line.

 Example 2
 ---------

 Now, consider the following description file that has been slightly
 modified from the one shown in Example 1 above:

             all:main.exe

             one.obj:one.c
                 cl /c one.c

             two.obj:two.c
                 cl /c two.c

             three.obj:three.c
                 cl /c three.c

             main.exe:three.obj one.obj two.obj
                 link one two three, main;

 In this example the files are compiled in the order: THREE.C, ONE.C,
 TWO.C. After that, the link statement will then be executed because
 there is nothing specified on the command line, so NMAKE will build
 the first target in the file, which is MAIN.EXE. When NMAKE looks at
 what it needs to build MAIN.EXE, it sees the list of dependents and
 builds them in that order.

 In summary, NMAKE looks first on the command line. If nothing is found
 there, it builds the first target in the description file by building
 each of its dependents in the order specified. If the dependent of the
 first target specifies another target, the dependents of that target
 are built in the order they are specified and so on.


 21. Multiple Dependency Blocks Are Not Cumulative

 Product Version(s): 1.00 1.01 1.10 1.11 | 1.01 1.10 1.11
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER |
 Last Modified: 16-OCT-1990    ArticleIdent: Q59526

 Question:

 Specifying a target in multiple dependency blocks seems to confuse
 NMAKE. If my make file says something similar to the following

 FOO.EXE:: FOO1.obj
 FOO.EXE:: FOO2.obj
 FOO.EXE:: FOO3.obj
   link foo.exe

 FOO.EXE:: FOO.RES
   RC FOO.RES FOO.EXE

 and FOO1.OBJ and FOO2.OBJ are newer than FOO.EXE but FOO3.OBJ is not,
 FOO.EXE will not be built. To further confuse the issue, the following
 is the output from running NMAKE with the /d (display file dates)
 option:

 C:\>NMAKE /d foo.mak

   foo.exe                    Wed Mar 07 08:42:38 1990
     foo1.obj                 Thu Mar 08 15:25:44 1990
 ** foo1.obj newer than foo.exe
     foo2.obj                 Wed Mar 08 08:38:56 1990
 ** foo2.obj newer than foo.exe
     foo3.obj                 Thu Mar 01 09:49:52 1990
     foo.res                  Thu Mar 01 09:49:52 1990
 'foo.exe' is up-to-date.

 Obviously, NMAKE realizes the foo1 and foo2 .OBJs are newer, but
 FOO.EXE is never linked. Why not?

 Response:

 The multiple dependency construct, indicated by a double colon (::)
 following the target, is very useful in NMAKE because it allows the
 programmer to specify what operations are to take place on a target
 based on various dependents. For instance, in PM (Presentation
 Manager) programming the MAKE file can indicate that if the .OBJs
 change, execute the linker to rebuild the application. On the other
 hand, if all that changes is the resource file, only the resource
 compiler needs to be executed.

 However, there is a limitation to this feature. The command block for
 a target-dependency group MUST immediately follow it. They are not
 cumulative like normal dependency blocks. Therefore, one workaround to
 the above example is the following:

 FOO.EXE:: FOO1.obj
   link foo.exe

 FOO.EXE:: FOO2.obj
   link foo.exe

 FOO.EXE:: FOO3.obj
   link foo.exe

 FOO.EXE:: FOO.RES
   RC FOO.RES FOO.EXE

 The second alternative is to put all the dependencies on the same
 line as the target, for example:

 FOO.EXE:: FOO1.obj FOO2.obj FOO3.obj
   link foo.exe

 FOO.EXE:: FOO.RES
   RC FOO.RES FOO.EXE


 22. A Complete Example of Utilizing Paths in NMAKE

 Product Version(s): 1.00 1.01 1.11
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 18-APR-1990    ArticleIdent: Q60340

 The make file shown below is an NMAKE example of using paths in
 macros, inference rules, and target dependencies (descriptor blocks).
 This is a working example of what is described on Page 298 of the
 "Microsoft FORTRAN CodeView and Utilities User's Guide" and Page 168
 of the "Microsoft QuickC Tool Kit."

 This make file compares the modification dates of the .H and the .C
 files with the .OBJ files, and the .OBJ files with the .EXE files. If
 any of the dependent files have changed more recently than the target
 files, the specified series of commands is executed. The .H and the
 .C files in the work directory are compared to the .OBJ files of the
 lib directory.

 If any of the source file(s) have changed since the last .OBJ was
 .created, then it is recompiled and copied from the current
 directory to the lib directory. The .OBJ files in the lib directory
 are compared to the .EXE files in the current directory. If any of the
 .OBJ files have changed since the last .EXE was created, then the
 .OBJs are relinked.

 Sample Make File
 ----------------

 #macros

 objdir =d:\qc2\lib
 wrkdir =d:\qc2\work
 list   =$(objdir)\grdemo.obj $(objdir)\turtle.obj \
 $(objdir)\menu.obj
 cc     =qcl -c

 #inference rules

 #compile
 {$(wrkdir)}.c{$(objdir)}.obj:
  $(cc) $<
  copy $(*F).obj $(*R).obj
  erase $(*F).obj

 #link
 {$(objdir)}.obj{}.exe:
  link $(**R);

 #target-dependencies

 run: grdemo.exe

 $(objdir)\*.obj: $(wrkdir)\$$(@B).c $(wrkdir)\menu.h \
 $(wrkdir)\turtle.h

 grdemo.exe: $(list)


 23. NMAKE May Invoke MASM Instead of the C Compiler

 Product Version(s): 1.00 1.01 1.11 | 1.01 1.11
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER | docsup s_pwb h_fortran
 Last Modified: 17-JUL-1990    ArticleIdent: Q60746

 When using an NMAKE file in combination with adding /Fa to the
 compiler options within Programmer's WorkBench (PWB), NMAKE will
 invoke the Macro Assembler, if it is in the current search path.

 This does not occur the first time you build your application, but it
 does occur the second time, and thereafter, because of the generation
 of the .ASM created by the compiler.

 Files with the .ASM extension have a predefined inference rule within
 NMAKE to invoke MASM. However, the inference rule for .ASM files takes
 place before the rule for files with the .C or .OBJ extension.
 Therefore, if you have a filename with the same base name, but one has
 an .ASM extension and the other has a .C extension (as is the case
 with the /FA switch), the .ASM file will be assembled before the .C
 file will be compiled. Since the assembly step generates an .OBJ file
 that is newer than the .C file, the .C file is never compiled.

 Use the following procedures to work around this behavior:

 1. The best workaround is to use /Fa [LSTFILE.EXT] with a filename
    included as a compiler option, instead of allowing the /Fa option
    to default to its <filename>.ASM.

    Example: /Fa <filename>.ASC

    In using this method, the .C file will be compiled, instead of the
    .ASM version being assembled.

 2. Use the /Fc compiler option in place of the /Fa option (if you just
    want to look at an assembly source listing). This produces a .COD
    file (combined assembly and C source listing).

 3. Use the /R switch for the NMAKE invocation to ignore inference
    rules and macros that are predefined or defined in the TOOLS.INI
    file.

 For a more in-depth discussion on the /R switch and its effects, see
 the following references:

 1. The "Microsoft C Advanced Programming Techniques" reference manual

    Page(s) 112-114 Predefined macros
            118-119 Predefined inference rules
            125     /R Switch

 2. The "Microsoft FORTRAN, CodeView and Utilities User's Guide"

    Page(s) 288     /R Switch
            295-297 Predefined macros
            299-230 Predefined inference rules

 3. The "Microsoft QuickC Toolkit" reference manual

    Page(s) 158     /R Switch
            165-197 Predefined macros
            169     Predefined inference rules


 24. Looking for Files in Different Directories

 Product Version(s): 1.00 1.01 1.10 1.11 | 1.01 1.10 1.11
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER | s_c s_quickc s_quickasm h_fortran
 Last Modified: 17-JUL-1990    ArticleIdent: Q60867

 If you use the "directory search" feature of NMAKE (curly braces "{}")
 to use a separate directory for some files, the location of these
 files cannot be inferred in subsequent dependency rules.

 The following code example demonstrates this confusion:

    test.exe: {\obj}test.obj
       link \obj\test.obj graphics.lib;

    test.obj: test.c test.h
       cl /c /Fo\obj\test.obj test.c

 If TEST.EXE and \OBJ\TEST.OBJ were up to date and we were to change
 one of the dependencies for TEST.OBJ, nothing would happen. This is
 because \OBJ\TEST.OBJ doesn't have any dependencies. The TEST.OBJ
 dependency line is only for the current directory. If we were to
 change the TEST.OBJ line to the following

    {\obj}test.obj: test.c test.h

 a change to TEST.C or TEST.H would cause \OBJ\TEST.OBJ and TEST.EXE
 to be updated.

 Note: NMAKE has a predefined inference rule for C.EXE that causes
 TEST.EXE to be relinked in the above example if it is out of date with
 TEST.C.


 25. /MAKE Option Is Invalid with NMAKE

 Product Version(s): 1.11   | 1.11
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 25-MAY-1990    ArticleIdent: Q61619

 On Page 43 of the "Microsoft C Reference" manual for version 6.00,
 NMAKE is described as being upwardly compatible with the earlier MAKE
 utility through the use of the /MAKE option. Since NMAKE does not
 support the /MAKE option, it produces the error "U1065:  Invalid
 option 'm'."

 To work around this problem, you can either use the earlier MAKE
 utility, or use a pseudo-target on the first line of your make file.
 The pseudo-target line should read as follows:

    ALL: [target name.exe/obj]

 For more information about the differences between MAKE and NMAKE, see
 Section 6.9 of the "Microsoft C Advanced Programming Techniques"
 manual for version 6.00.


 26. Using "!" and "$?" Do Not Work as Expected with NMAKE 1.11

 Product Version(s): 1.11   | 1.11
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.11
 Last Modified:  6-FEB-1991    ArticleIdent: Q61808

 Applying the "!" (exclamation point) operator to the beginning of a
 command line using the macro "$?" should cause the command to be
 executed once for every out-of-date dependent file. (This is
 documented on Page 108 of the "Advanced Programming Techniques" manual
 included with the Microsoft C Optimizing Compiler version 6.00.)

 This feature works correctly in NMAKE version 1.00, but does not work
 as expected in version 1.11. NMAKE version 1.11 is included with the
 Microsoft C Compiler version 6.00.

 In version 1.11 of NMAKE, the $? macro evaluates to the list of every
 dependent, regardless of whether it is out of date or not. This is not
 the correct behavior.

 To re-create this problem, save the following lines to a file called
 MAKEFILE:

    new.lib: a.obj b.obj c.obj
        !lib $@-+$?;

 Assuming that only a.obj is out-of-date with respect to new.lib, the
 following will be produced upon running NMAKE:

 1. NMAKE 1.00:

       lib new.lib-+a.obj;

 2. NMAKE 1.11:

       lib new.lib-+a.obj
       lib new.lib-+b.obj
       lib new.lib-+c.obj

 Example 1 above shows the correct function of the $? macro.

 Fortunately, the problem above is easy to fix.  NMAKE performs
 correctly if two colons (::) are placed after the target new.lib on
 the dependency line.  The NMAKE file has been re-written below so that
 the $? macro will work with NMAKE 1.11.

 MODIFIED NMAKE FILE
 -------------------
 new.lib::a.obj b.obj c.obj
    !lib $@-+$?;

 The use of the two colons on the dependency line is described on page
 109 of the Advanced Programming Techniques manual included with the
 Microsoft C compiler version 6.00.

 Microsoft has confirmed this to be a problem with NMAKE version 1.11.
 The problem has been resolved with later versions of NMAKE.


 27. NMAKE U1001 Illegal Character Caused by Corrupted MAKEDIR

 Product Version(s): 1.11
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.11
 Last Modified:  4-DEC-1990    ArticleIdent: Q61978

 NMAKE version 1.11 may produce a U1001 "syntax error: illegal
 character <character> in macro" while building a project.

 NMAKE has an internal macro, MAKEDIR, which contains the full drive
 and path to the directory from where NMAKE was invoked. This macro is
 corrupted in NMAKE version 1.11 under DOS. Rather than the correct
 pathname, the macro contains "garbage" or graphics characters. This
 macro can cause the U1001 "illegal character" error message.

 To display the contents of MAKEDIR, invoke NMAKE with the /P switch.
 This switch causes all macros to be displayed to the screen. To work
 around this problem, manually set MAKEDIR in the .MAK file for the
 project. Set it to the drive and path where the project is being
 built. If MAKEDIR is manually set in the .MAK file, it will override
 the default setting and correct the problem.

 Microsoft has confirmed this to be a problem with NMAKE version 1.11.
 We are researching this problem and will post new information here as
 it becomes available.

 NMAKE version 1.11 comes with Microsoft C Professional Development
 System version 6.00 for MS-DOS and MS OS/2.

 This problem does not occur with NMAKE version 1.10. The problem
 occurs only with the DOS version of NMAKE, not the protected mode
 version of NMAKE version 1.11.


 28. Can't Use Multiple Description Blocks with NMAKE Version 1.10

 Product Version(s): 1.10
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.10 fixlist1.11 b_basiccom
 Last Modified: 25-JUL-1990    ArticleIdent: Q62332

 Page 639 of "Microsoft BASIC 7.0: Programmer's Guide" explains how you
 can use NMAKE to specify more than one description block for the same
 target.

 The example given on this page is the proper way to specify more than
 one description block; however, this feature does not function
 correctly in NMAKE version 1.10. It does function correctly in NMAKE
 version 1.11.

 NMAKE version 1.10 shipped with the Professional Development System
 (PDS) BASIC version 7.00. NMAKE version 1.11 shipped with Microsoft C
 Professional Development System (PDS) version 6.00.

 The following example specifies more than one description block for
 the same target by using two colons (::) as the separator instead of
 one. The following example is taken from Page 639 of "Microsoft BASIC
 7.0: Programmer's Guide":

       TARGET.LIB :: A.ASM B.ASM C.ASM
          MASM A.ASM B.ASM C.ASM;
          LIB TARGET -+A.OBJ -+B.OBJ -+C.OBJ;
       TARGET.LIB :: D.BAS E.BAS
          BC D.BAS;
          BC E.BAS;
          LINK D.OBJ E.OBJ;
          LIB TARGET -+D.OBJ -+E.OBJ;

 Given the two description blocks above, NMAKE should update the
 library named TARGET.LIB. In the first description block, if any of
 the assembly language files have changed more recently than the
 library, the assembly files will be assembled and the library will be
 updated with the new .OBJs. In the second description block, the BASIC
 files that have changed should be compiled and the library should also
 be updated with the new OBJs.

 When using NMAKE version 1.10, the commands in the first description
 block are executed correctly; however, the commands in the second
 description block are never executed.

 Microsoft has confirmed this to be a problem in NMAKE version 1.10.
 This problem was corrected in version 1.11.


 29. Expression in Brackets "

 Product Version(s): 1.00 1.01 1.10 1.11 | 1.01 1.10 1.11
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER |
 Last Modified: 27-JUN-1990    ArticleIdent: Q63146

 When using the !IF directive in conjunction with the square brackets
 "[]" in the NMAKE utility, all expressions inside square brackets will
 be evaluated when NMAKE initially reads the makefile, before any
 commands are executed (and before dependency blocks are evaluated).

 The square brackets are used within NMAKE to denote program
 invocations in expressions within an !IF directive, as documented in
 Section 6.3.5, Pages 120-121 of the "Advanced Programming Techniques"
 manual shipped with the Microsoft C compiler version 6.00.

 By design, all the program invocations are executed when NMAKE starts
 up, regardless of whether or not they are contained in a dependency
 block. The return values of these program invocations can then be used
 within the !IF expression to evaluate the expression.

 The following makefile displays this behavior:

    test.exe: test.c
    !IF ( [check /f] < 3 )
       cl test.c
    !ENDIF

 In this example, the program "check /f" will be executed each time the
 makefile is called, regardless of whether or not the file TEST.EXE is
 up to date.


 30. Changing Directories in Make Files Not Supported by NMK.COM

 Product Version(s): 1.11
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.11 S_QUICKC S_C
 Last Modified: 31-AUG-1990    ArticleIdent: Q64028

 Using a command to change directories in a make file will cause
 unexpected results with NMK.COM version 1.11. This is a side effect of
 a problem with NMAKE.EXE where directory changes within make files are
 executed while processing the make file, and the current directory is
 not reset upon exit.

 NMK spawns NMAKE to do its processing. While NMAKE is processing, if
 it sees a change drive/directory command, it must make the change to
 finish processing the make file. The problem is that it doesn't reset
 the drive when it is through processing. This causes NMK, when control
 is returned to it, to spawn the actual commands from the final
 drive/directory, rather than where it was originally invoked.

 The make file below, if run from Drive D, will demonstrate the
 problem. It works properly with NMAKE.EXE but not with NMK.COM.

 all: cded.exe

 cded.exe: cded.obj
   c:\
   copy cded.obj cded.exe

 cded.obj: cded.mak
   copy cded.mak c:\cded.obj

 To work around the problem, add a line at the end of each place block
 where you change the drive/directory to the original one (if known).
 For example, change the above make file to the following:

 all: cded.exe

 cded.exe: cded.obj
   c:\
   copy cded.obj cded.exe
   d:

 cded.obj: cded.mak
   copy cded.mak c:\cded.obj


 31. Spaces in Inference Rules Corrupt NMAKE Macro Expansion

 Product Version(s): 1.00 1.11 | 1.00 1.11
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | s_quickc
 Last Modified: 28-AUG-1990    ArticleIdent: Q65084

 If a space is inserted between the target and dependent extensions in
 an inference rule, it will cause NMAKE's default macros to expand
 incorrectly. The correct syntax for inference rules is to list the
 dependent file extension followed by the target file extension WITHOUT
 any embedded spaces.

 The following sample make files demonstrate a few of the problematic
 results that are possible if spaces are used in an inference rule. In
 both cases below, note that it is the embedded spaces that cause NMAKE
 to invoke the commands incorrectly. Removing the spaces allows NMAKE
 to generate the desired commands.

 Example 1
 ---------

 {c:\source\}.c {c:\objs\}.obj:
   cl $*

 ALL: c:\objs\foo2.obj

 c:\objs\foo2.obj: c:\source\foo2.c

 Command executed by NMAKE:

 cl {c:\objs\}

 Example 2
 ---------

 .c .obj:
   cl $<

 ALL: foo.obj

 foo.obj: foo.c

 Command executed by NMAKE:

 cl


 32. In-line File in Inference Rule Causes Bad Macro Substitution

 Product Version(s): 1.11   | 1.11
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.11
 Last Modified: 11-NOV-1990    ArticleIdent: Q66459

 Using an in-line file inside of an inference rule can cause improper
 results in macro substitutions following the in-line file. The example
 below demonstrates the problem.

 Make File Example
 -----------------

 EXENAME=test.exe
 SAMPLEDIR=\test

 .obj.exe:
   link @<<lrf     <--- In-line file with $(EXENAME) macro
 $<                     causes the problem.
 $(EXENAME);
 <<KEEP
   cd $(SAMPLEDIR)

 test.exe:test.obj

 test.obj:test.c

 The above NMAKE description file produces the following output:

    cl -c test.c
    link @lrf
    cd test.exe    <---- This is wrong.  It should be "cd \test"
 NMAKE: fatal error U1077: 'cd' return code 1
 Stop.

 The third line of the output is incorrect. The macro $(SAMPLEDIR) is
 replaced with the value of $(EXENAME).

 Microsoft has confirmed this to be a problem in version 1.11. We are
 researching this problem and will post new information here as it
 becomes available.


 33. Documentation Error: Extmake Syntax for %|partsF Incorrect

 Product Version(s): 1.11   | 1.11
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified:  6-NOV-1990    ArticleIdent: Q66474

 The extmake syntax for determining the complete name of the first
 dependent in a NMAKE description file is incorrectly described in the
 "Advanced Programming Techniques" manual on Page 124.

 The extmake syntax described on Page 124 of the "Advanced Programming
 Techniques" manual lists the syntax as

    %|partsF

 where parts is one or more of the following:

    Letter            Description
    ------            -----------

    d                 Drive
    e                 File extension
    f                 File base name
    p                 Path
    s                 Complete name

 However, "s" is not a valid selection. You may use %s, or you may use
 %|partsF, where "parts" is one or more of the above (d, e, f, or p,
 but not s). The following makefile illustrates the problem.

 Sample Makefile
 ---------------

    sample.obj: sample.c
         cl /c %|sF

 If this makefile is run, it will produce the following error message:

    NMAKE : fatal error U1098: extmake syntax in sF incorrect

 The online help specifies the correct syntax for using the extmake
 switch:

    Letter     File-Specification Part
    ------     -----------------------

    p          Path
    d          Drive
    f          Base name
    e          Extension

 The makefile below shows the correct extmake syntax for obtaining the
 complete name of the first dependent:

 Correct Makefile
 ----------------

    sample.obj: sample.c
         cl /c %s


 34. Problem in NMAKE 1.11 with Multiple Dependency Blocks

 Product Version(s): 1.11   | 1.11
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.11 fixlist1.12 s_c
 Last Modified:  9-NOV-1990    ArticleIdent: Q66571

 The sample makefile below will be correctly executed in all cases
 except if the target is missing. In that case, both sets of commands
 will be executed even though the second set is not necessary.

 Microsoft has confirmed this to be a problem in NMAKE version 1.11.
 This problem has been corrected in version 1.12, which shipped with
 Microsoft COBOL version 4.00.

 Multiple Dependency blocks are supposed to be evaluated one at a time.
 In the sample makefile, because the target is missing when NMAKE is
 invoked, it assumes that both sets of commands will need to be
 invoked. This is incorrect behavior.

 Sample Makefile
 ---------------

 test.exe :: test.obj test.def
     link /nod test,,,slibcew libw, test.def
     rc test.res

 test.exe :: test.res
     rc test.res


 35. NMAKE 1.11 Fails to Stop If Command Is Redirected

 Product Version(s): 1.11
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.11 fixlist1.12
 Last Modified:  9-NOV-1990    ArticleIdent: Q66572

 If the command line that NMAKE invokes is redirected to another
 output file and the command returns a non-zero return code, NMAKE
 version 1.11 will not stop the build process.

 Microsoft has confirmed this to be a problem in the DOS version of
 NMAKE.EXE. This problem has been corrected in version 1.12.

 The following is a sample make file that, with NMAKE version 1.11,
 will fail to stop if the compiler returns an error; with version 1.12,
 it correctly stops the build process:

 all: foo.exe

 foo.obj: foo.c
    cl /c /AS foo.c >foo.err

 foo.exe: foo.obj
    link /NOI /NOE foo.obj;

 The easiest way to workaround this is to redirect from the command
 line, for example:

    nmake /f foo.mak >foo.err

 The drawback to this is that you can only have one error log.


 36. NMAKE /N Doesn't Work Across Multiple Dependency Blocks

 Product Version(s): 1.11 1.12 | 1.11 1.12
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist1.11 buglist1.12
 Last Modified:  7-NOV-1990    ArticleIdent: Q66644

 Given the sample makefile below and the fact that mod2.c has been
 changed, invoking NMAKE /N displays the following commands:

    cl /c -c mod2.c
    lib sub.lib -+ mod2.obj;

 However, if NMAKE is run without the /N parameter, the following
 commands will be executed:

    cl /c -c mod2.c
    lib sub.lib -+ mod2.obj;
    link boss.obj,,,sub.lib;

 The /N switch is used to debug the logic of makefiles without actually
 processing them. In this case, the commands that /N indicates will be
 executed are not the same as those that actually are executed. This is
 caused by the multiple dependencies for sub.lib. If the makefile is
 changed to eliminate the multiple dependency blocks, the /N switch
 will function correctly.

 Microsoft has confirmed this to be a problem in NMAKE versions 1.11
 and 1.12. We are researching this problem and will post new
 information here as it becomes available.

 Sample Code
 -----------

 CFLAGS=/c

 .obj.exe:
         link $<,,,sub.lib;

 all:boss.exe

 boss.exe:boss.obj  sub.lib

 boss.obj:

 sub.lib:: mod1.obj
         lib $@ -+ mod1.obj;

 sub.lib:: mod2.obj
         lib $@ -+ mod2.obj;


 37. U4007 Error Can Be Caused By Not Using Quotation Marks

 Product Version(s): 1.11 1.12
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified:  7-NOV-1990    ArticleIdent: Q66646

 If you have a makefile for OS/2 that uses long filenames, you must use
 quotation marks around the long filenames. For instance, if the
 following makefile is used, it will generate the U4007 error message
 ("file name too long:  truncating to 8.3"):

 Sample Makefile
 ---------------

 all: thisisalongfilename.exe

 thisisalongfilename.exe: thisisalongfilename.obj
    link thisisalongfilename.obj;

 thisisalongfilename.obj: thisisalongfilename.c
    cl /c /Tcthisisalongfilename.c

 If the makefile above is changed to the following version, the error
 will not be generated:

 Sample Makefile
 ---------------

 all: "thisisalongfilename.exe"

 "thisisalongfilename.exe": "thisisalongfilename.obj"
    link "thisisalongfilename.obj";

 "thisisalongfilename.obj": "thisisalongfilename.c"
    cl /c /Tc"thisisalongfilename.c"

 For more information on this behavior, please see the README.DOC file
 shipped with Microsoft C version 6.00.


 38. Cause of U4004 Error Message

 Product Version(s): 1.10   | 1.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified:  7-NOV-1990    ArticleIdent: Q66649

 The U4004 error message is generated by NMAKE when it encounters
 multiple build dependency blocks for a single target. The following is
 a sample makefile:

 all: tty.exe

 tty.res: tty.rc tty.dlg tty.h
     rc -r tty.rc

 tty.obj: tty.c
    cl -c -AS -Gsw -Os -Zdp tty.c

 wstdio.obj: wstdio.c
    cl -c -AS -Gsw -Os -Zdp wstdio.c

 tty.exe: tty.obj wstdio.obj tty.def
     link /NOD tty wstdio,,,libw slibcew,tty.def
     rc tty.res

 tty.exe: tty.res tty.dlg tty.h
    rc tty.res

 To eliminate the error, use the multiple dependency block separator --
 a pair of colons (::). In the above makefile, the two dependency
 blocks for tty.exe should use this syntax. The multiple dependency
 block separator is documented further on page 109 of the "Advanced
 Programming Techniques" manual, as well as in the online help.

 The following is the corrected makefile:

 all: tty.exe

 tty.res: tty.rc tty.dlg tty.h
     rc -r tty.rc

 tty.obj: tty.c
    cl -c -AS -Gsw -Os -Zdp tty.c

 wstdio.obj: wstdio.c
    cl -c -AS -Gsw -Os -Zdp wstdio.c

 # Note the use of the double colon below and in the next block...

 tty.exe:: tty.obj wstdio.obj tty.def
     link /NOD tty wstdio,,,libw slibcew,tty.def
     rc tty.res

 tty.exe:: tty.res tty.dlg tty.h
    rc tty.res


 39. Link Not Performed During Build or Make

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.00 fixlist1.10 fixlist1.11 s_c s_link s_pwb
 Last Modified: 14-DEC-1990    ArticleIdent: Q67482

 During a build inside the Programmer's WorkBench (PWB) (using PWB.COM)
 or while using NMK.COM from the command line, the build operation
 returns successfully but no .EXE file is created.

 This problem may be caused by an incorrectly set COMSPEC environment
 variable. If the COMSPEC environment variable contains any extra
 characters, NMK.COM fails to properly spawn the linker. This affects
 the PWB as well because, under DOS, PWB.COM spawns the build commands
 the same way as NMK.COM. Two examples of COMSPEC environment variables
 that cause this problem are shown in the following:

    COMSPEC=C:\COMMAND.COM /E:512 /P
    COMSPEC=C:\COMMAND.COM;

 Microsoft has confirmed this to be a problem in PWB.COM version 1.00
 and NMK.COM version 1.00. This problem was corrected in PWB.COM
 version 1.10 and NMK.COM version 1.11.


 40. NMK.COM Will Execute PWB.SHL If it Exists

 Product Version(s): 1.00 1.11
 Operating System:   MS-DOS
 Flags: ENDUSER | S_C S_PWB S_QUICKC S_NMK
 Last Modified: 28-DEC-1990    ArticleIdent: Q67776

 NMK.COM will execute the PWB.SHL file if it exists in the subdirectory
 specified by the TMP environment variable. After spawning NMAKE to
 parse the desired makefile, PWB.SHL will be executed as a batch file
 with the commands listed in reverse order.

 This is expected behavior since NMK actually spawns NMAKE with the /z
 option. This instructs NMAKE to preprocess the makefile, writing out
 the commands to be performed into the file PWB.SHL, which is placed in
 the directory pointed to by the TMP environment variable. After NMAKE
 is finished, NMK reads the PWB.SHL file and executes the required
 commands. Once it is finished, the PWB.SHL file is set to 0 bytes or
 deleted.

 To see this behavior, create a file and name it PWB.SHL, placing the
 following two lines in it:

    type listing.txt
    dir > listing.txt

 Place this file in the subdirectory pointed to by the TMP environment
 variable. The following command will spawn NMAKE /z in an attempt to
 parse PROGRAM.MAK, and then execute PWB.SHL:

    nmk /f program.mak

 PWB.SHL will be set to 0 bytes or deleted after all commands have been
 executed.

 If PROGRAM.MAK does not exist, NMAKE will report an error informing
 you of that fact, and then NMK will proceed to execute PWB.SHL as
 described above.

 If you do not have a TMP environment variable, PWB.SHL will be
 executed if it exists in the current subdirectory.

 A side effect to be aware of is the following scenario. If you have
 shelled out of the Programmer's WorkBench to run your program (from
 the Execute selection on the Run menu) and your program hangs, forcing
 you to reboot, a PWB.SHL file will be left in your TMP subdirectory.
 If, after rebooting, you happen to run NMK before going into PWB, NMK
 will find the PWB.SHL file in the TMP subdirectory and execute it,
 causing PWB to be invoked even though you had not explicitly invoked
 PWB since the reboot.


 41. NMAKE Does Not Expand Wildcard Characters

 Product Version(s): 1.11   | 1.11
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified:  6-FEB-1991    ArticleIdent: Q67794

 Page 107 of the "Advanced Programming Techniques" manual that shipped
 with Microsoft C version 6.00 states:

    NMAKE expands wild cards in target names when it reads the
    description file.

 NMAKE does not expand these wildcard characters when passing the
 wildcard to the compiler. The example given works correctly because
 the compiler expands the wildcard on its own. If you use a compiler
 that does not expand wildcards, the example given will not work.


 42. NMAKE Default Is to Build Only the First Target in a Makefile

 Product Version(s): 1.00 1.01 1.11 1.12 | 1.01 1.11 1.12
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER |
 Last Modified: 15-JAN-1991    ArticleIdent: Q40184

 The NMAKE file maintenance utility will only "make" the first target
 in the makefile if no target is explicitly given on the command line.

 Although the following sample makefile will both compile and link
 PROG1.EXE when used with MAKE, it will only compile when the NMAKE
 utility is used. This is an important consideration when porting
 makefiles from MAKE to NMAKE.

 # Sample makefile MAKEFILE1

 PROG1.OBJ : PROG1.C
     cl /Zi /c PROG1.C

 PROG1.EXE : PROG1.OBJ
     link /CO PROG1.OBJ

 If all files are out of date with PROG1.C, and MAKEFILE1 is executed
 with the standard invocation as follows

    NMAKE /f makefile1

 the only command executed from MAKEFILE1 will be the following:

    cl /Zi /c prog1.c

 The LINK command will not be executed because NMAKE did not receive a
 specific target; thus, it only makes the first target in the makefile.
 To achieve the desired results, the desired target (PROG1.EXE) must be
 specified on the NMAKE command-line or the following line could be
 added to MAKEFILE1 (it must be the first line in the makefile):

    ALL : PROG1.EXE

 This pseudotarget "ALL" will be made because it will be the first
 target in the makefile. By using the pseudotarget, it is guaranteed
 that all dependencies will be made because the dependents are always
 out of date. This will force NMAKE to make all targets dealing with
 PROG1.EXE.

 Please refer to the NMAKE documentation shipped with your compiler or
 assembler for more information.


 43. Accessing Environment Variables Inside MAKE or NMAKE Makefile

 Product Version(s): 1.00 1.01 1.10 1.11 1.12 | 1.01 1.10 1.11 1.12
 Operating System:   MS-DOS                   | OS/2
 Flags: ENDUSER | s_make
 Last Modified: 23-JAN-1991    ArticleIdent: Q59141

 You can access environment variables within a MAKE or NMAKE makefile
 in the same way that you access user-defined macros. The only
 difference is that the names of environment variables must be
 capitalized when used in this manner. For example:

 SOURCE=c:\mysource
 # the INCLUDE "macro" will pick up your INCLUDE environment variable

 file.obj : $(SOURCE)\file.c $(INCLUDE)\file.h
     cl /c /Zi /Od $(SOURCE)\file.c


 44. Recursively Calling NMAKE Using the MAKEFLAGS Macro

 Product Version(s): 1.11   | 1.11
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 17-JAN-1991    ArticleIdent: Q68234

 According to page 113 of the "Microsoft C Advanced Programming
 Techniques" manual, if you want to invoke NMAKE recursively, the macro
 $(MAKEFLAGS) can be used to pass the command-line switches to the
 recursively invoked NMAKE. However, the $(MAKEFLAGS) macro will
 contain only the letters of the switches and will not contain the
 actual command-line syntax.

 For example, if the original command line contained "/D /N", the
 $(MAKEFLAGS) macro will contain "DN". This results in NMAKE trying to
 use the $(MAKEFLAGS) macro as the name of the makefile, rather than as
 command-line switches. To use the $(MAKEFLAGS) macro to invoke NMAKE
 recursively, it is necessary to precede it with a hyphen (-) or
 forward slash (/) so that NMAKE uses the macro as a set of
 command-line switches. The documentation should read:

    $(MAKE) -$(MAKEFLAGS)


 45. Placing a Target File in Different Directory Than Dependents

 Product Version(s): 4.07   | 4.07
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_make
 Last Modified:  6-FEB-1991    ArticleIdent: Q46354

 To put a target file in a directory different from its dependent file
 in a makefile, you must explicitly name the path for the target file.
 When compiling, use the /Fo switch and a path to place the .OBJ file
 in a different directory from the source. When linking, give the full
 pathname when specifying the .EXE file parameter.

 The following example demonstrates both aspects:

 # MAKE SURE THERE IS A TRAILING BLANK AFTER THE FINAL BACKSLASH
 LONGPATH=e:\c51\binr\
 SHORTPATH=e:\c51\

 pixel.obj:  $(LONGPATH)pixel.c
 # USE /Fo SWITCH TO PUT .OBJ FILE IN DIFFERENT DIRECTORY
   cl /Fo$(SHORTPATH) /c $(LONGPATH)pixel.c

 Note that if you use a macro in the makefile for the pathname (as
 shown above), then you must be sure the final backslash (\) in the
 pathname is followed by a trailing space. If there is no trailing
 space, the backslash will be interpreted as a line-continuation
 character. When you create the makefile, use an editor that will
 preserve a trailing space, such as the Programmer's WorkBench or the
 Microsoft Editor (if you set the "trailspace" switch).


 46. Extmake Switch Does Not Expand Macros

 Product Version(s): 1.11   | 1.11
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.11
 Last Modified: 24-JAN-1991    ArticleIdent: Q68379

 The following NMAKE description file shows that macro substitution
 does not occur when using the extmake switch.

 To show the error, set SUBDIR to a subdirectory and execute NMAKE on
 the makefile while in ANOTHER subdirectory.

 Sample Makefile
 ---------------

 SUBDIR = subdir

 foo.exe: $(SUBDIR)\foo.c
      cl %|pfeF

 Resulting command:  cl $(SUBDIR)\foo.c

 The workaround for this particular problem is to replace the extmake
 switch with the predefined macros (that is, $** and $?).


 47. The D Modifier to $? Is Broken in NMAKE Version 1.11

 Product Version(s): 1.11   | 1.11
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.11 fixlist1.12
 Last Modified: 24-JAN-1991    ArticleIdent: Q68381

 The D modifier to the $? macro is supposed to return the directory and
 drive portion of the dependent. This does not work properly with NMAKE
 version 1.11. Instead, the full pathname and filename are returned.
 This was corrected in NMAKE version 1.12, which shipped with Microsoft
 COBOL version 4.00.

 Sample Makefile
 ---------------

 all : c:\dos\command.com
    echo The D modifier of $? is $(?D)


 48. $$(@F) Macro Doesn't Work with NMAKE Version 1.01

 Product Version(s): 1.01   | 1.01
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | buglist1.01 fixlist1.11
 Last Modified: 24-JAN-1991    ArticleIdent: Q68388

 The $$(@F) macro illustrated on page 297 of the "Microsoft FORTRAN
 CodeView and Utilities User's Guide" for version 5.00 will not
 function correctly in NMAKE version 1.01. This has been corrected in
 NMAKE version 1.11, which shipped with Microsoft C version 6.00.

 The following is the example from page 297:

 DIR=c:\include
 $(DIR)\global.h $(DIR)\types.h $(DIR)\macros.h: $$(@F)
      !COPY $? $@

 With NMAKE version 1.01, this will only work for the first file in the
 list. Subsequent files are not processed. NMAKE 1.11 correctly copies
 all three files to the c:\include directory.


 49. NMK Displays Only First of Multiple Commands

 Product Version(s): 1.11
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.11 S_C S_NMK
 Last Modified:  1-FEB-1991    ArticleIdent: Q68658

 NMK version 1.11 displays only the first of multiple commands it is
 executing when the exclamation point (!) command modifier is used with
 the predefined macro $? or $**.

 The ! command modifier executes the command for each dependent file if
 the command uses the predefined macro $? or $**. The $? macro refers
 to all dependent files that are out-of-date with respect to the
 target. The $** macro refers to all dependent files in the description
 block.

 The sample makefile below echoes each filename to the screen. The
 NMAKE output shows the correct result; each ECHO command is displayed
 and executed. Likewise, the NMK output executes each ECHO command;
 however, only the first command is displayed to the screen.

 Sample Makefile
 ---------------

 ALL: foo1.c foo2.c foo3.c
       !ECHO $**

 Output:

       NMAKE                      NMK
 -----------------         -----------------
       ECHO foo1.c               ECHO foo1.c
 foo1.c                    foo1.c
       ECHO foo2.c         foo2.c
 foo2.c                    foo3.c
       ECHO foo3.c
 foo3.c

 Microsoft has confirmed this to be a problem in NMK version 1.11. We
 are researching this problem and will post new information here as it
 becomes available.


 50. NMAKE Doesn't Allow CD Command That Only Specifies Drive

 Product Version(s): 1.11 1.12 | 1.11 1.12
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | buglist1.11 buglist1.12
 Last Modified:  5-FEB-1991    ArticleIdent: Q68836

 DOS and OS/2 command lines allow you to see the current directory of a
 drive by using the CD (change directory) command. For example, the
 command "CD D:" will return the current directory for the D drive.
 Because this is a valid DOS or OS/2 command, NMAKE should allow you to
 perform the command without error. However, when the NMAKE file below
 is executed, the following message occurs:

    NMAKE: fatal error U1077: 'cd' :return code '1'

 NMAKE treats the CD command as a special case and fails to execute the
 command correctly.

 Sample NMAKE File:

 all:
    cd d:

 Microsoft has confirmed this to be a problem in NMAKE versions 1.11
 and 1.12. We are researching this problem and will post new
 information here as it becomes available.


 51. NMK Macros Do Not Override Environment Variables

 Product Version(s): 1.11
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist1.11
 Last Modified:  6-FEB-1991    ArticleIdent: Q68946

 Macros that are created to redefine environment variables (such as
 INCLUDE, LIB, and PATH) do not work correctly when the description
 file is executed using NMK.COM, rather than NMAKE.EXE.

 The description file below, when executed by NMAKE.EXE, will look for
 the include files in the directory "E:\C\INCLUDE". If the same
 description file is executed by NMK.COM, the include directory will be
 determined by the include environment variable.

 Sample Code
 -----------

 INCLUDE=E:\C\INCLUDE

 FOO.EXE : FOO.OBJ
    link foo.obj;

 FOO.OBJ : FOO.C
    cl /c foo.c

 Note: This example will reproduce the problem correctly only if the
 following conditions are met.

 1. FOO.C exists.
 2. FOO.C contains a line of the form:

       #include <INC_FILE.H>

 3. INC_FILE.H exists in the directory "E:\C\INCLUDE".
 4. INC_FILE.H does not exist in the default include directory.

 Finally, NMK does change the variable for arguments that are in the
 makefile. Therefore, to work around the problem above, you can use the
 following example:

 INCLUDE=E:\C\INCLUDE

 FOO.EXE : FOO.OBJ
    link foo.obj;

 FOO.OBJ : FOO.C
    cl /c /I$(INCLUDE) foo.c






 Microsoft Development Utilities
 =============================================================================


 1. Hyphen in File or Directory Name Causes LIB Error U2155

 Product Version(s): 3.00 3.04 3.07 3.08 3.10 3.11 3.14 3.17 | 3.10 3.11 3.14
 Operating System:   MS-DOS                                  | OS/2
 Flags: ENDUSER | s_lib dash minus sign
 Last Modified: 16-JAN-1991    ArticleIdent: Q67880

 The Microsoft Library Manager utility LIB.EXE does not allow file or
 directory names to contain a hyphen (-) character. If a file or
 directory name containing a hyphen is passed to LIB.EXE, the following
 error will be generated:

    LIB : error U2155: <path> : module not in library; ignored

 Although a hyphen is a valid character for a DOS or OS/2 filename, LIB
 interprets this character as the extraction operator that tells LIB to
 remove an object module from an existing library. Since LIB is
 assuming everything following the hyphen is the name of an object
 module that you want removed, and since this is not an actual module
 name, the U2155 error is generated.

 A common situation where this error may occur is while installing one
 of the Microsoft language products that build combined libraries
 during the installation process. You may receive the U2155 error when
 running a Setup program if you have specified a directory name during
 setup that contains a hyphen. For example, many C users install the C
 compiler in a directory called MS-C, but Setup then fails when LIB is
 called to build the combined libraries in that directory.

 This is expected behavior for LIB.EXE and is the result of the
 established command-line syntax. Unless the command-line syntax is
 changed, the hyphen cannot be recognized as a filespec character
 instead of an operator.


 2. How to Add a Category in QuickHelp

 Product Version(s): 1.70   | 1.40 1.70
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_qh s_helpmake
 Last Modified: 24-JAN-1991    ArticleIdent: Q66631

 When creating a help database with HELPMAKE, new categories may be
 added to the Microsoft Advisor help system for use in the QuickHelp
 utility. To add selections that will appear under the QuickHelp
 Categories menu, use the topic "List categories." Under the List
 categories topic, list the selections that need to be added to the
 menu.

 The following is a sample help file:

    File CATEGORY.TXT
    -----------------

       .context List categories
       Category1
       Category2

       .context Category1
       This is the information under the first category.

       .context Category2
       This is the information under the second category.

 For the file CATEGORY.TXT shown above, the HELPMAKE command line will
 appear as follows:

    helpmake /E8 /Ocategory.hlp category.txt

 The choice of /E8 for partial compression is strictly arbitrary in
 this case, and is shown for demonstration purposes only. The maximum
 compression can be achieved by using /E15, and no compression is
 denoted by /E0.

 When the above help database is added to the list of databases for the
 Advisor, the topics "Category1" and "Category2" will be added under
 the Categories menu.

 The items that are placed in the List categories topic should be
 topics that are already defined with ".context" strings; otherwise,
 when the item is selected from the Categories menu, a message will be
 displayed stating that the topic could not be found.

 When using HELPMAKE with the "/C" option, which preserves case
 sensitivity, you must use the string "List categories" exactly. The
 case is important. Failure to use the exact case for each letter will
 cause the Advisor to ignore the categories you have added.


 3. Help Files for QuickC Require Special "Backtrace" Declaration

 Product Version(s): 6.00 6.00a | 6.00 6.00a
 Operating System:   MS-DOS     | OS/2
 Flags: ENDUSER | docerr s_quickc s_helpmake
 Last Modified: 11-FEB-1991    ArticleIdent: Q68678

 When creating a help file using the Microsoft Helpmake utility, !B is
 defined to have the effect of backtracing to the previous help screen
 (if available). However, this is true only when using QuickHelp or the
 Programmer's WorkBench (PWB). If an attempt is made to use this help
 file with QuickC, the link will issue a beep and no backtrace will be
 allowed.

 The documentation included with Microsoft C version 6.00 does not
 reference the exclamation (!) character as being a special function.
 However, on pages 20-21, the "Professional Advisor Library Reference"
 lists all the options available for this command. It also states that
 the !CQ.HB command will allow QuickC version 2.00 compatibility.
 However, it should be noted that the compatibility for this function
 is for QuickC version 2.50 as well. The use of this command gives
 complete compatibility through C versions 6.00 and 6.00a, as well as
 QuickC versions 2.50 and 2.00.

 Another error in the documentation is that !CQ.HB must be in all
 lowercase letters (that is, !cq.hb). HelpMake will not issue an error
 message with an uppercase command, but it will also not allow a
 backtrace to be performed.


 4. Omitting .LIB Extension with BIND Gives U1268 Error

 Product Version(s): 1.10 1.30 | 1.10 1.30
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | s_bind
 Last Modified: 15-JAN-1991    ArticleIdent: Q29135

 Question:

 When I try to bind an application using the BIND utility, I receive
 the following error message:

    BIND : fatal error U1268: duplicate infile given

 This is my BIND command line:

    bind file.exe c:\c\lib\os2 c:\c\lib\api

 What is causing this error?

 Response:

 This error occurs with BIND if you do not specify the .LIB extension
 for the libraries, OS2.LIB and API.LIB. The correct command line is as
 follows:

    bind file.exe c:\c\lib\os2.lib c:\c\lib\api.lib

 Note that BIND version 1.00 displays the same error, but does not
 display an error number.


 5. C 6.00 Utility Support for OS/2 Long Filenames

 Product Version(s): 6.00
 Operating System:   OS/2
 Flags: ENDUSER | s_link s_nmake s_c
 Last Modified: 28-JAN-1991    ArticleIdent: Q58487

 The utilities shipped for Microsoft C version 6.00 provide limited
 support for OS/2 long filenames introduced in OS/2 version 1.20.

 The following is a list of the limitations:

 1. Long filenames with quotation marks are supported via the command
    line. For example:

       "fooo bar"

 2. Embedded quoted long filenames on the command line are not
    supported. For example:

       d:\foo\" bar xyzzy"

 3. Link supports one quoted long filename per argument. For example

       "foo bar"+"bar foo"

    will resemble the following:

       "foo bar+bar foo"

 4. NMAKE provides long filename support inside the makefile with the
    restriction (beyond 1 and 2 above) that target and dependent names
    cannot have a period (.) as the first character (conflicts with
    inference rules). For example:

       ".foo bar.c".".foo bar.exe"


 6. Modifying Existing Help Files with HELPMAKE (QuickC Example)

 Product Version(s): 1.00 1.04 1.05 1.06 | 1.04 1.05 1.06
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER | s_helpmake s_qh
 Last Modified: 24-JAN-1991    ArticleIdent: Q40599

 You can add to or change the information in the online help files that
 are accessible from QuickHelp, PWB, and QuickC. To accomplish this, do
 the following:

 1. Decompress the existing help file using HELPMAKE.EXE.

 2. Edit the resulting source listing of the help file.

 3. Recompress this modified file using HELPMAKE.EXE.

 The example below illustrates this process.

 There is a known coding error in the Font function examples in the
 QuickC 2.00 online help. This error occurs in the following code line:

    strcat (fondir, "\*.fon") ;

 This statement should be corrected to read as follows:

    strcat (fondir, "\\*.fon") ;

 To correct this online example in the GRAPHICS.HLP file, do the
 following:

 1. Decompress GRAPHICS.HLP, as follows:

       HELPMAKE /D /Ographics.src /V Graphics.hlp  > decode.log

    /D  Tells HELPMAKE to decode GRAPHICS.HLP
    /O  Tells HELPMAKE to name the output file GRAPHICS.SRC
    /V  Tells HELPMAKE to be verbose in decoding information

    "> decode.log"  redirects decoding information to DECODE.LOG.
    This DOS redirection is not necessary, but is helpful.

 2. Edit GRAPHICS.SRC

    Using an editor of your choice, search GRAPHICS.SRC for the
    code line that contains "\*.fon". When you locate the strcat()
    instruction mentioned above, you will notice that the line already
    correctly reads as follows:

       strcat (fondir, "\\*.fon") ;

    This is the correct coding for the C language. However,
    HELPMAKE.EXE views the backslash, "\", as a flag for instructions.
    Therefore, the first "\" is interpreted and is subsequently not
    viewable in the online help.

    If you intend a "\" to be viewed from within the online help, you
    must type two backslashes. That is why the strcat() instruction is
    displayed in the online help with only one "\".

    To display two successive backslashes from within online help, you
    must type four backslashes in the source file, which HELPMAKE will
    interpret and compress into a helpfile.

    In this example, you would modify the following statement

       strcat (fondir, "\\*.fon") ;

    to read as follows:

       strcat (fondir, "\\\\*.fon") ;

 3. Recompress GRAPHICS.SRC into a help file, as follows:
    (This process may take up to 10 minutes with this file.)

    HELPMAKE /E15 /A: /W128 /Ographics.hlp graphics.src /V > encode.log

    /E15   Tells HELPMAKE to fully compress GRAPHICS.SRC
    /A:    Tells HELPMAKE to view a ':' as an operator
    /W128  Tells HELPMAKE to truncate lines longer than 128 characters
    /O     Tells HELPMAKE to name the output file GRAPHICS.HLP
    /V     Tells HELPMAKE to output verbose encoding information

    "> encode.log" redirects encoding information to ENCODE.LOG
    This is helpful, but it is not necessary.

 4. Copy the new GRAPHICS.HLP to the directory with your other
    help files.

 For further information, refer to the printed or online documentation
 supplied with your version of HELPMAKE.


 7. HELPMAKE Interprets Backslashes as Formatting Flags

 Product Version(s): 1.00 1.04 1.05 1.06 | 1.04 1.05 1.06
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER | s_helpmake
 Last Modified: 24-JAN-1991    ArticleIdent: Q40598

 The Microsoft HELPMAKE utility interprets a backslash (\) as a
 formatting flag. If you want to display a backslash in the online
 help, you must type two successive backslashes (\\). The first
 backslash is interpreted; the second is displayed.

 For further information on formatting flags, refer to the HELPMAKE
 documentation in the utilities manual, or the online help supplied
 with your particular compiler.


 8. HELPMAKE: "/A:" Must Be Used When Using Colon (:) Commands

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_helpmake s_quickc docerr
 Last Modified: 28-JAN-1991    ArticleIdent: Q42771

 In at least two places in the "Microsoft QuickC Tool Kit" version 2.00
 manual, it is implied that the colon (:) is used as a default for
 HELPMAKE commands. However, it is never explicitly stated that
 HELPMAKE must be invoked with the "/A:" option when encoding the help
 database.

 In fact, for any HELPMAKE colon (:) command to be recognized and
 correctly interpreted during the encoding process, the "/A:" switch
 must be used. For example, to encode the source file HELPTEST.SRC into
 the help database HELPTEST.HLP, the following line should be used
 (where "/A:" specifies the control character; "/E" indicates that the
 file is being encoded, not decoded; and "/O" gives the destination
 filename):

    HELPMAKE /A: /E /OHELPTEST.HLP HELPTEST.SRC

 HELPMAKE options may be in either uppercase or lowercase letters.


 9. Specifying Anchor Blocks in Help Files in RTF

 Product Version(s): 1.05   | 1.05
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 31-JAN-1991    ArticleIdent: Q68688

 Rich Text Format (RTF) is a text format supported by Microsoft Word
 and other word processors. HELPMAKE.EXE can use an RTF file (and the
 RTF symbols) to create help databases for the Microsoft Advisor.
 However, because \a (Anchor text for cross-reference) is not an RTF
 symbol, there is no documented method for creating hyperlinks that
 have more than one word.

 When Helpmake encodes RTF, any text between an RTF code and hidden
 text on a single line becomes a hyperlink. For example, the following

    {\bHyperlink here}{\vhyperlink.dat}

 will cause "Hyperlink here" to be displayed in bold type, and be a
 hyperlink to the topic "hyperlink.dat". To create an anchor block of
 unformatted text, use the \plain code. For example, the following

    {\plainplain hyperlink}{\vhyperlink.dat}

 will cause "plain hyperlink" to be displayed in normal text, and be a
 hyperlink to "hyperlink.dat". If you want to create a hyperlink that
 has only one word, anchor blocks are not needed. Finally, a link must
 fit entirely on one line. You cannot continue invisible or anchored
 text over a line break.

 Sample Code
 -----------

    {\rtf0
    >> open \par
    {\b Include:}   <fcntl.h>, <io.h>, <sys\\types.h>, <sys\\stat.h>

    {\b Prototype:}  int open(char *path, int flag[, int mode]);\par
        flag: O_APPEND  O_BINARY   O_CREAT  O_EXCL  O_RDONLY\par
         O_RDWR    O_TEXT   O_TRUNC  O_WRONLY\par
         (can be joined by |)\par
        mode: S_IWRITE  S_IREAD   S_IREAD | S_IWRITE\par
    \par
    {\b Returns:}    a handle if successful, or -1 if not.\par
      errno:  EACCES, EEXIST, EMFILE, ENOENT\par
    \par
    {\b See also:}   {\plain Example Program}{\v open.ex},\par
    {\ul Template}{\v open.tp}, access, chmod, close,\par
    creat, dup, dup2, fopen, sopen, umask\par
    }

 For more information, see the online help and Chapter 7 in the
 "Microsoft C Advanced Programming Techniques" manual.


 10. RTF Codes \fi<n> and \li<n> Use Twips Instead of Spaces

 Product Version(s): 1.06   | 1.06
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr
 Last Modified: 31-JAN-1991    ArticleIdent: Q68694

 The Rich Text Format codes \fi<n> and \li<n> used for creating help
 files are incorrectly described in the online help. The online help
 states that the code \fi<n> indents the first line of the paragraph
 <n> spaces, and the code \li<n> indents the entire paragraph <n>
 spaces from the left margin.

 However, the value of <n> is the number of twips and not the number of
 spaces. A twip is 1/20 of a point or 1/1440 of an inch; 180 twips
 approximates one space (that is, \li720 will indent the entire
 paragraph four spaces).

 Page 4 of the "Professional Advisor Library Reference" describes the
 RTF codes \fi and \li but does not mention the <n> parameter to indent
 the paragraphs.

 Page 155 of the "Microsoft C Advanced Programming Techniques" manual
 describes the correct syntax for the RTF codes but does not mention the
 format for <n>.


 11. Help Databases Not Properly Decoded by HELPMAKE.EXE

 Product Version(s): 1.03 1.05 1.06 | 1.03 1.05 1.06
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER | buglist1.03 buglist1.05 buglist1.06
 Last Modified:  6-FEB-1991    ArticleIdent: Q68989

 When using HELPMAKE.EXE to decode concatenated help databases, you
 must use the "Decode Split" option (/DS). If a concatenated help
 database is decoded with either "Decode" (/D) or "Decode Unformatted"
 (/DU), HELPMAKE may be caught in an infinite loop that will eventually
 fill the hard disk.

 If OS2.HLP is decoded with

    helpmake /D /Ooutfile OS2.HLP

 HELPMAKE will decompress the first database in OS2.HLP over and over
 until either the disk fills up or you stop the program (with a
 CTRL+BREAK, for instance).

 If OS2.HLP is decoded with

    helpmake /DS OS2.HLP

 it is broken into STRUCT.HLP, MACROS.HLP, and TABLES.HLP. These help
 files can then be decoded properly with the /D or /DU option.

 If you don't know how a help file is assembled, the following are the
 steps to take to decompress it:

 1. Save a backup copy of the help file in case of problems.

 2. Rename the help file to "TEMP.HLP".

 3. Split the file as follows:

       HELPMAKE /DS TEMP.HLP

    If the file is not a concatenated database, you will get a single
    file with the name of the help database as it was originally built
    (the internal database name).

    If the file is a concatenated database, you will get individual
    help files with the internal database names. For OS2.HLP, these are
    STRUCT.HLP, MACROS.HLP, and TABLES.HLP.

 4. Decode the resulting files as follows:

       HELPMAKE /D TEMP1.HLP /OTEMP1.SRC
       HELPMAKE /D TEMP2.HLP /OTEMP2.SRC

 Microsoft has confirmed this to be a problem with HELPMAKE.EXE versions
 1.03, 1.05, and 1.06. We are researching this problem and will post new
 information here as it becomes available.


 12. Always Use Latest Version of HIMEM and Other Memory Utilities

 Product Version(s): 2.50 2.60
 Operating System:   MS-DOS
 Flags: ENDUSER | s_codeview s_himem s_ramdrive s_smartdrv
 Last Modified: 15-JAN-1991    ArticleIdent: Q60830

 The newest versions of the memory management utilities (HIMEM.SYS,
 RAMDRIVE.SYS, and SMARTDRV.SYS) should be used at all times. For
 instance, if you use CodeView Version 3.00 (first shipped with
 Microsoft C Version 6.00) and you use a version of HIMEM.SYS earlier
 than what was shipped with the C 6.00 package, you may experience a
 number of problems, including the following:

 1. You may get spurious error messages such as "Not enough extended
    memory available," even if you have more than enough extended
    memory installed.

 2. You may receive the error "CV1319: CodeView initialization error"
    when trying to invoke CodeView.

 3. Your computer may hang or reboot.

 As memory management technology progresses, the Microsoft tools and
 utilities that use the technology are also updated. Therefore, it is
 critical that the latest versions of the memory utilities (HIMEM.SYS,
 RAMDRIVE.SYS, SMARTDRV.SYS, etc.) be installed. Tools such as CodeView
 and the Programmer's WorkBench (PWB) depend on features that are
 available only in the latest versions.


 13. Using LIB to Combine Two Libraries

 Product Version(s): 3.00 3.04 3.07 3.08 3.10 3.11 3.14 3.17 | 3.11 3.14 3.17
 Operating System:   MS-DOS                                  | OS/2
 Flags: ENDUSER | s_lib
 Last Modified: 15-JAN-1991    ArticleIdent: Q25108

 The Microsoft Library Manager utility (LIB.EXE) can be used to combine
 two libraries into one.

 The following is an example of how to add the contents of LIB1.LIB to
 LIB2.LIB in a single LIB command:

    LIB LIB2.LIB+LIB1.LIB;

 You may also have LIB prompt you for input, in which case the input
 and prompts will appear as follows:

 LIB <RETURN>
 Library name: LIB2.LIB <RETURN>
 Operations: +LIB1.LIB <RETURN>

 Note that the .LIB extension is required; otherwise, LIB will assume
 LIB1 is an object module.


 14. Using EXEHDR or EXEMOD to Change the Stack Size of an .EXE

 Product Version(s): 1.00 2.01 | 1.00 2.01
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | s_exehdr s_exemod
 Last Modified:  6-FEB-1991    ArticleIdent: Q25321

 The EXEHDR and EXEMOD utilities can be used to change the stack size
 of a program. EXEHDR runs in both DOS and OS/2, while EXEMOD is an
 older utility that only runs under DOS.

 To view the current size of the stack, no options are used. Both
 EXEHDR and EXEMOD will produce a table of information with a line such
 as the following:

    Initial SS:SP 0000:0800 0

 The offset portion of this line gives the current stack size in hex.
 In this example, the stack size is set at 2K. If you wanted to change
 it to 4K, you could use the /STACK option of EXEHDR or EXEMOD in the
 following way:

    EXEHDR file /STACK 1000

 -or-

    EXEMOD file /STACK 1000


 15. Replacing Real Mode Family API Functions in Bound Applications

 Product Version(s): 1.00 1.10 1.30 | 1.00 1.10 1.30
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER | s_bind
 Last Modified: 15-JAN-1991    ArticleIdent: Q39812

 Question:

 How do I create a bound application that uses the system calls in
 protected mode and uses my calls in real mode? The real mode call must
 access global data in my program.

 I would like to bind a program so that it will use the system
 VioGetConfig() function in protected mode, but will use my rewritten
 VioGetConfig() function when run in real mode. Everything compiles and
 links correctly, using either my function or the system function.
 However, my VioGetConfig accesses an initialized global int that is
 declared above the main(), which still compiles and links error free.
 But when I link the main with the system VioGetConfig, then bind the
 .EXE giving it the user's version of VioGetConfig, I get an unresolved
 external on the external global variable from the assembly routine.

 Response:

 The original strategy is probably the best method and should work
 correctly in the general case, that is, in the BIND step, specify the
 user version of VioGetConfig(). The problem is the global int
 variable. BIND does a link of the following:

    API stub loader
    API library modules
    protected-mode image with no symbols

 The key point is that BIND has no access to the internal name space of
 the program. Thus any API routine, including one rewritten by the
 user, cannot see any of the program's data. You should rewrite your
 VioGetConfig() so it does not use the global variable, if possible.
 Otherwise you will have to use one of the methods discussed below.

 Rather than using BIND, do it yourself. In the main program, use code
 such as the following:

     /* Under what operating system we are running ? */

     if (_osmode == DOS_MODE)
     {
         /* We are running under DOS - real mode */

         VioGetConfigUser(); /* User version */
     }
     else
     {
         /* We are running under OS/2 - protected mode */

         VioGetConfig();     /* System version */
     }

 Another way to do this is to build a dual-mode .EXE, as follows:

 1. Build your real-mode program using user VioGetConfig.

 2. Write protected-mode main program using OS/2 VioGetConfig.

 3. In the .DEF file for the protected-mode program, add the following
    statement:

       STUB '<name-of-your-real-mode-app>'

 4. Link your protected-mode application. You will get two programs in one
    .EXE file. In protected mode, the system will load only the
    protected-mode version. In real-mode, the system will load only
    real-mode applications.


 16. Page Size May Cause Big Size Increase When Combining Libraries

 Product Version(s): 3.0x 3.11 3.14 3.17 | 3.11 3.14 3.17
 Operating System:   MS-DOS              | OS/2
 Flags: ENDUSER | s_lib
 Last Modified: 15-JAN-1991    ArticleIdent: Q44896

 Question:

 When I use LIB.EXE to combine my libraries with a third-party library,
 the resultant library is much larger than I expected it to be.

 The following is an example:

     LIB1.LIB    5K   bytes
     LIB2.LIB    250K bytes

     LIB1.LIB + LIB2.LIB  = 305K bytes

 Why is the combined file 50K larger?

 Response:

 This size difference may be the result of different page sizes among
 the libraries being combined. The page size of a library affects the
 alignment of modules stored in the library. When libraries with
 different page sizes are combined, the resultant library uses the
 largest page size from the constituent libraries. Thus, the actual
 increase in file size represents wasted space between modules in the
 library. To reduce the amount of wasted space, you should specify a
 smaller page size for the new library. This may be accomplished by
 using the library manager as follows:

    LIB BIG.LIB /PAGESIZE:16;

 This sets the page size for the library BIG.LIB to 16 bytes.

 As indicated in the library manager documentation, the page size must
 be an integer power of 2 from 16 to 32,768 bytes.


 17. Helpmake Binary Format Is Proprietary

 Product Version(s): 1.00 1.05 1.06 | 1.00 1.05 1.06
 Operating System:   MS-DOS         | OS/2
 Flags: ENDUSER | s_helpmake
 Last Modified: 15-JAN-1991    ArticleIdent: Q48292

 The binary format of the help files produced by the Microsoft Helpmake
 utility is proprietary information, and therefore, not available for
 distribution.


 18. CALLTREE Produces Argument Mismatch with Void Parameter List

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | s_calltree buglist1.00 s_editor
 Last Modified: 15-JAN-1991    ArticleIdent: Q46896

 The CALLTREE utility program included with the Microsoft C version
 5.10 produces the following error message if a void parameter list is
 used for the function foo() and the options -a and -b are specified on
 the command line:

    Argument Mismatch Calling        foo  in  main.c(10)

 Microsoft has confirmed this to be a problem in version 1.00. We are
 researching this problem and will post new information here as it
 becomes available.

 The CALLTREE utility program can be used to produce a tree-like
 structure of function usage. Documentation on the options for CALLTREE
 can be found in the C 5.10 CodeView and Utilities manual in the
 "Microsoft Editor for the MS OS/2 and MS-DOS Operating Systems: User's
 Guide," section on pages 112-114.

 The following program demonstrates the problem:

 void foo(void);   /* prototye contains (void) */

 void main(void)
 {
   foo();     /* function call does not contain (void) */
              /* replace with foo(void); to prevent warning message */
 }

 void foo(void)
 {
   printf("Inside foo\n");
 }

 Invoke CALLTREE by issuing the following command:

 calltree -a -b back.out -w warn.out main.c

 The "warn.out" file will now contain the error message:

    Argument Mismatch Calling        foo  in  main.c(5)


 19. Incorrect Response File Used with LIB Causes U1183 Error

 Product Version(s): 3.1x   | 3.1x
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 30-AUG-1989    ArticleIdent: Q47016

 Question:

 I want to use a response file entitled LIB_OPS with the library
 manager just for specifying my library operations. When I invoke LIB
 with the command

    LIB mylib.lib @lib_ops, mylib.lst;<cr>

 it generates the following error:

    LIB : fatal error U1183 : 'cannot open response file'

 However, when I invoke LIB using the command prompts and supply my
 response file for the Operations prompt as follows, everything works
 correctly:

     .
     .
     Operations: @lib_ops<cr>
     .
     .

 What differentiates the two cases?

 Response:

 Using a response file on the command line of the library manager
 requires that the response filename be delimited correctly. This is
 mandated by the command-line parser, which considers trailing argument
 delimiters such as a comma or semicolon to be part of the response
 filename. Consequently, the parsing of the unknown filename prohibits
 DOS from locating and opening the correct response file. When a
 response file is detected on the LIB command line (via the "@"
 character), the command interpreter parses following characters as the
 filename argument until a DOS delimiter, either a space character or a
 carriage return, is encountered. Hence, LIB commands such as

    LIB @response;<cr>
    LIB mylib.lib @response, mylib.lst;<cr>

 generate the U1183 "cannot open response file" because the file
 "response" is actually parsed as "response;" and "response,",
 respectively, neither of which exist in the current working directory
 or those directories searched for by the DOS APPEND command. However,
 correctly delimiting the end of the response file argument with a
 space or carriage return allows the following LIB commands to work
 correctly:

    LIB @response ;<cr>
    LIB @response<cr>
    LIB mylib.lib @response ,mylib.lst;<cr>

 When operating the library manager with a response file containing
 information for one or more of the LIB arguments, it must be invoked
 in one of the following two ways:

 1. With the response file supplied on the LIB command line and the
    file's final character delimited correctly (by a space or carriage
    return).

 2. With no command line arguments and the response file used as a
    reply to the appropriate LIB command prompt.

 The first method is discussed and illustrated in the information
 above. The second method of using the library manager prompts is
 equally effective. However, when supplying a response file to a LIB
 command prompt, the filename must be delimited correctly as in the
 aforementioned, or the U1183 error occurs. The following example
 demonstrates the generation of this error due to incorrect delimiting
 of the response file:

 LIB<cr>

 Microsoft (R) Library Manager  Version 3.14
 Copyright (C) Microsoft Corp 1983-1988. All rights reserved

 Library name: mylib.lib<cr>

 Operations: @response;<cr>

 LIB : Fatal Error U1183:  Cannot open response file

 Correcting the response file argument to the Operations prompt as
 follows eliminates the problem:

 Operations: @response<cr>

 or

 Operations: @response thisisextrajunkbutwillworkcuzofthe<space>delimiter


 20. LIB Version 3.17 Available for Increased Library Capacity

 Product Version(s): 3.17   | 3.17
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | appnote SS0329.ARC s_lib
 Last Modified: 17-DEC-1990    ArticleIdent: Q66569

 The Microsoft Library Utility (LIB.EXE) version 3.17 is available to
 registered users of Microsoft language products who are experiencing
 difficulty creating libraries with older versions of LIB due to
 capacity limits. If you are the registered owner of a Microsoft
 language product, you may obtain LIB 3.17 as an application note from
 Microsoft Product Support Services by calling (206) 637-7096.

 LIB 3.17 can also be found in the Software/Data Library by searching
 on the keyword SS0329, the Q number of this article, or S12776. SS0329
 was archived using the PKware file-compression utility.

 Older versions of the Microsoft Library Manager are somewhat limited
 as far as the size of a library that can be created or the number of
 modules or symbols that a library can contain. These limits are not
 specific because the actual limits for any particular library are the
 result of a combination of factors including the number of modules,
 the number of symbols, the page size used, and the order in which
 items are added to the library.

 One indication of a library capacity problem is if a previously usable
 library suddenly causes the linker to generate the error message
 "L1101: invalid object module" after some additions to the library.

 Newer versions of LIB, such as version 3.17, have improved capacity
 over the earlier versions. Thus, libraries with a greater number of
 object modules, and/or a greater overall size, should be possible,
 even though the exact limits are still specific to each particular
 library.

 No documentation for the Library Manager is supplied with the
 application note because its usage and commands are identical to
 previous versions. Any questions concerning the usage, command syntax,
 or options for this version can be addressed by referring to existing
 LIB documentation.


 21. "Packed File Corrupt" Error

 Product Version(s): 3.x 4.x
 Operating System:   MS-DOS
 Flags: ENDUSER | s_link s_c h_fortran s_pascal s_quickc h_masm b_basic
 Last Modified: 12-FEB-1991    ArticleIdent: Q58225

 Question:

 When I attempt to run my program, I get the error message "Packed File
 Corrupt." What causes this error and how can I run my program?

 Response:

 The error is caused by a problem in the packed EXE loader that is
 incorporated into EXEPACKed files. This causes incorrect loading of
 packed files. The problem only occurs when the program is loaded into
 memory before the first 64K byte boundary.

 CHKDSK reports more than 589,824 bytes of free memory. Typically, this
 problem tends to occur with DOS Version 3.30 when you try to free up
 more memory by setting the files and buffers in your CONFIG.SYS file
 to less than their default values.

 To correct this problem, force DOS to load the program above the first
 64K of memory by increasing the amount of memory DOS uses. One way to
 do this is to fill up the first 64K segment with one or more copies of
 COMMAND.COM.

 You can also use copies of COMMAND.COM to diagnose the problem. Spawn
 a new command interpreter by typing "COMMAND" at the DOS prompt. Then
 try to run the program. Keep spawning copies of COMMAND.COM until the
 program runs. When the program runs, you have successfully filled the
 first 64K.

 If this method works, you may resolve the problem in a more permanent
 manner by increasing the number of files and buffers in the CONFIG.SYS
 file, and rebooting your machine.

 The EXEPACK utility compresses sequences of identical characters from
 a specified executable file. It also optimizes the relocation table,
 whose entries are used to determine where modules are loaded into
 memory when the program is executed. When the program is executed, it
 must first unpack the file into memory. It is the unpacking code that
 unpacks incorrectly and generates the "Packed File Corrupt" error.

 For more information on the EXEPACK utility, refer to Page 321 in the
 "Microsoft CodeView and Utilities" manual shipped with C version 5.10.
 For information on the /EXEPACK linker option, refer to the utilities
 manual or online help shipped with your particular version of the
 compiler or assembler.
 Additional reference words: b_quickbasic o_msdos h_mouse h_mspbrush


 22. CVPACK May Lose Type Information in Large Files

 Product Version(s): 2.01 3.01 | 2.01 3.01
 Operating System:   MS-DOS    | OS/2
 Flags: ENDUSER | s_cvpack s_codeview
 Last Modified:  5-FEB-1991    ArticleIdent: Q58718

 Certain type information such as that required to expand a structure
 using the "?? <structurename>" command in CodeView can be lost in
 large files when using CVPACK.

 Running CVPACK on very large executables may remove such information
 from the file. Before running CVPACK, internal information can be
 viewed and members can be expanded on structures; after CVPACK, only
 the structure's address is viewable.

 The reason this occurs is that CVPACK is stripping out information
 that CodeView needs to correctly display pointers to far data.

 In this case, CodeView attempts to provide information on the pointers
 to far data in the structure, but the information it gives is not
 correct. Observing the change in the structure's segment address
 before and after using CVPACK shows that this address changes while
 the offset address remains the same. Therefore, the correct
 information cannot be displayed, and CodeView emits a warning beep
 instead of showing the expanded structure elements.


 23. BIND Error "Import By Ordinal Not Defined: DOSCALLS.5"

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_bind
 Last Modified: 27-DEC-1990    ArticleIdent: Q58929

 Question:

 When I use BIND version 1.00 to bind my OS/2 program, the following
 error message is returned:

    Import by ordinal not defined: DOSCALLS.5

 I bind my program with the following:

    BIND hello.exe -o hellob.exe

 Why do I get that error when I call FAPI functions by name and not
 their ordinal numbers?

 Response:

 The above error occurs because DOSCALLS.LIB must be listed on the BIND
 command line. Bind automatically searches for API.LIB and OS2.LIB
 (using the LIB environment variable), but not DOSCALLS.LIB.

 When using bind, DOSCALLS.LIB must be explicitly listed on the command
 line and the LIB environment variable must point to API.LIB and
 OS2.LIB. For example:

    BIND hello.exe c:\c510\lib\doscalls.lib -o hellob.exe


 24. LIB.EXE Failure When Trying to Build Large Libraries

 Product Version(s): 3.11   | 3.11
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_lib appnote
 Last Modified: 17-DEC-1990    ArticleIdent: Q59892

 When using versions of the Microsoft Library Manager (LIB.EXE) earlier
 than Version 3.14 to try to build large libraries with many symbols
 and modules, the LIB program may fail due to capacity limits.

 If you encounter various failures or random errors when trying to
 build a large library (for example, the Greenleaf Libraries), you
 should contact Microsoft Product Support at (206) 637-7096 to obtain a
 more recent version of LIB.EXE.

 LIB.EXE is shipped with all Microsoft language products for building
 and maintaining run-time libraries. Earlier versions of LIB run into
 problems when the library size approaches 200K or larger, but the
 point at which LIB may fail varies widely. LIB capacity is
 unpredictable because it is affected by such items as the number of
 symbols, the number of modules, and the length of symbol names.

 Sometimes, just changing the order in which modules are added to a
 large library will resolve the problem (or at least alter the point of
 failure or the particular errors generated). Some of the errors
 reported from capacity failures are U1174, U1188, and U1189.

 Errors such as U1174 and U1189 are documented only as being problems
 for which you should contact Microsoft Product Support. In general,
 these errors indicate major LIB capacity overflow problems and the
 best workaround is to update to a newer version of LIB.EXE.


 25. Bound Program Works Under OS/2, but Hangs Under DOS

 Product Version(s): 1.10   | 1.10
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_bind h_fortran s_link
 Last Modified: 15-JAN-1991    ArticleIdent: Q61469

 If you use BIND version 1.10 and the OS/2 Linker/2 Version 1.20, the
 program will bind error-free and will run correctly under OS/2, but
 will hang the machine if run under DOS.

 BIND version 1.10 creates an executable that hangs under DOS but runs
 correctly in OS/2 if the program is linked with the OS/2 linker
 version 1.20. Using BIND 1.10 with LINK version 5.03 resolves this
 problem, and using BIND 1.20 or later with the OS/2 linker also
 creates a valid executable for DOS and OS/2.


 26. Using /help Option with RM.EXE Displays EXP.EXE Online Help

 Product Version(s): 1.01   | 1.01
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_rm s_pwb s_editor docerr
 Last Modified: 17-DEC-1990    ArticleIdent: Q61967

 The utility program RM.EXE version 1.01 displays the wrong help screen
 when invoked with the /help option. The /help parameter is designed to
 invoke the Quick Help (QH) utility in order to display the online help
 for RM.EXE. Because the wrong utility name was written into the RM.EXE
 file, the help screen displayed for RM with /help is the help
 information for the EXP utility.

 This error is due to a problem in the RM.EXE file, rather than being a
 problem in the help files; thus there is no easy way to correct this
 problem. To access the correct help information for RM, one of the
 following methods may be used:

 1. Invoke Quick Help directly. Use RM as the parameter to indicate RM
    as the item on which to find help (for example, type QH RM at the
    DOS or OS/2 prompt).

 2. Invoke RM with the /help option (for example, type RM /help at the
    prompt) and when the EXP help screen appears, page down to the
    bottom where there is a link labeled "RM Command." Select this link
    and the RM help screen will be displayed.

 3. Help on RM can be accessed from within the Programmer's WorkBench
    (PWB) by selecting "Miscellaneous" on the main Help Contents screen
    (in the box titled Microsoft Utilities), and then selecting "RM
    Command" from the submenu.


 27. Helpmake Version 1.05 May Not Decode All Formatting

 Product Version(s): 1.05   | 1.05
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_helpmake buglist1.05 fixlist1.06
 Last Modified: 23-JAN-1991    ArticleIdent: Q64792

 HELPMAKE version 1.05 (shipped with Microsoft C version 6.00) does not
 decode all formatting information in help files decoded with the /D
 option. HELPMAKE version 1.03 (shipped with the OS/2 1.20 SDK) works
 as expected.

 This lack of decoding will result in no bold, green, italic, or
 underline formatting in help files that are compressed again with
 HELPMAKE.

 Microsoft has confirmed this to be a problem in HELPMAKE version 1.05.
 This problem was corrected in HELPMAKE version 1.06. HELPMAKE 1.06 was
 shipped with the Microsoft Advisor Library.

 Example
 -------

 The "\i" and "\p" options are not decoded in the sample below. This
 excerpt is from PWB 1.00 version of the PWB.HLP file.

 Note: Nonprintable characters are removed from these examples.

 From HELPMAKE version 1.03:

    +------- Browse Menu ---------+
    | \i\a\pGoto Definition...\v@L8001\v\i\p | Finds definition of symbol

 From HELPMAKE version 1.05:

    +------- Browse Menu ---------+
    | \aGoto Definition...\v@L8001\v | Finds definition of symbol


 28. QuickHelp Duplicate Search Brings Up Wrong Help

 Product Version(s): 1.70   | 1.70
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_qh buglist1.70 SDK
 Last Modified: 17-DEC-1990    ArticleIdent: Q67234

 In QuickHelp, if you select Duplicate Search from the View menu and
 enter a search string containing a wildcard, all the topics that match
 that string should appear. In some cases, however, all of the
 occurrences are NOT displayed, which causes the help topics to be out
 of sync with the information they bring up. When this problem occurs,
 you may select a topic, and help on a different topic will be
 displayed.

 One example of this problem occurs when searching on _dos* with the
 CLANG.HLP help file that comes with Microsoft C version 6.00. Another
 example is found when searching for wm_* in the SDKADV.HLP help file
 that comes with the Windows 3.00 Software Development Kit. In both
 cases, if you go to the end of the list of topics and bring up the
 information, the wrong help will be displayed.

 Microsoft has confirmed this to be a problem in QuickHelp version
 1.70. We are researching this problem and will post new information
 here as it becomes available.


 29. Hyperlink for MakeProcInstance in SDKADV.HLP Incorrect

 Product Version(s): 1.70   | 1.70
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | s_qh docerr
 Last Modified: 17-DEC-1990    ArticleIdent: Q67397

 When accessing the function MakeProcInstance() from the index in
 QuickHelp version 1.70, the help screen for Windows DataTypes is
 presented instead. This behavior may be duplicated by following the
 procedure outlined below:

 Start QuickHelp with an argument to get help on any windows topic, as
 follows:

    qh wndclass

 This will bring up the help screen for the wndclass structure. Now
 click the right button on the QuickHelp index, and then on the
 alphabetical section for M. At this point, if help for
 MakeProcInstance() is chosen, QuickHelp will, instead, bring up the
 help screen for Windows Data Types.

 If the SDKADV.HLP file is decoded using HELPMAKE, as follows

    helpmake /D /Osdk.doc sdkadv.hlp

 it becomes obvious that the reason for this error is that the
 hyperlink for MakeProcInstance() appears as follows in the decoded
 help file:

    \aMakeProcInstance function \vDatatypes\v

 This causes QuickHelp to display the DataTypes help screen instead of
 help for the appropriate function.

 This problem can be corrected by changing the above line to read as
 follows:

    \aMakeProcInstance function \vMakeProcInstance\v

 The SDKADV.HLP file must then be recompressed, as follows:

    helpmake /E0 /T /Osdkadv.hlp sdk.doc

 The choice of /E0 indicates no compression, and is strictly arbitrary
 in this case. If maximum compression is desired, the 0 argument to the
 /E switch may be left off, or /E15 may be specified.


 30. The Syntax for STACK Is Incorrect in EXEHDR Usage Statement

 Product Version(s): 2.01   | 2.01
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | docerr s_exehdr
 Last Modified: 17-DEC-1990    ArticleIdent: Q67793

 When the /? parameter is used for EXEHDR, a listing is displayed
 detailing the various switches accepted by EXEHDR. This list
 incorrectly indicates that the /STACK switch must be followed by a
 hexadecimal number between 0h and ffffh. In reality, the /STACK switch
 must be followed by either a decimal number between 0 and 65535 or a
 hexadecimal number using C notation (0x0 - 0xffff).

 If any other format is used, EXEHDR will return the following error
 messages:

    EXEHDR: error U1110: malformed number xxxx
    EXEHDR: error U1115: option /STACK:xxxx ignored






 Microsoft Mouse
 =============================================================================


 1. Availability of MENU.COM

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  4-NOV-1988    ArticleIdent: Q28420

 I have obtained a file with the .MNU extension for a third party
 application that requires a file from Microsoft called MENU.COM.

 If you have a mouse with driver Version 6.14, the MENU.COM file will
 be on your Mouse Setup Disk.

 If you have a version between Version 6.00 and Version 6.14, call
 Microsoft Product Support (206) 454-2030 about obtaining MENU.COM.

 If you have a version prior to Version 6.00, you will have the file on
 your System Disk.


 2. Network and Mouse Conflicts

 Product Version(s): 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  4-DEC-1988    ArticleIdent: Q28421

 The bus mouse is interrupt selectable using the J4 jumper block
 located on the INPORT interface card. Make sure the netcard is not
 using the same interrupt; if your network card is using the same
 interrupt, it will crash when the mouse driver installs.

 The bus mouse uses its own I/O address (23c-23f). On the current
 interface cards this can be changed to the lower four bytes by
 selecting secondary INPORT (address 238-23b) over PRIMARY on the J3
 jumper setting. (note: moving the card to another slot may in
 addition solve the problem).

 If the above does not solve the problem or if you have the serial
 mouse, change the driver loading order or disable the driver (mouse
 off) when using the network.

 Contact the manufacturers of your netcard to see if they know of the
 above problem.


 3. IRQ Settings and Mouse Installation

 Product Version(s): 1.x 2.x 3.x 4.x 5.x 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1988    ArticleIdent: Q12230

 The jumper on the bus mouse should be checked before the card is
 installed in any computer, especially if the card is moved from one
 machine to another. The board's jumper controls which interrupt
 request (IRQ) line is used. IRQ lines are used to facilitate
 information transfer from such I/O devices as disk controllers and
 serial ports. The jumper avoids IRQ conflicts with other devices
 already installed in the computer. Under each pair of pins on the card
 is a number between 2 and 5 (inclusive). The jumper selects the IRQ
 line. Microsoft ships the boards with the jumper set to IRQ 2, for
 installation in a typical IBM PC or PC XT. Because IBM changed the IRQ
 architecture in the PC AT by using using IRQ 2 for the second IRQ
 controller, the bus mouse jumper is usually set to IRQ 5 on an AT.

 While these jumper settings are correct for most installations, you
 should verify which (if any) IRQ lines are being used by every device
 already installed in the machine. There can be only one active device
 per IRQ line. Refer to the technical manuals for each manufacturer's
 product or contact the manufacturer directly for this information. The
 following is an IRQ allocation table as defined in the IBM PC and AT
 technical reference manuals (other manufacturers' software, hardware
 and add-on boards must follow this convention in order to be IBM
 compatible):

                                         PC-AT
 IRQ Line        PC, PC-XT       CTLR 1          CTLR 2

     0             Timer         Timer     | IRQ8  Clock
     1            Keyboard      Keyboard   | IRQ9  Redirected IRQ2
     2            Reserved       CTLR 2 <--| IRQ10 Reserved
     3              COM2          COM2     | IRQ11 Reserved
     4              COM1          COM1     | IRQ12 Reserved
     5           Hard disk        LPT2     | IRQ13 Coprocessor
     6          Floppy disk   Floppy disk  | IRQ14 Hard disk
     7             LPT1-3         LPT1     | IRQ15 Reserved

 Because the mouse can be jumpered in the IRQ range of 2 through 5 and
 there can be only one active device per IRQ line, the bus mouse can be
 installed only if at least one of these lines is free.

 For example, a bus mouse is to be installed in an IBM PC-AT with an
 IBM PC-AT Serial/Parallel Adapter configured as COM1 and LPT1,
 respectively; a Color Graphics Adapter; and a multi-function card with
 128K of memory and a serial port configured as COM2. On this computer,
 there is only one IRQ line still available on IRQ controller 1: IRQ 5.
 IRQ 2 is used by the AT's second IRQ controller and IRQ lines 4 and 3
 are used by COM1 and COM2. The CGA does not use an IRQ line and the
 parallel port uses IRQ 7, which falls outside of the mouse's range.
 The bus mouse should be jumpered for IRQ 5, thereby using the last IRQ
 line in the normal IRQ range of 0 through 7 of the first IRQ controller.
 The user of this computer should be aware of this for future
 expansion.

 The Enhanced Graphics Adapter (EGA) is now becoming a popular display
 card for PCs and XTs. The EGA includes a hardware feature that allows
 software to enable interrupts on IRQ2 to indicate the start of
 vertical retrace. Therefore, if an EGA and bus mouse are installed in
 a PC or XT, IRQ2 is no longer available for the mouse. In a full XT
 with a hard disk, two serial ports, an EGA, and a bus mouse, there
 will be an IRQ line overlap between two devices. Therefore, one device
 will have to be sacrificed to free up an IRQ line for the bus mouse.
 This is not a design deficiency of the bus mouse; it is a fundamental
 design restriction in the PCs and XTs.

 As discussed above, there are only eight IRQ lines in the PC and XT,
 of which four are used up by the motherboard and other standard
 equipment. The other four lines go quickly. Almost all expansion cards
 require that a free IRQ line be available, such as the following:

 1. Network cards
 2. Bisync communication cards
 3. Tape back-up units
 4. Some clock/calendar hardware
 5. Serial communication cards
 6. EGAs
 7. Emulation boards
 8. Hard disk controllers

 There are more desirable devices to install in a machine than IRQ
 lines to handle them. To help relieve the crowding of IRQ lines, the
 IBM AT includes a second IRQ controller with seven more lines.
 Currently, hardware is evolving to take advantage of the new AT
 architecture.

 Once the hardware is installed, the software must be loaded. When the
 mouse driver loads, using either MOUSE.SYS from CONFIG.SYS or
 MOUSE.COM from a batch file or the keyboard, the file will be loaded
 into memory and the driver will then install itself. This installation
 requires a few seconds. Various operations are undertaken, including
 mouse hardware initialization. This is the primary reason for the
 delay before the mouse installation message appears.

 If the error message "MOUSE: Microsoft mouse not found!" appears,
 there can be a number of hardware-related causes, such as a broken
 mouse; however, the problem more likely is an IRQ contention problem
 either between the mouse and another device or between the serial
 ports.

 Typical bus mouse related problems are between the mouse and the hard
 disk controller, i.e., bus mouse jumpered on IRQ 5 in an XT or IRQ 2
 in an AT. The common symptom for this problem is the inability to
 perform a warm boot (CTRL+ALT+DEL). If the bus mouse is jumpered on
 the same line as a serial port, network card, or emulator card,
 irregular and unreproducible system crashes can occur. In Windows,
 with a bus mouse doubled up on the IRQ line used by a modem, the mouse
 will "go away" when communications software is run.

 The standard isolation procedure is to verify IRQ-line usage and if no
 problems are uncovered, the next step is to remove as much hardware as
 possible. In this way, the conflict should be uncovered between
 particular devices and a resolution of the problem will follow.


 4. Bus Mouse and Cipher Tape Drive Card

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 31-AUG-1989    ArticleIdent: Q46793

 Problem:

 When using the Microsoft Bus Mouse in an AST Premium 386/25, I got the
 following error message after I installed a Cipher Tape drive card:

    Bad or missing interrupt jumper

 Response:

 This problem occurred because the interrupt and primary/secondary
 jumper settings were wrong. To correct this problem, change J4 to
 interrupt 2, and J3 to secondary inport.


 5. Types Of Mice Available: Serial, Bus, and InPort

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-JUL-1988    ArticleIdent: Q28738

    Version 1.00 of the new white-button mouse is available in three
 varieties; there are no noticeable differences in function or speed.
 The type of mouse you want depends on the available resources of your
 system.
    The PS/2 Serial mouse will work in any IBM PS/2 mouse port or in
 any standard IBM 9- or 25-pin serial port. The PS/2 Serial mouse is
 recommended if you own an IBM PS/2 machine or have an available COM1:
 or COM2: serial port on your system.
    The Bus mouse has its own interface card, which includes the
 Microsoft InPort interface. It can be used with any IBM PC, XT, AT, or
 PS/2 model 25/30 with an available 8- or 16-bit slot. The Bus mouse is
 interrupt selectable (2 through 5), and frequently saves your serial
 ports for other uses.
    The InPort mouse is the same as the Bus mouse except that it does
 not come with a Microsoft InPort interface-equipped interface card.
 You must have the Microsoft InPort interface within your system (e.g.
 the MACH 20 has built-in InPort technology).


 6. Programming the Mouse Driver Versus Writing One

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  4-NOV-1988    ArticleIdent: Q28739

 If you plan to write an application with built-in mouse support,
 obtain the "Microsoft Mouse Programmer's Reference Guide." The manual
 includes a mouse library (for the Microsoft Compilers) and
 documentation on programming the mouse driver.

 Microsoft recommends that you program the mouse driver, rather than
 write your own mouse driver. This will maintain compatibility over any
 changes in future mouse hardware.

 If you need to write your own mouse driver, you can obtain the InPort
 Application Note (which is used with the Bus mouse) by calling
 Microsoft Product Support Services at (206) 454-2030.

 The Serial mouse protocol may be obtained by writing a formal request
 to our Mouse Product Manager (or contacting our Mouse ISV department),
 giving supported reasons for bypassing our mouse driver.


 7. Obtaining Hosiden Connectors Used with the Bus Mouse

 Product Version(s): 6.0 6.02 6.10 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28740

    The Hosiden connectors and sockets, which are used with the Bus
 Mouse with InPort hardware, can be obtained from HB Associates at
 1-800-423-3014.


 8. How to Deallocate or Disable the Mouse Driver

 Product Version(s): 6.0 6.02 6.10 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28741

    If the MOUSE.COM driver is installed, the Mouse Off command will
 deallocate the driver from memory if there were no other
 memory-resident programs loaded after it.
    If the MOUSE.SYS driver was installed, the Mouse Off command will
 only disable the driver and not deallocate.
    Although the mouse driver is deallocated or disabled, the mouse
 hardware will continue to send interrupts.



 9. Keyboard Styles for IBM and IBM Compatibles

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER | non-numeric
 Last Modified: 31-AUG-1989    ArticleIdent: Q46918

 Use of the Microsoft Mouse menus is sometimes affected by the style of
 computer keyboard being used. The following are some major versions
 the IBM and IBM-compatible keyboard:

 1. The "standard" keyboard came with the original IBM PC. This
    keyboard includes a numeric keypad on the right-hand side and 10
    function keys across the top of the keyboard.

 2. The "extended" keyboard adds the F11 and F12 function keys to the
    standard keyboard.

 3. The "expanded" keyboard widens the standard keyboard and reproduces
    the nonnumeric keys and the cursor keys in the additional space.


 10. Leading Edge Model D Error "Unexpected SW Interrupt 33"

 Product Version(s): 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  5-JUN-1988    ArticleIdent: Q29466

    The error message "Unexpected SW Interrupt 33" can occur on some
 Leading Edge Model D computers when installing a mouse driver.
    You usually can continue after this error message has appeared by
 typing C to continue. For a patch, call Leading Edge technical support
 at (617) 821-4300.


 11. Serial Mouse: "Driver Not Installed--Mouse Not Found" Message

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 28-APR-1988    ArticleIdent: Q29201

    A "Driver not installed--Mouse not found" error message usually
 pertains to a possible hardware problem.
    When isolating the source of the problem, first boot from a
 "vanilla" DOS (i.e., no AUTOEXEC.BAT or CONFIG.SYS files), then
 install the mouse driver manually from the Mouse Setup Disk.
    If the error remains, check your hardware set up for possible
 hardware conflicts or incorrect serial port configuration before
 determining if you have a possible faulty mouse.
     Your serial ports must follow an IBM standard and be configured as
 follows:

 COM1 using IRQ4 and configured as DTE (data terminal equipment).
 COM2 using IRQ3 and configured as DTE (data terminal equipment).

    The serial mouse does not work on serial ports configured as COM3
 or COM4. If you have only one serial port and it is configured as
 COM2, the mouse driver usually installs but does not work. Configure
 the port as COM1.
    If you have checked your configuration and the mouse driver does
 not install, checking the mouse on two machines is a good isolation
 test.


 12. Mouse Driver Installs but Mouse Does Not Work

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  5-JUN-1988    ArticleIdent: Q29202

    If the mouse driver is installed, but the mouse does not work, the
 problem may be due to one of the following problems:

    1. A hardware conflict
    2. A software conflict
    3. A faulty mouse

    If you have a serial mouse, make sure that your serial ports are
 correctly configured.
    To rule out a software conflict, boot from a "vanilla" DOS (i.e.,
 no AUTOEXEC.BAT or CONFIG.SYS files) and manually install the mouse
 driver from the Mouse Setup disk by typing Mouse.
    Problems can occur if the mouse driver is installed on a device
 other than the mouse. This is true in cases where a noisy bus causes
 the driver to install for a bus mouse, or a device such as a modem
 causes the driver to think a serial mouse is being used.
    If you suspect the driver is not installing on the correct port,
 use the mouse switches to direct the driver to the specific port.
    For example, if your mouse is on COM2, load the mouse driver with
 the following command:

    MOUSE /C2  <- install driver on COM2

    If you have a bus mouse, check the jumper settings for a possible
 interrupt conflict, an I/O address conflict, or expansion slot problems.
   If the problems continue, isolate the problem on another machine
 before determining if you have a faulty mouse.


 13. Serial Mouse Pin-Outs

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  5-JUN-1988    ArticleIdent: Q29204

    The serial mouse includes a 9- and 25-pin adapter cable to work with
 a standard 9- or 25-pin IBM serial port. The following are the pin-outs
 of the mouse cables:

                   Connectors

    Function    9 pin      25 pin

    RXD         pin 2      pin 3

    TXD         pin 3      pin 2

    RTS         pin 7      pin 4

    GND         pin 5      pin 7

    DTR         pin 4      pin 20

    The serial mouse is a data communication equipment (DCE) device,
 and is a female device (i.e., it has holes in its connectors). Because
 it is a DCE device, the port's functions should be one to one when
 making a cable for a nonstandard serial port.
    For example, the mouse's RXD should connect to your serial port's
 RXD and the mouse's TXD should connect to the serial port's TXD. This
 is true for other functions as well.


 14. Bus Mouse May Not Work on IRQ 2 on a 386 with OS/2

 Product Version(s): 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1988    ArticleIdent: Q29279

 The OS/2 mouse driver MOUSEA04.SYS will not install if you use the IRQ
 2 setting for OS/2 and a Wyse 386. MOUSEA03.SYS will install, but
 will not work in OS/2. The mouse works properly in DOS.

 OS/2 seems to be more sensitive to the IRQ usage. This problem occurs
 with both the old and new bus mice. To work around the problem, use
 another interrupt other than 2 on the 386.

 Although IRQ2 is not recommended for ATs or 386s, the mouse seems to
 work without any problems in the DOS environment (using all other
 interrupts); however, this does not seem to be the case in OS/2.


 15. Serial Mouse May Fail with an Older AT&T 6300

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  1-AUG-1988    ArticleIdent: Q28681

    There have been some reports that the mouse driver may not install
 correctly with a serial mouse connected to an older AT&T 6300. Using
 the "/C1" or "/C2" switch often solves the problem. If the problem
 continues, check the ROM date and upgrade the ROM if you are using an
 older one. AT&T recommends Version 1.43 ROM or later. Contact AT&T at
 (800) 222-7278 for ROM upgrade costs.


 16. Mouse EGA Register Interface

 Product Version(s): 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  4-NOV-1988    ArticleIdent: Q29467

 An application note concerning the Mouse EGA Register Interface can be
 obtained by contacting the Microsoft Product Support Services Hardware
 Group at (206) 454-2030.

 The Microsoft Mouse EGA Register Interface is a library of nine
 functions. It can be called from assembly language programs or high
 level languages, such as FORTRAN, Pascal, C, and compiled BASIC. Its
 functions allow you to do the following:

 1. Read and write to one or more of the EGA write-only registers.

 2. Define default values for the EGA write-only registers or reset the
    registers to these default values.

 3. Confirm that the EGA Register Interface is present and if so,
    return its version number.

 If your program tries to set the EGA registers directly, rather than
 through the interface, the mouse cursor will draw incorrectly.


 17. No IBM DW4 or TopView Support for Bus Mouse with InPort

 Product Version(s): 6.00 6.02 6.10 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28682

 Problem:
    IBM DisplayWrite 4 does not recognize the Bus mouse with Microsoft
 InPort Device Interface. DisplayWrite 4 supports the serial mouse and
 older Bus mouse (with a 8255 chip), but does not have an upgraded
 mouse driver for the InPort interface Bus mouse.
    This problem also occurs with IBM TopView.

 Response:
    Because DisplayWrite 4 has custom-made pointing device drivers, you
 should contact your IBM dealer or have the IBM dealer contact
 IBM dealer support.



 18. Mouse Compatibility with IBM PCjr

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1988    ArticleIdent: Q29469

 The Microsoft Mouse has not been tested with the IBM PCjr. Microsoft's
 PCjr Booster, which was discontinued, was the only official hardware
 that included mouse support (i.e., bus mouse hardware).

 We have received customer reports stating that gray-button serial mice
 work properly on the PCjr if a special serial adapter is obtained to
 make the PCjr serial I/O compatible.

 We have not confirmed that Microsoft's new white-button mouse will
 work properly with the PCjr using the special adapter.

 Solid Rock was a company that provided PCjr accessories, but it has
 since gone out of business.


 19. Mouse MREADME.DOC: Single Drive PCs

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 29-JUN-1988    ArticleIdent: Q29702

    If you have a single-drive PC without a hard disk, you will not be
 able to use the Mouse Setup program (MSETUP) to set up the mouse
 software.
    MSETUP installs the mouse driver, MOUSE.COM.
    On a single-drive PC, you must install the mouse driver yourself in
 one of the following two ways:

    Manual Installation:      Copy MOUSE.COM onto the disk you use to
                              start your computer. You can then load
                              the mouse driver manually each time you
                              start your system, by typing "MOUSE" at
                              the DOS prompt.

    Automatic Installation:   With MOUSE.COM on the disk you use to
                              start your computer, you can modify your
                              AUTOEXEC.BAT file so that the mouse
                              driver is automatically loaded each time
                              you start your system. Add the line
                              "MOUSE" to the AUTOEXEC.BAT file to
                              automatically load MOUSE.COM when you
                              start your computer.

    For more information on this subject, see the "What the MSETUP
 Program Does" section of the "Microsoft Mouse User's Guide."


 20. Some ASCII Control Characters Incorrect in Programmer's Manual

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | mouse menu
 Last Modified: 31-AUG-1989    ArticleIdent: Q46923

 A documentation error on Page 2-24 of "Microsoft Mouse Programmer's
 Reference Guide" incorrectly states that ASCII value 28 corresponds to
 CTRL+\, not CTRL-. This error was corrected in "Microsoft Mouse
 Programmer's Reference" from Microsoft Press.

 Control characters CTRL+H, CTRL+I, CTRL+J, CTRL+M, and CTRL+[ are not
 listed in the table on Page 2-24 because their ASCII values are the
 same as ASCII codes for backspace, horizontal tab, linefeed, carriage
 return, and escape, respectively.


 21. Mouse MREADME.DOC: Invoking the Control Panel in Word

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1988    ArticleIdent: Q29703

 Microsoft Word recognizes the CTRL+LEFT mouse button and SHIFT+LEFT
 mouse-button key combinations as Word operations.

 To invoke the Control Panel while working in Word, do the following:

 1. Hold down the CTRL key.
 2. Press the ALT or SHIFT keys before pressing the left mouse button.


 22. Mouse Driver Command Line Switches

 Product Version(s): 6.00 6.02 6.10 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28684

    The following are command-line switches for mouse driver 6.00 and above:

    SWITCH       DESCRIPTION

    /B           Look for Bus or InPort mouse at primary address
    /I1          InPort mouse at primary address
    /I2          InPort mouse at secondary address
    /C1          Serial mouse on COM1
    /C2          Serial mouse on COM2
    /S <nnn>     Horizontal and vertical sensitivity <nnn> = 0 to 100
    /H <nnn>     Horizontal sensitivity
    /V <nnn>     Vertical sensitivity
    /R0          InPort interupt rate disabled
    /R1          InPort interupt rate 30Hz (default)
    /R2          InPort interupt rate 50Hz
    /R3          InPort interupt rate 100Hz
    /R4          InPort interupt rate 200Hz

    Example: mouse /s75    <- sets mouse sensitivity to 75 (50 default)



 23. Driver "Removed from Memory" Versus "Disabled"

 Product Version(s): 1.x 2.x 3.x 4.x 5.x 6.x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 31-AUG-1989    ArticleIdent: Q47138

 MOUSE.COM Versions 6.00 and later are removed from memory unless
 connected to a PS/2 mouse port. The message "Existing Mouse Driver
 Disabled" appears if the mouse is connected to a PS/2 mouse port or if
 other terminate-and-stay-resident programs (TSRs) prevent the mouse
 from being removed from memory.

 Earlier versions of the mouse driver do not deallocate.

 Versions 6.11 and 6.12 are the only versions that are removed from
 memory if connected to the PS/2 mouse port.


 24. MREADME.DOC: Using the Default Expert Mouse Menu

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  5-JUN-1988    ArticleIdent: Q29705

    The default Expert Mouse menu allows you to use a mouse to emulate
 keys, such as the ESCAPE, ENTER, and cursor keys, with applications
 that normally do not support mice.

    To use this menu, load it into memory before you start your
 application.
    To load the default menu, type the following after the prompt of
 the drive or directory where the DEFAULT.COM file resides:

    default

    Once the default menu is loaded, you can perform the mouse actions
 described in the following tables to emulate certain keys in your
 application:

                  Press                     To Emulate

                  The left mouse button     The F3 key
                  The right mouse button    A carriage return (the ENTER key)
                  Both mouse buttons        The ESCAPE key

                  Move                      To emulate

                  The mouse to the left     The LEFT ARROW key
                  The mouse to the right    The RIGHT ARROW key
                  The mouse up              The UP ARROW key
                  The mouse down            The DOWN ARROW key

    To remove the default menu from memory, type the following after
 the prompt of the drive or directory where the DEFAULT.COM file
 resides:

                  default off



 25. Supplemental Mouse Menus Disk (Expert and Basic Menus)

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 14-JUL-1989    ArticleIdent: Q35131

 The following Microsoft Mouse menus are available by contacting the
 Microsoft Information Center by calling (800) 426-9400 and requesting
 the Mouse Supplemental Menus disk:

    Filename                 Application
    --------                 -----------

    MSMENU.COM               Most text-based software
    MSDB3.COM                dBASE III PLUS
    MS123.COM                Lotus 1-2-3, Versions 1A and later
    MSSYM.COM                Lotus Symphony, Versions 1.20 and 2.00
    MSMM2.COM                MultiMate Advantage II
    MSPF.COM                 PFS: Professional File, Version 2.00
    MSPLAN.COM               PFS: Professional Plan, Version 1.00
    MSPW1.COM                PFS: Professional Write, Version 1.00
    MSPW2.COM                PFS: Professional Write, Version 2.00
    MSSC4.COM                SuperCalc 4, Version 1.00
    MSWP4.COM                WordPerfect, Version 4.20
    MSWP5.COM                WordPerfect, Version 5.00
    MSWS.COM                 WordStar, Versions 3.30 and 4.00
    MSWS5.COM                WordStar, Version 5.00

 In addition, you will receive an Expert Mouse Menus disk with the
 following menus:

    Filename                  Application

    MS123-1.COM               Lotus 1-2-3 Version 1A
    MS123-2.COM               Lotus 1-2-3 Version 2
    MSDW.COM                  DisplayWrite 3 Version 1.10
    MSMM.COM                  MultiMate Version 3.31

 The expert menus have more functionality than the basic menus. The
 menus are sold for a small fee.


 26. Ventura Publisher 2.0 and Mouse Driver 6.24b

 Product Version(s): 1.x 2.x 3.x 4.x 5.x 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-JUL-1990    ArticleIdent: Q63224

 When mouse driver version 6.24b for the Microsoft Mouse is installed,
 Ventura Publisher version 2.0 is limited to black and white regardless
 of the screen colors selected.

 To correct this behavior, replace mouse driver 6.24b with mouse driver
 7.04.



 27. Mouse Versions Prior to New Mouse 1.00 Used MOUSE.SYS

 Product Version(s): 1.x 2.x 3.x 4.x 5.x 6.x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1988    ArticleIdent: Q35082

 Although there is no difference in functionality between the MOUSE.SYS
 and MOUSE.COM drivers, versions prior to the new white-button Version
 1.00 mice used MOUSE.SYS loaded from the CONFIG.SYS rather than the
 MOUSE.COM used via the AUTOEXEC.BAT file.

 The MOUSE.COM driver provides greater flexibility in that it is able
 to deallocate from memory and is executable from DOS.


 28. Mouse Menu May Have Up to 32 Menus

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  5-JUN-1988    ArticleIdent: Q29882

    There are 32 Menu statements allowed for each Mouse Menu. A
 combination of Popup and Menu statements can exceed 32.


 29. 123.MNU Worked on Floppy But Not on Hard Drive

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1988    ArticleIdent: Q31045

 The Lotus 1-2-3 menu that was included with the original mouse (Word
 2.00 bundle) will not work if Lotus 1-2-3 was loaded from the hard
 disk and you have the bus mouse set for interrupt 5 on your IBM PC.
 The menu runs properly from a floppy.

 Change the interrupt setting to 2 on the bus card to resolve this
 problem.


 30. Windows Versions 1.01 and 1.02 and the Bus Mouse

 Product Version(s): 3.00
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR59473
 Last Modified:  4-NOV-1988    ArticleIdent: Q19915

 Windows Versions 1.01 and 1.02 will hang or will not recognize bus
 mouse Version 5.03 (InPort hardware) or later.

 Windows Versions 1.01 and 1.02 contain an initial release of
 MOUSE.DRV. Beginning with Version 5.03 of the bus mouse, new InPort
 hardware was incorporated in the bus mouse design. An update to the
 MOUSE.DRV software is required for Windows to correctly recognize the
 mouse.

 The updated MOUSE.DRV is included in Windows Version 1.03 and later.
 In addition, it is included in the mouse Version 5.03 System disk and
 the current mouse Version 1.00 Setup disk.

 If you have Version 6.x of the mouse, you can obtain the updated
 MOUSE.DRV by calling Microsoft Product Support hardware group at (206)
 454-2030 and requesting for the "Mouse Drivers Update Disk."

 The above problem may also affect ISVs and OEMs that have developed
 stand-alone Windows applications or have licensed and adapted Windows
 using the initial Windows development software.


 31. Mouse-Cursor State and EGA Memory

 Product Version(s): 6.x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 28-JUN-1988    ArticleIdent: Q31149

    The Microsoft Mouse driver EGA interface maintains the mouse-cursor
 state in the unused 8K of video memory available at the top of the
 four 64K buffers that comprise the 256K of total video memory
 available on a loaded EGA adapter. Normally this is of little
 consequence in programming such systems; however, if you resize the
 video buffer by reprogramming the CRT Controller's Offset register,
 problems may occur.
    You will know there is a problem if garbage appears on the display
 after panning through an enlarged virtual screen.
    To work around this problem, do not use Mouse Function 1 to show
 the mouse cursor. Instead, use an alternative method of monitoring the
 mouse's screen location (e.g. XOR some graphical object to the
 screen).


 32. CPANEL May Crash if /S Switch Used Previously

 Product Version(s): 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1988    ArticleIdent: Q35229

 If a value such as /s33 is passed to the mouse driver before invoking
 CPANEL, CPANEL may crash if you keep decrementing while in the CPANEL
 screen. The CPANEL will not be invoked and a divide overflow may
 occur, but the mouse driver remains intact.


 33. Using Mouse Menus with WordPerfect Version 5.00

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 28-JUN-1988    ArticleIdent: Q31293

    When using a Mouse menu with WordPerfect Version 5.00, the menu
 opens; however, no text appears at the current cursor location when a
 selection is made. Upon exiting WordPerfect, the characters from the
 menu appear at the DOS command prompt.
    WordPerfect Version 5.00 has keyboard macros that disable the Mouse
 menu while in WordPerfect. To use a Mouse menu with WordPerfect
 Version 5.00, you must start WordPerfect with the /nk switch. This
 will disable the keyboard macros and allow the Mouse menu to function
 normally.


 34. Mouse Driver Conflict with Fixed-Disk Organizer

 Product Version(s): 6.x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 25-JUL-1988    ArticleIdent: Q31330

    The mouse driver may not install due to a possible conflict between
 the Microsoft Mouse driver and the IBM fixed-disk organizer (FDO).
    This problem can be avoided by altering the load order of the two
 programs. If the mouse driver is loading first and being destroyed by
 the FDO, edit your AUTOEXEC.BAT file so the FDO loads first. If the
 FDO is loading first, load it after the mouse driver.
    Please note that this workaround is not guaranteed to avert all
 conflicts, but it has yielded positive results in many instances.


 35. "Microsoft Mouse Driver Not Found" Error Message

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-JUL-1988    ArticleIdent: Q32263

    The MOUSE.COM or MOUSE.SYS driver must be loaded before attempting
 to load a mouse menu. The "Microsoft Mouse driver not found" error
 message is generated when a mouse expert menu tries to load without
 the mouse driver already loaded.
    This error message should not be confused with the message "Driver
 not installed-- Microsoft Mouse not found", which is a mouse driver
 not loading message.


 36. CPANEL Defaults to Display Page 0

 Product Version(s): 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1988    ArticleIdent: Q35230

 CPANEL may not display in a graphics application that uses graphics
 pages greater than 0. CPANEL defaults to display on Page 0 of the
 graphics page.

 To work around this problem, use the /S switch to the mouse driver.


 37. /S1 or /S2 Yields Same Result as /S0

 Product Version(s): 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1988    ArticleIdent: Q35231

 If a sensitivity switch of value 1 or 2 is passed to the mouse driver,
 you may not recognize any mouse cursor change for mouse movement. A
 sensitivity value of 3 seems to be the minimum sensitivity that the
 mouse driver moves the cursor.


 38. Internal Processing Error and OS2MOUSE.V12 with Mouse

 Product Version(s): 1.20
 Operating System:   OS/2
 Flags: ENDUSER |
 Last Modified:  6-JUL-1990    ArticleIdent: Q63226

 When OS2MOUSE.V12 is installed and the communications manager is
 selected, an internal processing error is detected and the system will
 hang.

 To correct this problem, reinstall the mouse driver using the drivers
 that were supplied with the OS/2 package and the system will not hang
 when the communications package is selected.

 We are researching this problem and will post new information here as
 it becomes available.


 39. Symphony Mouse Menu Works in Text Mode Only

 Product Version(s): 1.0
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28425

    When using the Symphony mouse menu, please make sure Symphony is
 set up for "text and graphics separate".

    If you are running Symphony with an EGA, Symphony comes up in green
 for "text and graphics separate" configurations. Combined
 configuration will display in red when Symphony is running.


 40. Standard Mouse Menus Do Not Deallocate

 Product Version(s): 4.x 5.x 6.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 29-AUG-1988    ArticleIdent: Q23827

 You cannot deallocate a standard mouse menu (a menu that loads with
 MENU.COM) from memory. Entering "menu off" will disable the keyboard
 emulation; however, it will not deallocate from memory.


 41. Available Mouse Menus

 Product Version(s): 4.x 5.x 6.x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 23-AUG-1988    ArticleIdent: Q23836

    Version 6.00 of the Microsoft Mouse contains "Expert Mouse Menus"
 for Lotus 1-2-3 Versions 1A and 2.00, MultiMate Version 3.31, and
 DisplayWrite 3 Version 1.10. The "Mouse Programmer's Reference Guide"
 contains "Standard Mouse Menus" for previous versions (date mid-1985)
 of Symphony, WordStar, Multiplan, and VisiCalc.


 42. Expert and Standard Mouse Menus

 Product Version(s): 4.x 5.x 6.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 23-AUG-1988    ArticleIdent: Q23837

 Question:
    What is the difference between an Expert and a Standard mouse menu?

 Response:
    Standard mouse menus are loaded with MENU.COM, while an Expert
 mouse menu is an executable .COM file.


 43. CPANEL Does Not Display in the OS/2 DOS 3.x Box

 Product Version(s): 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1988    ArticleIdent: Q35232

 CPANEL will not work in the OS/2 DOS 3.x box unless you load the DOS
 mouse driver rather than the OS/2 mouse driver.


 44. MSETUP Installs on Drive Specified

 Product Version(s): 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1988    ArticleIdent: Q35250

 If you have more than one hard-disk partition, MSETUP has the
 capability of installing the mouse software on a partition that may
 not be your C: drive. If you select to do this, you must manually edit your
 AUTOEXEC.BAT file to invoke the mouse driver and optionally CPANEL.
 For example, to install the mouse software on your D: drive, you must
 edit your AUTOEXEC.BAT on your boot drive C: to the following:

 D:\mouse1\mouse
 D:\mouse1\cpanel



 45. Standard Mouse Menus Are Not in .COM Format

 Product Version(s): 6.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 23-AUG-1988    ArticleIdent: Q23829

    You cannot write menus in .COM format with the "Mouse
 Programmer's Reference Guide." The reference guide allows you to
 create standard mouse menus, which are installed with the MENU.COM
 file.
    If you are a developer interested in creating menus in .COM format,
 an Expert Menus Toolkit is available that allows you to create expert
 mouse menus. For more information, call Microsoft Hardware Development
 at (206) 882-8080, and ask for information on Expert Menus Development
 software.


 46. Earlier Versions with Mouse Menu Software

 Product Version(s): 4.x 5.x 6.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 23-AUG-1988    ArticleIdent: Q24163

    The content of the "Microsoft Mouse Programmer's Reference Guide"
 is similar to earlier versions of the mouse containing the mouse
 programming.
    If you are writing standard mouse menus, the commands in the
 "Microsoft Mouse Programmer's Reference Guide" are the same as they
 were with versions prior to Version 6.00. The major changes include
 better documentation, examples, and updated mouse libraries. If you
 have a version prior to Version 5.03, we recommend that you obtain the
 "Microsoft Mouse Programmer's Reference Guide" if you are having any
 problems with MENU.COM or MAKEMENU.EXE.


 47. Applications That Do Not Use the Mouse

 Product Version(s): 4.x 5.x 6.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 29-AUG-1988    ArticleIdent: Q24164

 The "Microsoft Mouse Programmer's Reference Guide" allows you to write
 your own mouse menus for programs without mouse support. The reference
 guide includes the necessary software and documentation to provide
 keyboard emulation using mouse menus. Mouse menus will run in text
 mode with most programs that do not grab the keyboard interrupts.


 48. MENU.COM Needed to Load .MNU Files

 Product Version(s): 4.x 5.x 6.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 29-AUG-1988    ArticleIdent: Q24178

 With the release of Version 6.00 of the mouse, we decided to separate
 the programming aspects of the mouse and place them in the "Microsoft
 Mouse Programmer's Reference Guide." The guide contains the menu
 installer MENU.COM and the menu compiler MAKEMENU.EXE. If you have the
 software prior to Version 6.00, you will find MENU.COM and
 MAKEMENU.EXE on your system diskette.



 49. Mouse Menus May Hang in the OS/2 DOS 3.x Box

 Product Version(s): 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1988    ArticleIdent: Q35251

 Mouse menus may hang in the OS/2 DOS 3.x box if you are using the OS/2
 mouse drivers. To work around this problem, use the DOS mouse drivers
 that were included with your mouse and do not load the OS/2 mouse
 driver.


 50. Menu Problems with Leading Edge D2 in 43-Line Mode

 Product Version(s): 1.0
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28428

    The characters on the screen get trashed if you load a mouse menu
 in 43-line text mode using a Leading Edge D2 with monochrome display.
 The characters are readable, but the top two or three lines of pixels
 composing the characters are repeated beneath the characters (similar
 to a vertical ghost effect).

    Resetting the EGA into the 43-line mode corrects the problem
 temporarily. Run EGA.EXE with the argument EGA, or set switch 5 on the
 display adapter to the open position to disable the auto-mode
 selection feature (this process produces the same effect as the EGA
 EGA command).


 51. Erratic Cursor Movement Using 123 Mouse Menu

 Product Version(s): 4.x 5.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  4-NOV-1988    ArticleIdent: Q24710

 If the cursor moves erratically when using the 123.MNU mouse menu
 provided with Version 5.00 of the mouse, make sure no other
 memory-resident programs are interfering. If the problems persist,
 contact Microsoft Product Support at (206) 454-2030 for the 123 Menu
 disk, which includes an updated 123.MNU file.

 If you own Mouse Version 6.00, use the MS123-2.COM found on your
 Expert Mouse Menus disk. This supersedes the 123.MNU file.


 52. Operation of InPort Chip Versions 1.00 and 1.10 Versus 1.20

 Product Version(s): 1.00 1.10 1.20
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-MAR-1990    ArticleIdent: Q49003

 Versions 1.00 and 1.10 of the Microsoft Mouse InPort Chip operates in
 the timer interrupt mode (mouse service routine interrupt occurs at a
 fixed rate).

 Version 1.20 of the InPort Chip operates in the data interrupt mode
 (mouse service routine interrupt occurs whenever mouse data is
 present).


 53. Bus Mouse with InPort Not Supported in IBM PC-DOS 4.00

 Product Version(s): 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1988    ArticleIdent: Q35364

 IBM PC-DOS Version 4.00 has three special mouse drivers that only work
 with the DOS Shell: PS/2, serial, and bus mouse (non-InPort).

 For bus mice with InPort, we recommend that you load the mouse driver
 that was included with your mouse (MOUSE.COM) and delete the following
 command line in the DOSSHELL.BAT that loads the IBM DOS shell mouse
 driver:

 /MOS:PCMSPDRV.MOS


 54. Unable to Activate the Mouse in Chart

 Product Version(s): 6.00
 Operating System:   MS-DOS
 Flags: ENDUSER | TAR64094
 Last Modified: 19-SEP-1988    ArticleIdent: Q25053

 You may be unable to activate the mouse in Chart; the mouse arrow may
 appear to be frozen.

 Chart defaults serial printer drivers to COM1:. Therefore, when using
 a serial mouse, it is necessary to start Chart and then change the
 Print Setup adapter in the Chart screen to something other than the
 COM port to which the mouse is connected. You must do the following to
 activate the mouse:

 1. Change the Print Setup adapter in the Chart screen from COM1: to
    LPT1:.

 2. Exit.

 3. Restart Chart.


 55. End User Made Mouse Menus Don't Run Under MS-DOS 4.00 or 4.01

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 20-JUN-1990    ArticleIdent: Q61105

 Mouse menus compiled with MAKEMENU.EXE and run with the MENU.COM that
 came with Mouse driver versions 6.24b and earlier will not work under
 MS-DOS version 4.00 or 4.01. The menu will install into memory, but
 will not be visible and will not interface correctly with the
 application.

 Currently, the only workaround is to load the ANSI.SYS driver with the
 /k option. This disables the extended keys on the keyboard, which
 allows your Mouse menus to work.

 Microsoft is researching this problem and will post new information
 as it comes available.


 56. Using PS/2 Serial Mice with Laptop Computers

 Product Version(s): 1.0
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 14-JUL-1989    ArticleIdent: Q28492

    Microsoft PS/2 serial mice are not guaranteed to work correctly
 with laptops due to the low power specification on serial ports
 usually found on the laptops.

    PS/2 serial mice with the SSMA adapters (cigarette box shaped
 adapters) may not work properly with the Zenith laptop models 181 and
 183.
    The current mice with the UMA adapters (cigar-shaped adapters) with
 the Version 6.14 mouse driver have been tested informally and seem to
 work properly with the Zenith laptops.


 57. Restricted Mouse Cursor Movement in Pro Design II

 Product Version(s): 1.0
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28493

    When using Pro Design II, the mouse cursor is restricted to a 1
 inch box in the top left-hand corner.

    This problem has been reported with the mouse driver Version 6.02 through
 mouse driver Version 6.11. Currently the problem cannot be isolated to a
 mouse driver problem since the cursor movement restriction seems to occur
 only with the Pro Design II application.
    Please contact American Small Business Computers, developers of Pro
 Design II, at (918) 825-4844. An update may resolve the problem.
    Microsoft is researching this problem and will post new information
 as it becomes available.


 58. NEC Multispeed Laptop Continues to Access Drive

 Product Version(s): 6.0 6.02 6.10 1.0
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28494

    When using the NEC Multispeed laptop with the mouse driver
 installed, the disk light stays on as if the disk is being accessed.

    NEC produced a patch INIT059.COM or ROM upgrade that resolves the
 problem.
    Please contact NEC's technical support at (800) 632-7368.


 59. Tests with the Compaq 386/20

 Product Version(s): 1.0
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28495

    The new Bus and PS/2 serial mice work properly with the Compaq
 386/20 computer.

    The Version 1.0 mouse and revision G of the Bus interface board
 worked properly with the Compaq 386/20 with the Version 6.11 of the
 mouse driver.
    The white button and gray button serial mice tested successfully
 with the Compaq 386/20's serial port.


 60. FCC Class B Approval

 Product Version(s): 1.0
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28496

    The new Version 1.0 mice have Class B FCC approvals.

    The InPort mouse and the InPort interface card of the new white
 button Version 1.0 mice have FCC Class B approvals (ID C3K7PN9937 for
 the mouse and C3K6P8 for the interface card respectively).


 61. Interrupt Setting for the IBM PS/2 Model 30

 Product Version(s): 1.0
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28497

    When setting the J4 interrupt setting on the mouse InPort interface
 card, Microsoft recommends jumper 2 or 3.

    Please check that other peripheral boards are not using the same
 interrupt setting as the mouse. Do not use pair 5 for the setting.


 62. Installing Windows when Using the PS/2 Mouse Port

 Product Version(s): 6.10 1.0
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28498

    If you are using the IBM PS/2 mouse port for your mouse, please be
 sure to select IBM PS/2 when selecting a pointing device during the
 Windows Version 1.04 installation.

    Selecting the Microsoft mouse when using the IBM PS/2 mouse port
 will not give you mouse control in Windows Version 1.04.


 63. DOS 2.xx Does Not Recognize \Mouse1\Mouse

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 26-APR-1988    ArticleIdent: Q28499

 Problem:
    After running the mouse setup routine and rebooting my machine, the
 mouse driver will not install.

 Response:
    Because DOS Version 2.xx does not recognize the path statement in
 command lines, such as /mouse1/mouse in the AUTOEXEC.BAT file, the
 mouse driver never installs.
    To work around this, edit your AUTOEXEC.BAT file to change the
 directory to your MOUSE1 subdirectory. Then, directly call the MOUSE
 and CPANEL as follows:

   CD \MOUSE1
   MOUSE
   CPANEL
   CD\


 64. Use MOUSE.SYS with Flight Simulator

 Product Version(s): 1.0
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28500

    If you have Flight Simulator and a mouse, you should use the
 MOUSE.SYS file in the CONFIG.SYS file rather than the MOUSE.COM in the
 AUTOEXEC.BAT file that is installed by the mouse setup.

    The Version 6.11 of the mouse driver that uses the MOUSE.COM file,
 may cause Flight Simulator to continuously ask if you have a mouse.
 Using the MOUSE.SYS file solved the problem.


 65. Windows 1.01 MOUSE.DRV File Included with Mouse 1.0

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28502

    The current Mouse Setup disk contained in the EasyCad and MS
 Paintbrush software includes the mouse driver for Windows Version 1.01
 owners.

    Because the Windows Version 1.01 mouse driver does not recognize
 mice with InPort hardware, Microsoft has included an updated MOUSE.DRV
 file to resolve the problem.
    Copy the MOUSE.DRV file to your Windows Install disk and reinstall
 the Windows software. If you have Windows Version 1.03 or a newer
 version, you will not have this problem.


 66. Compaq Portable 3 Compatibility

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1988    ArticleIdent: Q28503

 The Compaq Portable 3 has built-in hardware that includes a serial
 port and an expansion chassis slot. The serial mouse should work
 properly in the standard serial port. The bus mouse will not fit in
 the only slot available for the expansion chassis, but should fit in
 the expansion chassis slot (this has not been tested).


 67. STB VGA Extra Using Mouse

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1988    ArticleIdent: Q28504

 STB requests that callers having problems with the mouse and VGA Extra
 (unspecified symptoms) contact STB at (214) 234-8750.


 68. Mouse Installation with OS/2

 Product Version(s): 1.0
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 21-APR-1988    ArticleIdent: Q28505

    OS/2 does not use the mouse driver contained with the Microsoft
 mouse.

    The DOS mouse driver MOUSE.COM or MOUSE.SYS does not load if you
 install OS/2 on a machine unless you have a dual boot option where
 standard DOS is loaded. OS/2 has a custom driver MOUSExxx.SYS which
 will run in the OS/2 protected mode or DOS compatibility box. In
 addition to the OS/2 mouse driver, you should load the POINTDD.SYS and
 EGA.SYS as well. Refer to your OS/2 documentation for further OS/2
 mouse driver details.


 69. Cipher Data Tape Drive Conflicts with Bus Mouse

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-SEP-1988    ArticleIdent: Q28515

    The Cipher Data Tape Drive can be set to use I/O address 220-23F;
 however, this setting causes the drive to forward and reverse every
 time the Bus mouse moves.
    The Tape Drive can reportedly use another I/O address to resolve
 the conflict. This is not a problem with the serial mouse.


 70. Choice of Three Software Bundles for New Mouse 1.00

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 31-AUG-1989    ArticleIdent: Q28517

 The new white-button mice are available in three software bundles. You
 can purchase a PS/2 serial or bus mouse with one of the following
 products:

 1. EasyCAD

 2. Microsoft Paintbrush with Mouse Menus

 3. Windows with Paintbrush for Windows


 71. Bus Mouse Jumper Settings J2, J3, and J4

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  5-JUN-1988    ArticleIdent: Q28538

    The new white-button Bus Mouse Version 1.00 interface card
 (Revision G) is an InPort interface half-size card. When installing
 the interface card, the jumper settings J2, J3, and J4 must be
 correctly set for the mouse to function properly.

    The J2 jumper setting allows you to use your Bus mouse from slot 8
 if you have an IBM PC XT. Set the top two pins to the "XT SLOT 8"
 configuration. If you have an IBM PC, AT, or some other non-IBM PC XT,
 you can leave the jumper setting on the "Normal" position (the lower
 two settings).
    The J3 jumper setting allows you to set another I/O address space
 other than the default 23C-23F. The "Primary" settings are the top two
 settings, while the "Secondary," which has the I/O address 238-23C, is
 the bottom two settings.
    Microsoft recommends that you only change this setting if another
 InPort interface hardware item is used in your system or if another
 system peripheral card is using the same I/O addresses.
    The J4 jumper setting allows you to select an IRQ or machine
 interrupt. Microsoft recommends that you select an interrupt from two
 through five that is not used in your system. In most instances,
 although you should confirm that another card is not using the same
 interrupt, an IBM PC or XT has interrupt two available for you to use
 and an IBM PC AT usually has interrupt five available.
    Refer to Page 6 of your "Microsoft Mouse User's Guide" for more
 information.


 72. Mouse and Flight Simulator 3

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 25-JUL-1988    ArticleIdent: Q32028

    Mouse driver Versions 6.02, 6.11, 6.14, and 6.23 have been tested
 with Flight Simulator 3 and all work normally.


 73. Mouse, Windows, Desqview, and HP Drawing Gallery

 Product Version(s): 6.00 6.10 6.14
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 25-JUL-1988    ArticleIdent: Q32064

    If you run Hewlett-Packard Drawing Gallery from either Windows or
 Desqview and exit the program normally, the mouse still works
 correctly; however, there is no cursor.
    To correct this problem, modify the PIF file included with the
 program. Under the Directly Modifies section, select Memory in
 addition to Screen.


 74. Earlier Versions of Generic Cad May Not Work with InPort

 Product Version(s): 1.00 5.03 6.00 6.02 6.10
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  8-AUG-1988    ArticleIdent: Q32129

    Generic Cad recommends Interrupt 3 for the J4 setting of the bus
 mouse.
    Be aware that older versions (possibly releases 1 and 2) of Generic
 Cad may not work correctly with versions of the bus mice that include
 the InPort Interface. Because Generic Cad goes directly to the
 hardware (i.e., it uses its own mouse driver), you must obtain an
 update to release 1 or 2. To obtain an update, contact Generic Cad by
 calling (206) 487-2934.


 75. Mouse Must be Removed to Run PS/2 Diagnostics

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 13-FEB-1989    ArticleIdent: Q33570

    When running the PS/2 diagnostics program with a Microsoft Mouse on
 the mouse port, the mouse must be disconnected. If the mouse is not
 disconnected the machine will hang.


 76. Sensitivity May Reset if a /R Switch Passed to the Driver

 Product Version(s): 6.24
 Operating System:   MS-DOS
 Flags: ENDUSER |  buglist6.24
 Last Modified: 11-OCT-1988    ArticleIdent: Q35974

 If an /R switch is passed to the MOUSE.COM, the sensitivity may reset.
 Note: the /R switch is only used with the Bus Mouse with InPort
 hardware.

 Microsoft has confirmed this to be a problem in Version 6.24. We are
 researching this problem and will post new information as it becomes
 available.


 77. Extension Cables for Microsoft Mice

 Product Version(s): 5.x 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 17-JUL-1989    ArticleIdent: Q32128

 Microsoft retails a 1.5-meter InPort extension cable. Although the
 cable was designed for the gray-button mouse, we have found, under
 informal testing, that the extension cable works with the new
 white-button mice (serial and bus).

 If you decide to make a longer cable, special wire is not needed. The
 Microsoft extension cable uses shielded, 7-conductor, 30-gauge wire. A
 heavier gauge wire might be considered for strength.

 If an extension is added to the serial mouse, the cable needs to pass
 the following pins straight through as follows:

    pins 2,3,4,7,20 and shield for the 25-pin D version, or
    pins 2,3,4,5,7 and shield if using the 9-pin version.

 Microsoft is not aware of any special considerations for special
 installation, such as alignment to compensate for cable
 characteristics, special cable termination (R, RC, etc.), needed for
 line drivers, or noise-immunity considerations.

 If you do anything to change the mouse cabling, the machine is likely
 to violate FCC Electromagnetic Interference regulations. The computer
 may interfere with nearby television or radio reception. Operation in
 a residential environment is especially ill-advised, and such a
 configuration certainly cannot be offered for sale without extensive
 testing and FCC certification.

 Microsoft takes no responsibility for the performance of its products
 when modified or used in a manner other than that intended and advised
 in the manual. Microsoft assumes the customer will comply with all
 applicable laws and regulations, and offers the above advice only on
 that basis.


 78. AT&T 6300 Plus and Bus Mouse

 Product Version(s): 5.00 5.30 6.00 6.10 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-JUL-1988    ArticleIdent: Q32682

    When using the bus mouse with the AT&T 6300 Plus, the J4 jumper
 must be set to either 3 or 4.
    There have been problems reported while using interrupt 5 with this
 computer; this should be a free interrupt on an AT machine. This
 problem may occur with any program that uses the mouse; however, the
 problem has not occurred with Paintbrush, CPANEL.COM, and DEFAULT.COM.


 79. DEFAULT.COM Included with Mouse

 Product Version(s): 1.x 2.x 3.x 4.x 5.x 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-JUL-1988    ArticleIdent: Q32714

    If you have the new white-button mouse Version 1.00, the
 DEFAULT.COM file, which provides cursor emulation, is located on the
 Mouse Setup Disk. Version 6.00 through 6.10 owners have the
 DEFAULT.COM file located on their Mouse Expert Menus Disk. Mouse
 owners with versions prior to Version 6.00 can write their own menus
 using the mouse menu programming tools (MAKEMENU.EXE and MENU.COM)
 included with their mouse software.


 80. Resolution, Mickeys, or Points Per Inch of the Mouse

 Product Version(s): 1.x 2.x 3.x 4.x 5.x 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  4-AUG-1988    ArticleIdent: Q33066

    The resolution (or mickeys) of Versions 5.x and 6.x of the mouse
 (gray buttons), and the new Version 1.00 of the mouse (white buttons)
 is 200 ppi. For example, the mouse driver can recognize 1/200th of an
 inch movement of the mouse. The resolution of Versions 1.x, 2.x, 3.x,
 and 4.x of the mouse (green buttons) is 100 ppi.


 81. PS/2 Mouse on Mouse Port Initializes Slowly

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  2-AUG-1988    ArticleIdent: Q33106

    If you load a program when using a serial PS/2 mouse on the PS/2
 mouse port, it will take longer to load than a serial or bus connect
 because the mouse initialization is performed through the PS/2 BIOS.


 82. Mouse and IBM Page Printer Hang System

 Product Version(s): 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  4-AUG-1988    ArticleIdent: Q33117

    When using the Microsoft Mouse with an IBM Page Printer, the mouse
 driver must use MOUSE.SYS rather than MOUSE.COM. To use the mouse with
 an IBM Page Printer, do the following:

    1. Copy MOUSE.SYS from the Setup/Basic Menus disk to the MOUSE1
       subdirectory of your hard drive.
    2. Edit your AUTOEXEC.BAT file (found in the root directory) and
       remove the following line:

       /MOUSE1/MOUSE

    3. Edit your CONFIG.SYS file (also found in the root directory) and
       insert the following line prior to the line that loads the Page
       Printer driver:

       DEVICE=C:\MOUSE1\MOUSE.SYS

    4. Reboot the machine. The mouse now can be used in conjunction
       with the Page Printer.


 83. Tempest-Approved Mouse

 Product Version(s): 6.00   | 6.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 31-AUG-1989    ArticleIdent: Q47676

 Tempest versions of the Microsoft Mouse are available from Quality
 Tempest Products (QTP) of Herndon, Va.

 A Tempest "approved" mouse is one that has been modified so that there
 are no RF emissions. This modification is needed so the mouse can be
 used in sensitive or classified areas

 For more information, contact Steve Rice of QTP at (703) 834-5200.


 84. Jumper Settings for Bus Mouse Used in an XT 286

 Product Version(s): 1.x 2.x 3.x 4.x 5.x 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 23-AUG-1988    ArticleIdent: Q34009

    For the purpose of setting the jumpers on the bus mouse card, the
 IBM XT 286 is equivalent to an IBM AT. The hard disk in the IBM XT 286
 uses IRQ 2. The typical settings are as follows:

    Jumper    Setting
      J2      normal
      J3      primary
      J4      IRQ 5

    As always, be sure that IRQ 5 is not being used for other hardware
 devices, such as a Bernoulli box, network card, or tape backup.


 85. Mouse and AutoCAD

 Product Version(s): 1.x 2.x 3.x 4.x 5.x 6.x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-SEP-1988    ArticleIdent: Q33476

 AutoCAD contains its own mouse driver; therefore, it does not need to
 have the Microsoft Mouse Driver installed to take advantage of the
 Microsoft Mouse. If the Microsoft Mouse Driver is installed, it may
 cause a TSR-type error when AutoCAD is run.

 AutoCAD problems can be directed to Autodesk by calling (415)
 332-2344.


 86. Cursor Freezes when Using Old Mouse Driver on AT-Type Machine

 Product Version(s): 5.03
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  8-AUG-1988    ArticleIdent: Q33553

    The mouse cursor may freeze or leave contrails in application
 programs running on 80286 or 80386-based machines if the mouse driver
 is Version 5.03 or earlier.
    The keyboard ordinarily will still work correctly. You should
 update to the current version of the driver.


 87. Mouse Menu for Quattro

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 17-MAY-1989    ArticleIdent: Q34086

 The Lotus 1-2-3 mouse menus on the Mouse Expert Menus disk do not
 enable the pop-up menus in Quattro. To use the mouse with Quattro,
 install DEFAULT.COM or MSMENU.COM.

 MSMENU.COM allows you to scroll through the spreadsheet and select
 menu items with the mouse. The menus do, however, need to be activated
 with the SLASH (/) key. The menus function the same whether or not
 Quattro is loaded with the Lotus 1-2-3 menu tree.

 Note: DEFAULT.COM is now called MSMENU.COM.


 88. Selecting Communications Ports, Interrupts in COMPAQ SLT/286

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | mouse
 Last Modified: 19-MAR-1990    ArticleIdent: Q48414

 On a COMPAQ SLT/286, the communications port and its associated
 interrupt can be set by using the Setup/Diagnostic program included
 with the computer. The following is the procedure:

 1. Place the Setup disk in your floppy drive.

 2. Run the Setup program.

 3. At the menu screen, press F4 to select "change configuration."

 4. From the next menu screen, select "Modem async-device."

 5. From the next screen, select "system async device."

 6. From the next screen, select "com1."

 7. From the next screen, select "interrupt 4."

 8. Back up through the screens until you return to the DOS prompt.


 89. Text Mode Problem with Mouse Version 3.00

 Product Version(s): 3.00
 Operating System:   MS-DOS
 Flags: ENDUSER | buglist3.00 fixlist4.00
 Last Modified: 11-OCT-1988    ArticleIdent: Q11085

 Question:

 Were there any known problems with Hercules graphics support with the
 mouse Version 3.00? When we use the routine reccommended by Hercules
 to get the mouse into graphics mode, we still get a text mouse when we
 use function 0 of the mouse library.

 Response:

 There is a problem in the mouse driver that is defaulting the text
 cursor to the hardware text cursor, instead of to the software text
 cursor. Microsoft has confirmed this to be a problem in Version 3.00.
 This problem was corrected in Version 4.00.

 There are two possible solutions for the problem: use only driver
 Version 4.00 or later, or insert a mouse function 10 call (Set Text
 Cursor) into the beginning of the application program, with the second
 parameter (M2%) set to 0 (select software text cursor).


 90. Losing Data When Mouse and Data Transfer Are Involved

 Product Version(s): 6.00 6.11 6.14 6.24 6.24b
 Operating System:   DOS
 Flags: ENDUSER |
 Last Modified: 22-MAR-1990    ArticleIdent: Q49285

 Several customers report lost data or a system lock up when
 transferring high speed data from a modem or mainframe through a
 serial port. The mouse was resident in memory when the problem
 occurred.

 With communications going through COM2:, the interrupt 3 is in use.
 This interrupt has a higher priority than either interrupt 4 (for a
 mouse in COM1:) or interrupt 5 (bus mouse with interrupt 5 set on the
 J4 jumper).

 You should ensure that the communications equipment is loaded onto
 COM2: so that it can take advantage of the higher priority interrupt.
 The phenomenon is inherent with interrupt handling and established
 priorities.


 91. Intermittent Installation on the Packard-Bell PS/2 Port

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  8-MAY-1990    ArticleIdent: Q61591

 When the 400 dpi Microsoft Mouse is attached to the PS/2 port of the
 Packard-Bell PackMate 2, the Excel 5, and the Legend 5 computers, the
 mouse sometimes does not install correctly.

 When the mouse is attached to the serial port there are no
 installation problems.

 If you are experiencing this problem, contact Packard-Bell at
 (818) 773-4400.


 92. Sluggish or Jerky Mouse Motion in PC DOS Version 4.00 Shell

 Product Version(s): 4.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 11-OCT-1988    ArticleIdent: Q35975

 When using the IBM PC DOS Version 4.00 shell mouse drivers with an IBM
 PS/2, the mouse motion may appear sluggish or jerky.

 To work around this problem, do not load the PC DOS Version 4.00 mouse
 drivers /MOS:PC??DRV.COM (where ?? is PC or MS) and load the Microsoft
 mouse driver MOUSE.COM before running the DOSSHELL.BAT file.


 93. Deallocating Memory When Using Compaq and IBM Mouse Ports

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 31-AUG-1989    ArticleIdent: Q43344

 When using a PS/2 style mouse port, you cannot deallocate the memory
 the mouse driver is using. The Mouse Off switch disables only the
 mouse. However, the memory will be deallocated if a bus or serial
 mouse is used.

 The following machines have PS/2 style mouse ports:

 1. COMPAQ 286e, 386s, 386e, and 386 20e

 2. IBM (all PS/2's)


 94. Mouse Will Not Work with PC Tools Deluxe 5.5 and 6.0

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 14-MAY-1990    ArticleIdent: Q61264

 If PC Tools Deluxe versions 5.5 and 6.0 are loaded as memory resident,
 the mouse cursor may or may not be displayed on the screen. If the
 mouse cursor is displayed, it will not move.

 This problem has been corrected in a later version of PC Tools.

 For information about this update, contact Central Point Software at
 (503) 690-8080.


 95. "Mouse Off" Hangs System: Samsung AT Compatible with J4 on 2

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  1-NOV-1988    ArticleIdent: Q37252

 On the Samsung S-500 AT compatible, typing "Mouse Off" may hang the
 system if the Bus mouse J4 jumper is set on interrupt 2. Moving the
 jumper to interrupt 5 eliminates the problem.


 96. Excellerator Requires Ms-DOS Version 3.30 with AT&T 6312

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 10-JAN-1989    ArticleIdent: Q37254

 When using the Excellerator (a code generation program) with an AT&T
 6312, MS-DOS Version 3.30 must be used.

 When any version of DOS earlier than Version 3.30 is used with the
 AT&T 6312 machine and the Excellerator, one of the following symptoms
 may occur:

 1. More than one cursor may appear.

 2. The mouse pointer may skip pixels as it is moved across the screen.

 3. Hieroglyphics may appear.

 According to Leading Index, the problem can be corrected by upgrading
 to MS-DOS Version 3.30.


 97. Mouse Command-Line Switches for Mouse Driver Version 7.04

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | Video 7 Video-7
 Last Modified: 29-AUG-1990    ArticleIdent: Q61592

 The following are the current command-line options (switches) for
 Microsoft Mouse Driver version 7.04:

    Option  Description
    ------  -----------

    /B      Using bus mouse

    /Cn     Using serial mouse on port COMn
            (where:  0 <= n <= 1)

    /Dn     Enabling double-speed threshold
            (where:  0 <= n <= 100)

            0 => No threshold speed (always double speed)
            100 => Maximum threshold speed (rarely double speed)

    /Hn     Setting horizontal sensitivity
            (where:  0 <= n <= 100)

            0 => 0 horizontal mickeys per pixel scaling factor
               (i.e., no horizontal movement returned)
            100 => 100 horizontal mickeys per pixel scaling factor

    /In     Using Microsoft InPort Mouse on primary or secondary InPort
            (where:  n = 1  or  n = 2)

    /L(c)   Selecting language c
            Languages are defined as follows:

               c         Language             Ordinal Value
               -         --------             -------------

           (default)     English                    0
               F         French                     1
               NL        Netherlands (Dutch)        2
               D         German                     3
               S         Swedish                    4
               SF        Finnish                    5
               E         Spanish                    6
               P         Portuguese                 7
               I         Italian                    8
               K         Korean                     9
               J         Japanese                   10

    /Mn     Cursor mask override
            (where:  0 <= n <= 255, n = 0 => mask off)

            0 => Mask off
            Not 0 => Mask on

            (If software cursor is specified in function 10, then set
            cursor to default software cursor. It tells the mouse
            driver to determine which bit pattern to use to make
            the cursor visible.)

    /Nn     Using dampened cursor motion to fix LCD laptop display
            problems
            (where:  0 <= n <= 255)
            (This slows down the screen update rate.)

            0 =>    Skip 0 interrupts (this is, same as normal mouse)
            255 =>  Skip 255 mouse hardware interrupts before
                    processing data

    /Pn     Selecting ballistic curve number n
            (where:  1 <= n <= 4)

            (Note that this may change if the specification changes.)

    /R(n)   Setting interrupt rate
            (where:  1 <= n <= 4, default n = 1)

            1 => 30Hz
            2 => 50Hz
            3 => 100Hz
            4 => 200Hz

    /Sn     Setting both horizontal and vertical sensitivity
            (where:  0 <= n <= 100)

            0 => 0 mickeys per pixel scaling factor
                 (that is, no movement returned)
            100 => 100 mickeys per pixel scaling factor

    /Vn     Setting vertical sensitivity
            (where:  0 <= n <= 100)

            0 => 0 vertical mickeys per pixel scaling factor
                 (that is, no vertical movement returned)
            100 => 100 vertical mickeys per pixel scaling factor

    /Y      Disabling sprite and Video Seven code

            (To disable mouse driver hardware cursor support on
            certain Video Seven and C&T VGA controllers.)

    /Z      Using PS/2 mouse

            (This is added for PS/2 only. It directs the driver to look
            for the mouse at the mouse port.)


 98. Hot Spot Not Displaced Along Horizontal Axis with Driver 7.04

 Product Version(s): 7.04
 Operating System:   MS-DOS
 Flags: ENDUSER |  h_menupr menu programming INT33 MF9
 Last Modified: 27-JUL-1990    ArticleIdent: Q64177

 If mouse driver version 7.04 for the Microsoft Mouse is installed
 without the /Y switch, the hot spot will not be displaced along the
 horizontal axis.

 This problem will occur only in programs that use mouse function 9 to
 set the hot spot. Including a /Y switch when installing the mouse
 driver will eliminate this problem.


 99. Problem with Mouse and PS/2 Model 70A21

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 18-APR-1990    ArticleIdent: Q38654

 Older models of the PS/2 Model 70A21 will not boot with the mouse in
 the mouse port.

 The machine hangs and gives an 8603 error, indicating something is
 wrong with the mouse. The mouse functions properly in the serial
 ports, and an IBM mouse will work in the mouse port with the drivers
 provided by Microosft.

 There is a patch that will correct this problem. Contact Microsoft
 Product Support Services at (206) 454-2030 for this patch.


 100. "Interrupt Jumper Missing" Error Message

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  6-DEC-1988    ArticleIdent: Q38754

 The "Interrupt jumper missing" message can appear when installing the
 driver on a bus mouse. This can be caused by several things.

 It frequently appears because the interrupt selected on the
 J4 jumper is conflicting with existing hardware. If the
 IRQ vector is being used by anything else this message will
 appear.

 The message also can appear because the J2 jumper is set on slot 8 and
 not to normal as it should be.

 It also is possible that the interface card is defective. This can
 only be verified by installing the mouse and software onto another
 machine and testing the mouse.


 101. How to Define, Display Graphics Mouse Cursor in FORTRAN 5.00

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | H_fortran
 Last Modified: 10-JUL-1990    ArticleIdent: Q51225

 The following code shows how to define and display a graphics mouse
 cursor in Microsoft FORTRAN version 5.00:

 c This program displays mouse cursor in a shape of a cross.
 c The program terminates when the user presses the ENTER
 c key.

       include 'fgraph.fi'
       include 'fgraph.fd'
       integer*2 m1,m2,m3,m4
       integer*2 mcursor(32)
       integer*2 arrloc(2)
       integer*4 arradds
       equivalence (arrloc(1),arradds)

       do 50 i=1,16                   !define the screen mask
  50      mcursor(i) = #ffff
          mcursor(17) = #0000         !define the cursor mask
          mcursor(18) = #0180
          mcursor(19) = #0180
          mcursor(20) = #0180
          mcursor(21) = #7ffe
          mcursor(22) = #0180
          mcursor(23) = #0180
          mcursor(24) = #0180
          mcursor(25) = #0000
          mcursor(26) = #0000
          mcursor(27) = #0000
          mcursor(28) = #0000
          mcursor(29) = #0000
          mcursor(30) = #0000
          mcursor(31) = #0000
          mcursor(32) = #0000

       m1 = 0
       call mousel(m1,m2,m3,m4)         !reset mouse driver
       dummy = setvideomode($erescolor) !set video mode (EGA)
       m1 = 9
       m2 = 1
       m3 = 1
       arradds = locfar(mcursor) !get address of cursor array
       call mousel(m1,m2,m3,arrloc(1))  !set graphics cursor
       m1 = 1
       call mousel(m1,m2,m3,m4)         !show cursor
       read(*,*)                        !press enter to quit
       m1 = 2
       call  mousel(m1,m2,m3,m4)        !hide cursor
       dummy = setvideomode($defaultmode) !set video mode
       end


 102. Serial Mouse May Hang on ATT 6300

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 10-MAR-1989    ArticleIdent: Q40162

 When either MOUSE.COM or MOUSE.SYS is loaded using a serial mouse on
 some of the ATT 6300's, the machine will hang.

 You can correct this problem by specifying the COM port the mouse is
 attached to by using the /C1 or /C2 command-line switches. You can do
 this either in a manual start up or by including the information in
 the AUTOEXEC.BAT or CONFIG.SYS files.


 103. Mouse and Lotus 1-2-3 Mouse Menu Under Windows/286

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 10-MAR-1989    ArticleIdent: Q41087

 To run Lotus 1-2-3 and the Mouse Menu for Lotus under Windows, the
 123.PIF file included with Windows must be edited. The key point to
 note is that under the "Directly Modifies" option of the PIF file the
 check boxes for both Screen and Memory must be turned on. Add any
 parameters or set the initial directory if necessary. Save these
 changes so you will not have to repeat them again.

 After the 123.PIF file is correctly configured, load the Mouse and
 Menu in memory as you normally would before going into Lotus 1-2-3.
 Bring up Lotus 1-2-3 within Windows and the Menu should function
 correctly. If not, reboot the system from the original floppy DOS disk
 to make sure nothing else in memory is interfering, then load the
 mouse and menu into memory.


 104. ATI Wondercard Graphics Adapter

 Product Version(s): 1.00 2.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 13-FEB-1989    ArticleIdent: Q31338

 Certain BIOS versions of the ATI Wondercard Graphics Adapter and
 Microsoft Mouse Driver Versions 6.02, 6.10, 6.11, and 6.14 are
 incompatible. ATI has solved this problem by offering a BIOS upgrade.

 The BIOS version is displayed when booting your computer. If you do
 not know the BIOS version of the Wondercard, reboot the machine. The
 board and BIOS versions that do work together are as follows:

 Board Version                      BIOS Version

    1                             1.16 (or higher)
    2                             2.07 (or higher)
    3                             3.07 (or higher)
    4                             4.07 (or higher)

 It is also possible to disable the VGA emulatoin on the ATI card
 by running SMS (ATI's configuration program) with the following
 paramiters:

             sms egabios   (to disable VGA)
             sms vgabios   (to enable VGA)

 For more information about the BIOS upgrade, contact ATI at the
 following phone number and address:

 (416) 576-0711
 ATI 3761 Victoria Park Ave.
 Unit #2
 Scarborough, Ontario, Canada
 M1W352


 105. BOA Demo Program Does Not Work on AT&T 6300 Computer

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | att
 Last Modified: 20-MAR-1990    ArticleIdent: Q51227

 BOA, the Microsoft Mouse Demo Program, does not work on an AT&T 6300
 computer: it begins to draw a border and then hangs. Otherwise, the
 mouse appears to function correctly.


 106. PC Tools Version 5.00 Needs Mouse Driver Version 6.14 or Later

 Product Version(s): 1.x 2.x 3.x 4.00 4.01
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 17-MAY-1989    ArticleIdent: Q42317

 PC Tools Version 5.00 documentation recommends Version 6.14 or later
 of the mouse driver.


 107. Mouse and Renaissance Legacy II Switch Graphics Adapter

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 20-MAR-1990    ArticleIdent: Q51240

 Problem:

 A serial mouse is installed on a computer with a Renaissance video
 card and the mouse driver reports that it is installed. However, the
 mouse does not respond in programs.

 Response:

 The Renaissance card has an InPort-type mouse adapter, which the mouse
 driver finds before it checks for a serial mouse.

 To correct this problem, include the /C1 or /C2 option on the mouse
 command line to specify where the mouse driver should look for the
 mouse. For example, do the following for COM1:

    mouse /C1


 108. Error in SIMPLE Mouse Menu in Programmer's Reference

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | docerr
 Last Modified: 22-MAR-1990    ArticleIdent: Q51489

 There is an error in the code for SIMPLE Mouse Menu on Page 74 of the
 "Microsoft Mouse Programmer's Reference Guide." The erroneous code
 reads as follows:

    dn:  TYPE 0,801       ;Down-arrow key

 It should read as follows:

    dn:  TYPE 0,80        ;Down-arrow key


 109. cegal() Function in EGA.LIB May Not Work Properly

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 16-APR-1990    ArticleIdent: Q43335

 When using cegal() in the EGA.LIB with Function f1, cegal() doesn't
 perform correctly. An example is shown below.

 Perform the following function in C

    outp(CRTC_INDEX,INDEX);

 where CRTC_INDEX is the port address and INDEX is the register.

 The mouse will not see the change in the EGA register; therefore, the
 above C call may cause the mouse to not perform properly because the
 call bypasses the BIOS routines.

 The following are two ways to perform this call so that the mouse will
 see the change in the EGA register:

 1. Use the EGA.LIB (this does not work):

          e1=0xf1;
          e2=0xd;
          e4=0;
          cegal(&e1,&e2,&e3,&e4,&e5);

 2. Use the equivalent BIOS call (this works):

          inregs.x.ax=0xf1;
          inregs.x.bx=0xd;
          inregs.x.dx=0;
          int86(0x10,&inregs,&outregs);


 110. NOTEPAD.COM Doesn't Work with Extended Keyboard

 Product Version(s): 1.00 1.01 2.00 2.01 2.50 3.00 4.00 5.00 5.02 5.03
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 12-JUN-1989    ArticleIdent: Q43336

 NOTEPAD.COM does not work with keyboards that have the extended
 function keys F11 and F12.

 No resolution to this limitation is expected because NOTEPAD.COM is
 no longer included with the mouse.


 111. Mouse and Token Ring Conflict

 Product Version(s): 7.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 22-MAR-1990    ArticleIdent: Q57606

 With the mouse driver installed first, Token Ring does not install
 properly.

 It has been reported that if the mouse driver was loaded after the
 three drivers that are needed for Token Ring, both will work properly.


 112. MS123.COM May Not Work in Lotus 1-2-3 with Look & Link Add-On

 Product Version(s): 1.x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 12-JUN-1989    ArticleIdent: Q43600

 MS123.COM may not work properly in Lotus 1-2-3 if Look & Link (a Lotus
 1-2-3 add-on by Personics) is being used.

 The workaround is to load MOUSE.SYS in the CONFIG.SYS file instead of
 loading MOUSE.COM in the AUTOEXEC.BAT file.


 113. Microsoft Mouse and the NEC Powermate

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 12-JUN-1989    ArticleIdent: Q43720

 When using the NEC Powermate and the Microsoft Mouse with the Bus
 Interface, you must place the J3 jumper to the secondary setting. The
 Powermate can use the primary addressing for its screen I/O.


 114. MOUSE.COM Solves PS/2 Serial Problems with Ventura Publishing

 Product Version(s): 1.01
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 20-MAR-1990    ArticleIdent: Q43781

 Ventura Publisher uses its own mouse driver for the PS/2 - Serial
 mouse. For the bus mouse, Ventura requires the Microsoft Mouse driver
 (MOUSE.COM) to be loaded.

 If you are experiencing problems using a PS/2 - Serial mouse,
 reinstall Ventura and select the Bus Mouse option.  This will load
 the Microsoft Mouse Driver rather than the driver supplied by Ventura.
 The problems that your experienced with your PS/2-Serial mouse will
 no longer be present.  You DO NOT need to replace your PS/2-Serial
 mouse to choose the bus mouse option.  Selecting the Bus mouse option
 bypasses Ventura's own mouse drivers.



 115. Using the 400 PPI Mouse with GEM

 Product Version(s): 7.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 19-MAR-1990    ArticleIdent: Q59313

 When using the 400 PPI Serial Mouse with GEM, the mouse cursor jumps
 all over the screen.

 When installing GEM, select the Microsoft Bus Mouse option, even
 though you are using a serial mouse. When the bus mouse is selected
 during the installation process, GEM will use the Microsoft Mouse
 Driver that is supplied with the mouse.


 116. MS123 Mouse Menu Not Correctly Positioning Cursor

 Product Version(s): 1.x 2.x 3.x 4.x 5.x 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 29-JUN-1989    ArticleIdent: Q44057

 If you position the Lotus cursor in 1-2-3 with the mouse cursor on an
 "unprotected cell," the Lotus cursor does not stay positioned on the
 cell selected by the mouse. The cursor jumps to the left or right,
 depending on which part of the cell the mouse cursor is located.

 If you position the Lotus cursor with the mouse cursor on "protected"
 cells, the cursor appears to stay positioned.

 One workaround in positioning the Lotus cursor with the mouse is to
 place the mouse cursor on the appropriate arrow keys that appear on
 the right side of the screen, or resort to using the keyboard cursor
 keys.


 117. Finding the COM1: Serial Port on a PC/XT/AT Machine

 Product Version(s): 1.00   | 1.00
 Operating System:   MS-DOS | OS/2
 Flags: ENDUSER |
 Last Modified: 31-AUG-1989    ArticleIdent: Q44126

 When connecting the Microsoft Mouse serial interface cable to your
 computer, you must first determine the location of the serial port.

 On a PC- or XT-class computer, the serial port is normally the male,
 25-pin, D-shaped connection in the back of the machine.

 On an AT-class computer, the serial connection is normally the male,
 9-pin, D-shaped connection on the back of the computer.

 There are exceptions, but these descriptions are a good rule of thumb.

 Note: If the machine has only one serial port, it should be set up as
 COM1: using IRQ4. If the serial port is set up as COM2: and it is the
 only serial port in the machine, the Microsoft Mouse driver might
 install, but the mouse might not function properly.

 COM3: and COM4: is not supported by the mouse driver.


 118. InPort/Bus Mouse Comparison and Overview

 Product Version(s): 1.00
 Operating System:   OS/2
 Flags: ENDUSER | SR# G890626-21385
 Last Modified: 31-AUG-1989    ArticleIdent: Q46369

 Question:

 Could you clarify the difference between the Microsoft Bus Mouse and
 the InPort Mouse?

 Response:

 The Microsoft InPort device interface is a low-cost graphic device
 interface consisting of a 40-pin custom LSI IC and a compact 9-pin
 circular connector, which supports a variety of graphic input devices,
 especially mice.

 The following is a comparison between old Bus Mouse and new InPort
 Mouse:

 1. The InPort Mouse uses a custom Microsoft designed 40-pin LSI
    interface chip manufactured by OKI Inc. of Japan.

    The Bus Mouse uses a generic Intel 8255A parallel interface chip.

 2. The InPort Mouse allows the CPU interrupt rate to be programmable
    from 0 (no interrupt) to 200 Hz.

     The Bus Mouse CPU interrupt rate is fixed at 30 Hz.

 3. The InPort Mouse interrupts the CPU only when the mouse position
    or button status has changed.

     The Bus Mouse interrupts the CPU constantly regardless of mouse
     (in)activity.

 4. The InPort Mouse requires only two I/O operations to read the mouse
    XY position.

    The Bus Mouse requires four I/O operations to read mouse XY
    position.

 5. The InPort Mouse uses the compact Hosiden 9-pin circular connector.

    The Bus Mouse uses the bulky DB-9 connector.

 When used stand-alone with an IBM XT/AT PC, both mice use an interface
 board that plugs into the standard IBM XT/AT bus. In addition, since
 the InPort custom IC is essentially an enhanced, single-chip version
 of the Microsoft Bus Mouse interface board, other manufacturers can
 easily add the InPort interface to their PC plug-in cards. The
 following are examples:

 1. The Microsoft MACH 10 enhancement board

 2. Renaissance GRX graphics add-in boards

 3. Selected Verticom graphics controllers/adapters come with an InPort
    interface.

 The InPort Mouse can also connect to an RS-232 serial port, or the
 IBM PS/2 mouse port through an external adapter box.


 119. Mouse Driver Conflicts with Novell Network Software

 Product Version(s): 7.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 22-MAR-1990    ArticleIdent: Q59314

 Using MOUSE.COM Version 7.00 may cause problems with Novell network
 software.

 Using MOUSE.SYS or loading MOUSE.COM before the network software will
 resolve the conflict.

 Microsoft is researching this problem and will post new information
 here as it becomes available.


 120. Mouse Performance between Serial and Bus Mouse

 Product Version(s): 1.x 2.x 3.x 4.x 5.x 6.x 1.00 1.01
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 31-AUG-1989    ArticleIdent: Q46461

 Summary

 Although there are no differences in functionality between the bus and
 serial mouse, you should be aware that there are differences in the
 way the mouse interrupts the CPU (i.e., the mouse driver must be
 installed).

 The serial mouse is event driven. This means when you neither move the
 mouse nor press a button (i.e., the mouse is not in use), there is no
 degradation to the CPU processing. When the mouse is being used, an
 approximately 5-percent degradation to the CPU performance can occur.

 The bus mouse is not event driven. When you neither move the mouse nor
 press a button, the mouse interrupts the CPU at either the default (30
 Hz) or at the user-defined rate (50, 100, or 200 Hz).


 121. Cadkey and Mouse Driver 7.00

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-APR-1990    ArticleIdent: Q59859

 If Mouse Driver Version 7.00 is installed when Cadkey is used, the
 mouse is limited to a 1-inch x 1-inch area in the upper left-hand
 corner of the screen.

 Microsoft has confirmed this to be a problem in Mouse Driver Version
 7.00. This problem was corrected in Mouse Driver Version 7.04.


 122. Intermittent Installation on NEC 386 Machines

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-APR-1990    ArticleIdent: Q59860

 Mouse Driver Version 7.00 causes intermittent installation of the
 mouse on the NEC 386 computers.

 Microsoft has confirmed this to be a problem with the Mouse Driver
 Version 7.00. This problem was corrected in Version 7.04.


 123. 400 DPI Serial Mouse and Northgate Computers

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  2-MAY-1990    ArticleIdent: Q59861

 When the 400 PPI PS/2/Serial Mouse is installed on the 9-pin serial
 port of some Northgate Computer, the mouse may not install.

 When the 400 PPI PS/2/Serial Mouse is installed on the 9-pin serial
 port as a serial mouse, it uses pins 2, 3, 4, 5, and 7 to communicate
 with the serial port.

 The other pins in the 9-pin connector are used when the PS/2 adapter
 is connected to the mouse. Pin 8 of the built-in serial port, when set
 to a logic zero, is 1 to 2 volts higher than the voltage that would be
 present on an IBM compatible serial port. When a logic 1 is present on
 pin 8 and the mouse is connected to a 9-pin serial port, the mouse
 cannot reset. This prevents the mouse from installing.

 To work around this problem, do either of the following:

 1. Contact Northgate Technical Services at (800) 445-5037. They have
    found the cause of the problem and will work with you to make the
    necessary corrections to the motherboard.

 2. Use a 9- to 25-pin serial adapter to eliminate the signal from pin
    8. To do this, you need to purchase the adapter from a local
    electronics store. This adapter has a 9-pin female connector on one
    end and a 25-pin male connector on the other end. Once you have the
    adapter perform the following steps:

    a. Attach the adapter you purchased to the built-in serial port of
       your computer.

    b. Attach the mouse to the 25- to 9-pin serial adapter that was
       supplied with your mouse.

    c. Attach this adapter to the 9- to 25-pin adapter that you have
       already attached to your computer.


 124. Mouse Function 9 and Mouse Driver 7.00

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-APR-1990    ArticleIdent: Q59877

 Mouse Function 9 does not function correctly when Mouse Driver Version
 7.00 is installed. Vertical movement of the hot spot is blocked. The
 symptoms of this are as follows:

 1. The wrong menu item is selected when the mouse buttons are clicked.

 2. The line is drawn above the cursor in a graphics application

 Microsoft has confirmed this to be a problem in Mouse Driver Version
 7.00. This problem was corrected in Version 7.04.

 Major Products: First Publisher
                 Ultravision


 125. MSETUP Deletes Reference to MOUSE.SYS in CONFIG.SYS

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-APR-1990    ArticleIdent: Q59929

 The MSETUP program that is supplied with the 400 PPI Mouse (Mouse
 Driver Version 7.00 or later) deletes any reference to MOUSE.SYS in
 the CONFIG.SYS file.

 If you are operating under OS/2, do NOT run MSETUP.

 MSETUP deletes the MOUSE.SYS reference in CONFIG.SYS to prevent the
 loading of a older version of the mouse driver when the machine is
 booted.

 Do not run MSETUP on an OS/2 system, and do not load the DOS mouse
 driver to make the mouse work in the DOS box.


 126. Which Mouse Menus Work with Which Version of Lotus

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-APR-1990    ArticleIdent: Q59932

 Testing of the various versions of Lotus 1-2-3 with each of the
 available MS123 mouse menus and with either the Version 6.24b or
 Version 7.00 mouse driver yield the following results:

    Lotus     |  MS123       MS123-1     MS123-2     MS123-3
    Version   |  6.24b/7.00  6.24b/7.00  6.24b/7.00  6.24b/7.00
    ----------|-----------------------------------------------
      1A      |   yes/yes     yes/yes     yes/yes     yes/yes
              |     */*                                  /**
              |
      2.01    |   yes/yes     yes/yes     yes/yes     yes/yes
              |     */                       /**       **/**
              |
      2.2     |   yes/yes     yes/yes     yes/yes     yes/yes
              |     */*                                 */*
              |
      3.0     |    no/no       no/no       no/no      yes/yes
              |               ***/***     ***/***      **/**

 Notes: *   No mouse action on Master screen.
        **  No side bar menu.
        *** Cursor moves with mouse but no menu action.

 Summary of Normal Mouse Action (Yes in Above Chart)
 ---------------------------------------------------

 Usually, the mouse works in one of two ways: either the selected block
 moves around with the mouse movements, or a separate mouse cursor is
 on the screen and the selected block moves to the mouse cursor
 position upon clicking the left mouse button.

 In most cases, clicking the left mouse button activates a side bar
 menu with options such as page up, page down, page left, page right,
 home, end, and arrow key functions, and sometimes more (depends on the
 version of the menu).

 Also, in most cases, clicking the right mouse menu does the same as
 pressing the "/" (slash) key to bring up the standard Lotus menu.
 Moving the mouse changes the highlighted command. The right mouse
 button acts as an ENTER key. Clicking both buttons will return the
 mouse to the spreadsheet.


 127. Multimate Menu Will Work with Multimate Advantage 4.0

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  3-APR-1990    ArticleIdent: Q59934

 Informal testing with the Multimate Advantage II mouse menu has shown
 that it also works with Multimate Advantage Version 4.0.


 128. Pin-Outs of the 9-Pin Hosiden Socket

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified:  8-MAY-1990    ArticleIdent: Q61593

 The following is the signal configuration of the 9-pin Hosiden socket
 on the bus adapter of the Microsoft Mouse:

    Pin          Signal
    ---        ------

    1          +5v
    2           XA
    3           XB
    4           YA
    5           YB
    6           SW1
    7           SW2
    8           SW3
    9           Signal ground
    E           Shield ground


 129. Bus Mouse Port on Leading Edge 386 SX

 Product Version(s): 2.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 27-JUL-1990    ArticleIdent: Q64178

 The Leading Edge 386 SX computer has what appears to be a PS/2-style
 mouse port near the keyboard connector. This is actually an inport
 mouse connector designed for a Microsoft-compatible bus mouse,
 according to Page 6-13 of the "Leading Edge 386 SX User's Guide." The
 connection is a standard hosedin connector for an inport mouse.

 There is one switch that may or may not be in the correct position to
 install the mouse. This is Switch 3 on the motherboard. This must be
 in the ON position or the mouse will not install.


 130. Practical Peripherals and Serial Mouse Configuration

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | mouse modem practical peripherals
 Last Modified: 15-NOV-1990    ArticleIdent: Q66536

 If the Microsoft serial mouse is connected to COM 1, then a Practical
 Peripherals 2400 baud rate modem cannot be configured as COM 2.  This
 modem/mouse combination may work for a while, but eventually it
 will fail to an I/O address conflict between the mouse and the modem.

 Practical Peripherals technical support ([818] 991-8200)
 confirms this to be a problem.  They recommend that the modem be
 configured as COM 3 or COM 4.  The mouse should then remain on COM 1
 to separate the I/O addresses as much as possible.


 131. Serial Mouse with Timeline

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 13-JAN-1991    ArticleIdent: Q67339

 To use the Microsoft Serial Mouse with Timeline, a Symantec
 Corporation project management application, load the mouse driver by
 invoking MOUSE.SYS in the CONFIG.SYS file. Symantec Corporation
 technical support confirms that the Microsoft Mouse will not work
 correctly with Timeline if you use the MOUSE.COM driver file.


 132. 386MAX.SYS with MOUSE.COM 7.0 Can Hang Sprite Video Cards

 Product Version(s): 7.00 7.03 7.04
 Operating System:   MS-DOS
 Flags: ENDUSER | SR# S901024-6 B_BasicCom
 Last Modified: 15-NOV-1990    ArticleIdent: Q66561

 When used with 386MAX.SYS version 4.05 (an expanded memory driver by
 Qualitas Software), Microsoft Mouse driver versions 7.00, 7.03, and
 7.04 can hang computers equipped with video cards that have sprite
 capabilities (the ability to have a graphic cursor in text mode).

 This problem only occurs with the above mentioned versions. Earlier
 versions of the Microsoft Mouse driver will not cause this problem.

 Using Mouse driver version 7.04 with the "/y" line option will fix
 this problem.
 e.g.
     in DOS:

       mouse /y

  or in the AUTOEXEC.BAT:

       C:\MOUSE1\MOUSE /Y



 133. Correct Mouse Drivers for Express Publisher

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | driver mouse express publisher
 Last Modified: 13-JAN-1991    ArticleIdent: Q67340

 The application Express Publisher requires the 7.04 mouse
 driver to run correctly. Other mouse driver versions will not work
 according to the manufacturers, Power Up Software Corporation
 of San Mateo, CA.



 134. Trail of Multiple Cursors in Desqview 386

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | cursors trail mouse port setup
 Last Modified: 13-JAN-1991    ArticleIdent: Q67341

 If the Microsoft Serial Mouse is connected to a mouse port in a PS/2
 style machine, you may see a trail of red cursors inside the windows
 of Desqview 386 when you use QEMM 5.0.

 This is not a problem with the mouse. This problem occurs if you have
 selected "serial" in the port selection for the mouse when you set up
 Desqview. If you select "add-on board" for the mouse port selection in
 the Desqview Setup program, the mouse cursor will display normally.
 Note: This problem will not occur if the mouse is connected to the
 serial port.


 135. Mouse Menu Key Sequences: Corrections and Additions

 Product Version(s): 1.x 2.x 3.x 4.x 5.x 6.x 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | key sequence mouse menu docerr
 Last Modified: 10-FEB-1991    ArticleIdent: Q67854

 Page 71 of the "Microsoft Mouse Programmer's Reference Guide" lists
 "Key Sequences That Can't Be Simulated" using the menu programming
 TYPE statement. These keys cannot be simulated in a mouse menu because
 the key or key sequence is suppressed in the ROM BIOS. The list that
 is presented in the guide is incomplete, and in certain instances it
 is in need of revision.

 Each suppressed key mentioned is the lowercase character on the key.
 It is understood, but not explicitly stated, that the uppercase
 character on these keys will also be suppressed. A number of keys and
 key combinations that are suppressed and cannot be emulated are not
 mentioned in the guide. Some of the additions and corrections that can
 be made to the published list are given below.

 KEY COMBINATIONS FOR 83-KEY KEYBOARD
 ------------------------------------

 For the IBM PC and compatibles with a standard 83-key keyboard,
 the following keys and key combinations are suppressed.

 NOTE: Where applicable the uppercase character is given in
 parentheses.

 In Combination With the ALT Key
 -------------------------------

 RIGHT TAB
 ` (~)
 \ (|)
 ALT
 HOME
 PG UP
 NUMPAD 5
 NUMPAD
 +
 END
 PG DN
 INS
 DEL

 In Combination with the CTRL Key
 --------------------------------

 CTRL
 ` (~)
 NUMPAD 5
 NUMPAD
 +

 KEY COMBINATIONS FOR 84-KEY KEYBOARD
 ------------------------------------

 For the IBM AT and compatibles with a 84-key keyboard, the following
 keys and key combinations are suppressed:

 In Combination with the ALT Key
 -------------------------------

 ` (~)
 \ (|)
 TAB (right and left)
 ALT

 With ALT and on the Numeric Keypad
 ----------------------------------

 7 (HOME)
 1 (END)
 5
 0 (INS)
 9 (PG UP)
 3 (PG DN)
 - (SYS RQ)
 +

 In combination with the CTRL Key
 --------------------------------

 ENTER
 CTRL

 With CTRL and on the Numeric Keypad
 -----------------------------------

 5
 - (SYS RQ)
 +

 For the IBM PS/2 and compatibles with a 101- and 102-key keyboard, the
 following keys and key combinations are suppressed:

 In combination with the ALT key and on the Numeric Keypad
 ---------------------------------------------------------

 7 (HOME)
 1 (END)
 5
 0 (INS)
 9 (PG UP)
 3 (PG DN)
 - (SYS RQ)
 +

 In combination with the CTRL Key
 --------------------------------

 ` (~)
 CTRL
 ALT
 SCROLL LOCK

 With CTRL and on the Numeric Keypad
 -----------------------------------
 +

 EXCEPTIONS AND CORRECTIONS
 --------------------------

 The exceptions and corrections to the list of suppressed key and key
 combinations given on pages 71-72 of the "Microsoft Mouse Programmer's
 Reference" (Copyright 1989) are noted below.

 The followings key combinations can be represented using
 extended-keyboard-scan codes with the IBM PS/2 and compatibles with a
 101- and 102-key keyboard:

    ALT+BACKSPACE
    ALT+ESC
    CTRL+INS
    CTRL+TAB

 The ALT key used in combination with any one of the following keys can
 also be represented using extended-keyboard-scan codes for the IBM
 PS/2 and compatibles with a 101- and 102-key keyboard:

    [    ]
    ;
    '
    -
    ,
    .
    /
    *

 The CTRL key used in combination with the RIGHT ARROW and LEFT ARROW
 key can be represented on the PC, AT, and PS/2 keyboards.

 For more information about this topic, see "The Programmer's PC
 Sourcebook," pages 400-406; the "IBM PC/AT Technical Reference," pages
 4-21 and 5-14 to 5-23; and the "IBM PS/2 Hardware Technical
 Reference," pages 41-49.


 136. The Microsoft Mouse with Lotus 1-2-3 Release 3.1

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 10-FEB-1991    ArticleIdent: Q67860

 You can use the Microsoft Mouse with Lotus 1-2-3 version 3.1. The
 mouse will work correctly with both the COM and SYS versions of the
 drivers. Correct mouse use in 1.2.3 release 3.1 depends on whether or
 not the memory resident formatting and printing utility WYSIWYG is
 properly installed and loaded into memory. Without installation and
 loading of WYSIWYG, no mouse cursor will appear on the normal Lotus
 1-2-3 screen. If you try use a previous Lotus 1-2-3 Microsoft Mouse
 menu or the generic MSMENU, Lotus will not work correctly (for
 example, you will get erratic highlights and no cursor).

 It appears that in some instances there is a problem with earlier
 versions of the mouse driver even when WYSIWYG is correctly installed
 and loaded. A possible solution is to update the mouse driver to
 MOUSE.COM version 7.04. Another possible solution is to load MOUSE.SYS
 version 7.04 with the CONFIG.SYS file.

 Correct use of the mouse in Lotus 1-2-3 version 3.1 depends on proper
 installation of WYSIWYG, correct hardware configuration, and the right
 operating environment.

 Installation
 ------------

 The following steps are necessary to ensure that the Microsoft Mouse
 will work with Lotus 1-2-3 version 3.1:

  1. Complete installation of the mouse hardware and software. Be sure
     the mouse driver is loaded into memory.

  2. Complete the first-time installation of Lotus 1-2-3 3.1. If you did
     not choose to have the WYSIWYG files transferred to the hard disk
     the first time, you must rerun the installation program from the
     hard disk and choose the option to transfer the WYSIWYG files to
     the hard disk.

  3. After completing the first installation of Lotus 3.1, put the
     Add-In Support Disk into drive A and type "install" (without the
     quotation marks) at the A:> prompt. The installation program will
     place the WYSIWYG files into the default directory C:\123R3\ADDINS.

  4. When this second "install" is complete, go to the C:\123R3
     subdirectory and type "123". This takes you into the normal Lotus
     screen.

  5. Press the ALT+F10 key combination. You will see the Addin menu in
     the Lotus menu bar area.

  6. From the Addin menu, choose Load.

  7. Specify WYSIWYG.PLC as the add-in to read into memory.

  8. Select No-Key.

  9. WYSIWYG is now in memory, and you have a mouse cursor.

 10. You can get the regular Lotus menus by selecting Quit or using the
     key combination CTRL+BREAK. You also may toggle between the Addin
     menu and the main Lotus menu by clicking the right mouse button.

 Hardware
 --------

 You must have a mouse and mouse driver as well as a graphics
 display monitor and a graphics display card. Lotus 1-2-3 3.1
 also requires at least a 286 microprocessor.

 Operating Environment
 ---------------------

 Lotus 1-2-3 3.1 requires MS-DOS version 3.00 or later. It will not run
 in the DOS compatibility box of OS/2; however, it will run after you
 choose the DOS dual-boot option from OS/2. Lotus 1-2-3 3.1 will run
 under the DOS option of Windows 3.00 or it can be installed as a
 Windows 3.00 application.

 Additional Tips
 ---------------

 Microsoft Mouse Driver versions 7.03 and 7.05 will return a white
 arrow graphics cursor in Lotus 1-2-3 3.11 while all other mouse driver
 versions will return a blue graphics cursor.

 To select an item from a menu you must point to the menu item desired
 and hold the left mouse button down. Then move the highlight to the
 sub-menu choice. When you release the mouse button, the item will be
 selected.

 In addition to normal mouse cursor movement, you may also move the
 mouse cursor by selecting the arrow icons on the right hand side of
 the 1-2-3 screen.


 137. Running MSETUP from Drive B

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | driver mouse install b: msetup
 Last Modified: 10-FEB-1991    ArticleIdent: Q67862

 When you run the Setup program from drive B, the message "please
 insert disk into drive A" may occur. You can temporarily force drive B
 to emulate drive A. Using the DOS ASSIGN command, type

    ASSIGN A=B

 at the C:\DOS> prompt. Then, run MSETUP from drive B. After rebooting
 the system, the drives will return to their normal configuration.



 138. 400 DPI Serial Mouse and Epson Equity LT 386/SX

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 12-FEB-1991    ArticleIdent: Q67863

 The 400 DPI serial mouse may not install on the 9-pin serial port of
 an Epson Equity LT 386/SX. Epson America has confirmed this and offers
 a patch for this problem. You can obtain this patch from your Epson
 dealer.

 Note: Not all Epson dealers may be aware of this problem, but they
 should be able to get the patch from their main Epson supplier.



 139. Quattro Pro 2.0 Graphics Mode Needs /Y Switch

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 10-FEB-1991    ArticleIdent: Q68106

 Borland's Quattro Pro 2.0 requires mouse switch /Y when you run the
 7.04 mouse driver in graphics mode. This information is contained in
 the readme file that accompanies Quattro Pro 2.0.

 The graphics mode in Quattro Pro 2.0 is known as the "Annotate" mode.
 Owners of the Microsoft Mouse and Quattro Pro 2.0 also report that the
 earlier version 6.24b mouse driver will work in any mode of Quattro
 Pro 2.0. Borland recommends that you should not use a Microsoft Mouse
 driver earlier than version 6.10.


 140. I/O Addresses for the Microsoft Mouse

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 10-FEB-1991    ArticleIdent: Q68110

 The following are the ranges in which an I/O (Input/Output) port
 assignment may occur for the Microsoft Mouse. The ranges are given in
 hexadecimal numbers, and the serial communications port assignments
 conform to the IBM standard I/O address range assignments for PCs and
 PS/2s.

 SERIAL MOUSE
 ------------

 Port Assignments    Address Ranges
 ----------------    --------------

 COM1                3F8H-3FFH

 COM2                2F8H-2FFH

 BUS MOUSE (BUS INTERFACE BOARD SETTINGS)
 ----------------------------------------

 Primary Inport Range
 --------------------

 23CH-23FH

 Secondary Inport Range
 ----------------------

 238H-23BH

 An I/O port acts as a doorway through which information travels.
 Information may originate from the CPU, travel over data and address
 buses, pass through the I/O port, and finally reach a peripheral
 device such as the mouse. Although the CPU recognizes various ports
 through 16-bit port numbers that range from 00H through FFFFH, the
 port address is not actually an address found in main memory. A port
 assignment is a memory location separate from a (main) memory address
 that is associated with that particular I/O port.

 No other peripheral device, such as a modem or printer, may share the
 same I/O address with the mouse or the mouse may not function
 correctly.


 141. Pascal Example in Programmer's Guide Won't Compile

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | Pascal Mouse Programming Borland Turbo
 Last Modified: 11-FEB-1991    ArticleIdent: Q68881

 The "Making Calls from Borland Turbo Pascal Programs" sample in
 Appendix E of the "Microsoft Mouse Programmer's Reference" does not
 compile with Turbo Pascal versions 5.0 and 6.0.

 The CpuReg data structure needs to be defined as "Registers"
 variables. The semicolons need to be removed from the END lines that
 immediately precede ELSE. Finally, finding the segment and offset of
 the pointer of the address of the user array or subroutine (functions
 9,12,20,22,23,and 24) needs to be done outside of this procedure.
 Passing the first element of the array or the start point of the
 subroutine into the procedure, then calling the "ofs" and "seg"
 functions in the procedure doesn't seem to work. This is due to how
 the variables get dereferenced when passed into a procedure.

 The following example compiles in both Turbo Pascal version
 6.0 and Quick Pascal version 1.00:

 Procedure Mouse (Var m1, m2, m3, m4, m5 : integer );

 Var
    CpuReg: Registers;

 begin {mouse}

    if m1 >= 0 then
       begin
      CpuReg.AX := m1;        { Load Parameters       }
      CpuReg.BX := m2;        { into appropriate      }
      CpuReg.CX := m3;        { registers             }

      if (m1 = 9) or (m1 = 12) or (m1 = 20)
         or (m1 = 22) or (m1 = 23) or (m1 = 24) then
         begin
           CpuReg.DX  :=  m4;    {m4 = offset,         }
           CpuReg.ES  :=  m5;    { and m5 = segment    }
         end                       { of the user array }
                          { or subroutine     }

       else
       if  m1 = 16  then
        begin
          CpuReg.CX  := m2;           {Left  x coordinate }
          CpuReg.DX  := m3;           {Upper y coordinate }
          CpuReg.SI  := m4;           {Right x coordinate }
          CpuReg.DI  := m5;           {Lower y coordinate }
        end
      else
          CpuReg.DX  := m4;

      Intr($33, CpuReg);              {Call mouse driver  }
                             { at Interrupt 33H  }

      m1 := CpuReg.AX;                {Return values back }
      m2 := CpuReg.BX;                { to parameters     }
      m3 := CpuReg.CX;
      m4 := CpuReg.DX;

      if (m1 = 20) then               {special returns    }
         m2 := CpuReg.ES              { from subroutines  }
    end;
 end; {mouse}


 142. CADKEY Requires Microsoft Mouse Driver Version 7.04

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | AutoCAD EasyCAD FastCAD VersaCAD
 Last Modified: 10-FEB-1991    ArticleIdent: Q68930

 The CAD software package CADKEY requires that the Microsoft Mouse
 driver be updated to version 7.04 to run properly. Earlier
 versions of the driver, such as version 7.00, will not allow you to
 operate the mouse correctly in this software. In one instance, the
 cursor is confined to a small area of the upper-left-hand corner of
 the screen.

 CADKEY is produced and marketed by CADKEY Inc. The technical support
 number is (203) 647-9235. The CADKEY Inc. product referenced here is
 manufactured by vendors independent of Microsoft; we make no warranty,
 implied or otherwise, regarding the product's performance or
 reliability.


 143. Using the Microsoft Mouse with Open Access III

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 10-FEB-1991    ArticleIdent: Q68931

 The Microsoft Mouse can be successfully used with the application Open
 Access III by performing the following steps:

 1. Copy the Open Access III files MMENU.DEF and MMENU.MNU to the
    MOUSE1 subdirectory.

 2. Copy the file MENU.COM to the MOUSE1 subdirectory.

 3. Load the Microsoft Mouse driver.

 4. Go to the MOUSE1 subdirectory and type:

       MENU MMENU

    You should get a "Menu Installed" message.

 5. Go to the Open Access III subdirectory and start the Open Access
    III program.

 If this sequence does not work, you may have problems with memory
 resident software. In which case, perform the above steps after doing a
 "clean boot" with a copy of the original DOS floppy disk.

 You may obtain the MENU.COM program by calling Microsoft Product
 Support (Hardware).

 Open Access III is an integrated function application that combines a
 database, a word processor, and a spreadsheet into one application.
 The product is developed and marketed by Software Products
 International. The technical support number is (800) 937-4774.

 The Software Products International product referenced here is
 manufactured by a vendor independent of Microsoft; we make no
 warranty, implied or otherwise, regarding the product's performance or
 reliability.


 144. False Cursor Trail in SimEarth with Mouse Driver 7.00

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 10-FEB-1991    ArticleIdent: Q68932

 Microsoft Mouse Driver version 7.00 displays a false cursor trail in
 the planet simulation program SimEarth. You may temporarily correct
 this problem by using a /B switch when loading SimEarth (that is
 SimEarth /B).

 For a permanent fix you can obtain an updated mouse driver from Microsoft
 Product Support or Microsoft Customer Service.

 More info:

 SimEarth is developed and marketed by Maxis. The technical support
 number is (415) 376-6434. The Maxis product referenced here is
 manufactured by a vendor independent of Microsoft; we make no
 warranty, implied or otherwise, regarding the product's performance or
 reliability.


 145. Microsoft Mouse Incompatible with Commodore PC 40-III

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 10-FEB-1991    ArticleIdent: Q68953

 The Commodore PC 40-III and PC 10-III may not work with the Microsoft
 Serial Mouse. The mouse port for these machines is not designed to
 function with the Microsoft Mouse.

 You may obtain further information and assistance by calling Commodore
 technical support at (703) 644-4170. The Commodore product referenced
 here is manufactured by a vendor independent of Microsoft; we make no
 warranty, implied or otherwise, regarding this product's performance
 or reliability.


 146. Using a Bus Mouse on a Tandy 1000

 Product Version(s): 1.x 6.x 7.x
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 12-FEB-1991    ArticleIdent: Q68955

 When using a bus mouse on a Tandy 1000 computer, you may not be able
 to run the mouse on IRQ2. A better choice may be IRQ5, even though the
 computer may have a hard drive.

 The early models of the Tandy 1000 used IRQ2 for a hard card, which
 may have been optionally installed. These models included the Tandy
 1000, Tandy 1000A, Tandy 1000SX, and Tandy 1000TX.

 Later models used IRQ5 for hard cards. These models included the
 Tandy 1000SL, Tandy 1000SL/2, Tandy 1000TL, and Tandy 1000TL/2.


 147. WordPerfect 5.1 and WordStar 6.0 Mouse Support

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | word processor
 Last Modified: 10-FEB-1991    ArticleIdent: Q68956

 WordPerfect version 5.1 incorporates Microsoft Mouse support; however,
 WordStar versions 5.5 and 6.0 do not. The following information
 identifies whether or not a menu is needed to use the Microsoft Mouse
 with WordStar or WordPerfect.

 Product                  Description
 -------                  -----------

 WordStar version 6.0     Not Microsoft Mouse aware: see below note
 WordStar version 5.5     Not Microsoft Mouse aware: uses MSWS5.COM
 WordPerfect version 5.1  Microsoft Mouse aware: no menu needed
 WordPerfect version 5.0  Not Microsoft Mouse aware: uses MSWP5.COM

 Note:
 WordStar 6.0 sometimes works with MSWS5.  But we do not gurantee this
 version to work with WS 6.0.

 It is important to learn how the built-in mouse menus in WordPerfect
 version 5.1 work. In color modes, the normal cursor is a rectangular
 red text cursor. A right-button click causes a menu line to appear at
 the top of the screen. Then, by clicking and holding the left mouse
 button, you may drag the highlight down the chosen drop-down menu to
 make the desired menu selection.

 The products referenced here are manufactured by vendors independent
 of Microsoft; we make no warranty, implied or otherwise, regarding
 these products' performance or reliability.


 148. Using MSMENU.COM with ACT! version 2.0

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER |
 Last Modified: 11-FEB-1991    ArticleIdent: Q68958

 You can use the Microsoft Mouse with ACT! version 2.0. In order to use
 the mouse correctly, you must first load the generic menu DEFAULT.COM
 or MSMENU.COM. Appendix H-1 of the ACT! "Reference Manual" specifies
 DEFAULT.COM, but the more current MSMENU.COM or MENU.COM work as well.

 Copy one of these files to the ACT! subdirectory. The directions for
 ACT! specify that you:

 1. Load the mouse.

 2. In the subdirectory in which ACT! is installed, type "MSMENU MSACT"
    (without the quotation marks).

 3. After the menu is loaded in this way, type "ACT!" (without the
    quotation marks). You will now have the use of the mouse in ACT!

 The file MSACT.MSE is a menu file that comes with ACT!. If the mouse
 and menu are loaded properly, then the mouse should give basic cursor
 movement with the buttons serving the following functions:

    Button                   Function
    ------                   --------

    Left Button Click        Same as ENTER
    Right Button Click       Same as F2 (edit mode)
    Both Buttons Click       Same as ESC

 Note: These button assignments may not work properly in DOS 4.00.

 If you do not have a copy of MSMENU.COM, you may obtain a copy by
 calling Microsoft Customer Service or Product Support and ordering
  "The Microsoft Mouse Supplemental Menus Disk."

 ACT! is a database software program that helps keep track of business
 contacts. ACT! is developed and marketed by Contact Software
 International. The technical support number is (214) 418-4885. The
 Contact Software International product referenced here is
 manufactured by a vendor independent of Microsoft; we make no
 warranty, implied or otherwise, regarding this product's performance
 or reliability.


 149. NEC Mouse Port, Lotus 3.1, and Microsoft Serial Mouse

 Product Version(s): 1.00
 Operating System:   MS-DOS
 Flags: ENDUSER | NCR
 Last Modified: 10-FEB-1991    ArticleIdent: Q68959

 The mouse cursor may freeze when you use the Microsoft Mouse in the
 PS/2 mouse port of some of the NEC 286 and 386 machines while running
 the WYSIWYG mode of Lotus 1-2-3 version 3.1. Contact NEC technical
 support at (508) 264-4300 for more information.

 The products included here are manufactured by vendors independent of
 Microsoft; we make no warranty, implied or otherwise, regarding the
 products' performance or reliability.


