home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft_Programmers_Library.7z / MPL / pas / pasknl.txt < prev    next >
Encoding:
Text File  |  2013-11-08  |  1.4 MB  |  42,178 lines

Text Truncated. Only the first 1MB is shown below. Download the file for the complete contents.
  1.  Microsoft PASCAL Compiler
  2.  =============================================================================
  3.  
  4.  
  5.  1. Restoring Remapped Interrupt Vectors
  6.  
  7.  Product Version(s): 3.3x
  8.  Operating System:   MS-DOS
  9.  Flags: ENDUSER | TAR53039
  10.  Last Modified: 23-FEB-1988    ArticleIdent: Q11709
  11.  
  12.  Problem:
  13.     When you define interrupt service routines using Microsoft Pascal
  14.  Version 3.3x under MS-DOS, the interrupt vector will not always be
  15.  restored to its original value after program termination.
  16.  
  17.  Response:
  18.     Pascal will not allow you to automatically restore remapped interrupt
  19.  vectors. If you want to remap interrupt vectors, you will have to use
  20.  DOS functions 25H and 35H to both change and explicitly restore the
  21.  vectors.
  22.  
  23.  
  24.  2. Pascal 3.32: Reading Unlocked Records after Locked Records
  25.  
  26.  Product Version(s): 3.32
  27.  Operating System:   MS-DOS
  28.  Flags: ENDUSER | buglist3.32 ptr62966
  29.  Last Modified: 17-MAR-1988    ArticleIdent: Q27205
  30.  
  31.  Problem:
  32.     If I lock a range of records in a data file over a network, a
  33.  second user attempting to read these records will get read error 11
  34.  (protected file or record) as expected. However, if the second user
  35.  consecutively reads locked records and then unlocked records, he will
  36.  still get read errors attempting to read the unlocked records.
  37.     For example, if records number two and three are locked and records
  38.  four and five are unlocked, a second user reading records two and
  39.  three will get read errors as expected. If the second user then
  40.  attempts to read unlocked record numbers four and then five, he will
  41.  still get read errors.
  42.  
  43.  Response:
  44.     This is a verified problem with Pascal Version 3.32. It will be
  45.  corrected in a future release of Pascal.
  46.     To work around the problem, you must read the unlocked records in
  47.  non-consecutive order after reading locked records.
  48.     If you read the last locked record whose record number is N, the
  49.  next attempted read of any unlocked record other than number N+1 will
  50.  succeed. After reading locked record number N, attempting to read
  51.  unlocked record number N+1 will fail, and consecutively reading
  52.  unlocked record numbers N+2, N+3, N+4 and so on will also fail.
  53.     One method to avoid this problem would be to re-attempt reading a
  54.  record after trapping a read error. If the record is unlocked, the
  55.  second read attempt will succeed.
  56.     Depending on which records are locked in the file, other methods to
  57.  avoid this problem may include resetting the file before reading
  58.  unlocked records, or skipping one or more records before the next
  59.  read.
  60.  
  61.  
  62.  3. STACK Entry in MS-DOS and XENIX
  63.  
  64.  Product Version(s): 3.30 3.31
  65.  Operating System:   XENIX
  66.  Flags: ENDUSER | TAR55715 docerr
  67.  Last Modified: 26-SEP-1988    ArticleIdent: Q11816
  68.  
  69.  Question:
  70.  
  71.  Page 79 of the XENIX "Microsoft Pascal Compiler User's Guide" displays
  72.  a memory map. For the STACK entry, it says that this is provided for
  73.  compatibility with MS-DOS. But under XENIX, the STACK is reserved by
  74.  it and not in DGROUP. However, when you use the -F option to set the
  75.  stack, the effect is as if the stack is in DGROUP. For example,
  76.  setting the stack bigger makes the heap smaller (I get out of heap
  77.  errors), and making the stack smaller makes the errors go away. Does
  78.  the -F option not only affect the XENIX Stack but also the DOS
  79.  compatibility stack?
  80.  
  81.  Response:
  82.  
  83.  The information on page 79 is incorrect. Both DOS and XENIX place
  84.  the stack in DGROUP. The documentation insinuates that there are two
  85.  stacks; however, there only is one. Thus, the heap is reduced when the
  86.  stack size is increased.
  87.  
  88.  
  89.  4. Flushing I/O buffers
  90.  
  91.  Product Version(s):
  92.  Operating System:   MS-DOS
  93.  Flags: ENDUSER | TAR56140
  94.  Last Modified: 25-FEB-1988    ArticleIdent: Q11872
  95.  
  96.  Product: PASCAL 3.31
  97.  
  98.  Question:
  99.     I have a large application written in MS-Pascal and I would like to force
  100.  the flushing of the I/O buffer. The file is open in DIRECT mode and is a
  101.  binary file.  Is there any way to do this short of closing and reopening the
  102.  file?
  103.  
  104.  Response:
  105.     At this time, there is no way to flush the I/O buffer without closing the
  106.  file.
  107.  
  108.  
  109.  
  110.  5. Use of the /STACK Linker Switch
  111.  
  112.  Product Version(s): 3.20 3.3x
  113.  Operating System:   MS-DOS
  114.  Flags: ENDUSER | TAR56601
  115.  Last Modified: 23-FEB-1988    ArticleIdent: Q11963
  116.  
  117.  Question:
  118.     I am using Version 3.2 of Microsoft Pascal and having problems with
  119.  stack overflow. I use the /STACK linker switch to increase the size of
  120.  the stack and everything seems to be fine but the documentation in
  121.  both the 3.2 and 3.3 manuals says not to use the /STACK switch. Am I
  122.  likely to have a problem with this? If so, what can I do?
  123.  
  124.  Response:
  125.     In the 3.2 version, it is possible for a program to cause the stack
  126.  size to increase or decrease. Setting a stack size with the linker
  127.  switch and then having that size changed by a program could cause
  128.  unpredictable results. This is the reason that you should not use the
  129.  /STACK switch.
  130.     In Version 3.3x, the stack size is fixed by the compiler so
  131.  changing the stack size when linking is acceptable. You will find more
  132.  information on the /STACK linker switch in the README.DOC file that
  133.  accompanies the 3.31 version of the product.
  134.  
  135.  
  136.  6. Symbol Defined More than Once Linking with FORTRAN Library
  137.  
  138.  Product Version(s): 3.3x
  139.  Operating System:   MS-DOS
  140.  Flags: ENDUSER | TAR56929
  141.  Last Modified:  3-OCT-1988    ArticleIdent: Q11984
  142.  
  143.  Question:
  144.  
  145.  In the process of adding a Pascal language-user interface to our
  146.  FORTRAN language system, a run-time library compatibility problem has
  147.  surfaced. Any time we search both run-time libraries during a link, a
  148.  "Symbol defined more than once: `SUBSQQ'" error is reported in the
  149.  second run-time library searched.
  150.  
  151.  This is both an operational problem (our MAKEs terminate at the error)
  152.  and a potential run-time problem. The only run-time problem we know
  153.  about is when the FORTRAN substring is used (i.e.,  TEST(I:I)=' ') and
  154.  the Pascal library is searched first. This will generally lock up a
  155.  system at run-time.
  156.  
  157.  We would like to know the following:
  158.  
  159.  1. Is there a fix for the libraries?
  160.  
  161.  2. Is there a potential Pascal run-time problem when we link the
  162.     FORTRAN library first to solve the FORTRAN substring crash?
  163.  
  164.  Response:
  165.  
  166.  No. You are not likely to have a problem in using the executable that
  167.  you created.
  168.  
  169.  For the first problem, with the MAKE file, you should use conditional
  170.  execution based on whether or not you receive certain error levels.
  171.  
  172.  With regards to the library problem, the information that you sent
  173.  would suggest that you have a FORTRAN main program that calls Pascal
  174.  routines that, for example, provide a user interface to your system.
  175.  But there is something in the structure of your program that tangles
  176.  the linker, which is NOT your fault.
  177.  
  178.  If you look at the contents of the FORTRAN and Pascal libraries using
  179.  the "LIB" utility, you can see that the function SUBSQQ is present in
  180.  both PASCAL.LIB and FORTRAN.LIB. You can see that the object module
  181.  that contains the SUBSQQ function in the Pascal library contains many
  182.  other entry points, in contrast to the FORTRAN object module
  183.  containing SUBSQQ, which only has three entry points.
  184.  
  185.  PASCAL.LIB:
  186.  
  187.  sets              Offset: 000101d0H  Code and data size: 4c5H
  188.    ADDSQQ            CEQSQQ            CLESQQ            CLTSQQ
  189.    MIN               MULSQQ            O3ESQQ            SETSQQ
  190.   *SUBSQQ*           T3OSQQ            Z3RSQQ
  191.  
  192.  FORTRAN.LIB:
  193.  
  194.  fstl              Offset: 0000fb00H  Code and data size: 19eH
  195.    FCPSQQ            FSTLQQ            SUBSQQ
  196.  
  197.  An entry point is not necessarily a function. For example, in the
  198.  FORTRAN library module containing SUBSQQ, FCPSQQ is actually a module
  199.  name, while SUBSQQ is a procedure and FSTLQQ a function.
  200.  
  201.  Your program uses at least one entry point contained in both of these
  202.  two modules. The entry point does not necessarily have to be SUBSQQ.
  203.  
  204.  For example, if you link the Pascal library First, then the FORTRAN
  205.  library, and if your program generates calls to ADDSQQ and FSTLQQ, the
  206.  linker will first pull in the "sets" module from the PASCAL.LIB to
  207.  resolve the reference to ADDSQQ. Then it would have to pull in the
  208.  "fstl" module from the FORTRAN.LIB to resolve the reference to FSTLQQ.
  209.  Then it will check all of its entry points for duplicates. The linker
  210.  would find that now it has duplicates of the SUBSQQ procedure, and
  211.  generate a message that you have pulled in two (possibly different)
  212.  versions of SUBSQQ.
  213.  
  214.  This process should not generate a fatal error, and you should be able
  215.  to proceed. If it is fatal and hangs your machine, try switching your
  216.  link order.
  217.  
  218.  Because you are using two Microsoft compilers, and because you are
  219.  using the same version number of two particularly compatible compilers
  220.  (they share the same source code for many routines), the process
  221.  should work properly.
  222.  
  223.  The SUBSQQ procedure is identical in the FORTRAN and
  224.  Pascal Version 3.31.
  225.  
  226.  You should proceed with the executable that you created by linking in
  227.  FORTRAN first and then PASCAL. You should not have any problems.
  228.  
  229.  
  230.  7. ANDRQQ Should Return REAL8
  231.  
  232.  Product Version(s): 3.31 3.32
  233.  Operating System:   MS-DOS
  234.  Flags: ENDUSER | TAR54013 buglist3.31 fixlist3.32
  235.  Last Modified:  3-OCT-1988    ArticleIdent: Q12391
  236.  
  237.  Function andrqq() returns a REAL4 value instead of a REAL8 value when
  238.  the parameter is an arithmetic expression and it has been linked with
  239.  DECMATH.LIB.
  240.  
  241.  y and z should be the same, but y is only accurate to seven digits.
  242.  
  243.  Microsoft has confirmed this to be a problem in Version 3.31. This
  244.  problem was corrected in Version 3.32.
  245.  
  246.  The following code demonstrates the problem:
  247.  
  248.      {$decmath+}
  249.     var w,x:real8;
  250.          y,z:real8;
  251.     function andrqq(consts a:real8):real8;extern;
  252.         w:=12345678.1234;
  253.         x:=1234567812.34;
  254.         y:=andrqq((w*100));
  255.         z:=andrqq(x);
  256.  
  257.  
  258.  8. Compiling in Parent Directories
  259.  
  260.  Product Version(s): 3.3x
  261.  Operating System:   MS-DOS
  262.  Flags: ENDUSER | TAR51090 buglist3.30 buglist3.31 fixlist3.32
  263.  Last Modified: 22-FEB-1988    ArticleIdent: Q12393
  264.  
  265.  Problem:
  266.     PAS1 and FORTRAN's FOR1 do not accept the .. (parent directory)
  267.  path designator. For example, if THIS.PAS and THAT.FOR are in my
  268.  parent directory and PAS1.EXE and FOR1.EXE are in the parent's
  269.  subdirectory, PAS1 ..\THIS and FOR1 ..\THAT generate error messages.
  270.  Note: LINK version 3.x and the C compiler driver CL do accept
  271.  the .. path designator.
  272.  
  273.  Response:
  274.     This problem was corrected in Version 3.32.
  275.  
  276.  
  277.  9. Bad code generated for ADS assignment in Version 3.31
  278.  
  279.  Product Version(s):
  280.  Operating System:   MS-DOS
  281.  Flags: ENDUSER | TAR57668
  282.  Last Modified: 25-FEB-1988    ArticleIdent: Q12396
  283.  
  284.  Subject:   Bad code generated for ADS assignment
  285.  
  286.  Product: PASCAL 3.31
  287.  
  288.  Problem:
  289.     Bad code is generated when assigning a element of ADS record to the offset
  290.  of an ADS variable.  This problem occurs in versions 3.30 and 3.31.
  291.  
  292.  Response:
  293.     This problem is corrected in the version 3.32 release.
  294.  
  295.  EXAMPLE PROGRAM:
  296.  
  297.  program temp(input, output);
  298.  
  299.    type
  300.      boxg_rec = record
  301.        next : word;
  302.        case btype : word of
  303.          1   : (l_lit    : word);
  304.          2   : (d_handle : word);
  305.        {end case}
  306.      end{record};
  307.  
  308.      boxg_ary = array [1..10] of boxg_rec;
  309.  
  310.    var
  311.      boxgary_ads : ads of boxg_ary;
  312.      i           : integer;
  313.  
  314.  begin
  315.    boxgary_ads^[i].next := (ads boxgary_ads^[i+1]).r;
  316.  end.
  317.  
  318.  3.30 and 3.31 produces the following code - for the assignment;
  319.  
  320.    REPZ
  321.    STOSB
  322.  
  323.  3.20 produces this code.
  324.  
  325.    MOV       AX,0006H
  326.    MUL       I
  327.    LES       BX,BOXGAR
  328.    ADD       BX,AX
  329.    ADD       AX,FFFAH
  330.    MOV       DX,BX
  331.    LES       BX,BOXGAR
  332.    ADD       BX,AX
  333.    MOV       ES:[BX],DX
  334.  
  335.  
  336.  10. BRTEQQ and Windows Development
  337.  
  338.  Product Version(s): 3.3x
  339.  Operating System:   MS-DOS
  340.  Flags: ENDUSER | TAR51995 buglist3.30 buglist3.31 fixlist3.32
  341.  Last Modified: 23-FEB-1988    ArticleIdent: Q12397
  342.  
  343.  Problem:
  344.     In Pascal.lib, the routine BRTEQQ accepts one parameter but ends
  345.  with a RETF instead of a RETF 2. When running under Windows, this
  346.  causes the routine EQCLQQ to jump back into the middle of itself when
  347.  it does a RET to the epilogue code. We have tried to patch BRTEQQ but
  348.  LINK4 will not produce an EXE file if there is a "variable already
  349.  declared" error. Looking at BRTEQQ in general, it will not behave
  350.  correctly with the Windows stack structure.
  351.  
  352.  Response:
  353.     This problem was corrected in Version 3.32.
  354.  
  355.  
  356.  11. Pascal Has No Append Mode for Sequential Files
  357.  
  358.  Product Version(s): 3.1x 3.20 3.3x
  359.  Operating System:   MS-DOS
  360.  Flags: ENDUSER |
  361.  Last Modified:  4-APR-1988    ArticleIdent: Q28288
  362.  
  363.     Pascal has no append mode for text and other sequential files. To
  364.  add data to an existing sequential file, you must create a new
  365.  sequential file with the Rewrite procedure. Then, use the Reset
  366.  procedure to open your existing file, read the data, and write it to
  367.  the newly created file. Once your old file's data has been written to
  368.  the new file, you may write additional data to the new file.
  369.     The DOS Copy command may be used to append files together, as in
  370.  the following command:
  371.  
  372.  copy file1 + file2
  373.  
  374.     Please note that you can append to direct access files by use of
  375.  the Reset procedure. This procedure is documented on Page 266 of the
  376.  Version 3.32 "Microsoft Pascal Compiler Reference" manual.
  377.  
  378.  
  379.  12. Error Accessing the I/O Addresses
  380.  
  381.  Product Version(s): 3.3x 4.00
  382.  Operating System:   MS-DOS
  383.  Flags: ENDUSER | docerr
  384.  Last Modified: 26-SEP-1988    ArticleIdent: Q29805
  385.  
  386.  The port attribute does not allow Pascal programs to access I/O
  387.  addresses as documented at the top of Section 11.5.3 on Page 142 of
  388.  the "Microsoft Pascal Compiler Reference Manual."
  389.  
  390.  The port attribute is designed to behave like the origin attribute, as
  391.  stated in Appendix B.2 "Implementation Restrictions" of the "Microsoft
  392.  Pascal Compiler User's Guide."
  393.  
  394.  Both the origin and port attributes direct the compiler to locate a
  395.  variable at a specified memory address.
  396.  
  397.  
  398.  13. File Sharing Mode Fails in Version 3.31
  399.  
  400.  Product Version(s): 3.31 3.32
  401.  Operating System:   MS-DOS
  402.  Flags: ENDUSER | TAR53822 buglist3.31 fixlist3.32
  403.  Last Modified:  3-OCT-1988    ArticleIdent: Q12400
  404.  
  405.  Reading and writing a file with file-sharing mode set will not work
  406.  correctly under Version 3.31 of Pascal.
  407.  
  408.  If the mode of the file is set to sm_DENYNONE, it will read up to the
  409.  583rd byte of the record, then go back and read from the beginning
  410.  instead of reading the rest of the file. The problem does not appear
  411.  if the file sharing is not set. It does not matter if SHARE.EXE is
  412.  loaded or not.
  413.  
  414.  This problem occurs when the share modes are sm_DENYWR, sm_DENYRD, and
  415.  sm_DENYNONE. It appears to work correctly under sm_COMPAT and
  416.  sm_DENYRW.
  417.  
  418.  The sample program below writes 26 30-character strings in a 780-byte
  419.  direct-access record. Each of the 26 strings is filled with a
  420.  different letter of the alphabet.
  421.  
  422.  The following code demonstrates this problem:
  423.  
  424.  program testit(input,output);
  425.  type test_rec=record
  426.                line:array[1..26] of string(30);
  427.                end;
  428.  
  429.  var
  430.    i,j,k:integer;
  431.    go_again:char;
  432.    test:test_rec;
  433.    test_file:file of test_rec;
  434.  
  435.  begin
  436.    assign(test_file,'testfile');
  437.    test_file.mode:=direct;
  438.    for i:=1 to 4 do begin
  439.      for j:=1 to 26 do
  440.        for k:=1 to 30 do
  441.          test.line[j][k]:=chr(j +96);
  442.      test_file.share:=sm_DENYRW;
  443.      rewrite(test_file);
  444.      seek(test_file,i);
  445.      test_file^:=test;
  446.      put(test_file);
  447.      close(test_file);
  448.  
  449.      test_file.share:=sm_DENYNONE;
  450.      reset(test_file);
  451.      seek(test_file,i);
  452.      get(test_file);
  453.      test:=test_file^;
  454.      close(test_file);
  455.  
  456.      writeln(output);
  457.      writeln(output,'Record : ',i:2);
  458.      writeln(output);
  459.      for j:=1 to 13 do begin
  460.        write(output,'  ',j:2,' : ',test.line[j]);
  461.        writeln(output,'   ',(j+13):2, ' : ',test.line[j+13]);
  462.      end;
  463.      writeln(output);
  464.      write(output,'enter a key to go to next record --> ');
  465.      readln(iniput,go_again);
  466.    end;  {for i:=1 to 4}
  467.  end.
  468.  
  469.  
  470.  14. READs and WRITEs to Binary File Cause Crash in Version 3.31
  471.  
  472.  Product Version(s): 3.31 3.32
  473.  Operating System:   MS-DOS
  474.  Flags: ENDUSER | TAR52819 buglist3.31 fixlist3.32
  475.  Last Modified:  3-OCT-1988    ArticleIdent: Q12402
  476.  
  477.  The program below uses READs and WRITEs to a binary sequential file.
  478.  It crashes the system in Version 3.31, but works properly in Version
  479.  3.30. If GETs and PUTs are used instead, the program executes
  480.  successfully. According to the standard, it is legal to use READs and
  481.  WRITEs on a binary sequential file.
  482.  
  483.  Microsoft has confirmed this to be a problem in Version 3.31. This
  484.  problem was corrected in Version 3.32.
  485.  
  486.  The following code demonstrates this problem:
  487.  
  488.  {$LINE+}
  489.  program test(input,output);
  490.  TYPE BUFF=ARRAY[0..511] OF INTEGER;
  491.  
  492.  VAR  BFILE:FILE OF BUFF;
  493.       FNAME:LSTRING(80);
  494.       DATA:BUFF;
  495.  
  496.       I:INTEGER;
  497.  BEGIN
  498.       FNAME:='CU.DAT';
  499.       ASSIGN(BFILE,FNAME);
  500.       REWRITE(BFILE);
  501.       FOR I:=0 TO 511 DO
  502.        DATA[I]:=I;
  503.       WRITE(BFILE,DATA);
  504.       CLOSE(BFILE);
  505.  
  506.       RESET(BFILE);
  507.       FOR I:=0 TO 511 DO
  508.        DATA[I]:=0;
  509.       READ(BFILE,DATA);
  510.       FOR I:=0 TO 511 DO
  511.        WRITELN(DATA[I]);
  512.       CLOSE(BFILE);
  513.  END.
  514.  
  515.  
  516.  15. Compiler and Heap Management Error Messages
  517.  
  518.  Product Version(s): 3.3x
  519.  Operating System:   MS-DOS
  520.  Flags: ENDUSER | TAR52075 buglist3.31 fixlist3.32
  521.  Last Modified:  3-OCT-1988    ArticleIdent: Q19725
  522.  
  523.  Question:
  524.  
  525.  The compiler behaves very inconsistently. When trying to compile a
  526.  file, for example xx.PAS, "pas1 xx;" sometimes works correctly, but
  527.  "pas1 xx,,list;" gives "Error: compiler pointer to disposed var."
  528.  
  529.  Changing the name of the listing file, "pas1 xx,,lis;" sometimes works
  530.  properly. This problem occurs when compiling exactly the same source
  531.  file; different results are produced by changing the invocation line.
  532.  The different error messages are as follows:
  533.  
  534.        "Error: Compiler Invalid Pointer Range"
  535.        "Null Pointer Assignment"
  536.        "Compiler Pointer To Disposed Var"
  537.  
  538.  Response:
  539.  
  540.  Microsoft has confirmed this to be a problem in Version 3.31. This
  541.  problem was corrected in Version 3.32.
  542.  
  543.  
  544.  16. Windows Development for 80386 Requires Pascal Version 3.32+
  545.  
  546.  Product Version(s): 3.3x
  547.  Operating System:   MS-DOS
  548.  Flags: ENDUSER | TAR58979
  549.  Last Modified: 29-FEB-1988    ArticleIdent: Q19931
  550.  
  551.  Problem:
  552.     My Windows application written in Pascal runs correctly on my 80286
  553.  machine, but crashes on my 80386 machine.
  554.  
  555.  Response:
  556.     You must compile Windows applications with the Pascal Version 3.32
  557.  (or higher) compiler and libraries in order to run the application on an
  558.  80386 machine.
  559.  
  560.  
  561.  17. Floating-Point Libraries for Windows
  562.  
  563.  Product Version(s): 3.3x 4.00
  564.  Operating System:   MS-DOS
  565.  Flags: ENDUSER | TAR59216
  566.  Last Modified:  3-OCT-1988    ArticleIdent: Q19940
  567.  
  568.  Problem:
  569.  
  570.  I am having trouble getting my Windows application to link without
  571.  errors. It is a Pascal program and I am using floating-point
  572.  calculations. I am specifying the following libraries to the linker
  573.  and I am receiving unresolved externals such as "_fpmath" and
  574.  "_fptaskdata":
  575.  
  576.  paslibw pascal math llibc /nod
  577.  
  578.  Response:
  579.  
  580.  You need to include the following as your linker library:
  581.  
  582.  altmath paslibw pascal mlibc libh/NOD
  583.  
  584.  The altmath should be linked first to override the Pascal library that
  585.  would disable the floating point. Also, with Pascal Versions 3.x, only
  586.  the alternate math package is supported in Windows.
  587.  
  588.  
  589.  18. Duplicate Code Generated for a Function Call
  590.  
  591.  Product Version(s): 3.32 4.00 | 4.00
  592.  Operating System:   MS-DOS    | OS/2
  593.  Flags: ENDUSER | TAR61145 buglist3.32 buglist4.00
  594.  Last Modified: 18-AUG-1988    ArticleIdent: Q22514
  595.  
  596.  Problem:
  597.     Under certain circumstances, the startup code and call to a
  598.  user-defined function is followed by an exact duplicate of the startup
  599.  code and function call, i.e., the function is called twice.
  600.     This process rarely occurs, but it has been reported to happen when
  601.  a function call is made as one of the arguments to another function or
  602.  procedure call.
  603.  
  604.  Response:
  605.     Microsoft has confirmed this to be a problem in Versions 3.32 and
  606.  4.00. We are researching this problem and will post new information as
  607.  it becomes available.
  608.     You can work around the problem by using a temporary variable to
  609.  receive the result of the function call, and then use the temporary
  610.  variable within expressions.
  611.  
  612.  
  613.  19. Comparing Floating-Point Numbers
  614.  
  615.  Product Version(s): 3.13 3.20 3.3x 4.00
  616.  Operating System:   MS-DOS OS/2
  617.  Flags: ENDUSER | TAR61353
  618.  Last Modified: 29-SEP-1988    ArticleIdent: Q22589
  619.  
  620.  Question:
  621.  
  622.  It seems that comparing a VAR and a CONST produces a condition
  623.  resulting in FALSE while the two values are equal. The following
  624.  program is an example:
  625.  
  626.     PROGRAM RE(INPUT,OUTPUT)
  627.     CONST
  628.     H=199.33;
  629.     VAR R:REAL4.
  630.     BEGIN
  631.     R:=H;
  632.     WRITELN(R);
  633.     IF R=H THEN WRITELN('OK');
  634.     END.
  635.  
  636.  Executing this program never gives the equality between R and H. Is
  637.  this problem due to a difference between the internal format
  638.  representation?
  639.  
  640.  Response:
  641.  
  642.  First, real constants use eight bytes. Because the decimal fraction .33
  643.  cannot be exactly represented in binary, the eight-byte constant will
  644.  have more significant digits than the four-byte variable, making the
  645.  comparison between them false.
  646.  
  647.  Second, be aware of the way real numbers are internally represented in
  648.  a computer. Because these numbers are stored in a binary
  649.  floating-point format, it is impossible to represent all decimal real
  650.  numbers exactly, and a conversion from binary to decimal may result in
  651.  some degree of inaccuracy.
  652.  
  653.  Because the conversion process is not always exact, conditional tests,
  654.  rounding or truncating routines, and conversions are not always
  655.  reliable. Therefore, we recommend that if they are used, they be used
  656.  with caution.
  657.  
  658.  Do not compare floating-point numbers for equality due to the
  659.  conversion problems. Instead, compare a floating-point number to a
  660.  range of values. For example, to compare a single-precision
  661.  floating-point variable "x" to 1.0, the following expression could be
  662.  used:
  663.  
  664.  if ((x <= 1.001) AND (x >= 0.999)) then
  665.     writeln('x = 1.0');
  666.  
  667.  If you would like a more detailed description of the floating-point
  668.  format, we recommend that you refer to the following articles:
  669.  
  670.  1. A three-part series on real-number representations in "PC Tech
  671.     Journal" running in the October, November, and December 1984 issues
  672.  
  673.  2. An article titled "Arithmetic On Your PC" by Peter Rice in the
  674.     March 1985 issue of "BYTE" magazine
  675.  
  676.  
  677.  20. No Unique Serial Number on Registration Card
  678.  
  679.  Product Version(s): 3.13 3.20 3.3x
  680.  Operating System:   MS-DOS
  681.  Flags: ENDUSER |
  682.  Last Modified: 18-FEB-1988    ArticleIdent: Q22738
  683.  
  684.  Question:
  685.     I am trying to fill out the registration card, but am
  686.  unable to access the 16-digit serial number that you ask
  687.  for. I am following the instructions, but no serial number
  688.  appears in the right-hand corner. What am I doing wrong?
  689.  
  690.  Response:
  691.     There is no unique serial number for this product. The
  692.  instructions you are referring to pertain to Microsoft Word
  693.  users only. You should skip this part of the registration
  694.  card, fill out the rest, and send it in.
  695.  
  696.  
  697.  21. Sending Output to the Printer
  698.  
  699.  Product Version(s): 3.13 3.20 3.3x
  700.  Operating System:   MS-DOS
  701.  Flags: ENDUSER |
  702.  Last Modified:  3-OCT-1988    ArticleIdent: Q22829
  703.  
  704.  Question:
  705.  
  706.  How do I output data from my Pascal program to the printer?
  707.  
  708.  Response:
  709.  
  710.  You may access the printer by treating it as a file with one of the
  711.  following system names:
  712.  
  713.  1. Prn
  714.  2. Lpt1
  715.  3. Lpt2
  716.  
  717.  The following example sends output to the printer:
  718.  
  719.     PROGRAM EXAMPLE(INPUT,OUTPUT);
  720.      VAR F:TEXT;
  721.      BEGIN
  722.       ASSIGN(F,'PRN');
  723.       REWRITE(F);
  724.       WRITELN(F,'OUTPUT NOW GOES TO THE PRINTER');
  725.       CLOSE(F);
  726.      END.
  727.  
  728.  The ASSIGN statement associates the TEXT file variable F with the
  729.  system file PRN. The REWRITE statement opens the printer for output,
  730.  and the WRITELN statement sends output to the file F, which is the
  731.  printer.
  732.  
  733.  It should be noted that the system name you use is dependent upon your
  734.  particular system, and you may have to experiment to see which one
  735.  works for you. If you have a serial printer attached to your
  736.  communications port, you should use the MS-DOS MODE command to tell
  737.  the operating system to send printer output to the communications port
  738.  instead of to the regular printer port.
  739.  
  740.  
  741.  22. Pascal Constants and Concatenation Operator
  742.  
  743.  Product Version(s): 3.3x
  744.  Operating System:   MS-DOS
  745.  Flags: ENDUSER |
  746.  Last Modified:  3-OCT-1988    ArticleIdent: Q23439
  747.  
  748.  Question:
  749.  
  750.  Is there a way to indicate in the source file the continuation of a
  751.  line when declaring a constant that is longer than 80 characters? If
  752.  so, what would the continuation character be?
  753.  
  754.  Response:
  755.  
  756.  There is no continuation character; however, you may use the string
  757.  concatenation operator (*) with string constants to declare a constant
  758.  longer than 80 characters. The following is an example:
  759.  
  760.     const a = 'hello'
  761.           b = ' there'
  762.           c = a * b
  763.           { c = 'hello there'}
  764.  
  765.  This information is documented in Section 10.6 (Pages 125-127) in the
  766.  "Microsoft Pascal Compiler for the MS-DOS Operating System Reference
  767.  Manual" for Version 3.32.
  768.  
  769.  
  770.  23. Stack and Heap Growth
  771.  
  772.  Product Version(s): 3.3x
  773.  Operating System:   MS-DOS
  774.  Flags: ENDUSER | docerr
  775.  Last Modified: 26-SEP-1988    ArticleIdent: Q23693
  776.  
  777.  Problem:
  778.  
  779.  Section 10.3.2 (Page 116) in the "Microsoft Pascal Compiler User's
  780.  Guide" states that the stack grows down and the heap grows up and that
  781.  they "grow toward each other." However, according to the memory model
  782.  in the README file, the stack would have to grow up and the heap down
  783.  for them to grow toward each other.
  784.  
  785.  Response:
  786.  
  787.  In MS-DOS Pascal Versions 3.3x, the stack and heap do grow apart. They
  788.  grow toward each other in Version 3.20. The error in the documentation
  789.  is a result of incomplete changes in the documentation from Versions
  790.  3.2 to 3.3x.
  791.  
  792.  
  793.  24. Units and Interfaces Versus Modules
  794.  
  795.  Product Version(s): 3.20 3.3x
  796.  Operating System:   MS-DOS
  797.  Flags: ENDUSER |
  798.  Last Modified: 18-FEB-1988    ArticleIdent: Q23666
  799.  
  800.  Question:
  801.     What is the advantage of using units and interfaces over
  802.  modules?
  803.  
  804.  Response:
  805.     The purpose of units in Microsoft Pascal is to allow
  806.  programmers to port programs written in UCSD Pascal to
  807.  Microsoft Pascal more easily. We recommend the use of
  808.  modules over units. Modules are more straightforward,
  809.  clearer, and easier to use.
  810.  
  811.  
  812.  25. Error 2033 in Pascal Compiler 3.32
  813.  
  814.  Product Version(s): 3.32
  815.  Operating System:   MS-DOS
  816.  Flags: ENDUSER | TAR62947 buglist3.32 fixlist4.00
  817.  Last Modified: 18-AUG-1988    ArticleIdent: Q23616
  818.  
  819.     Version 3.32 of the Pascal compiler generates the "2033 Invalid
  820.  Pointer Range" error for the code segment below.
  821.     Note that Pascal Version 3.31 runs correctly without any errors.
  822.     Microsoft has confirmed this to be a problem in Version 3.32. This
  823.  problem was corrected in Pascal Version 4.00.
  824.  
  825.     The following is the sample code segment:
  826.  
  827.     {$debug-}
  828.     program test(input,output);
  829.  
  830.       var
  831.         config_name : lstring(20);
  832.  
  833.       procedure get_config;
  834.         var
  835.           config_file  : file of integer;
  836.         begin
  837.           assign(config_file,config_name);
  838.           close(config_file);
  839.         end;{get_config}
  840.  
  841.      procedure copy_screen;
  842.         type
  843.           video_screen = ads of array[0..16383] of byte;
  844.         var
  845.           plane0,plane1 : video_screen;
  846.         begin{copy_screen}
  847.           plane0.s:=16#b800;
  848.           plane0.r:=0;
  849.           plane1.s:=16#b800;
  850.           plane1.r:=16#4000;
  851.           plane1^ := plane0^
  852.         end;{copy_screen}
  853.     {-------------------------------------------------------}
  854.  
  855.       begin
  856.         config_name := 'config.mcb';
  857.         copy_screen;
  858.     {$debug+}
  859.         get_config;
  860.       end.
  861.  
  862.  
  863.  
  864.  26. Linking DOS2PAS.LIB and MS-DOS Version 2.00
  865.  
  866.  Product Version(s): 3.3x
  867.  Operating System:   MS-DOS
  868.  Flags: ENDUSER | docerr
  869.  Last Modified: 26-SEP-1988    ArticleIdent: Q23697
  870.  
  871.  Problem:
  872.  
  873.  Page 35 in the "Microsoft Pascal Compiler User's Guide" discusses how
  874.  linking with the DOS2PAS.LIB file will cause your program to use the
  875.  MS-DOS Version 2.00 file system. I cannot find this .LIB file on any
  876.  of my disks.
  877.  
  878.  Response:
  879.  
  880.  This file is included only in MS-DOS Pascal Compiler Version 3.20. It
  881.  is not included with Versions 3.3x. The user's guide is incorrect.
  882.  
  883.  
  884.  27. Determining Available Memory
  885.  
  886.  Product Version(s): 3.3x
  887.  Operating System:   MS-DOS
  888.  Flags: ENDUSER | docerr
  889.  Last Modified:  4-NOV-1988    ArticleIdent: Q23698
  890.  
  891.  Question:
  892.  
  893.  The example on Page 164 in the "Microsoft Pascal Compiler User's
  894.  Guide" does not work correctly. How can my Pascal program determine
  895.  how much memory is available?
  896.  
  897.  Response:
  898.  
  899.  The example on Page 164 only applies to Version 3.20 of the Microsoft
  900.  Pascal Compiler. The documentation is in error; in Version 3.20,
  901.  CESXQQ:2 contains the upper memory limit. However, in Version 3.3x,
  902.  CESXQQ:2 contains the top of DGROUP.
  903.  
  904.  There is no way to determine how much memory is available directly
  905.  from a Pascal Version 3.3x program. However, you may link in an
  906.  assembly routine that makes a call to DOS with the Setblock function
  907.  call (Function 4A).
  908.  
  909.  An example of a program that returns available memory is available as
  910.  an application note called "V 3.3x Available Memory." This application
  911.  note is available by contacting Microsoft Product Support Services at
  912.  (206) 454-2030.
  913.  
  914.  
  915.  28. Overlaying Data with the Overlay Linker
  916.  
  917.  Product Version(s): 3.13 3.20 3.3x
  918.  Operating System:   MS-DOS
  919.  Flags: ENDUSER |
  920.  Last Modified: 18-FEB-1988    ArticleIdent: Q23755
  921.  
  922.  Question:
  923.     How do I overlay data using the overlay linker?
  924.  
  925.  Response:
  926.     Microsoft Linker only allows the overlaying of code, so
  927.  it cannot be used to overlay data. There are third-party
  928.  linkers that work with Microsoft products to allow the
  929.  overlaying of data.
  930.  
  931.  
  932.  29. No Implementation of SHL, SHR, and ISR Operators
  933.  
  934.  Product Version(s): 3.11 3.13 3.20 3.3x 4.00 | 4.00
  935.  Operating System:   MS-DOS                   | OS/2
  936.  Flags: ENDUSER | docerr
  937.  Last Modified: 18-AUG-1988    ArticleIdent: Q23758
  938.  
  939.  Question:
  940.     Page 6 in the "Microsoft Pascal Compiler Reference" manual states
  941.  that SHL, SHR, and ISR are not implemented features; however, Page 151
  942.  in Section 12.1 implies that these operators are available. Which part
  943.  of the manual is correct?
  944.  
  945.  Response:
  946.     Section 12.1 of the "Microsoft Pascal Compiler Reference" manual is
  947.  incorrect. Microsoft Pascal Compilers Versions 3.11 to 4.00 (Version
  948.  4.00 being the most recent version) do not implement the SHL, SHR, and
  949.  ISR operators. This information is also in the "Microsoft Pascal
  950.  Compiler User's Guide" in Appendix B.3 under "Unimplemented Features."
  951.  
  952.  
  953.  30. PAS3 Generates File Access Errors
  954.  
  955.  Product Version(s): 3.1x 3.20 3.3x
  956.  Operating System:   MS-DOS
  957.  Flags: ENDUSER |
  958.  Last Modified: 18-FEB-1988    ArticleIdent: Q23877
  959.  
  960.  Question:
  961.     Why does pass three generate the error message "File
  962.  access error in file PASIBF.OID", and an error code such as
  963.  1032"?
  964.  
  965.  Response:
  966.     The purpose of PAS3 is to generate a code file in which
  967.  the Pascal source code has been translated into assembly
  968.  code. When PAS3 is run, it looks for two files it assumes
  969.  were created by PAS2. These two files are PASIBF.OID and
  970.  PASIBF.TMP. PAS2 will create these files only if you
  971.  requested a code file when you ran PAS1.
  972.     PAS1 requests the names of four files: the source,
  973.  object, listing, and code files. In order to run PAS3, you
  974.  must explicitly give the code file a name. If you use the
  975.  default (type ENTER), it assumes you do not want a code
  976.  file; thus, running PAS3 will generate the file access
  977.  error.
  978.     More information on this topic can be found in Section
  979.  3.2 of the "Microsoft Pascal Compiler User's Guide."
  980.  
  981.  
  982.  31. Clearing Screen and Locating Cursor
  983.  
  984.  Product Version(s): 3.1x 3.20 3.3x
  985.  Operating System:   MS-DOS
  986.  Flags: ENDUSER |
  987.  Last Modified:  3-OCT-1988    ArticleIdent: Q23884
  988.  
  989.  Question:
  990.  
  991.  How do I clear the screen and locate the cursor?
  992.  
  993.  Response:
  994.  
  995.  Microsoft Pascal does not directly support operations such as clearing
  996.  the screen and locating the cursor. This is because these operations
  997.  are machine dependent and Microsoft compilers are designed to support
  998.  a variety of MS-DOS machines.
  999.  
  1000.  There are several ways to perform these machine-dependent operations.
  1001.  One is to call assembly-language routines that you or someone else has
  1002.  written. There are several excellent third-party graphics packages
  1003.  available for Microsoft compilers.
  1004.  
  1005.  Another method is to use ANSI or VT52 escape sequences. To use these,
  1006.  you must have either the ANSI or the VT52 screen driver installed. For
  1007.  example, if a computer has ANSI.SYS on its system disk, and the
  1008.  CONFIG.SYS file contains the file DEVICE=ANSI.SYS, that computer has
  1009.  the ANSI driver installed.
  1010.  
  1011.  The ANSI escape sequence for clearing the screen is "{esc}[2J".
  1012.  Therefore, to clear the screen in Pascal with the ANSI driver
  1013.  installed, execute the following procedure:
  1014.  
  1015.     Procedure ClearScreen;         {uses ESC 2 J to clear the screen and}
  1016.     Var  line:lstring(4);          {move the cursor to the home position}
  1017.     Begin
  1018.       line[1] := chr(27);          {escape character}
  1019.       line[2] := '[';
  1020.       line[3] := '2';
  1021.       line[4] := 'J';
  1022.       line[0] := chr(4);           {number of characters}
  1023.       Write(line)
  1024.     End;                           {ClearScreen}
  1025.  
  1026.  
  1027.  32. Fixup Overflow Error While Linking
  1028.  
  1029.  Product Version(s): 3.3x
  1030.  Operating System:   MS-DOS
  1031.  Flags: ENDUSER | docerr
  1032.  Last Modified: 18-AUG-1988    ArticleIdent: Q23888
  1033.  
  1034.  Problem:
  1035.     I am linking my Pascal Version 3.32 program with an assembler
  1036.  module; I am following the instructions on Page 98 in the "Microsoft
  1037.  Pascal Compiler User's Guide." However, the linker is generating the
  1038.  error message "Fixup overflow..."
  1039.  
  1040.  Response:
  1041.     There are several probable sources for this problem, as follows:
  1042.  
  1043.     1. The documentation on Page 98 of the Pascal user's guide is
  1044.        incorrect. The guide shows the correct interface to assembly for
  1045.        Version 3.20, not for Version 3.3x. Version 3.3x uses a different
  1046.        memory model than does Version 3.20; as a result, you need a
  1047.        slightly different interface. The correct way to use an assembler
  1048.        module with Pascal is given in Appendix A of the user's guide, in
  1049.        Section A.12. If you are using the correct interface to your
  1050.        assembly code, your problem may lie elsewhere.
  1051.     2. Other causes of this error are described in the Pascal user's
  1052.        guide in the error messages section. Specifically, this part of
  1053.        the manual contains a section of linker error messages, in which
  1054.        there is a Fixup Overflow entry.
  1055.     3. If a segment is larger than 64K bytes (Point 1 under the Fixup
  1056.        Overflow entry), the typical reason is that the global data from
  1057.        all object files has been accumulated into the default data
  1058.        segment (Dgroup). The solution in this case is to declare ADS OF
  1059.        arrays. You then can keep arrays out of the default data segment
  1060.        by allocating them on the long heap with the function ALLMQQ or
  1061.        GETMQQ, using the ADS variables to keep track of the addresses
  1062.        where the arrays are located. See the user's guide under "Long
  1063.        Heap Allocation."
  1064.     4. If a code segment exceeds 64K bytes, you will have to break up
  1065.        the respective source file. A map file with a code segment larger
  1066.        than FFFF hexidecimal indicates this condition. If a map file
  1067.        cannot be created, link a single-object file by itself. Assuming
  1068.        there is less than 64K bytes of data declared in the object's
  1069.        source-code file, a Fixup Overflow for a single-object file
  1070.        indicates that the code exceeds 64K bytes. (Generally, you also
  1071.        will see numerous unresolved reference errors, which you may
  1072.        ignore for the purpose of this test.)
  1073.  
  1074.  
  1075.  33. Inconsistency in Truncating Numeric Constants
  1076.  
  1077.  Product Version(s): 3.31 3.32
  1078.  Operating System:   MS-DOS
  1079.  Flags: ENDUSER | buglist3.32
  1080.  Last Modified:  5-MAY-1988    ArticleIdent: Q24062
  1081.  
  1082.  Problem:
  1083.     The compiler seems to be inconsistent in truncating numeric
  1084.  constants longer than 31 characters. Appendix B.2 in the "Pascal
  1085.  User's Guide" states that numeric constants can have up to 31
  1086.  characters and, like identifiers, numeric constants longer than 31
  1087.  characters are truncated.
  1088.     However, declaring a constant with this property does not cause
  1089.  Pas1 to generate warning message 104 "number too long - truncated." In
  1090.  fact, the constant is not truncated.
  1091.     This is inconsistent with Appendix B.2.
  1092.  
  1093.  Response:
  1094.     This problem is under review and will be considered for inclusion
  1095.  in a future release.
  1096.  
  1097.  
  1098.  34. Stack-Overflow Error
  1099.  
  1100.  Product Version(s): 3.3x
  1101.  Operating System:   MS-DOS
  1102.  Flags: ENDUSER |
  1103.  Last Modified:  3-OCT-1988    ArticleIdent: Q24251
  1104.  
  1105.  Question:
  1106.  
  1107.  What is causing the error message "Stack Overflow" in my program? Can
  1108.  I work around it?
  1109.  
  1110.  Response:
  1111.  
  1112.  The usual source of this error is the allocation of too much space to
  1113.  variables in the 64K default data segment, especially large arrays. To
  1114.  avoid this problem, declare the arrays as ADS arrays and move them out
  1115.  of the default data segment. To move them out, allocate the arrays on
  1116.  the long heap with the function ALLMQQ or GETMQQ (these functions are
  1117.  described in the "Microsoft Pascal Compiler for the MS-DOS Operating
  1118.  System User's Guide").
  1119.  
  1120.  Another source of this error is having too many local variables in
  1121.  procedures and functions. These variables are allocated on the stack,
  1122.  which by default has a size of 2K. If there are too many of them, they
  1123.  will overflow the stack.
  1124.  
  1125.  To correct this problem, increase the stack size just prior to run
  1126.  time by using the EXEMOD utility (this utility comes with the
  1127.  compiler). At the DOS prompt, enter a line similar to the following:
  1128.  
  1129.  EXEMOD FOO.EXE /STACK <size of the stack>
  1130.  
  1131.  The size of the stack must be entered as a hex number between 0 and
  1132.  FFFF, inclusive. (Due to some overhead, the maximum stack size for a
  1133.  program is actually around FFE0 hex.) This number represents the
  1134.  number of bytes that will be reserved for the stack. For efficiency,
  1135.  increase the size of the stack by increments of 1K or 2K at a time,
  1136.  until a suitable stack size is found. It is not necessary to create
  1137.  more stack space than is needed.
  1138.  
  1139.  
  1140.  35. "256 VAR or CONST Parameter Types Not Identical" Error
  1141.  
  1142.  Product Version(s): 4.00   | 4.00
  1143.  Operating System:   MS-DOS | OS/2
  1144.  Flags: ENDUSER | buglist3.32 fixlist4.00
  1145.  Last Modified: 26-SEP-1988    ArticleIdent: Q32409
  1146.  
  1147.  In Pascal Version 3.32, you can pass an lstring variable by
  1148.  reference (using VAR or VARS) to a function or procedure whose
  1149.  corresponding formal parameter is declared as a longer lstring type.
  1150.  This process allows the lstring to be overwritten in the function or
  1151.  procedure without detection, resulting in corruption of data declared
  1152.  after the lstring.
  1153.  
  1154.  In Pascal Version 4.00, this problem is detected by the compiler,
  1155.  resulting in the "256 VAR or CONST Parameter Types Not Identical"
  1156.  error. The following program demonstrates a way to work around this
  1157.  type checking. Note that passing lstrings of a long type to a
  1158.  procedure whose formal lstring parameter is of a shorter type
  1159.  generates the error.
  1160.  
  1161.  The program below is used to pass varying length lstrings by
  1162.  reference to a procedure.
  1163.  
  1164.  The lstring super type should be used for the procedure's formal
  1165.  parameter declaration to avoid the "256  VAR or CONST Parameters Not
  1166.  Identical" error when passing VAR(S) lstring arguments whose types are
  1167.  of variable lengths.
  1168.  
  1169.  Variables of the lstring super type cannot be assigned to directly, so
  1170.  a maximum-length local lstring (255) is loaded with characters, and
  1171.  the length of the local lstring is assigned the length of the lstring
  1172.  variable. The local lstring then is copied into the lstring variable
  1173.  by the copystr procedure.
  1174.  
  1175.  With Pascal Version 3.30, there is a problem with passing lstrings
  1176.  by reference (VAR or VARS). If a variable of a short lstring type was
  1177.  passed by VAR(S) to a procedure or function whose corresponding formal
  1178.  parameter was a longer lstring type, the actual short lstring could be
  1179.  overwritten without detection, corrupting data declared after the
  1180.  shorter lstring.
  1181.  
  1182.  This problem was corrected in Pascal Version 4.00; however, numerous
  1183.  programs depend on this Pascal Version 3.30 problem. The following
  1184.  program provides the same function, but avoids the possible data
  1185.  corruption:
  1186.  
  1187.  program test_variable_len_lstr_arg(input,output);
  1188.      var  global_ls : lstring(10);
  1189.  
  1190.      procedure Proc(var ls_parm : LSTRING);
  1191.          var local_ls : lstring(255);
  1192.      begin
  1193.        {make assignment to local lstring,
  1194.        and set it's length to the parameter lstring
  1195.        }
  1196.          local_ls := 'xxxxxxxxxxxxxxxxx';
  1197.          local_ls.len := ls_parm.len;
  1198.        {copy local lstring into global lstring}
  1199.          copystr(local_ls,ls_parm);
  1200.          writeln;
  1201.          write('In procedure.');
  1202.          writeln(' After copying local lstring to global lstring parameter,');
  1203.          write('local lstring = ', local_ls, ', ');
  1204.          writeln('lstring parameter = ', ls_parm)
  1205.      end;
  1206.  
  1207.  begin
  1208.      global_ls := 'original';
  1209.      writeln;
  1210.      writeln('In main, global lstring = ', global_ls);
  1211.      writeln('Call procedure, passing lstring by reference (var).');
  1212.      Proc(global_ls);
  1213.      writeln;
  1214.      writeln('Retured to main, global lstring = ', global_ls)
  1215.  end.
  1216.  
  1217.  
  1218.  36. Seek Subroutine Will Not Seek to Same Record Twice
  1219.  
  1220.  Product Version(s): 3.31 3.32
  1221.  Operating System:   MS-DOS
  1222.  Flags: ENDUSER | buglist3.32
  1223.  Last Modified:  5-MAY-1988    ArticleIdent: Q24422
  1224.  
  1225.  Problem:
  1226.     The Seek subroutine does not work correctly if one attempts to seek
  1227.  to the same record more than once. The only way to seek to a record
  1228.  that already has been "visited" is to perform a Reset on the file.
  1229.  
  1230.  Response:
  1231.     Microsoft is researching this problem and will post new information
  1232.  as it becomes available.
  1233.     Use the following method to work around the problem:
  1234.  
  1235.     1. Open the file.
  1236.     2. Seek to the desired record.
  1237.     3. Reset the file.
  1238.     4. Seek to the record again.
  1239.  
  1240.  
  1241.  37. Trapping Run-Time File System Errors
  1242.  
  1243.  Product Version(s): 3.1x 3.20 3.3x
  1244.  Operating System:   MS-DOS
  1245.  Flags: ENDUSER |
  1246.  Last Modified:  3-OCT-1988    ArticleIdent: Q25361
  1247.  
  1248.  Question:
  1249.  
  1250.  Is it possible to trap run-time file-system errors?
  1251.  
  1252.  Response:
  1253.  
  1254.  You can trap run-time file-system errors by using the
  1255.  TRAP flag, as in the following sample program:
  1256.  
  1257.  program file_error_trapping(input,output);
  1258.    var
  1259.      myfile: text;
  1260.    begin
  1261.      myfile.trap:=true;           {turns on error trapping}
  1262.      assign(myfile,'foo.dat');
  1263.      reset(myfile);               {if the file does not
  1264.                                    exist then myfile.errs
  1265.      if myfile.errs = 10 then      will be set to 10 }
  1266.      begin
  1267.        writeln('myfile.errs = ', myfile.errs);
  1268.        writeln('file not found');
  1269.        writeln('it will be created ');
  1270.        myfile.errs = 0;           {set myfile.errs back to 0}
  1271.        rewrite(myfile);
  1272.        writeln(myfile, 'this is a test');
  1273.        close(myfile);
  1274.        writeln(' file foo.dat has been created');
  1275.      end;
  1276.  end.
  1277.  
  1278.  MYFILE.TRAP initially is set to false. If an I/O error occurs, the
  1279.  program will abort. If MYFILE.TRAP is set to true, then error trapping
  1280.  for file MYFILE will be turned on. If an I/O error occurs, the value
  1281.  in MYFILE.ERRS will be set to the appropriate error-code number, and
  1282.  the attempted file operation will be ignored. At this point, you
  1283.  should examine the error and write an error-trapping routine.
  1284.  
  1285.  Note: once MYFILE.ERRS is set, it does not automatically get set back
  1286.  to 0 once the error routine has been executed. Therefore, MYFILE.ERRS
  1287.  should be set to 0 to assure that I/O operations are not ignored.
  1288.  
  1289.  
  1290.  38. Change to MSINSTALL for XENIX Pascal
  1291.  
  1292.  Product Version(s):
  1293.  Operating System:   XENIX
  1294.  Flags: enduser |
  1295.  Last Modified: 24-FEB-1988    ArticleIdent: Q10280
  1296.  
  1297.  PRODUCT:  PASCAL/3.30
  1298.  
  1299.  DESCRIPTION:
  1300.  Filenames in Pascal, Fortran, and C are the same in the same directory.
  1301.  The libraries have the same names as the C libraries but different content.
  1302.  This means to us that you cannot have Pascal, C, and Fortran installed at
  1303.  the same time !
  1304.  
  1305.  MICROSOFT RESPONSE:
  1306.  
  1307.  We named these files with the same names because they are exactly the same
  1308.  files.  The FORTRAN and Pascal runtimes needed portions of the C runtimes,
  1309.  so we included them as is.  There should be no problem copying these all on
  1310.  1 directory as long as the user copies the latest ones over the older ones.
  1311.  
  1312.  Because of possible confusion, we have rewritten the install program
  1313.  (msinstall) to do checking for the file creation dates.  What the compiler
  1314.  does now is warn the user that if there are old versions of the libraries,
  1315.  it WILL NOT write over these libraries.  It writes these libraries (if they
  1316.  are present) out to temporary files.  Then it checks to see if there are
  1317.  temporary files (i.e. there were libraries present before msinstall was
  1318.  invoked) and if they are present, it copies these original libraries back
  1319.  to the filenames that the compiler looks for.
  1320.  
  1321.  If the user later wants to use the new libraries, the install program can
  1322.  be run again, after the original libraries are renamed to different
  1323.  filenames. Please note that these C libraries ARE necessary for Pascal and
  1324.  FORTRAN now. You can indeed have C, Pascal, and FORTRAN on one system.
  1325.  Indeed, you can have different versions of each of these products on the
  1326.  same machine also.
  1327.  
  1328.  If you want to have different versions of the same product on the same
  1329.  machine, you may do one of the following:
  1330.  
  1331.  (1) Alter the msinstall program.  The msinstall program first checks to see
  1332.  if there are current C libraries.  If there are C libraries already
  1333.  existing on the system, msinstall will rename all of these copies of the
  1334.  libraries.  It then checks to see if there are these old library files. If
  1335.  there are old library files, it copies these files back into the original
  1336.  names, which are the filenames that the compiler searches for.  What you
  1337.  can do is delete the section of the msinstall program that copies the old
  1338.  library files back to the original filenames.  This would mean that then
  1339.  the msinstall program will backup your library files, and then install the
  1340.  new versions of these files.  This would be very simple to do.
  1341.  
  1342.  (2) Alter the cl driver.  Create a driver that would look for the filenames
  1343.  of the old library files instead of the new files.  Then you could use
  1344.  multiple versions on your machine, invoking the newest version with the cl
  1345.  driver and the older version with your altered driver.  This would be more
  1346.  complicated and would require a programmer with more skill, but it is
  1347.  possible.
  1348.  
  1349.  If any users have additional questions about the installation procedure, we
  1350.  would suggest that they first read the msinstall program to see what it
  1351.  does, and then contact Microsoft OEM customer support with specific
  1352.  questions.
  1353.  
  1354.  
  1355.  39. XENIX Pascal/FORTRAN cl Driver
  1356.  
  1357.  Product Version(s):
  1358.  Operating System:   XENIX
  1359.  Flags: enduser |
  1360.  Last Modified: 24-FEB-1988    ArticleIdent: Q10283
  1361.  
  1362.  PRODUCT:  PASCAL/3.30 Beta
  1363.  
  1364.  Question:
  1365.  The Pascal driver has the same filename as the Fortran driver (CL) which
  1366.  means to us that two compilers cannot be installed on the same system at
  1367.  the same time.
  1368.  
  1369.  Response:
  1370.  The CL driver is exactly the same for Microsoft Fortran as it is for
  1371.  Pascal.  This driver can link Fortran and Pascal programs. The driver
  1372.  checks the extension of the file. An extension of "f" for FORTRAN or
  1373.  "p" for Pascal will determine which compiler is used.
  1374.  
  1375.  
  1376.  40. Documentation on Command Line Switches is Incorrect
  1377.  
  1378.  Product Version(s): 3.20
  1379.  Operating System:   MS-DOS
  1380.  Flags: ENDUSER | docerr
  1381.  Last Modified: 18-AUG-1988    ArticleIdent: Q10285
  1382.  
  1383.  Question:
  1384.     Concerning Table 18.6, "Command Line Switches" on Page 347 of the
  1385.  "Microsoft Pascal Reference" manual for Version 3.20, and Table 5.2,
  1386.  "Pass One Compiler Switches," on Page 51 of the "Microsoft Pascal
  1387.  Compiler User's Guide;" which one of the two lists is correct?
  1388.     Concerning the switch /L; does this refer to the SYMDEB debugger
  1389.  that comes with Microsoft Macro Assembler, or the DOS Debug?
  1390.  
  1391.  Response:
  1392.     Table 18.6, on Page 347 of the Pascal reference manual is
  1393.  correct.
  1394.     The debugger is SYMDEB. Debug does not detect line numbers.
  1395.  
  1396.  
  1397.  41. Example of Using VECTIN Procedure
  1398.  
  1399.  Product Version(s):
  1400.  Operating System:   MS-DOS
  1401.  Flags: enduser |
  1402.  Last Modified: 24-FEB-1988    ArticleIdent: Q10286
  1403.  
  1404.  PRODUCT:  PASCAL/3.20
  1405.  
  1406.  Question:
  1407.  Please give me an example of how to use the VECTIN procedure.
  1408.  
  1409.  Response:
  1410.  
  1411.  program EXAMPLE(input,output);
  1412.  
  1413.  {******************************************************************
  1414.  NOTE: THIS PROGRAM USES THE VECTIN PROCEDURE ALONG WITH THE DISBIN
  1415.  AND ENABIN PROCEDURES.  IT IS INTENDED TO ILLUSTRATE IMPLEMENTING A
  1416.  SUBSTITUTE DEFAULT DIVIDE BY ZERO ERROR HANDLER.  WHEN THE PROGRAM
  1417.  RECEIVES A DIVIDE BY ZERO, IT EXECUTES THE PROCEDURE "WORLD" INSTEAD
  1418.  OF THE NORMAL INTERRUPT 0 PROCEDURE.
  1419.  *******************************************************************}
  1420.  
  1421.  {******************************************************************
  1422.  ********** (1) DECLARE VARIABLES AND EXTERNAL PROCEDURES **********
  1423.  *******************************************************************}
  1424.  
  1425.  var
  1426.       HELLO : word;
  1427.       VAR1, VAR2, ZERO : integer;
  1428.  
  1429.  procedure disbin; extern;
  1430.  procedure enabin; extern;
  1431.  PROCEDURE VECTIN(HELLO:word;procedure world[interrupt,public]);extern;
  1432.  PROCEDURE PTYUQQ (W:word;x:adsmem);extern;
  1433.  
  1434.  {******************************************************************
  1435.  ***** (2) THIS IS THE PROCEDURE EXECUTED INSTEAD OF THE    ********
  1436.  *****     NORMAL INTERRUPT 0 PROCEDURE                     ********
  1437.  *******************************************************************}
  1438.  
  1439.  procedure world[interrupt,public];
  1440.          begin
  1441.                  {NOTE: WHEN THIS "WORLD" PROCEDURE IS EXECUTED,
  1442.                   INSTEAD OF EXECUTING THE NORMAL PROCEDURE, THE
  1443.                   FOLLOWING MESSAGE WILL BE PRINTED}
  1444.  
  1445.                  writeln ('Yea, verily, the vectin procedure worked.');
  1446.                  write ('Instead of executing the normal divide by zero');
  1447.                  writeln(' interrupt, a procedure ');
  1448.                  writeln('printing this message was executed instead.');
  1449.          End;
  1450.  
  1451.  Begin
  1452.  
  1453.  {******************************************************************
  1454.  ***** (3) THESE EXPLANATORY NOTES WILL BE PRINTED WHEN YOU     ****
  1455.  *****     EXECUTE THIS PROGRAM.  THEN IT WILL PROMPT YOU FOR   ****
  1456.  *****     THE INTERRUPT VECTOR NUMBER THAT YOU WANT TO REPLACE ****
  1457.  *******************************************************************}
  1458.  
  1459.  writeln(' ');
  1460.  WRITELN('NOTE:  Please enter the interrupt vector number "0" below.');
  1461.  writeln(' ');
  1462.  WRITELN('EXPLANATION: This is because this program causes a divide by
  1463.  zero,');
  1464.  writeln(' and interrupt vector type 0 is the divide error exception
  1465.  handler.');
  1466.  writeln('If you alter this program to do something else besides a divide');
  1467.  writeln(' by zero,you could use this program to try altering other
  1468.  interrupt');
  1469.  writeln(' vectors.  You can try entering other interrupt numbers into
  1470.  this');
  1471.  writeln(' program as it is, but the program will not execute the VECTIN');
  1472.  writeln(' procedure if you do.');
  1473.  write('Please enter an interrupt vector number  -->');
  1474.          read(hello);
  1475.  
  1476.  {******************************************************************
  1477.  ***** (4) FIRST YOU HAVE TO DISABLE INTERRUPTS USING DISBIN.     **
  1478.  *****     YOU THEN REPLACE THE EXISTING DIVIDE BY ZERO INTERRUPT **
  1479.  *****     HANDLER WITH YOUR PREFERRED PROCEDURE USING VECTIN.    **
  1480.  *****     YOU THEN ENABLE INTERRUPTS AGAIN, USING ENABIN.        **
  1481.  *******************************************************************
  1482.  ***** IMPORTANT NOTE: THIS IS A SIMPLE PROGRAM AND DOES NOT SAVE **
  1483.  ***** THE ORIGINAL ZERO INTERRUPT HANDLER                        **
  1484.  *******************************************************************}
  1485.  
  1486.          DISBIN;
  1487.          VECTIN(hello,world);
  1488.          ENABIN;
  1489.  
  1490.  {******************************************************************
  1491.  ***** (5) THIS PERFORMS A DIVIDE BY ZERO, WHICH WILL CAUSE THE ****
  1492.  *****     "world" PROCEDURE TO BE EXECUTED.                    ****
  1493.  *******************************************************************}
  1494.  
  1495.          VAR1 := 1;
  1496.          WRITELN('VAR1 := 1');
  1497.          ZERO := 0;
  1498.          WRITELN('ZERO := 0');
  1499.          writeln('var1 / zero = ...');
  1500.          writeln(' ');
  1501.          VAR2 := var1 div zero;
  1502.  End.
  1503.  
  1504.  
  1505.  42. VECTIN Procedure
  1506.  
  1507.  Product Version(s): 3.20 3.3x
  1508.  Operating System:   MS-DOS
  1509.  Flags: ENDUSER |
  1510.  Last Modified: 19-FEB-1988    ArticleIdent: Q10288
  1511.  
  1512.  Question:
  1513.     The Microsoft Pascal reference manual, Version 3.20,
  1514.  Page 271, says (concerning the VECTIN procedure) to see
  1515.  Appendix B, "Version Specifics," in the Microsoft Pascal
  1516.  Compiler user's guide for information regarding
  1517.  implementation. However, there is no notation in Appendix B
  1518.  regarding implementation.
  1519.     Do we need to make an adaptation to have the VECTIN
  1520.  procedure work properly? Explain the statement "...the
  1521.  meaning of [argument] V varies with target machine".
  1522.  
  1523.  Response:
  1524.     "Implementation" as it is used in Appendix B refers to
  1525.  this version of Pascal. So, "implementation additions"
  1526.  means additions to the previous implementation, i.e.,
  1527.  changes to Microsoft Pascal Version 3.20 which were not
  1528.  included in Version 3.13. In Appendix B, there is a great
  1529.  deal of information regarding this implementation.
  1530.     No adaptation is necessary to get VECTIN to work. It
  1531.  either works or it does not, and in Versions 3.20 to 3.32
  1532.  it does work.
  1533.     "The effect of these procedures and the meaning of V
  1534.  varies with the target machine," simply means that
  1535.  interrupt vectors are hardware specific. The effect of
  1536.  changing the interrupt vector 2 on an IBM Personal Computer
  1537.  could be extremely different from the effect of changing
  1538.  interrupt vector 2 on the Siemens PC, and you need to know
  1539.  what the difference is to use this VECTIN procedure.
  1540.  
  1541.  
  1542.  43. GTYUQQ Function Reads One Character Less Than Maximum
  1543.  
  1544.  Product Version(s): 3.13 3.20 3.3x
  1545.  Operating System:   MS-DOS
  1546.  Flags: ENDUSER | buglist3.13 buglist3.20 fixlist3.30
  1547.  Last Modified: 19-FEB-1988    ArticleIdent: Q10358
  1548.  
  1549.  Problem:
  1550.     The GTYUQQ function will only read characters up to one
  1551.  less than the maximum specified. For example, if the
  1552.  maximum specified was 10 then the GTYUQQ function will only
  1553.  read up to nine characters.
  1554.  
  1555.  Response:
  1556.     This problem was corrected in Version 3.30.
  1557.  
  1558.  
  1559.  44. Altering the Stack Size
  1560.  
  1561.  Product Version(s): 3.3x
  1562.  Operating System:   MS-DOS
  1563.  Flags: ENDUSER |
  1564.  Last Modified: 26-SEP-1988    ArticleIdent: Q10377
  1565.  
  1566.  Question:
  1567.  
  1568.  How can I adjust the size of a program's run-time stack with Pascal
  1569.  Version 3.3x?
  1570.  
  1571.  Response:
  1572.  
  1573.  You may use the /STACK linker option using the following command:
  1574.  
  1575.  link /STACK:<number> <object_file_name>;
  1576.  
  1577.  The <number> will be the decimal number of bytes for the size of the
  1578.  program's stack; <number> should be greater than 0 and less than
  1579.  64,000.
  1580.  
  1581.  Try to keep the stack size between 2000 and 30,000 bytes. A stack of
  1582.  64,000 could interfere with near-heap allocation, which also occurs in
  1583.  the same 64K default data segment. (The note of warning in the
  1584.  "Microsoft Pascal Compiler User's Guide" concerning the /STACK linker
  1585.  switch applied to Pascal Version 3.20, and is no longer a problem in
  1586.  Versions 3.3x.)
  1587.  
  1588.  Alternately, the EXEMOD utility can be used to change the stack
  1589.  size of a program after it has been linked, as in the following:
  1590.  
  1591.  exemod <exe_name> /stack <hex_number>
  1592.  
  1593.  The <exe_name> is the name of your executable file; <hex_number>
  1594.  specifies the hexadecimal number of bytes in the stack.
  1595.  
  1596.  
  1597.  45. Byte Comparison Causes PAS2 of Pascal Version 3.20 to Hang
  1598.  
  1599.  Product Version(s): 3.20
  1600.  Operating System:   MS-DOS
  1601.  Flags: ENDUSER | TAR17016 buglist3.20 fixlist3.30
  1602.  Last Modified:  3-OCT-1988    ArticleIdent: Q10378
  1603.  
  1604.  Problem:
  1605.  
  1606.  This problem involves byte comparisons and common subexpressions,
  1607.  i.e., if one of the elements of the comparison ends up in an index
  1608.  register because of an earlier subexpression, PAS2 would infinitely
  1609.  loop. The following program hangs in PAS2:
  1610.  
  1611.  SHORT EXAMPLE CODE:
  1612.  
  1613.     PROGRAM TEST(INPUT,OUTPUT);
  1614.     CONST UC_A=ORD('A');
  1615.     UC_Z=ORD('Z');
  1616.     VAR BUFF : ARRAY[0..255] OF CHAR;
  1617.     I, N : INTEGER;
  1618.     BEGIN
  1619.     FOR I:=UC_A TO UC_Z DO
  1620.     IF BUFF[I] <> CHR(I) THEN
  1621.     N:=SUCC(N);
  1622.     IF I<>N THEN
  1623.     N:=SUCC(N)
  1624.     END.
  1625.  
  1626.  Response:
  1627.  
  1628.  If an ORD function is added to the buff[i] in the comparison, the
  1629.  program compiles.
  1630.  
  1631.  Microsoft has confirmed this to be a problem in Version 3.20. This
  1632.  problem was corrected in Version 3.30.
  1633.  
  1634.  
  1635.  46. Calling Functions with Var Parameters
  1636.  
  1637.  Product Version(s): 3.20
  1638.  Operating System:   MS-DOS
  1639.  Flags: ENDUSER | TAR15705 buglist3.20 fixlist3.30
  1640.  Last Modified:  3-OCT-1988    ArticleIdent: Q10379
  1641.  
  1642.  Problem:
  1643.  
  1644.  The program shown below exhibits a problem when calling transcendental
  1645.  functions with var parameters. The address is improperly set for the
  1646.  argument that was defined as a formal reference (var) parameter.
  1647.  
  1648.  The following is a short code example:
  1649.  
  1650.     program fu(output);
  1651.     var  X : real8;
  1652.  
  1653.     PROCEDURE A1(VAR T: real8);
  1654.     begin
  1655.        T := exp(T)
  1656.     end;
  1657.  
  1658.     begin
  1659.        X := 1.0;
  1660.        A1(X);
  1661.        writeln('X = ',X)
  1662.     end.
  1663.  
  1664.  Response:
  1665.  
  1666.  Microsoft has confirmed this to be a problem in Version 3.20. This
  1667.  problem was corrected in Version 3.30.
  1668.  
  1669.  
  1670.  47. Searching for $INCLUDE Files
  1671.  
  1672.  Product Version(s): 3.20 3.3x
  1673.  Operating System:   MS-DOS
  1674.  Flags: ENDUSER | TAR17161
  1675.  Last Modified: 19-FEB-1988    ArticleIdent: Q10380
  1676.  
  1677.  Question:
  1678.     Can Version 3.20 of the Microsoft Pascal compiler use
  1679.  the $INCLUDE metacommand to bring in text from other
  1680.  directories? We cannot get this procedure to work properly
  1681.  and we do not want all of our interfaces in the same
  1682.  directory where the program is being written.
  1683.  
  1684.  Response:
  1685.     No, the Version 3.20 compiler uses the DOS Version 1.x
  1686.  compatible file system (i.e., no hierarchical file
  1687.  structure). Hence, the compiler can only find files that
  1688.  reside in the current directory.
  1689.     However, in Pascal Version 3.3x you are able to use path
  1690.  names because the compiler uses the DOS Version 2.x file
  1691.  system which does support non-root directories.
  1692.  
  1693.  
  1694.  48. Must Use readln to Read End of Text Line
  1695.  
  1696.  Product Version(s): 3.20 3.3x
  1697.  Operating System:   MS-DOS
  1698.  Flags: ENDUSER |
  1699.  Last Modified:  3-OCT-1988    ArticleIdent: Q10381
  1700.  
  1701.  Question:
  1702.  
  1703.  The file READ.PAS is an example of a program that uses a read
  1704.  statement to input the value of an lstring variable. The program loops
  1705.  indefinitely after the first value is read and written. Replacing the
  1706.  read with a readln causes the program to run as I would expect. Why
  1707.  does this occur?
  1708.  
  1709.  Is the read statement unable to read past the end of a line of text
  1710.  when reading an lstring value? This problem also occurs with string
  1711.  variables. The following READ.PAS program is an example:
  1712.  
  1713.     program read_lstring(input,output);
  1714.     VAR s : lstring(6);
  1715.     begin
  1716.     repeat
  1717.     write('enter string > ');
  1718.     read(s);
  1719.     writeln(s)
  1720.     until (s = 'bye');
  1721.     end.
  1722.  
  1723.  Response:
  1724.  
  1725.  You must use readln to read past the end-of-line marker for a text
  1726.  file. The files INPUT and OUTPUT, declared in the program statement,
  1727.  are text files.
  1728.  
  1729.  INPUT and OUTPUT are wholly distinct as far as Pascal is concerned.
  1730.  Thus, the fact that an intervening writeln (or two) may have advanced
  1731.  the line on the console device has no effect on the reads.
  1732.  
  1733.  All reads will take their data from the 80 character INPUT file buffer
  1734.  until there is an intervening readln. Because read(s), where "s" is an
  1735.  lstring variable, is satisfied with null input, you can have
  1736.  infinitely many consecutive read(s)s.
  1737.  
  1738.  Note: using readln (and writeln) only applies to text files. Other
  1739.  files defined by the type statement "file of <type>;" do not have
  1740.  end-of-line markers to be read/written by readln/writeln.
  1741.  
  1742.  
  1743.  49. Var Formal Parameters Ignore String Lengths
  1744.  
  1745.  Product Version(s): 3.20 3.3x
  1746.  Operating System:   MS-DOS
  1747.  Flags: ENDUSER | TAR15372
  1748.  Last Modified:  3-OCT-1988    ArticleIdent: Q10382
  1749.  
  1750.  Question:
  1751.  
  1752.  Why does PAS1 fail to detect the type mismatch between
  1753.  formal and actual lstring parameters of different lengths
  1754.  in the following code?
  1755.  
  1756.     PROGRAM TEST_LSTRINGS(INPUT,OUTPUT);
  1757.     TYPE
  1758.     LONGTYPE=LSTRING(200);
  1759.     SHORTTYPE=LSTRING(10);
  1760.     VAR
  1761.     SHORTSTR:SHORTTYPE;
  1762.  
  1763.     PROCEDURE DUMMY(VAR LONG:LONGTYPE);
  1764.     VAR LOCLONG:LONGTYPE;
  1765.     BEGIN
  1766.     LOCLONG:='1234';
  1767.     LONG:=LOCLONG;
  1768.     END;
  1769.  
  1770.     BEGIN {MAIN}
  1771.     DUMMY(SHORTSTR);
  1772.     END.
  1773.  
  1774.  Response:
  1775.  
  1776.  Because the formal parameter of procedure dummy is declared to be of
  1777.  type lstring (200), a type-mismatch error might be expected when dummy
  1778.  is called with the actual parameter shortstr, which is a lstring of
  1779.  length 10.
  1780.  
  1781.  However, type checking in this case is explicitly disabled (and has
  1782.  been for a long time, through many releases). Passing strings and
  1783.  lstrings by reference using var or vars ignores the string lengths. As
  1784.  a result, you are given the flexibility of using the same function or
  1785.  procedure to process strings of different lengths.
  1786.  
  1787.  
  1788.  50. Error 312 when Using the Variable Plm
  1789.  
  1790.  Product Version(s): 3.20
  1791.  Operating System:   MS-DOS
  1792.  Flags: ENDUSER | TAR02497 buglist3.20 fixlist3.30
  1793.  Last Modified:  3-OCT-1988    ArticleIdent: Q10384
  1794.  
  1795.  The declaration of plm causes pas1 to emit a compile-time error 312
  1796.  "identifier expected."
  1797.  
  1798.  The following is a short example code:
  1799.  
  1800.     program test(input,output);
  1801.     var PLM:integer;
  1802.     begin
  1803.     end.
  1804.  
  1805.  Microsoft has confirmed this to be a problem in Version 3.20. This
  1806.  problem was corrected in Version 3.30.
  1807.  
  1808.  In Version 3.20, plm was used as a procedure attribute to specify
  1809.  calling conventions and was incorrectly treated as a reserved word. In
  1810.  Version 3.30, plm may be redefined.
  1811.  
  1812.  
  1813.  51. Goto with {$line+} Gives Error 293
  1814.  
  1815.  Product Version(s): 3.20 3.3x
  1816.  Operating System:   MS-DOS
  1817.  Flags: ENDUSER | TAR17029
  1818.  Last Modified: 30-SEP-1988    ArticleIdent: Q10386
  1819.  
  1820.  According to Page 171 of the "Microsoft Pascal Compiler for the MS-DOS
  1821.  Operating System Reference Manual," a goto from a procedure to a
  1822.  higher-level procedure is permitted, although it is considered
  1823.  harmful.
  1824.  
  1825.  However, the code below generates the "error 293 - Goto invalid"
  1826.  message at compile time. If the {$line+} metacommand is removed, then
  1827.  the message is not generated.
  1828.  
  1829.  This error message occurs because if debugging is on (invoked by
  1830.  {$line+}), a procedure entry and exit code is generated. The exit code
  1831.  is bypassed by the goto, and from then on error recovery is corrupted.
  1832.  
  1833.  The following is a short code example:
  1834.  
  1835.     {$LINE+}
  1836.     PROGRAM TEST(INPUT,OUTPUT);
  1837.     LABEL 99;
  1838.  
  1839.     PROCEDURE A;
  1840.     BEGIN
  1841.     GOTO 99;
  1842.     END;
  1843.  
  1844.     BEGIN {MAIN}
  1845.     A;
  1846.     99:WRITELN('AT LABEL 99');
  1847.     END.
  1848.  
  1849.  
  1850.  52. Heap Space Not Freed When a File is Closed
  1851.  
  1852.  Product Version(s): 3.20
  1853.  Operating System:   MS-DOS
  1854.  Flags: ENDUSER | TAR15365 buglist3.20 fixlist3.30
  1855.  Last Modified: 19-FEB-1988    ArticleIdent: Q10387
  1856.  
  1857.  Problem:
  1858.     The "assign" statement allocates file information on the
  1859.  heap. When the file is closed, the space allocated is not
  1860.  returned to the heap. When a "dispose" is used to close the
  1861.  file, the space allocated for the file information is
  1862.  returned to the heap.
  1863.  
  1864.  Response:
  1865.     This problem was corrected in Version 3.30.
  1866.  
  1867.  
  1868.  53. The High-Ordered Word Is Zeroed Out
  1869.  
  1870.  Product Version(s): 3.20
  1871.  Operating System:   MS-DOS
  1872.  Flags: ENDUSER | TAR50048 buglist3.20 fixlist3.30
  1873.  Last Modified: 30-SEP-1988    ArticleIdent: Q10388
  1874.  
  1875.  In the program below, improper code is generated for the multiply.
  1876.  After the multiply is performed, the high-order word is zeroed-out,
  1877.  indicating that the compiler is trying to do an unsigned coercion
  1878.  before assigning the value to a 4-byte integer.
  1879.  
  1880.  Microsoft has confirmed this to be a problem in Version 3.20. This
  1881.  problem was corrected in Version 3.30.
  1882.  
  1883.  The following is a short example code:
  1884.  
  1885.     program fu;
  1886.     VAR X : INTEGER4;
  1887.     W : WORD;
  1888.     BEGIN
  1889.     W := 50;
  1890.     X := W * 10000;
  1891.     END.
  1892.  
  1893.  
  1894.  54. References Off to Windows Procedure Variable in Version 3.20
  1895.  
  1896.  Product Version(s): 3.20
  1897.  Operating System:   MS-DOS
  1898.  Flags: ENDUSER | TAR09596 buglist3.20 fixlist3.30
  1899.  Last Modified: 20-OCT-1988    ArticleIdent: Q10389
  1900.  
  1901.  There is a problem in the following code with the statement "D31 := n
  1902.  + x". When attempting to reference a nested variable (x) of a Windows
  1903.  procedure, the offset of "x" is off by 2 bytes due to the Windows
  1904.  entry sequence that pushes DS before allocating local memory.
  1905.  
  1906.  Microsoft has confirmed this to be a problem in Version 3.20. This
  1907.  problem was corrected in Version 3.30.
  1908.  
  1909.  The following is a short example code:
  1910.  
  1911.      {$stackseg+}
  1912.      module death;
  1913.      type
  1914.         deaths_head=record
  1915.           X,Y:integer;
  1916.           DATA:lstring(255);
  1917.           end;
  1918.  
  1919.      PROCEDURE D1(D:deaths_head)[public,windows];
  1920.      begin
  1921.        D.X:=d.y;
  1922.      end;
  1923.  
  1924.      procedure d2[public,windows];
  1925.      VAR DX:deaths_head;
  1926.      begin
  1927.        d1(dx);
  1928.      end;
  1929.  
  1930.      procedure d3[public,windows];
  1931.      VAR X:integer;
  1932.          FUNCTION D31(N:integer):integer;
  1933.          begin
  1934.             D31:=n+x;
  1935.          end;
  1936.      begin
  1937.        X:=5;
  1938.        X:=d31(10);
  1939.      end;
  1940.      end. {module death}
  1941.  
  1942.  
  1943.  55. Laddok Does Not Prevent Overflows
  1944.  
  1945.  Product Version(s): 3.20 3.3x
  1946.  Operating System:   MS-DOS
  1947.  Flags: ENDUSER | TAR05457
  1948.  Last Modified: 30-SEP-1988    ArticleIdent: Q10390
  1949.  
  1950.  Problem:
  1951.  
  1952.  The no-overflow addition function for integer4 numbers (laddok) does
  1953.  not handle adding 1 to the maximum positive integer4 number
  1954.  (2,147,483,647). The program crashes when this procedure is attempted.
  1955.  The correct result for laddok(2147483647,1) is the minimum negative
  1956.  integer4 number (-2,147,483,647). The calculation laddok(2147483647,2)
  1957.  does produce the result -2,147,483,647. The following is a short
  1958.  example code:
  1959.  
  1960.     program RollOver(input, output);
  1961.     VAR k: integer4;
  1962.     FUNCTION LADDOK(A, B: integer4; var c: integer4): boolean; extern;
  1963.     begin
  1964.     writeln('Rollover Test');
  1965.     writeln;
  1966.  
  1967.     if laddok(2147483647, 2, k) then
  1968.     WRITE('NO OVERFLOW: ')
  1969.     else
  1970.     WRITE('OVERFLOW: ');
  1971.     writeln('Result = ',k);
  1972.  
  1973.     if laddok(2147483647, 1, k) then
  1974.     WRITE('NO OVERFLOW: ')
  1975.     else
  1976.     WRITE('OVERFLOW: ');
  1977.     writeln('Result = ',k)
  1978.     end.
  1979.  
  1980.  Response:
  1981.  
  1982.  The behavior of the example program is entirely correct; your
  1983.  diagnosis is incorrect.
  1984.  
  1985.  The result of laddok(2147483647,1,k) is 16#80000000, which is not a
  1986.  valid integer4 value. Laddok permits you to carry out this add without
  1987.  getting a fatal run-time error. However, there is no way to keep
  1988.  write/writeln from discovering that variable "k" has this invalid
  1989.  value in the subsequent "writeln('Result = ',k);". It is this attempt
  1990.  to write out the illegal value that is causing the run-time error. You
  1991.  can get the same error by setting "k := 16#80000000" and then trying a
  1992.  "write(k)".
  1993.  
  1994.  
  1995.  56. lmulok Allows Overflow, but Gives No Message
  1996.  
  1997.  Product Version(s): 3.20 3.3x
  1998.  Operating System:   MS-DOS
  1999.  Flags: ENDUSER | TAR50110 docerr
  2000.  Last Modified: 18-AUG-1988    ArticleIdent: Q10393
  2001.  
  2002.  Problem:
  2003.     The program fragment below demonstrates a problem with the lmulok
  2004.  function. The value the function returns is correct. However, if you
  2005.  try to write out the value of the product when lmulok returns false,
  2006.  you get a data-format error at run time.
  2007.     The following is an example of input that causes the error:
  2008.  
  2009.     first integer4 >2000000
  2010.     second integer4 >2000000
  2011.  
  2012.     Notice that the multiplication is done without any errors, but
  2013.  writing out the product causes a data format error.
  2014.     Also, note that the behavior of lmulok is specified in the
  2015.  reference manual. I examined the example with SYMDEB and found that
  2016.  whenever the multiplication overflows, lmulok sets the value of the
  2017.  product to 16#80000000, i.e., (unsigned) 2^31. Of course, 16#80000000
  2018.  is not a legal integer4 value.
  2019.     The following is a short example code:
  2020.  
  2021.     program xx(input,output);
  2022.     VAR I,J,PRODUCT : integer4;
  2023.     X : integer;
  2024.     RESULT : boolean;
  2025.     FUNCTION LMULOK(A,B:integer4; var c:integer4) : boolean; extern;
  2026.     begin
  2027.     writeln;
  2028.     write('first integer4 >');
  2029.     readln(i);
  2030.     write('second integer4 >');
  2031.     readln(j);
  2032.     RESULT := lmulok(i,j,product);
  2033.     WRITELN(I:20,j:20);
  2034.     writeln(product);
  2035.     WRITELN('RESULT = ',RESULT:5)
  2036.     end.
  2037.  
  2038.  Response:
  2039.     This problem is the result of a documentation error on Page 240 of
  2040.  the Version 3.32 "Microsoft Pascal Compiler Reference Manual."
  2041.     The routine lmulok is the routine ultimately called to perform the
  2042.  multiplication in any integer4 product, e.g. the code generated for I
  2043.  := J * K;, where I,J,K:integer4, will invoke lmulok. You are given
  2044.  access to this routine so you can perform an integer4 multiplication,
  2045.  which overflows without having the program abort with a fatal run-time
  2046.  error.
  2047.     The value of the product is well defined only in the case where the
  2048.  product does not overflow, i.e., the return value of lmulok is true.
  2049.  This process occurs because the overflow condition is generally
  2050.  detected before the multiplication is complete and computation ceases
  2051.  as soon as the overflow is detected. The documentation indicates that
  2052.  the product is always computed and returned; this is clearly
  2053.  incorrect.
  2054.  
  2055.  
  2056.  57. Out of Memory Error in PAS2
  2057.  
  2058.  Product Version(s): 3.20
  2059.  Operating System:   MS-DOS
  2060.  Flags: ENDUSER | TAR17019 buglist3.20 fixlist3.30
  2061.  Last Modified: 20-OCT-1988    ArticleIdent: Q10395
  2062.  
  2063.  The following example yields an out-of-memory error in PAS2 of the
  2064.  compiler. If buff_ads is declared to be of adr type rather than ads
  2065.  type, the program will then compile the code below.
  2066.  
  2067.  Microsoft has confirmed this to be a problem in Version 3.20. This
  2068.  problem was corrected in Version 3.30.
  2069.  
  2070.  The following code demonstrates the problem:
  2071.  
  2072.     program test(input, output);
  2073.     type
  2074.     buff_rec = record
  2075.     BUFF1_PTR:adrmem;
  2076.     end;
  2077.     var
  2078.     BUFF_ADS:ads of buff_rec;
  2079.     BUFF1:lstring(50);
  2080.     BUFF2:lstring(50);
  2081.     LOC:word;
  2082.     TMP_ADR:adrmem;
  2083.     begin
  2084.     with buff_ads^ do
  2085.     begin
  2086.     BUFF1:='1234it worked!';
  2087.     LOC:=5;
  2088.     BUFF1_PTR:=adr buff1;
  2089.     TMP_ADR:=adr buff1_ptr^[loc];
  2090.     movel(adr buff1_ptr^[loc],adr buff2[1],10);
  2091.     movel(tmp_adr,adr buff2[1],10);
  2092.     BUFF2[0]:=chr(10);
  2093.     writeln;
  2094.     writeln('********p3582');
  2095.     writeln;
  2096.     writeln(buff2);
  2097.     end;
  2098.     end.
  2099.  
  2100.  
  2101.  58. PAS1 Loops Infinitely if Too Many Errors
  2102.  
  2103.  Product Version(s): 3.13 3.20
  2104.  Operating System:   MS-DOS
  2105.  Flags: ENDUSER | TAR07491 buglist3.13 buglist3.20 fixlist3.30
  2106.  Last Modified: 16-DEC-1987    ArticleIdent: Q10396
  2107.  
  2108.  Problem:
  2109.     Under Version 3.13 of the Pascal compiler, when the
  2110.  number of syntax errors encountered by PAS1 exceeds the
  2111.  amount specified with the $errors metacommand, PAS1 loops
  2112.  infinitely. Under Version 3.20, PAS1 emits the error
  2113.  message "error count exceeded - compiler cannot continue"
  2114.  repeatedly until the compiler runs out of memory.
  2115.  
  2116.  Response:
  2117.     This behavior was caused because the procedure called
  2118.  when the number of errors overflows ("panic") attempts to
  2119.  flush the listing file by successively calling the lexer.
  2120.  Since the lexer can generate errors, rampant recursion is
  2121.  triggered. The Pascal front end (PAS1) was changed to avoid
  2122.  this recursion in Version 3.30.
  2123.  
  2124.  
  2125.  59. Problem with Assigning the Chr of a Trunc
  2126.  
  2127.  Product Version(s): 3.13 3.20
  2128.  Operating System:   MS-DOS
  2129.  Flags: ENDUSER | TAR15705 buglist3.20 fixlist3.30
  2130.  Last Modified: 16-DEC-1987    ArticleIdent: Q10397
  2131.  
  2132.  Problem:
  2133.     Assigning the chr of a trunc generates a two byte value
  2134.  overwriting the target string. The following is a short
  2135.  example code:
  2136.  
  2137.     program b(input,output);
  2138.  
  2139.     procedure b1;
  2140.     var
  2141.     I: integer;
  2142.     S: string(8);
  2143.     begin {b1}
  2144.     S := 'QQQQQQQQ';
  2145.     FOR I := 1 to 8 do
  2146.     begin
  2147.     S[I] := chr(trunc(80.0));
  2148.     WRITELN('I = ',I:0,' s = ',s)
  2149.     end
  2150.     end; {b1}
  2151.  
  2152.     begin {b}
  2153.     b1
  2154.     end. {b}
  2155.  
  2156.  \.BODYTEXT
  2157.  Response:
  2158.     PAS2 was performing an optimization which was
  2159.  eliminating the coercion node on assignment trees.
  2160.     This problem was corrected in Version 3.30.
  2161.  
  2162.  
  2163.  60. Problem Passing Function as CONST Parameter in Version 3.20
  2164.  
  2165.  Product Version(s): 3.20
  2166.  Operating System:   MS-DOS
  2167.  Flags: ENDUSER | TAR17011 buglist3.20 fixlist3.30
  2168.  Last Modified: 30-SEP-1988    ArticleIdent: Q10398
  2169.  
  2170.  The examples below exhibit two problems trying to pass functions as
  2171.  CONST parameters. In the first example when the function F is enclosed
  2172.  in a parenthesis in the "copystr" call, it appears as if F is invoked
  2173.  twice. When the parenthesis is omitted as in the second example, PAS1
  2174.  emits a compile time error 227 - Invalid address of Function.
  2175.  
  2176.  Microsoft has confirmed this to be a problem in Version 3.20. This
  2177.  problem was corrected in Version 3.30.
  2178.  
  2179.  The example code as is as follows:
  2180.  
  2181.  Example 1
  2182.  
  2183.      PROGRAM PAREN(INPUT,OUTPUT);
  2184.         TYPE LSTR_80=LSTRING(80);
  2185.         VAR  B_STRING:STRING(4);
  2186.  
  2187.         FUNCTION F:LSTR_80;
  2188.            BEGIN
  2189.             WRITELN('INSIDE FUNCTION F');
  2190.             F:='1234';
  2191.            END;
  2192.  
  2193.      BEGIN {MAIN}
  2194.        COPYSTR((F),B_STRING);
  2195.        WRITELN(B_STRING);
  2196.      END.
  2197.  
  2198.  Example 2
  2199.  
  2200.      PROGRAM PAREN(INPUT,OUTPUT);
  2201.         TYPE LSTR_80=LSTRING(80);
  2202.         VAR  B_STRING:STRING(4);
  2203.  
  2204.         FUNCTION F:LSTR_80;
  2205.            BEGIN
  2206.             WRITELN('INSIDE FUNCTION F');
  2207.             F:='1234';
  2208.            END;
  2209.  
  2210.      BEGIN {MAIN}
  2211.        COPYSTR(F,B_STRING);
  2212.        WRITELN(B_STRING);
  2213.      END.
  2214.  
  2215.  
  2216.  61. Problems Using NULE6
  2217.  
  2218.  Product Version(s): 3.20
  2219.  Operating System:   MS-DOS
  2220.  Flags: ENDUSER | TAR17162
  2221.  Last Modified: 16-DEC-1987    ArticleIdent: Q10399
  2222.  
  2223.  Question:
  2224.     When we link in the modules NULE6 and NULF with our MS
  2225.  Pascal programs, we get an error at link time specifying
  2226.  that certain "QQ" symbols are defined twice. How can we
  2227.  eliminate unneeded error checking and file routines so that
  2228.  we can reduce the size of the program? What other types
  2229.  of routines also can be eliminated to reduce this size?
  2230.  
  2231.  Response:
  2232.     Please refer to the discussion in the user's guide
  2233.  (Section 8.5).
  2234.     Your unexpected need for NULE6.OBJ may be caused by the
  2235.  use of initialized units (see paragraph 2 of subsection
  2236.  8.5.2).
  2237.  
  2238.  
  2239.  62. Problems with Segmented Address Types
  2240.  
  2241.  Product Version(s): 3.20
  2242.  Operating System:   MS-DOS
  2243.  Flags: ENDUSER | TAR50072 buglist3.20 fixlist3.30
  2244.  Last Modified: 20-OCT-1988    ArticleIdent: Q10401
  2245.  
  2246.  There is a problem with address types and long-heap allocation. The
  2247.  code below contains the constant declaration "const newnil=ptr(0,0)"
  2248.  and uses it in an if statement. The program should execute the else
  2249.  part of the if statement and print out that "t^.nest^.back" and t are
  2250.  equal. However, instead of executing the else part of the if statement
  2251.  (so it would think the addresses are different), the program prints
  2252.  out that the addresses are the same.
  2253.  
  2254.  Microsoft has confirmed this to be a problem in Version 3.20. This
  2255.  problem was corrected in Version 3.30.
  2256.  
  2257.  The following is the short sample code:
  2258.  
  2259.     program test(input,output);
  2260.     type ptr = ads of word;
  2261.     p_somestruct = ads of somestruct;
  2262.     somestruct = record
  2263.     NEXT:p_somestruct;
  2264.     BACK:p_somestruct;
  2265.     end;
  2266.     const newnil = ptr(0,0);
  2267.     VAR t : p_somestruct;
  2268.  
  2269.     FUNCTION GETMQQ(WANTS : word) : adsmem; extern;
  2270.  
  2271.     begin
  2272.     t := getmqq(sizeof(t^));
  2273.     t^.next := getmqq(sizeof(t^.next^));
  2274.     t^.next^.back := t;
  2275.     if t^.next <> newnil then
  2276.     if t^.next^.back <> t then
  2277.     begin
  2278.     writeln('test says T^.NEXT^.BACK and T are not equal, BUT...');
  2279.     writeln('T^.NEXT^.BACK=',T^.NEXT^.BACK.S,T^.NEXT^.BACK.R);
  2280.     WRITELN('T =',t.s,t.r);
  2281.     end
  2282.     else
  2283.     writeln('T^.NEXT^.BACK and T are equal');
  2284.     end.
  2285.  
  2286.  
  2287.  63. Linking in DOS2PAS.LIB Versus PASCAL.LIB
  2288.  
  2289.  Product Version(s): 3.20
  2290.  Operating System:   MS-DOS
  2291.  Flags: ENDUSER | TAR17027
  2292.  Last Modified: 30-SEP-1988    ArticleIdent: Q10402
  2293.  
  2294.  Question:
  2295.  
  2296.  When the following program is linked with the DOS2PAS.LIB, it behaves
  2297.  differently than when linked with just the PASCAL.LIB (which has the
  2298.  DOS Version 1.x I/O package).
  2299.  
  2300.  When linked with the DOS Versions 2.x I/O package DOS2PAS.LIB, the
  2301.  program seems to lag one character behind. When the "f.mode :=
  2302.  terminal;" is omitted, similar behavior is experienced. What is the
  2303.  difference between terminal I/O and sequential binary mode?
  2304.  
  2305.  The following is a short example code:
  2306.  
  2307.     PROGRAM xx(input,output);
  2308.     VAR C : char;
  2309.     F : file of char;
  2310.     BEGIN
  2311.     assign(f,'con');
  2312.     F.MODE := terminal;
  2313.     reset(f);
  2314.     writeln('end program with an "@"');
  2315.     while c<>'@' do begin
  2316.     read(f,c);
  2317.     if (c <> chr(0)) then begin
  2318.     write(c);
  2319.     writeln(ord(c))
  2320.     end
  2321.     end
  2322.     END.
  2323.  
  2324.  Response:
  2325.  
  2326.  No corrective action needs to be taken. The test programs are geared
  2327.  to DOS Version 1.25. DOS Version 1.25 uses a polling model for console
  2328.  I/O. If no input is in the queue DOS returns a 0. Thus, the line "if
  2329.  chr(c) <> 0" skips over calls that returned no input. DOS Versions
  2330.  2.0x use a different method, e.g. wait for input. Because the test is
  2331.  geared for DOS Version 1.25, the DOS Version 2.00 release always seems
  2332.  to be one character behind.
  2333.  
  2334.  For information about the difference between terminal and sequential
  2335.  mode, see Section 8.4 of the "Microsoft Pascal Compiler Reference
  2336.  Manual."
  2337.  
  2338.  Note: in the Version 3.30 release, only the DOS Versions 2.x I/O
  2339.  interface will be supported.
  2340.  
  2341.  
  2342.  64. Nil Not Equal to Zero
  2343.  
  2344.  Product Version(s): 3.20
  2345.  Operating System:   MS-DOS
  2346.  Flags: ENDUSER | TAR17028 buglist3.20 fixlist3.30
  2347.  Last Modified: 30-SEP-1988    ArticleIdent: Q10403
  2348.  
  2349.  Question:
  2350.  
  2351.  Super array pointers allocate words to hold the upper bound of the
  2352.  allocated type. In the following program, the word following the
  2353.  pointer holds the upper bound. When nil is assigned to pointer, the
  2354.  value of 0 is assigned to the pointer, and 2 is assigned to the upper
  2355.  bound portion. Why is 2 assigned and why not 0 also?
  2356.  
  2357.  The following is the short example code:
  2358.  
  2359.     program test(input,output);
  2360.     type hundred=lstring(99);
  2361.     supar =super array[1..*] of hundred;
  2362.     VAR POINTER:^supar;
  2363.     Y :word;
  2364.     begin
  2365.     POINTER:=nil;
  2366.     Y:=sizeof(pointer^,20);
  2367.     writeln('size returned =',y);
  2368.     end.
  2369.  
  2370.  Response:
  2371.  
  2372.  Microsoft has confirmed this to be a problem in Version 3.20. This
  2373.  problem was corrected in Version 3.30.
  2374.  
  2375.  
  2376.  65. Local Record Passed Incorrectly with {$stackseg+}
  2377.  
  2378.  Product Version(s): 3.20
  2379.  Operating System:   MS-DOS
  2380.  Flags: ENDUSER | TAR09596 buglist3.20 fixlist3.30
  2381.  Last Modified: 20-OCT-1988    ArticleIdent: Q10405
  2382.  
  2383.  There are problems with a string move when the source and target are
  2384.  both on the stack. Incorrect code is generated for passing a stack
  2385.  item as a value parameter with the {$stackseg+} metacommand in effect.
  2386.  The problem occurs at the procedure call statement "d1(dx)", and
  2387.  involves a string move where the source and target are both on the
  2388.  stack. The code generated assumes that both source and target are
  2389.  resident in dgroup (ds relative).
  2390.  
  2391.  This assumption is false when $stackseg is enabled.
  2392.  
  2393.  Microsoft has confirmed this to be a problem in Version 3.20. This
  2394.  problem was corrected in Version 3.30.
  2395.  
  2396.  The following is a short example program:
  2397.  
  2398.     {$stackseg+}
  2399.     module death;
  2400.     type
  2401.     deaths_head=record
  2402.     X,Y:integer;
  2403.     DATA:lstring(255);
  2404.     end;
  2405.  
  2406.     PROCEDURE D1(D:deaths_head)[public,windows];
  2407.     begin
  2408.     D.X:=d.y;
  2409.     end;
  2410.  
  2411.     procedure d2[public,windows];
  2412.     VAR DX:deaths_head;
  2413.     begin
  2414.     d1(dx);
  2415.     end;
  2416.  
  2417.     procedure d3[public,windows];
  2418.     VAR X:integer;
  2419.     FUNCTION D31(N:integer):integer;
  2420.     begin
  2421.     D31:=n+x;
  2422.     end;
  2423.     begin
  2424.     X:=5;
  2425.     X:=d31(10);
  2426.     end;
  2427.     end.
  2428.  
  2429.  
  2430.  66. Redirected Input File Causes Run-Time Hang
  2431.  
  2432.  Product Version(s): 3.13 3.20 3.3x
  2433.  Operating System:   MS-DOS
  2434.  Flags: ENDUSER |
  2435.  Last Modified: 30-SEP-1988    ArticleIdent: Q10406
  2436.  
  2437.  Problem:
  2438.  
  2439.  Using the ::N notation to write an integer causes a run-time error. We
  2440.  used the ::N notation to write an integer with a radix other than 2,
  2441.  8, 10, or 16. This procedure causes a data-format error in the file
  2442.  USER at run time.
  2443.  
  2444.  The following is sample code:
  2445.  
  2446.     program wformats(input,output);
  2447.     var
  2448.     I:integer;
  2449.     begin
  2450.     I:=32;
  2451.     WRITELN(I::3);
  2452.     end.
  2453.  
  2454.  Response:
  2455.  
  2456.  MS-DOS does not return an end-of-file from a redirected input file
  2457.  when it runs out of text; DOS just hangs. This problem has nothing to
  2458.  do with Pascal.
  2459.  
  2460.  Put a ^Z (CTRL+Z), or chr(26) in the file and it will work
  2461.  properly.
  2462.  
  2463.  
  2464.  67. Referencing Origin from Other Module or Unit
  2465.  
  2466.  Product Version(s): 3.20
  2467.  Operating System:   MS-DOS
  2468.  Flags: ENDUSER | TAR17015 buglist3.20 fixlist3.30
  2469.  Last Modified: 30-SEP-1988    ArticleIdent: Q10408
  2470.  
  2471.  Problem:
  2472.  
  2473.  In the following examples, I am trying to reference variables with the
  2474.  origin (segmented address) attribute across compilation modules.
  2475.  However, both fail to pass the origin. In the first example, I attempt
  2476.  to use the unit/interface method; in the second example, I am
  2477.  trying to reference the origin via modules with public/external
  2478.  variables. The only way that I can successfully reference origin
  2479.  variables across compilation units is to declare the variables with
  2480.  matching-origin attributes in each compilation unit.
  2481.  
  2482.  The following is a short sample code:
  2483.  
  2484.  Example 1
  2485.  
  2486.     {$INCLUDE: 'yu.int'}
  2487.     program x(input,output);
  2488.     uses y;
  2489.     begin
  2490.     I := 13;
  2491.     subcall;
  2492.     WRITELN('FROM MAIN PROGRAM I, J AND K ARE: ', i:8, j:8, k:8);
  2493.     end.
  2494.  
  2495.     {$INCLUDE: 'yu.int'}
  2496.     implementation of y;
  2497.     procedure subcall;
  2498.     begin
  2499.     J := 33;
  2500.     WRITELN('USING SUBCALL: i, j and k are: ', i:8, j:8, k:8);
  2501.     end;
  2502.  
  2503.     begin
  2504.     K := 53;
  2505.     end.
  2506.  
  2507.     interface;
  2508.     unit y(i, j, k, subcall);
  2509.     var
  2510.     I[ ORIGIN 16#6000 : 16#0000 ] : integer;
  2511.     J [ ORIGIN 16#6001 : 16#0000 ] : integer;
  2512.     K [ ORIGIN 16#6002 : 16#0000 ] : integer;
  2513.     procedure subcall;
  2514.     begin
  2515.     end;
  2516.  
  2517.  Example2
  2518.  
  2519.     program x(input,output);
  2520.     VAR [EXTERN] I, J, K : integer;
  2521.     procedure subcall;extern;
  2522.     begin
  2523.     I := 13;
  2524.     subcall;
  2525.     WRITELN('FROM MAIN PROGRAM I, J AND K ARE: ', i:8, j:8, k:8);
  2526.     end. {program x}
  2527.  
  2528.     module y;
  2529.  
  2530.     VAR I [PUBLIC,ORIGIN 16#6000:0000] : integer;
  2531.     J [PUBLIC,ORIGIN 16#6001:0000] : integer;
  2532.     K [PUBLIC,ORIGIN 16#6002:0000] : integer;
  2533.  
  2534.     procedure subcall;
  2535.     begin
  2536.     J := 33;
  2537.     K := 53;
  2538.     WRITELN('USING SUBCALL: i, j and k are: ', i:8, j:8, k:8);
  2539.     end;
  2540.  
  2541.     end. {module y}
  2542.  
  2543.  Response:
  2544.  
  2545.  The above examples actually constitute two completely separate
  2546.  problems.
  2547.  
  2548.  In Example 1, the variables are being allocated when the interface
  2549.  was processed. They then were reallocated when the implementation was
  2550.  processed and the origin forgotten.
  2551.  
  2552.  Microsoft has confirmed this to be a problem in Version 3.20. This
  2553.  problem was corrected in Version 3.30.
  2554.  
  2555.  In Example 2, external variables are assumed to be in "ds"; there
  2556.  is no way, in the examples, to indicate that they are origined (this
  2557.  cannot work correctly). Versions 3.3x of the compiler will not allow
  2558.  specification of origin and extern on the same object. However, simply
  2559.  making them static will work properly because the actual address is
  2560.  being explicitly specified.
  2561.  
  2562.  If you want to access origined variables using the unit/interface
  2563.  route, it is suggested that all origined variables be declared as such
  2564.  in each module with matching allocation specifications. This procedure
  2565.  can be easily accomplished by using the $include file facility.
  2566.  
  2567.  
  2568.  68. Unresolved External: avlgqq
  2569.  
  2570.  Product Version(s): 3.20
  2571.  Operating System:   MS-DOS
  2572.  Flags: ENDUSER | TAR50138 buglist3.20 fixlist3.30
  2573.  Last Modified: 30-SEP-1988    ArticleIdent: Q10409
  2574.  
  2575.  Problem:
  2576.  
  2577.  The following program compiles successfully, but generates the
  2578.  unresolved external "avlgqq" at link time. The following is a short
  2579.  example code:
  2580.  
  2581.     PROGRAM TEST(INPUT,OUTPUT);
  2582.     TYPE RTYPE=(TYPE1,TYPE2);
  2583.     RECTYPE=RECORD
  2584.     CASE T:RTYPE OF
  2585.     TYPE1:(UDEF:INTEGER);
  2586.     TYPE2:(FID:REAL);
  2587.     END;
  2588.     VAR ADS_REC:ADS OF RECTYPE;
  2589.     PTR_REC:^RECTYPE;
  2590.     BEGIN
  2591.     NEW(PTR_REC);
  2592.     PTR_REC^:=ADS_REC^;
  2593.     END.
  2594.  
  2595.  Response:
  2596.  
  2597.  The avlgqq external is a routine to move a variable number of bytes
  2598.  from a segmented address to the heap. It appears that there has not
  2599.  actually been such a routine in the library for quite a while. An
  2600.  avlgqq routine has now been written and placed in the PASCAL.LIB for
  2601.  Versions 3.30 and later.
  2602.  
  2603.  Microsoft has confirmed this to be a problem in Version 3.20. This
  2604.  problem was corrected in Version 3.30.
  2605.  
  2606.  
  2607.  69. sizeof Ignores Upper Bound of Super Array
  2608.  
  2609.  Product Version(s): 3.20
  2610.  Operating System:   MS-DOS
  2611.  Flags: ENDUSER | TAR17010 buglist3.20 fixlist3.30
  2612.  Last Modified:  4-OCT-1988    ArticleIdent: Q10410
  2613.  
  2614.  Problem:
  2615.  
  2616.  When discussing the sizeof statement, the "Microsoft Pascal Compiler
  2617.  for the MS-DOS Operating System Reference Manual" states that "if the
  2618.  variable is a super array, the second form, which gives upper bounds,
  2619.  must be used."
  2620.  
  2621.  In the example program below, the second parameter of the sizeof call
  2622.  is ignored. The upper bound of the allocated pointer is stored in the
  2623.  second word of the pointer value. When the sizeof function is invoked,
  2624.  the value stored in the second word of the super array pointer is used
  2625.  to calculate the size of the super array pointer. However, when the
  2626.  second parameter is omitted from the sizeof call, PAS1 emits a compile
  2627.  time error 233 "invalid procedure or function parameter."
  2628.  
  2629.  The following is the short example code:
  2630.  
  2631.     program test(input,output);
  2632.     type hundred=lstring(99);
  2633.     supar =super array[1..*] of hundred;
  2634.     VAR POINTER:^supar;
  2635.     Y :word;
  2636.     begin
  2637.     new(pointer,20);
  2638.     Y:=sizeof(pointer^,10);
  2639.     writeln('size returned =',y);
  2640.     end.
  2641.  
  2642.  Response:
  2643.  
  2644.  This behavior has been changed by adding the ability to use the short
  2645.  form of sizeof on a short array pointer. The long form now returns the
  2646.  length calculated purely from the values specified in the sizeof call,
  2647.  and ignores the fields in the pointer. The short form uses only the
  2648.  pointer fields.
  2649.  
  2650.  Microsoft has confirmed this to be a problem in Version 3.20. This
  2651.  problem was corrected in Version 3.30.
  2652.  
  2653.  Note: a feature, sizeof(p^), has been added where p is a pointer to a
  2654.  super array. Now, this is a valid expression but it is the
  2655.  programmer's responsibility to ensure that p^ has been allocated. Also
  2656.  note that if p = pointer to a one-dimensional super array then
  2657.  sizeof(p^, 10) depends only on the underlying type of the super array
  2658.  and 10. Whether or not p^ has been allocated is irrelevant.
  2659.  
  2660.  
  2661.  70. Warning for Label Following Hex Number
  2662.  
  2663.  Product Version(s): 3.20
  2664.  Operating System:   MS-DOS
  2665.  Flags: ENDUSER | TAR50109 buglist3.20 fixlist3.30
  2666.  Last Modified: 30-SEP-1988    ArticleIdent: Q10412
  2667.  
  2668.  Problem:
  2669.  
  2670.  The following program fragment contains an example of an integer label
  2671.  following a hex number (16#30). This causes the PAS1 compiler message
  2672.  "Warning 280 Invalid Integer Label" to be generated. If any statement
  2673.  is included between the two statements, no warning statement is
  2674.  generated.
  2675.  
  2676.  The following is a short example code:
  2677.  
  2678.     program xx(input,output);
  2679.     label 10;
  2680.     VAR dummy,HEXNUM : word;
  2681.  
  2682.     PROCEDURE HEY(VAR OOPS : word); extern;
  2683.  
  2684.     begin
  2685.     HEXNUM := 16#30;
  2686.     10: HEY(dummy);
  2687.     if (dummy<>0) then goto 10;
  2688.     end.
  2689.  
  2690.  Response:
  2691.  
  2692.  In the case above, a flag remains set that indicates the
  2693.  number 10 is in hex radix. Because the hex radix is not legal
  2694.  in numeric labels, a warning is emitted.
  2695.  
  2696.  Microsoft has confirmed this to be a problem in Version 3.20. This
  2697.  problem was corrected in Version 3.30.
  2698.  
  2699.  
  2700.  71. Working Around Lack of MARKAS and RELEAS
  2701.  
  2702.  Product Version(s): 3.20 3.3x
  2703.  Operating System:   MS-DOS
  2704.  Flags: ENDUSER |
  2705.  Last Modified: 23-FEB-1988    ArticleIdent: Q10413
  2706.  
  2707.  Question:
  2708.     The MARKAS and RELEASE procedures do not function correctly in
  2709.  Version 3.20, and will not be included in 3.3x versions. We have got a
  2710.  workaround for our product that uses the ALLMQQ and FREMQQ procedures
  2711.  instead. Do these procedures work correctly, and will they be
  2712.  supported in future releases of Microsoft Pascal?
  2713.  
  2714.  Response:
  2715.     Yes the ALLMQQ and FREMQQ procedures do work in 3.3x, and we do
  2716.  plan to provide support for them in the future.
  2717.     It is entirely possible to use ALLMQQ/FREMQQ to implement some sort
  2718.  of heap management. However, if these could be used to easily
  2719.  implement the functional equivalent of MARKAS and RELEAS then we would
  2720.  still be supporting MARKAS and RELEAS in 3.3x (i.e., these function
  2721.  were dropped because it was determined that they did not work
  2722.  correctly and there was no good way to make them work correctly with
  2723.  our heap implementation). You should review the heap management used
  2724.  in Version 3.3x to see what effects this may have on your particular
  2725.  implementation.
  2726.  
  2727.  
  2728.  72. ".R" Field in ADS Variable Incorrectly Assigned
  2729.  
  2730.  Product Version(s): 3.30 3.31
  2731.  Operating System:   MS-DOS
  2732.  Flags: ENDUSER | TAR51446 buglist3.30 fixlist3.31
  2733.  Last Modified: 30-SEP-1988    ArticleIdent: Q10813
  2734.  
  2735.  With MS-DOS Pascal Version 3.30, the ".R" field of an ADS variable can
  2736.  be incorrectly assigned. The assignment is incorrect if it is made as
  2737.  follows:
  2738.  
  2739.  (ADS OF RECORD TYPE)^.FIELD.R:=(ads of record type).r
  2740.  (ADS OF RECORD TYPE)^.FIELD.S:=(ads of record type).s
  2741.  
  2742.  If a temporary ADS variable is used to hold the address of the
  2743.  allocated memory, the assignment is made correctly.
  2744.  
  2745.  Microsoft has confirmed this to be a problem in Version 3.30. This
  2746.  problem was corrected in Version 3.31.
  2747.  
  2748.  
  2749.  73. Programming the Mouse with Pascal
  2750.  
  2751.  Product Version(s): 3.3x
  2752.  Operating System:   MS-DOS
  2753.  Flags: ENDUSER | TAR51499
  2754.  Last Modified: 16-DEC-1987    ArticleIdent: Q10842
  2755.  
  2756.  Question:
  2757.     Are there any plans to support programming the mouse
  2758.  with Pascal?
  2759.  
  2760.  Response:
  2761.     There are no plans for including mouse specific
  2762.  instructions within the Microsoft implementation of
  2763.  Pascal.
  2764.     However, regarding making calls from a Pascal program to
  2765.  the mouse, that is possible and documented in the
  2766.  "Microsoft Mouse Programmer's Reference Guide" in the
  2767.  section "Making Calls From High-Level Languages". The mouse
  2768.  manual also contains information on making mouse system
  2769.  calls from BASIC and Assembly.
  2770.  
  2771.  
  2772.  74. Example Using the POSITN Function
  2773.  
  2774.  Product Version(s): 3.13 3.20 3.3x
  2775.  Operating System:   MS-DOS
  2776.  Flags: ENDUSER | TAR21065
  2777.  Last Modified: 30-SEP-1988    ArticleIdent: Q10853
  2778.  
  2779.  Question:
  2780.  
  2781.  I am trying to use the POSITN procedure without success. Could you
  2782.  give me an example that uses POSITN?
  2783.  
  2784.  Response:
  2785.  
  2786.  POSITN is an intrinsic function.
  2787.  
  2788.  The following example program demonstrates the use of the POSITN
  2789.  function:
  2790.  
  2791.     program position_ex(output);
  2792.     VAR     I        : integer;
  2793.             PAT      : string(3);
  2794.             S        : string(7);
  2795.             position : INTEGER;
  2796.     begin
  2797.        PAT:='pat';
  2798.        S:= 'pattern';
  2799.        I:= 1;
  2800.        position :=POSITN(PAT,S,I);
  2801.        WRITELN('POSITION=',position);
  2802.     end.
  2803.  
  2804.  The output was:    POSITION=             1
  2805.  
  2806.  
  2807.  75. {INTEGER:4} Not Supported in Versions 3.3x
  2808.  
  2809.  Product Version(s): 3.3x
  2810.  Operating System:   MS-DOS
  2811.  Flags: ENDUSER | TAR21447 docerr
  2812.  Last Modified: 18-AUG-1988    ArticleIdent: Q10861
  2813.  
  2814.  Problem:
  2815.     It is not clear whether the metacommand {$INTEGER:4} is still
  2816.  supported within PASCAL Version 3.3x. Page 318 in the "Microsoft
  2817.  Pascal Compiler Reference Manual" mentions this command, saying that
  2818.  you can use values 2 or 4 as arguments for the $integer metacommand.
  2819.     The index on Page 388 tells you that metacommand $integer is
  2820.  described on Pages 317 and 318. However, Table 18.2 on Page 317 does
  2821.  not show the metacommand.
  2822.     If you use {$integer:4}, the compiler gives you the following
  2823.  warning:
  2824.  
  2825.     Warning 116 Meta Value Out Of Range Skipped
  2826.  
  2827.     The Microsoft Pascal Compiler User's Guide states on Page 230 that
  2828.  only 2 is allowed as an argument for the $integer metacommand;
  2829.  {$INTEGER:4} will be ignored, producing errors in programs using this
  2830.  format.
  2831.  
  2832.  Response:
  2833.     {$INTEGER:4} is not supported in Versions 3.3x. These are
  2834.  documentation errors; only {$INTEGER:2} is supported.
  2835.     The documentation probably should not mention the metacommand because
  2836.  variables declared as type "integer" are two-byte integers, making the
  2837.  allowed form of this metacommand, {$integer:2}, redundant.
  2838.  
  2839.  
  2840.  76. VALUE Section Not Allowed with $ROM
  2841.  
  2842.  Product Version(s): 3.3x
  2843.  Operating System:   MS-DOS
  2844.  Flags: ENDUSER | TAR21824 docerr
  2845.  Last Modified: 26-SEP-1988    ArticleIdent: Q10862
  2846.  
  2847.  Pages 317 and 318 of the Pascal Reference Manual incorrectly state
  2848.  that using the $ROM metacommand in conjunction with the VALUE section
  2849.  results in a compiler warning; however, the metacommand, actually
  2850.  gives error message 347, "Cannot Use Value Section with ROM Memory."
  2851.  
  2852.  The manual should state that when you have a VALUE section in a
  2853.  program using the {$ROM+} metacommand, you will receive an error
  2854.  message.
  2855.  
  2856.  The following sample code demonstrates the problem:
  2857.  
  2858.  {$rom+}
  2859.  program xx;
  2860.  VAR   I :  integer;
  2861.  VALUE I := 1;
  2862.  begin
  2863.  end.
  2864.  
  2865.  
  2866.  77. Printing a File Containing CTRL+Z Characters
  2867.  
  2868.  Product Version(s): 3.3x
  2869.  Operating System:   MS-DOS
  2870.  Flags: ENDUSER | TAR21449
  2871.  Last Modified: 30-SEP-1988    ArticleIdent: Q10868
  2872.  
  2873.  Question:
  2874.  
  2875.  Printing fails when attempting to print out hexadecimal character 1A
  2876.  (CTRL+Z) with the following command:
  2877.  
  2878.  writeln(prn,chr(26));
  2879.  
  2880.  If written to the printer, you get "Error 1028 device full in file
  2881.  PRN". We used the following assignment to print CTRL+Z:
  2882.  
  2883.     VAR prn : text;
  2884.     begin
  2885.     assign(prn,'prn');
  2886.     rewrite(prn);
  2887.     writeln(prn,chr(26));
  2888.  
  2889.  Is this problem occurring because chr(26) is the end-of-file marker
  2890.  (CTRL+Z)? Can you eliminate this problem by using write or writeln?
  2891.  
  2892.  Response:
  2893.  
  2894.  This problem occurs because of the DOS interpretation of CTRL+Z, which
  2895.  is chr(26). When DOS is processing a file and encounters a CTRL++Z
  2896.  character, it interprets the CTRL+Z character as an
  2897.  end-of-file (EOF) marker.
  2898.  
  2899.  In your example, you are sending a file containing the CTRL+Z
  2900.  character to the printer. DOS interprets the character as the end of
  2901.  the file, causing anything after the CTRL+Z not to be printed. Pascal
  2902.  recognizes that it was not able to print out all that it should have
  2903.  and interprets that to mean that the printer was full. This behavior
  2904.  causes the "device full" error.
  2905.  
  2906.  The filename PRN is reserved by DOS for the printer device. Read,
  2907.  readln, write, and writeln all read/write data to/from textfiles. When
  2908.  you write a line to PRN (printer device) using writeln, you are trying
  2909.  to write a line of a textfile to the printer, as in the following
  2910.  example:
  2911.  
  2912.  writeln(prn,chr(26));
  2913.  
  2914.  Textfiles are files of type text and always have an ASCII structure.
  2915.  Because DOS always interprets CTRL+Z characters in ASCII files as
  2916.  EOF markers, DOS interprets this CTRL+Z as the EOF marker and quits.
  2917.  
  2918.  Thus, in Pascal and FORTRAN you cannot send CTRL+Z to either standard
  2919.  output (filename OUTPUT) or to the printer (filename PRN). If you
  2920.  were instead trying to send output to a binary file (FILE OF <type>),
  2921.  DOS would allow you to send a CTRL+Z.
  2922.  
  2923.  Do the following to work around this behavior of DOS:
  2924.  
  2925.  1. Ensure that your output contains only printable ASCII characters
  2926.     (this is the recommended method).
  2927.  
  2928.  2. Trap errors on output (PRN.TRAP := true) and then decide what to
  2929.     do when an error occurs, e.g. try to print a CTRL+Z. If
  2930.     you were using some other filename reserved by DOS (such as USER)
  2931.     with OUTPUT), you should write an assembler or MS-C routine to check
  2932.     that standard input/output has been redirected.
  2933.  
  2934.  3. Direct output to a file instead of to the printer or standard
  2935.     output. (Please note that this does not resolve your specific problem
  2936.     in which the objective is to print the CTRL+Z character at the
  2937.     printer device.)
  2938.  
  2939.  4. One other possibility is to put all of your data/characters into
  2940.     a binary (FILE OF <type>) file. This is a workaround for the DOS
  2941.     interpretation of a CTRL+Z character because DOS does not do any
  2942.     interpretation of a binary file; DOS only sends it on to the printer.
  2943.     Be careful if you use the binary-file approach because the compiler
  2944.     and DOS interpret the information contained in a binary file
  2945.     differently.
  2946.  
  2947.  In general, do the following:
  2948.  
  2949.  1. Make sure that output contains only printable ASCII characters.
  2950.     In particular, do not try to write a CTRL+Z to a TEXT file, i.e.,
  2951.     do not send a CTRL+Z to OUPUT, PRN, USER, etc.
  2952.  
  2953.  2. If you still want to be able to send a CTRL+Z to output, you
  2954.     must redirect output to a binary file or check for the CTRL+Z using
  2955.     error trapping.
  2956.  
  2957.  
  2958.  78. GETUQQ and PUTUQQ Fail Due to Buffered I/O
  2959.  
  2960.  Product Version(s): 3.3x
  2961.  Operating System:   Pascal
  2962.  Flags: ENDUSER | TAR21169
  2963.  Last Modified:  4-APR-1988    ArticleIdent: Q10880
  2964.  
  2965.  Question:
  2966.     There appears to be a problem with using getuqq() and seek()
  2967.  together on direct files. In each of the examples below, getuqq()
  2968.  appears to be returning values from the wrong position in the file
  2969.  after the first, or first few, seeks. The examples all work correctly
  2970.  with Version 3.20 (I linked with dos2pas.lib).
  2971.     Also, with the first two examples, calling rpsuqq() before each
  2972.  seek appears to solve the problem. However, the third example still
  2973.  malfunctions in this case.
  2974.  
  2975.  EXAMPLE 1:
  2976.  ----------
  2977.  {* This simple example was devised request to demonstrate the problem in
  2978.   * using seek() and getuqq() together in the case of a simple direct
  2979.   * file of char. If, instead of getuqq(), get() is used to fetch bytes from
  2980.   * the file, the program works correctly. The file sktst.dat is 28 bytes long
  2981.   * and consists of the characters 'A' through 'Z' followed by a carriage
  2982.   * return and line feed.
  2983.   *}
  2984.  program sktst(input, output);
  2985.  FUNCTION GETUQQ(VAR FFILE: fcbfqq; len: word; dst: adsmem): word; extern;
  2986.  VAR     I: word;
  2987.          C: char;
  2988.          F: file of char;
  2989.  begin
  2990.          F.MODE := direct;
  2991.          assign(f, 'sktst.dat');
  2992.          reset(f);
  2993.          FOR I := 10 downto 1 do begin
  2994.                  writeln;
  2995.                  writeln('i = ', i);
  2996.                  seek(f, i);
  2997.                  if getuqq(f, 1, ads c) <> 0 then
  2998.                          writeln('error! - getuqq failed!')
  2999.                  else if ord(c) <> (ord(i) + 64) then
  3000.                          writeln('error! - c = ', c)
  3001.                  else
  3002.                          writeln('correct character found');
  3003.          end
  3004.  end.
  3005.  
  3006.  CONTENTS OF SKTST.DAT:
  3007.  ---------------------
  3008.  ABCDEFGHIJKLMNOPQRSTUVWXYZ<cr><lf>
  3009.  
  3010.  ---------------------------------------------------------------------------
  3011.  
  3012.  EXAMPLE 2:
  3013.  ----------
  3014.  program bug (input,output);
  3015.  FUNCTION GETUQQ(VAR F : fcbfqq;
  3016.                   LEN : word;
  3017.                   DST : adsmem ) : word ; extern;
  3018.  const
  3019.    length = 6+2;
  3020.  VAR
  3021.    I : word;
  3022.    MSG : lstring(length);
  3023.    MSGFILE : file of char;
  3024.  Begin
  3025.    MSGFILE.MODE := direct;
  3026.    assign(msgfile,'bug.dat');
  3027.    reset(msgfile);
  3028.    if msgfile.errs = 0 then
  3029.      FOR I := 0 to 3 do begin
  3030.        seek(msgfile,length*i + 1);
  3031.        MSG.LEN := length - 2;
  3032.        if getuqq(msgfile,msg.len,ads msg[1]) <> 0 then
  3033.          MSG.LEN := 0;
  3034.        WRITELN(I:2,' ',msg);
  3035.      end;
  3036.  end.
  3037.  
  3038.  CONTENTS OF BUG.DAT:
  3039.  -------------------
  3040.  line 0<cr><lf>
  3041.  line 1<cr><lf>
  3042.  line 2<cr><lf>
  3043.  line 3<cr><lf>
  3044.  ^Z
  3045.  
  3046.  ---------------------------------------------------------------------------
  3047.  
  3048.  EXAMPLE 3:
  3049.  ----------
  3050.  {$INCLUDE:'finkxu'}
  3051.  {$INCLUDE:'finu'}
  3052.  program test(input,output);
  3053.  uses filuqq;
  3054.  uses filkqq;
  3055.  type    rec=record
  3056.                  I:integer;
  3057.                  S:string(230);
  3058.               end;
  3059.  VAR     DREC:rec;
  3060.          F:file of rec;
  3061.          I,IOSTATUS:word;
  3062.  begin
  3063.          writeln('size of drec=',sizeof(drec));
  3064.          F.MODE:=direct;
  3065.          assign(f,'this.dat');
  3066.          rewrite(f);
  3067.          FOR I:=1 to 10 do
  3068.           begin
  3069.            DREC.I:=ord(i);
  3070.            seek(f,i);
  3071.            IOSTATUS:=putuqq(f,sizeof(drec),ads drec);
  3072.           end;
  3073.          writeln('after for loop, i=',i);
  3074.          seek(f,1);
  3075.          FOR I:=1 to 10 do
  3076.           begin
  3077.             seek(f,i);
  3078.            IOSTATUS:=getuqq(f,sizeof(drec),ads drec);
  3079.            WRITELN('GETTING RECORD ',I:1,'. I=',drec.i:1);
  3080.           end;
  3081.          close(f);
  3082.  end.
  3083.  
  3084.  ---------------------------------------------------------------------------
  3085.  
  3086.  Response:
  3087.     In Version 3.3x, I/O to DIRECT files is buffered. This change was
  3088.  made to increase performance but, unfortunately, as a result of this
  3089.  change, it is no longer feasible to use the UNIT U functions GETUQQ()
  3090.  and PUTUQQ(). The only way to correct this is to take the buffering
  3091.  back out. This will not be done because we feel that the resulting
  3092.  degradation in performance would be more of a problem than the loss of
  3093.  use of these UNIT U routines.
  3094.     The loss of functionality to users resulting from this problem is
  3095.  minimal. GETUQQ()/PUTUQQ() is used to read/write strings of WHOLE
  3096.  records to a DIRECT file, starting at some record position, from/to a
  3097.  buffer. For this purpose, it is easy to build procedures using the
  3098.  intrinsics GET(), PUT(), and SEEK() to do the job. Furthermore, for
  3099.  small record lengths (small compared to the buffer size, 512) it is
  3100.  likely that such procedures would perform much better (i.e., faster)
  3101.  than using GETUQQ() and PUTUQQ() did in 3.20. The following MODULE
  3102.  illustrates one way you could implement procedures with equivalent
  3103.  functionality for most applications. (No claim is made that this is
  3104.  the best possible way.)
  3105.  
  3106.  -----------------------------------------------------------------------------
  3107.  {$INCLUDE: 'finkxu'}
  3108.  module io_recs [];
  3109.  uses filkqq;
  3110.  
  3111.  {* Procedure ERROR_CHECK checks for three possible error conditions in   *}
  3112.  {* in the parameters passed to GET_RECORDS() or PUT_RECORDS() and ABORTS *}
  3113.  {* the program if any of these are found. The parameter PROC_FLAG        *}
  3114.  {* identifies the procedure which called ERROR_CHECK, PROC_FLAG = 1 for  *}
  3115.  {* GET_RECORDS() and PROC_FLAG = 2 for PUT_RECORDS().                    *}
  3116.  
  3117.  PROCEDURE ERROR_CHECK(VAR F: fcbfqq; position: integer4; count: word;
  3118.  BUFF_ADS: adsmem; proc_flag: word);
  3119.  
  3120.  begin
  3121.     if f.cmod <> direct then
  3122.        abort('ERROR - FILE NOT OPENED FOR DIRECT ACCESS', 10000,
  3123.        proc_flag)
  3124.     else if count = 0 then
  3125.        abort('ERROR - I/O OF 0 RECORDS REQUESTED', 10001, proc_flag)
  3126.     else if (bylong(0, buff_ads.r) + bylong(0, count)*bylong(0, f.size))
  3127.     >= 65536 then
  3128.        abort('ERROR - BUFFER CANNOT SPAN SEGMENTS', 10002, proc_flag)
  3129.  end; { error_check }
  3130.  
  3131.  {* Procedure GET_RECORDS() copies COUNT records from file F, starting at *}
  3132.  {* record POSITION, to the buffer whose address is DESTINATION.          *}
  3133.  
  3134.  PROCEDURE GET_RECORDS (VAR F: fcbfqq; position: integer4; count: word;
  3135.  DESTINATION: adsmem) [public];
  3136.  
  3137.  VAR   I: word;
  3138.        CURR_DEST: adsmem;
  3139.  
  3140.  begin
  3141.     {error_check(f, position, count, destination, 1);}
  3142.     CURR_DEST := destination;
  3143.     seek(f, position);
  3144.     FOR I := 1 to count do begin
  3145.        get(f);
  3146.        movesl(ads (f^), curr_dest, f.size);
  3147.        CURR_DEST.R := curr_dest.r + f.size
  3148.     end { end of for }
  3149.  end; { get_records }
  3150.  
  3151.  {* Procedure PUT_RECORDS() copies COUNT records from the buffer whose    *}
  3152.  {* address is SOURCE to the file F, starting at record POSITION.         *}
  3153.  
  3154.  PROCEDURE PUT_RECORDS (VAR F: fcbfqq; position: integer4; count: word;
  3155.  SOURCE: adsmem) [public];
  3156.  
  3157.  VAR   I: word;
  3158.        CURR_SRC: adsmem;
  3159.  
  3160.  begin
  3161.     {error_check(f, position, count, source, 2);}
  3162.     CURR_SRC := source;
  3163.     seek(f, position);
  3164.     FOR I := 1 to count do begin
  3165.        movesl(curr_src, ads (f^), f.size);
  3166.        CURR_SRC.R := curr_src.r + f.size;
  3167.        put(f)
  3168.     end { end of for }
  3169.  end; { put_records }
  3170.  
  3171.  end.
  3172.  
  3173.  
  3174.  79. PAS2 Does Not Set the DOS ERRORLEVEL in Version 3.30
  3175.  
  3176.  Product Version(s): 3.3x
  3177.  Operating System:   MS-DOS
  3178.  Flags: ENDUSER | TAR51089 buglist3.30 fixlist3.31
  3179.  Last Modified: 24-FEB-1988    ArticleIdent: Q10940
  3180.  
  3181.  Question:
  3182.     According to the documentation (Pascal user's guide, Page 134),
  3183.  "The compiler supplies an exit status (to MS-DOS Versions 2.0 and
  3184.  later) that can be accessed via the IF ERRORLEVEL N batch command...".
  3185.     Unfortunately, in the case of PAS2.EXE running out of memory, it
  3186.  does not do this.
  3187.  
  3188.  Response:
  3189.     This problem was present in Version 3.30 of the compiler. There is
  3190.  a module called mis2 that contains error handling routines that
  3191.  interface with the Pascal run-time routines in the compiler. It was
  3192.  not properly setting the doseqq cell. This problem was corrected in
  3193.  Version 3.31.
  3194.  
  3195.  
  3196.  80. MIN Is an Undocumented Function
  3197.  
  3198.  Product Version(s): 3.3x
  3199.  Operating System:   MS-DOS
  3200.  Flags: ENDUSER | TAR51923
  3201.  Last Modified: 30-SEP-1988    ArticleIdent: Q10992
  3202.  
  3203.  Question:
  3204.  
  3205.  In a program we declare the global variable "MIN". When we link the
  3206.  program we get a "symbol defined twice" error message. Is there a
  3207.  procedure MIN that is used by the compiler?
  3208.  
  3209.  Response:
  3210.  
  3211.  It is not a reserved word, but it is an undocumented function defined
  3212.  in the library. The library function min() does just what you would
  3213.  expect; it returns the minimum of its two arguments. However, the
  3214.  argument type and return type are WORD rather than INTEGER. Thus, the
  3215.  following declaration should be made:
  3216.  
  3217.  FUNCTION MIN(I,J: word): integer; extern;
  3218.  
  3219.  There is no function MAX() defined in the library.
  3220.  
  3221.  
  3222.  81. $mathck and Integer2 Expressions
  3223.  
  3224.  Product Version(s): 3.3x
  3225.  Operating System:   MS-DOS
  3226.  Flags: ENDUSER | TAR21809
  3227.  Last Modified:  4-OCT-1988    ArticleIdent: Q11000
  3228.  
  3229.  Problem:
  3230.  
  3231.  Page 61 of the "Microsoft Pascal Reference Manual" describes how
  3232.  integer2 variables will be changed within a formula to integer4 if the
  3233.  result will be out of integer2's value range. However, if you use the
  3234.  metacommand $mathck as described on Page 323, this does not work
  3235.  correctly. The program will terminate with the error message "out of
  3236.  integer space."
  3237.  
  3238.  The following example code demonstrates this problem:
  3239.  
  3240.      { changing to INTEGER4 as described in Pascal reference manual }
  3241.      { on Page 61 is not done when mathck+ is set }
  3242.  
  3243.      { $mathck+ }
  3244.      {$line+}
  3245.      program p_f01(output);
  3246.      VAR L:integer4;
  3247.          I1:integer4;
  3248.          I: integer;
  3249.      begin
  3250.      writeln('no error message using only INTEGER4 variables');
  3251.      I1:= 1000;
  3252.      L:= I1*I1;
  3253.      writeln('1000*1000 = ',L);
  3254.      writeln;
  3255.      writeln('using INTEGER2 variables in expression, result assigned to ');
  3256.      writeln('a variable of typ INTEGER4');
  3257.      I:=1000;
  3258.      L:=I*I;     { will stop with error message right here }
  3259.      writeln('1000*1000 = ',l)
  3260.      end.
  3261.  
  3262.  Response:
  3263.  
  3264.  {$Mathck+} only tells you what the compiler finds. It evaluates the
  3265.  right-hand side as an integer2 expression, and finds that it cannot
  3266.  fit the result into an integer2 variable. More explicitly, it
  3267.  evaluates the right-hand side, determines that I is integer2,
  3268.  calculates the result, and then determines that the result is not
  3269.  integer2 and gives you an overflow error.
  3270.  
  3271.  The conversion of the result to an integer4, which happens if you
  3272.  delete the {$mathck+} metacommand, occurs at the assignment statement,
  3273.  not at the calculation of a result. But $mathck keeps a closer eye on
  3274.  the intermediate results, notes that the results do not fit into a
  3275.  variable of the type of those variables on the right-hand side, so it
  3276.  overflows and gives the error, never making it to the assignment that
  3277.  would have resolved the problem.
  3278.  
  3279.  To work around this problem, you can multiply the expression on the
  3280.  right-hand side by an integer4 1. The compiler will then evaluate the
  3281.  results of the right-hand side as an integer4 rather than integer2 and
  3282.  so $mathck+ will not give you an error.
  3283.  
  3284.  The following is an example:
  3285.  
  3286.      {$mathck+}
  3287.      {$line+}
  3288.  
  3289.      program test(output);
  3290.      VAR L4, I4, J4:integer4;
  3291.                   I:integer ;
  3292.      begin
  3293.           I4:= 1000;
  3294.           L4:= I4*I4;
  3295.           J4:= 1;
  3296.           writeln('1000*1000 = ',L4);
  3297.           I:=1000;
  3298.           L4:=J4*I*I;
  3299.           writeln('1000*1000 = ',L4)
  3300.      end.
  3301.  
  3302.  This code produces the following results:
  3303.  
  3304.  1000*1000 =        1000000
  3305.  1000*1000 =        1000000
  3306.  
  3307.  Note: you need to place the J4 at the beginning of the right-hand
  3308.  expression. The statement L4:=I*I*J4; results in the same error. That
  3309.  is because at the evaluation stage, it will evaluate it according to
  3310.  the type of the first (left-most) variable that it finds.
  3311.  
  3312.  
  3313.  82. Decimal Fractions Suffer Binary Round-off
  3314.  
  3315.  Product Version(s): 3.13 3.20 3.3x 4.00
  3316.  Operating System:   MS-DOS
  3317.  Flags: ENDUSER | TAR21448
  3318.  Last Modified: 29-SEP-1988    ArticleIdent: Q11001
  3319.  
  3320.  Problem:
  3321.  
  3322.  The following bankers rounding described in the "Microsoft Pascal
  3323.  User's Guide" on Page 165 does not work correctly:
  3324.  
  3325.  trunc(4.5)   result is 4         correct
  3326.  trunc(207.5) result is 207       should be 208
  3327.  
  3328.  This problem occurs with PASCAL.LIB and ALTMATH.LIB.
  3329.  
  3330.  Response:
  3331.  
  3332.  This is not a bug. Certain rational decimal numbers are not precisely
  3333.  representable in binary. As a result, the representation of a fraction
  3334.  may actually be slightly less than the fraction. Therefore, when the
  3335.  TRUNC function is performed, the result may be unexpected. When real
  3336.  numbers are decoded, the number is rounded to ensure correct results.
  3337.  
  3338.  The following example also illustrates this problem. When you use real
  3339.  numbers, performing a loop that adds 0.1 each time and then uses
  3340.  TRUNC, the results will be off eventually. In this example it becomes
  3341.  inaccurate after five increments of the loop. It becomes inaccurate
  3342.  because it truncates to 4.00 when it should have returned
  3343.  5.00.
  3344.  
  3345.  The following sample code demonstrates the problem:
  3346.  
  3347.      PROGRAM DEGTST(INPUT,OUTPUT);
  3348.      VAR PRTF:TEXT;
  3349.          I,J,DEG,TMP1:REAL;
  3350.      BEGIN
  3351.        ASSIGN(PRTF,'PRN');
  3352.        REWRITE(PRTF);
  3353.          TMP1:=4.5;
  3354.        REPEAT
  3355.          I:=TRUNC(TMP1);
  3356.          DEG:=TMP1 * 100.0;
  3357.          J:=TRUNC(DEG);
  3358.          WRITELN(PRTF,'I',I:3:2,' TMP1 ',TMP1,'DEG',DEG,' J',J:3:2);
  3359.          TMP1:= TMP1 + 0.1;
  3360.        UNTIL TMP1>6.0
  3361.      END.
  3362.  
  3363.  In your particular case, the following program illustrates the
  3364.  problem:
  3365.  
  3366.      PROGRAM TEST(OUTPUT);
  3367.      VAR I1 , I2: INTEGER;
  3368.      BEGIN
  3369.              I1:=TRUNC(4.5);
  3370.              I2:=TRUNC(207.5);
  3371.              WRITELN(I1);
  3372.              WRITELN(I2)
  3373.      END.
  3374.  
  3375.  If you check, the number 207.5 is indeed not precisely representable
  3376.  using binary arithmetic. It is in fact somewhat less than 207.5 in
  3377.  binary arithmetic. Thus, when you truncate it, the number returned will
  3378.  be 207.
  3379.  
  3380.  
  3381.  83. Clarification of Enumerated Type's Size
  3382.  
  3383.  Product Version(s): 3.3x
  3384.  Operating System:   MS-DOS
  3385.  Flags: ENDUSER | TAR21431
  3386.  Last Modified:  4-OCT-1988    ArticleIdent: Q11067
  3387.  
  3388.  Problem:
  3389.  
  3390.  There is an example in the "Microsoft Pascal Compiler Reference
  3391.  Manual" for the RETYPE procedure. If the example is followed exactly,
  3392.  the following warning message is given upon compiling:
  3393.  
  3394.  Warning 248 size not identical.
  3395.  
  3396.  Response:
  3397.  
  3398.  Because the enumerated type in question has only three values (COLOR =
  3399.  (RED, GREEN, BLUE)), values of this type are stored in one byte. This
  3400.  explains why the warning error occurs when the integer constant is
  3401.  RETYPEd as a COLOR. If the enumerated type COLOR had been defined to
  3402.  have more than 255 values, then values of type COLOR would be stored
  3403.  in a word (two bytes) and the warning error would not occur.
  3404.  
  3405.  
  3406.  84. VALUE Is a Reserved Word
  3407.  
  3408.  Product Version(s): 3.13 3.20 3.3x
  3409.  Operating System:   MS-DOS
  3410.  Flags: ENDUSER | TAR52108
  3411.  Last Modified: 30-SEP-1988    ArticleIdent: Q11077
  3412.  
  3413.  Question:
  3414.  
  3415.  What is wrong with the following Pascal program?
  3416.  
  3417.      program pem(input,output,em,errors);
  3418.      type
  3419.        idclass=  (types,konst,qvars,stcnst,field,carrbnd,proc,func);
  3420.        where=    (blck,rec,wrec);
  3421.        nameinfo=record
  3422.          CASE OCCUR:where of
  3423.            REC: (linker: integer);
  3424.          end;
  3425.  
  3426.          identifier=record
  3427.            CASE KLASS:idclass of
  3428.       KONST  : (value  :  integer);
  3429.          end;
  3430.      begin
  3431.      end.
  3432.  
  3433.  Response:
  3434.  
  3435.  The only change necessary is to rename your variable "value" because
  3436.  "value" is a reserved word (see Page 373 of the "Microsoft Pascal
  3437.  Version 3.32 Reference" manual, in Appendix E, "Summary of Microsoft
  3438.  Pascal Reserved Words").
  3439.  
  3440.  The error messages that you receive when you run PAS1 are confusing.
  3441.  Here is a summary of the process used in debugging your program:
  3442.  
  3443.  If you examine the line that causes the error for anomalies, the first
  3444.  thing to check is the syntax of a similar (successful) piece of code.
  3445.  
  3446.  There is an example in the manual of a very similar piece of code. On
  3447.  Page 79 of the Pascal Version 3.32 reference manual, in Section 7.3.1,
  3448.  "Variant Records", the example of the record "FOO" is very similar.
  3449.  After consulting this example, the only obvious difference is that
  3450.  there are no semicolons at the end of the line preceding the end
  3451.  statement. That should not create these errors, however, and indeed
  3452.  changing that does not do anything.
  3453.  
  3454.  Because the format of the line is correct, you have to look for
  3455.  something else. The variable "value" is a possible cause of error
  3456.  because it is a general name that might be used by the compiler for
  3457.  something else. Looking in the appendix concerning Pascal reserved
  3458.  words, you will find VALUE. Changing VALUE to a non-reserved word
  3459.  results in successful compilation.
  3460.  
  3461.  
  3462.  85. GTYUQQ, PTYUQQ Equivalent to BLOCKHEAD, BLOCKWRITE
  3463.  
  3464.  Product Version(s): 3.30 3.31 3.32
  3465.  Operating System:   MS-DOS
  3466.  Flags: ENDUSER | TAR52369 docerr
  3467.  Last Modified: 18-AUG-1988    ArticleIdent: Q11095
  3468.  
  3469.  Question:
  3470.     On Page 368 of the "Microsoft Pascal Compiler Reference Manual"
  3471.  ("Differences between MS-Pascal and UCSD Pascal") it makes reference
  3472.  to two functions, GETUQQ and PUTUQQ, as being equivalent to the UCSD
  3473.  functions BLOCKREAD and BLOCKWRITE. This is the only reference to
  3474.  these functions and there is no description of their use. Are these
  3475.  functions available? Is this a documentation problem?
  3476.  
  3477.  Response:
  3478.     This is a documentation error. The correct functions are GTYUQQ
  3479.  (Page 238 in the Pascal reference manual) and PTYUQQ (Page 249 of the
  3480.  same manual).
  3481.  
  3482.  
  3483.  86. PAGE(file) Incorrectly Sends Extra Line Feed in Version 3.31
  3484.  
  3485.  Product Version(s): 3.3x
  3486.  Operating System:   MS-DOS
  3487.  Flags: ENDUSER | TAR52568 buglist3.31 fixlist3.32
  3488.  Last Modified: 24-FEB-1988    ArticleIdent: Q11122
  3489.  
  3490.  Problem:
  3491.     If PAGE(file) is used with the file assigned to logical devices
  3492.  "prn" or "lpt1", the printer will correctly do a form feed to advance
  3493.  the page.
  3494.     However, an extra line feed also is being sent to the printer,
  3495.  resulting in the printer not being at the top of the form, but at the
  3496.  top of the form plus one line.
  3497.     The main problem is that if the printer is turned off after the
  3498.  program does a form feed, the next time the printer is turned on, the
  3499.  page will be off by one or more lines and the problem will compound
  3500.  each time the printer is turned off and on again.
  3501.  
  3502.  Response:
  3503.     This is a known problem in our Pascal Version 3.31 compiler. This
  3504.  problem was corrected in Version 3.32.
  3505.  
  3506.  
  3507.  87. XENIX Intermediate Code Incompatibility
  3508.  
  3509.  Product Version(s): 3.30
  3510.  Operating System:   XENIX
  3511.  Flags: enduser |
  3512.  Last Modified: 22-FEB-1988    ArticleIdent: Q11140
  3513.  
  3514.  Question:
  3515.     Do Microsoft's compilers use the same intermediate code format as
  3516.  that specified by AT&T? Under System V, AT&T has their own type of
  3517.  Cmerge project where compilers such as the portable C compiler and the
  3518.  portable FORTRAN compiler use the same code generator.
  3519.  
  3520.  Response:
  3521.     No, Microsoft's compilers do not use the same intermediate code
  3522.  format as that specified by AT&T.
  3523.     To create the same intermediate code from one compiler to another,
  3524.  a detailed knowledge of the compiler internals is necessary. This is
  3525.  possible only if you have written the compiler, or if you have the
  3526.  source code and access to someone who built it.
  3527.     In our case, we have intermediate code compatibility within our own
  3528.  products, but not relative to AT&T.
  3529.     Intermediate code compatibility is not possible because our XENIX
  3530.  compilers are similar to our DOS compilers, without the DOS trimmings
  3531.  and instead with some XENIX trimmings. This makes us incompatible with
  3532.  AT&T, because our DOS compilers were built for intermediate code
  3533.  compatibility between MS-DOS PASCAL and FORTRAN (PAS2 is the same for
  3534.  both compilers).
  3535.  
  3536.  
  3537.  88. Table of Limitations of Various Linker Versions
  3538.  
  3539.  Product Version(s): 3.30
  3540.  Operating System:   MS-DOS
  3541.  Flags: enduser |
  3542.  Last Modified: 22-FEB-1988    ArticleIdent: Q11171
  3543.  
  3544.  Question:
  3545.     Apparently, there was a 384K limitation on the Pascal Version 3.2
  3546.  Linker. Is this still valid on Version 3.31? Are there any other
  3547.  limitations that are no longer valid? This applies to all versions of
  3548.  DOS and of the Linker.
  3549.  
  3550.  Response:
  3551.     Please see the application note in the MS-DOS FORTRAN database that
  3552.  deals with this subject. This application note is a table that
  3553.  summarizes the Linker limitations for all versions of the Linker and
  3554.  several versions of FORTRAN, Pascal, MASM, and C.
  3555.  
  3556.  
  3557.  89. Using the Long and Short Heap Together
  3558.  
  3559.  Product Version(s): 3.20
  3560.  Operating System:   MS-DOS
  3561.  Flags: ENDUSER | TAR52789
  3562.  Last Modified: 23-FEB-1988    ArticleIdent: Q11218
  3563.  
  3564.  Question:
  3565.     Is there any reason why the long heap and the short heap cannot be
  3566.  used together? I cannot find any reference to this in our manuals. The
  3567.  Convergent Technology Pascal compiler which is our Pascal only differs
  3568.  in one place when referring to the heap. It says that you cannot mix
  3569.  the two because the short heap requires contiguous memory and using
  3570.  the long heap will fragment memory causing the machine to crash. Is
  3571.  this true? I thought the short heap was constrained to the default
  3572.  data segment and the long heap took you out into the rest of memory.
  3573.  
  3574.  Response:
  3575.     There is no reason why you can't use both the long and short heaps
  3576.  with Microsoft DOS Pascal. The compiler itself uses both of them.
  3577.     The Convergent Technology version of the compiler has a different
  3578.  heap management system, and that is why it gives that warning.
  3579.  
  3580.  
  3581.  90. Determining and Setting the Stack's Size
  3582.  
  3583.  Product Version(s): 3.3x
  3584.  Operating System:   MS-DOS
  3585.  Flags: ENDUSER | TAR52656
  3586.  Last Modified: 22-FEB-1988    ArticleIdent: Q11220
  3587.  
  3588.  Question:
  3589.     How do you determine the optimum stack size for a program, besides
  3590.  using a trial and error method?
  3591.     How can we set the stack size?
  3592.  
  3593.  Response:
  3594.     There is no direct and simple method to determine the needed stack
  3595.  size. To get an estimate, do the following:
  3596.  
  3597.     1. Figure out the sequence of calls to functions made by the
  3598.  program.
  3599.     2. From this, estimate the approximate size of your stack, using
  3600.  the $symtab metacommand.
  3601.     3. Add a fudge factor of 10 percent plus 250 bytes.
  3602.  
  3603.     You may set the size of your program's stack at link time using the
  3604.  /STACK switch. You may also use the /STACK option of the EXEMOD
  3605.  utility. Note that the linker's stack switch accepts a decimal value
  3606.  for the stack size, where the stack size stipulated using EXEMOD is in
  3607.  hexadecimal.
  3608.  
  3609.  
  3610.  91. Stack Sizes for 3.20 to 3.3x
  3611.  
  3612.  Product Version(s): 3.20 3.3x
  3613.  Operating System:   MS-DOS
  3614.  Flags: ENDUSER | TAR52656 docerr
  3615.  Last Modified: 18-AUG-1988    ArticleIdent: Q11221
  3616.  
  3617.  Question:
  3618.     We are using Pascal Version 3.20, and we are trying to upgrade to
  3619.  Pascal Version 3.30. ".EXE" files created using the Pascal Compiler
  3620.  Version 3.30 and linker (Version 3.02), crash when run, due to stack
  3621.  overflow. We are not using any compiler or linker switches, and we are
  3622.  using Pascal.lib and Math.lib.
  3623.     Why does the documentation give conflicting information about using
  3624.  the /STACK switch of the Linker to increase the stack size? Page 66 of
  3625.  the "Microsoft Pascal Compiler User's Guide" warns you not to use the
  3626.  /STACK linker switch, and Page 155 of Appendix A warns you only to use
  3627.  the /STACK linker switch with programs compiled with Pascal
  3628.  Compiler Version 3.30 or later. Which of these two warnings is correct?
  3629.  
  3630.  Response:
  3631.     Page 155 of Appendix A is correct: the linker stack switch should
  3632.  only be used with Pascal Version 3.30 or later. Earlier versions
  3633.  allocated unused stack space for the near heap, causing problems if
  3634.  the /Stack switch was used.
  3635.  
  3636.  
  3637.  92. DGROUP too Large in Pascal
  3638.  
  3639.  Product Version(s): 4.00
  3640.  Operating System:   MS-DOS
  3641.  Flags: ENDUSER | SR# S880909-3
  3642.  Last Modified: 26-SEP-1988    ArticleIdent: Q35482
  3643.  
  3644.  If your DGROUP is running out of space, dynamically allocate some of
  3645.  your variables using ALLMQQ(). Pascal does not allow you to push your
  3646.  stack out of DGROUP. There is no data threshold switch (/Gt in C) for
  3647.  Pascal, so you cannot automatically push the data out of DGROUP like
  3648.  you can in C.
  3649.  
  3650.  
  3651.  93. Direct file I/O Unreliable in DOS or XENIX Pascal 3.30
  3652.  
  3653.  Product Version(s):
  3654.  Operating System:   XENIX
  3655.  Flags: enduser |
  3656.  Last Modified: 24-FEB-1988    ArticleIdent: Q11263
  3657.  
  3658.  PRODUCT: Pascal/3.30
  3659.  Problem:
  3660.  If you open a DIRECT file, write to it, close it, open it again, SEEK to
  3661.  one of the records you had previously written to, and attempt to PUT a new
  3662.  value into that record, then this new value will not be placed there and
  3663.  the directory length of the file is incorrect.
  3664.  Response:
  3665.  This problem exists in both Xenix and DOS Pascal.
  3666.  
  3667.  A work-around for MS-DOS is available on request; user either links with
  3668.  FILF.OBJ or replaces PASCAL.LIB with PASNEW.LIB.
  3669.  
  3670.  Theoretically the fix under DOS 3.X is to open the file under any sharing
  3671.  mode other than sm_compat or sm_denyrw to prevent Pascal from buffering the
  3672.  file, however this may not be practical under MS-NET.
  3673.  
  3674.  The problem does not occur if you do not close the file, i.e. you can open
  3675.  a file, place values in the records and then seek to individual records and
  3676.  write to them a second time to replace the previous value as often as you
  3677.  wish until you first close the file.
  3678.  
  3679.  PROGRAMMING WORK-AROUND:  First SEEK to record 256 and GET it before
  3680.  SEEKing to the record you want to write to.
  3681.  
  3682.  This problem was corrected in DOS Pascal version 3.31.
  3683.  
  3684.  
  3685.  94. Creating .INI Files
  3686.  
  3687.  Product Version(s): 3.31
  3688.  Operating System:   MS-DOS
  3689.  Flags: ENDUSER |
  3690.  Last Modified: 24-FEB-1988    ArticleIdent: Q11412
  3691.  
  3692.  Question:
  3693.     I am very impressed with the file initialization that Windows uses
  3694.  (i.e., the concept of the .INI file). I would like to incorporate this
  3695.  concept into my project (HTLV-III screening) application, so that it
  3696.  will be more consistent with the Microsoft setup. Will Microsoft
  3697.  consider releasing more technical information about the setup?
  3698.  
  3699.  Response:
  3700.     There is no detailed technical information available at this time.
  3701.  However, the basic ideas are straightforward: you set an environment
  3702.  variable that contains the directory name where the .INI file is
  3703.  located. Your program accesses this .INI file to find the
  3704.  user-specified parameters that customize the installation. The .INI
  3705.  file can contain information for more than one product. This is done
  3706.  by using keywords, contained in brackets, e.g. [KEYWORD], followed by
  3707.  the switches and information needed by that program.
  3708.     With respect to specific implementation, here are brief
  3709.  descriptions of some helpers that we have created for internal use to
  3710.  process .INI files (we cannot give you our tools, but it should be
  3711.  fairly simple to create your own):
  3712.  
  3713.     1. A routine that checks the environment variables (this routine
  3714.  can be coded in C; there is a GETENV function that can be used to
  3715.  determine the environment variables) and then searches for the .INI
  3716.  file at the appropriate location.
  3717.     2. A routine that opens the .INI file and searches for the KEYWORD.
  3718.     3. A routine to process the information contained after the
  3719.  keyword. One way to do this is to give the program a pointer to a
  3720.  matrix that contains the fields, possible field values (you need
  3721.  default values), and attributes of those values (e.g. the value must
  3722.  be a character string, or if that value is "20," a certain switch is
  3723.  set).
  3724.  
  3725.  
  3726.  95. Decode Will Not Accept Leading Blanks in Version 3.31
  3727.  
  3728.  Product Version(s): 3.3x
  3729.  Operating System:   MS-DOS
  3730.  Flags: ENDUSER | TAR53149 buglist3.31 fixlist3.32
  3731.  Last Modified: 30-SEP-1988    ArticleIdent: Q11496
  3732.  
  3733.  Question:
  3734.  
  3735.  After converting from Pascal Version 3.30 to Version 3.31, the library
  3736.  function decode behaves differently. In earlier versions, leading
  3737.  blanks were acceptable for decode to work. In Version 3.31, the
  3738.  leading blanks must be removed. The following is an example:
  3739.  
  3740.      var
  3741.         RESULT: lstring(7);
  3742.         TOT   : real;
  3743.  
  3744.  begin
  3745.    RESULT:= '   12.97';   ! Worked before 3.31
  3746.    RESULT:= '12.97';      ! Works with 3.31
  3747.    RESULT:= '12.97   ';   ! Also OK with 3.31
  3748.    eval(decode(result,tot));
  3749.  
  3750.  Will this restriction be corrected? Old applications are no longer
  3751.  compatible.
  3752.  
  3753.  Response:
  3754.  
  3755.  Microsoft has confirmed this to be a problem in Version 3.31. This
  3756.  problem was corrected in Version 3.32.
  3757.  
  3758.  
  3759.  96. Using VAR in a Parameter List
  3760.  
  3761.  Product Version(s): 3.x
  3762.  Operating System:   MS-DOS
  3763.  Flags: ENDUSER | TAR52916
  3764.  Last Modified: 24-MAR-1988    ArticleIdent: Q11494
  3765.  
  3766.  Problem:
  3767.     In the following code (an excerpt from a larger program) the
  3768.  parameter list contains a variable "Table". All other procedures in
  3769.  the program that use Table use the parameter "VAR TABLE:TableArray",
  3770.  but in this example, the PrintTable procedure declares it
  3771.  "TABLE:TableArray".
  3772.     The program hangs because of this error. If you replace the
  3773.  parameter with "VAR TABLE:TableArray" the program works correctly. We
  3774.  think that the compiler should issue an error message in this
  3775.  instance.
  3776.  
  3777.  Response:
  3778.     The behavior of the Microsoft Pascal compiler is correct. In the
  3779.  program you used, the procedure PrintTable contains a parameter list.
  3780.  One of the parameters passed to PrintTable is "TABLE: TableArray;" and
  3781.  your claim is that the program did not use the parameter "VAR
  3782.  TABLE:TableArray".
  3783.     In Pascal, you can pass parameters to procedures by reference
  3784.  (using VAR, or VARS between Modules or Units) or by value (by
  3785.  default). If you use "TABLE:TableArray", you pass the parameter by
  3786.  value, while "VAR TABLE:TableArray" passes it by reference. Both
  3787.  methods are valid. Sometimes you may want to pass an array to a
  3788.  procedure by value, and that is correct Pascal usage. In your program,
  3789.  using the array in such a way hangs your program. But since both
  3790.  instances (passing arrays by reference and passing them by value) are
  3791.  correct Pascal usage, this is not an error on the part of the compiler
  3792.  but rather a logic error that the user is responsible for. The
  3793.  following is a short code excerpt:
  3794.  
  3795.  {---------------------------------------------------------------------------}
  3796.  {Search table for word if found increment count else call InsertWord.       }
  3797.  {---------------------------------------------------------------------------}
  3798.  
  3799.  PROCEDURE SEARCHTABLE (VAR TABLE: TableArray;        {<--Used correctly}
  3800.                     VAR TABLESIZE: integer;
  3801.                              WORD: String ;
  3802.           VAR FIRST, LAST, MIDDLE: integer);
  3803.  
  3804.  var
  3805.       FOUND: boolean; {Check to see if word is found}
  3806.  
  3807.  begin {SearchTable}
  3808.  FIRST:= 1;
  3809.  LAST:= TableSize;
  3810.  FOUND:= false;
  3811.  while (Last >= First) and (not Found) do
  3812.       begin {while}
  3813.       MIDDLE:= (First + Last) div 2;
  3814.       if Word < Table [Middle].Word then
  3815.               LAST:= Middle - 1
  3816.       else
  3817.       if Word > Table [Middle].Word then
  3818.               FIRST:= Middle + 1
  3819.       else
  3820.               begin {else}
  3821.               TABLE [MIDDLE].COUNT:= Table [Middle].Count + 1;
  3822.               FOUND:= true;
  3823.               end; {else}
  3824.       end; {while}
  3825.  if (Last < First) and (not Found) then
  3826.       InsertWord (Table, TableSize, First, Word);
  3827.  end; {SearchTable}
  3828.  
  3829.  {---------------------------------------------------------------------------}
  3830.  {Print the contents of Table to the screen.                                 }
  3831.  {---------------------------------------------------------------------------}
  3832.  
  3833.  PROCEDURE PRINTTABLE (TABLE: TableArray;             {<-- Correct usage but }
  3834.                     WordCount,                         {   incorrect logic  }
  3835.                    SENTCOUNT: integer);
  3836.  
  3837.  var
  3838.       TABLET: integer; {Loop control variable in for loop}
  3839.  
  3840.  begin {PrintTable}
  3841.  writeln;
  3842.  WRITELN ('CONTENTS OF: ',FileName);
  3843.  WRITELN ('TOTAL SENTENCES: ',SentCount:1);
  3844.  WRITELN ('TOTAL UNIQ WORDS: ',TableSize:1);
  3845.  WRITELN ('TOTAL WORDS: ',WordCount:1);
  3846.  writeln;
  3847.  FOR TABLET:= 1 to TableSize do
  3848.       WRITELN (TABLE [TABLET].WORD,TABLE [TABLET].COUNT:1);
  3849.  end; {PrintTable}
  3850.  
  3851.  
  3852.  97. Adding FORTRAN Library Routines to Pascal
  3853.  
  3854.  Product Version(s): 3.3x
  3855.  Operating System:   MS-DOS
  3856.  Flags: ENDUSER | TAR53709
  3857.  Last Modified: 23-FEB-1988    ArticleIdent: Q11503
  3858.  
  3859.  Question:
  3860.     Can developers put FORTRAN Version 3.3x library routines into the
  3861.  Pascal Version 3.3x library?
  3862.  
  3863.  Response:
  3864.     Yes, it is possible to break up the FORTRAN Version 3.3x libraries
  3865.  into object modules that can be used by Pascal (using the LIB
  3866.  utility). This is tricky at best, and we do not support it.
  3867.     We do not guarantee forward compatibility if you do this.
  3868.  
  3869.  
  3870.  98. Problems with the Ads of an Array
  3871.  
  3872.  Product Version(s): 3.31
  3873.  Operating System:   MS-DOS
  3874.  Flags: ENDUSER | buglist3.31 fixlist4.00
  3875.  Last Modified:  4-OCT-1988    ArticleIdent: Q11585
  3876.  
  3877.  Under the following conditions, incrementing the index by one fails:
  3878.  
  3879.  1. A field of a record is an ads of an array.
  3880.  2. Another field is the index to the array.
  3881.  3. The array is allocated on the long heap.
  3882.  4. The record is passed by VARS and the array is referenced.
  3883.  
  3884.  The program adstest2.PAS (below) demonstrates this behavior. The
  3885.  record variable BUFFER is passed to Procedure Increment by VARS. The
  3886.  statement labeled "instruction 1" references the elements of the
  3887.  array. "Instruction 2" increments the array's index (BUFFER.CUR).
  3888.  However, BUFFER.CUR is not being incremented, as can be seen by
  3889.  running the program. "Instruction 3" prints the unincremented index.
  3890.  Microsoft is researching this problem and will post new information as
  3891.  it becomes available.
  3892.  
  3893.  Microsoft has confirmed this to be a problem in Version 3.31. This
  3894.  problem was corrected in Version 4.00.
  3895.  
  3896.  The following notes apply:
  3897.  
  3898.  1. Delete the statement labeled "Instruction 1" and the program
  3899.     works successfully (see adstest3.PAS).
  3900.  
  3901.  2. Use BUFFER as a global variable rather than passing it to
  3902.     Procedure Increment by VARS, and the program works successfully
  3903.     (see adstest1.PAS).
  3904.  
  3905.  3. adstest2.PAS works successfully under Pascal Version 3.20.
  3906.  
  3907.  The following are short example codes:
  3908.  
  3909.  Short Example Code: adstest1.pas
  3910.  
  3911.      program test(input,output);
  3912.      type    ads_table=ads of array[1..32766] of char;
  3913.              buffer_typ=record
  3914.                              TABLE_ADS:ads_table;
  3915.                              CUR:integer;
  3916.                              FINISH:integer;
  3917.                         end;
  3918.  
  3919.      const   size=200;
  3920.  
  3921.      VAR     BUFFER:buffer_typ;
  3922.              CH:char;
  3923.  
  3924.      FUNCTION ALLMQQ(WANTS:word):adsmem;extern;
  3925.  
  3926.      procedure initialize_buffer;
  3927.      begin
  3928.              BUFFER.TABLE_ADS:=allmqq(size);
  3929.              BUFFER.FINISH:=size;
  3930.              BUFFER.CUR:=1;
  3931.      end;
  3932.  
  3933.      procedure increment;
  3934.      begin
  3935.        repeat
  3936.              CH:=buffer.table_ads^[buffer.cur];     {instruction 1}
  3937.              BUFFER.CUR:=buffer.cur + 1;            {instruction 2}
  3938.              WRITELN('BUFFER.CUR = ',BUFFER.CUR:1); {instruction 3}
  3939.        until (buffer.cur > buffer.finish);
  3940.      end;
  3941.  
  3942.      begin {main}
  3943.              initialize_buffer;
  3944.              increment;
  3945.      end.
  3946.  
  3947.  Short Example Code:  adstest2.pas
  3948.  
  3949.      program test(input,output);
  3950.      type    ads_table=ads of array[1..32766] of char;
  3951.              buffer_typ=record
  3952.                              TABLE_ADS:ads_table;
  3953.                              CUR:integer;
  3954.                              FINISH:integer;
  3955.                         end;
  3956.  
  3957.      const   size=200;
  3958.  
  3959.      VAR     BUFFER:buffer_typ;
  3960.              CH:char;
  3961.  
  3962.      FUNCTION ALLMQQ(WANTS:word):adsmem;extern;
  3963.  
  3964.      procedure initialize_buffer;
  3965.      begin
  3966.              BUFFER.TABLE_ADS:=allmqq(size);
  3967.              BUFFER.FINISH:=size;
  3968.              BUFFER.CUR:=1;
  3969.      end;
  3970.  
  3971.      PROCEDURE INCREMENT(VARS BUFFER:buffer_typ);
  3972.      begin
  3973.        repeat
  3974.              CH:=buffer.table_ads^[buffer.cur];     {instruction 1}
  3975.              BUFFER.CUR:=buffer.cur + 1;            {instruction 2}
  3976.              WRITELN('BUFFER.CUR = ',BUFFER.CUR:1); {instruction 3}
  3977.        until (buffer.cur > buffer.finish);
  3978.      end;
  3979.  
  3980.      begin {main}
  3981.              initialize_buffer;
  3982.              increment(buffer);
  3983.      end.
  3984.  
  3985.  Short Example Code: adstest3.pas
  3986.  
  3987.      program test(input,output);
  3988.      type    ads_table=ads of array[1..32766] of char;
  3989.              buffer_typ=record
  3990.                              TABLE_ADS:ads_table;
  3991.                              CUR:integer;
  3992.                              FINISH:integer;
  3993.                         end;
  3994.  
  3995.      const   size=200;
  3996.  
  3997.      VAR     BUFFER:buffer_typ;
  3998.              CH:char;
  3999.  
  4000.      FUNCTION ALLMQQ(WANTS:word):adsmem;extern;
  4001.  
  4002.      procedure initialize_buffer;
  4003.      begin
  4004.              BUFFER.TABLE_ADS:=allmqq(size);
  4005.              BUFFER.FINISH:=size;
  4006.              BUFFER.CUR:=1;
  4007.      end;
  4008.  
  4009.      PROCEDURE INCREMENT(VARS BUFFER:buffer_typ);
  4010.      begin
  4011.        repeat
  4012.              BUFFER.CUR:=buffer.cur + 1;            {instruction 2}
  4013.              WRITELN('BUFFER.CUR = ',BUFFER.CUR:1); {instruction 3}
  4014.        until (buffer.cur > buffer.finish);
  4015.      end;
  4016.  
  4017.      begin {main}
  4018.              initialize_buffer;
  4019.              increment(buffer);
  4020.      end.
  4021.  
  4022.  
  4023.  99. PASIBF.OID and PASIBF.TMP in XENIX Pascal
  4024.  
  4025.  Product Version(s): 3.30 3.31
  4026.  Operating System:   XENIX
  4027.  Flags: ENDUSER |
  4028.  Last Modified:  4-OCT-1988    ArticleIdent: Q11592
  4029.  
  4030.  Problem:
  4031.  
  4032.  When I use the cl driver with the -c option as follows, the files
  4033.  PASIBF.OID and PASIBF.TMP are left in the current working directory:
  4034.  
  4035.  cl -c dummy.c
  4036.  
  4037.  These are the intermediate files from PAS2 to PAS3 so that an object
  4038.  file listing can be made.
  4039.  
  4040.  Although I have not asked for an object files listing, cl still
  4041.  creates them.
  4042.  
  4043.  Response:
  4044.  
  4045.  Microsoft has confirmed this to be a problem in Versions 3.30 and 3.31.
  4046.  
  4047.  To work around this problem, delete your temporary files.
  4048.  
  4049.  
  4050.  100. Run-Time Library Compatibility with FORTRAN
  4051.  
  4052.  Product Version(s): 3.13 3.20 3.3x
  4053.  Operating System:   MS-DOS
  4054.  Flags: ENDUSER | TAR53708
  4055.  Last Modified: 23-FEB-1988    ArticleIdent: Q11501
  4056.  
  4057.  Question:
  4058.     Are the REAL functions from the Microsoft FORTRAN Run-Time Library
  4059.  compatible with the Pascal DECMATH.LIB Library? How about the other
  4060.  Pascal libraries?
  4061.  
  4062.  Response:
  4063.     No, the Pascal DECMATH Library is not compatible with the FORTRAN
  4064.  Run-Time Library. However, the regular Pascal Version 3.3x Run-Time
  4065.  Library is compatible with the FORTRAN 3.3x Run-Time Library.
  4066.  
  4067.  
  4068.  101. Limit on Nesting Units or Include Files
  4069.  
  4070.  Product Version(s): 3.3x
  4071.  Operating System:   MS-DOS
  4072.  Flags: ENDUSER | TAR53861 docerr
  4073.  Last Modified: 23-FEB-1988    ArticleIdent: Q11582
  4074.  
  4075.  Problem:
  4076.     The manual does not say that there is a limit on the number of
  4077.  units or $include files one can nest in Pascal.
  4078.     If you nest units six levels deep, the compiler will give a warning
  4079.  118: too many file levels, followed by error 366: unit identifier
  4080.  expected skip to. From the sample program, if you nest up to five
  4081.  levels the compiler will not give the warning message. It seems that
  4082.  there is a limit on how many levels one can do.
  4083.  
  4084.  Response:
  4085.     There is an undocumented limit of five levels of nesting for units
  4086.  and include files. This documentation omission will be corrected in a
  4087.  future release.
  4088.  
  4089.  
  4090.  102. Extra Line Feeds with WRITE in Version 3.31
  4091.  
  4092.  Product Version(s): 3.31 3.32
  4093.  Operating System:   MS-DOS
  4094.  Flags: ENDUSER | TAR54481 buglist3.31 fixlist3.32
  4095.  Last Modified: 30-SEP-1988    ArticleIdent: Q11679
  4096.  
  4097.  Problem:
  4098.  
  4099.  Pascal Version 3.31 I/O seems to be behaving incorrectly. Line feeds
  4100.  are inserted when they should not be. If I use the following
  4101.  statements a carriage return is executed, but not a line feed:
  4102.  
  4103.      WRITE('ENTER A NUMBER');
  4104.      READLN;
  4105.      READ(F);
  4106.  
  4107.  As a result, the output is (and should be) overwriting the previous
  4108.  output. If the above statements are executed a second time, however, a
  4109.  line feed is inserted in the first write statement.
  4110.  
  4111.  Below is a copy of a program that duplicates the problem. This program
  4112.  works correctly in Version 3.20. However, in Version 3.31, if you
  4113.  execute the following program more than once you will see the line
  4114.  feed being inserted incorrectly with the first write statement:
  4115.  
  4116.      program test2(input,output);
  4117.      var
  4118.       num:integer;
  4119.       rnum:real;
  4120.       letter:char;
  4121.  
  4122.      begin
  4123.        write('enter a number (integer):');
  4124.        read(num);
  4125.        write('enter a real number: ');
  4126.        readln;
  4127.        read(rnum);
  4128.        write('enter a char:');
  4129.        readln;
  4130.        read(letter);
  4131.        writeln('The number is: ',num:3);
  4132.        writeln('the letter is: ',letter);
  4133.        writeln('the real number is:',rnum:5:2);
  4134.      end.
  4135.  
  4136.  Response:
  4137.  
  4138.  Microsoft has confirmed this to be a problem in Version 3.31. This
  4139.  problem was corrected in Version 3.32.
  4140.  
  4141.  
  4142.  103. Pascal Library Function Hdluqq Obtains Integer File Handles
  4143.  
  4144.  Product Version(s): 3.1x 3.20 3.3x 4.00 | 4.00
  4145.  Operating System:   MS-DOS              | OS/2
  4146.  Flags: ENDUSER | docerr
  4147.  Last Modified: 18-AUG-1988    ArticleIdent: Q32085
  4148.  
  4149.     To determine the integer file handle for a file opened in Pascal,
  4150.  you can use the Pascal library function Hdluqq as the following
  4151.  program demonstrates.
  4152.     On Page 386, under "Functions" in the index of the "Microsoft
  4153.  Pascal Compiler Reference" manual (Version 4.00), "HDLUQQ" is listed,
  4154.  but there is no documentation on this function in this manual.
  4155.  However, the "HDLUQQ" function is actually documented in the
  4156.  "Microsoft Pascal Compiler User's Guide" (Versions 3.20 to 4.00) on
  4157.  Page 133, Section 10.5.1.
  4158.  
  4159.     The following program uses the Pascal library function HDLUQQ to
  4160.  obtain the integer files handle of the files opened by the Rewrite or
  4161.  Reset functions. This program will work in both DOS and OS/2, although
  4162.  the respective operating systems do not open the file handle numbers
  4163.  in the same manner.
  4164.     Pascal only uses File Control Block stream files, and has no direct
  4165.  file I/O functions, so accessing the file handle is of little value in
  4166.  Pascal; however, the file handle could be passed to a Microsoft C or
  4167.  Macro Assembler routine.
  4168.  
  4169.  }
  4170.  
  4171.  program GetFileHandleWith_HDLUQQ(input,output);
  4172.      var
  4173.          f1, f2     : text; {File variables; for sequential text files here.}
  4174.          filehandle : integer;
  4175.  
  4176.      {Predeclare the Pascal library function Hdluqq. Hdluqq returns
  4177.       a 2-byte integer file handle for the stream file variable
  4178.       passed by reference to Hdluqq as an argument. Note that stream
  4179.       files use File Control Blocks, hence the name of the parameter
  4180.       below.
  4181.      }
  4182.      function Hdluqq (var FCBvariable : text) : integer; extern;
  4183.  
  4184.  begin
  4185.      {In DOS, the first available file handle should be 5. In OS/2, it
  4186.      ordinarily is file handle 3. Close the file to make the file
  4187.      handle available again.
  4188.      }
  4189.      assign(f1,'file1');
  4190.      rewrite(f1);
  4191.      filehandle := Hdluqq(f1);
  4192.      writeln;
  4193.      writeln('File handle for first  user-opened file = ',filehandle:3);
  4194.      writeln('Close this file and make its file handle available for reuse.');
  4195.      writeln;
  4196.      close(f1);
  4197.  
  4198.      {Open a second file. Note that file is not closed until the program's
  4199.      end.
  4200.      {
  4201.      assign(f2,'file2');
  4202.      rewrite(f2);
  4203.      filehandle := Hdluqq(f2);
  4204.      writeln('File handle for second user-opened file = ',filehandle:3);
  4205.      writeln;
  4206.  
  4207.      {Get the file handle for an existing file opened by reset.}
  4208.      reset(f1);
  4209.      filehandle := Hdluqq(f1);
  4210.      writeln('File handle for reopened first file     = ',filehandle:3);
  4211.      writeln;
  4212.      writeln('Good-bye.');
  4213.      close(f1);
  4214.  
  4215.      close(f2)
  4216.  end.
  4217.  
  4218.  
  4219.  104. Math Errors on 80286 and 80386 with Pascal Versions 3.13, 3.20
  4220.  
  4221.  Product Version(s): 3.13 3.20
  4222.  Operating System:   MS-DOS
  4223.  Flags: ENDUSER | appnote
  4224.  Last Modified:  4-NOV-1988    ArticleIdent: Q32093
  4225.  
  4226.  If you perform floating-point math calculations on 80286 or 80386
  4227.  machines with Pascal Versions 3.13 or 3.20 emulators or 87 math
  4228.  libraries, the computer hangs or returns incorrect answers.
  4229.  
  4230.  The same program that generates correct floating-point results on 8088
  4231.  or 8086 machines, such as the IBM PC/XT, will not work correctly on
  4232.  80286s, such as the IBM PC/AT (IBM AT), or 80386s, such as the Compaq
  4233.  Deskpro 386 or the IBM PS/2 Model 80.
  4234.  
  4235.  This problem occurs because the libraries provided with the Pascal
  4236.  compiler Versions 3.13 and 3.20 do not recognize the absence of an
  4237.  80287 or 80387 math coprocessor when run on 80286 or 80386 processors;
  4238.  these chips were created after Pascal Versions 3.13 and 3.20.
  4239.  
  4240.  For Pascal Version 3.20, but not for Pascal Version 3.13, this problem
  4241.  can be avoided by adding the following SET command to your
  4242.  environment, either by entering it at the operating system prompt or
  4243.  by first running a batch file that contains the SET command as
  4244.  follows:
  4245.  
  4246.     SET NO87=8087 SUPPRESSED
  4247.  
  4248.  For Pascal Versions 3.13 and 3.20, the problem can be corrected with
  4249.  an application note available from Microsoft Product Support Services
  4250.  by calling (206) 454-2030.
  4251.  
  4252.  
  4253.  105. File Access Error In <file>.PAS; Code 1140; Status 110
  4254.  
  4255.  Product Version(s): 4.00   |4.00
  4256.  Operating System:   MS-DOS |OS/2
  4257.  Flags: ENDUSER | MS-DOS OS/2 docerr
  4258.  Last Modified:  2-DEC-1988    ArticleIdent: Q32251
  4259.  
  4260.     When PAS1 or PL of the Pascal Version 4.00 compiler cannot locate a
  4261.  file it is looking for, it issues the following undocumented error
  4262.  message:
  4263.  
  4264.     File Access Error In <filename>.PAS; Code 1140; Status 110
  4265.     Compiler Cannot Continue
  4266.  
  4267.     PAS3 can issue a similar message, as follows:
  4268.  
  4269.     File access error in file pasibf.sgt, error code 1140
  4270.  
  4271.     While not documented, these error message indicate the cause of the
  4272.  problem: a file name was referenced, but the compiler cannot find the
  4273.  file. With the earlier Pascal Version 3.32, the equivalent PAS1 error
  4274.  message was as follows:
  4275.  
  4276.     File access error in file <name>.PAS; Code : 1032; Status : 2
  4277.  
  4278.     With Pascal Version 3.32, the equivalent PAS3 error message was as
  4279.  follows:
  4280.  
  4281.     File access error in file PASIBF.OID, error code 1032
  4282.  
  4283.     The following three types of files being searched for by the
  4284.  compiler may result in the error:
  4285.  
  4286.     1. The source (.PAS) file could not be found by PAS1 or PL, either
  4287.        in the current working directory (by default), or by the path
  4288.        specified. A user typographical error, an incorrectly specified
  4289.        path, or nonexistent file is the typical cause of this error.
  4290.        Under DOS, it could be due to running out of file handles which
  4291.        could be corrected by adding the line "FILES=20" to the
  4292.        CONFIG.SYS file, and rebooting the computer. Interference from
  4293.        terminate but stay resident in memory software (TSR) could also
  4294.        be a problem under DOS.
  4295.     2. An include file indicated by the $include metacommand could not
  4296.        be found, either in the current working directory, with the
  4297.        specified path, or in the directory(s) specified by the compiler
  4298.        option /I<include_file_directory> or the SET INCLUDE=
  4299.        environment variable. Under DOS, it could also be due to running
  4300.        out of file handles as mentioned above.
  4301.     3. A compiler created symbol file was expected, but not found.
  4302.        There are two primary reasons for this:
  4303.        a. You ran PAS3 without first explicitly specifying that you
  4304.           wanted a .COD file in PAS1. PAS3 is looking for the compiler
  4305.           intermediate symbol files PASIBF.OID or PASIBF.SGT.
  4306.        b. Using the /Zi or /Zd compiler switch for CodeView debugging
  4307.           information with PAS1;, /Zi is a PL option and not a PAS1
  4308.           option. (Use the /Z option for CodeView information with
  4309.           PAS1.) If /Zi is incorrectly used with PAS1, the resulting
  4310.           error message is as follows:
  4311.  
  4312.           File Access Error In File i.PAS; Code : 1140; Status : 2
  4313.  
  4314.  
  4315.  106. Compiler Switches Used with PL Versus PAS1
  4316.  
  4317.  Product Version(s): 4.00
  4318.  Operating System:   MS-DOS
  4319.  Flags: ENDUSER | MS-DOS OS/2 docerr
  4320.  Last Modified: 30-SEP-1988    ArticleIdent: Q32252
  4321.  
  4322.  The PL compiler-linker driver uses different compiler switches or
  4323.  options than those used when invoking PAS1 of the compiler separately.
  4324.  
  4325.  The PL driver uses a modified form of the PAS1 compiler switches or
  4326.  options. A PAS1 option consists of a forward slash (/) followed by a
  4327.  single capital letter and the source filename, such as "PAS1 /D
  4328.  myfile.pas". The PL form of the same option is generally "PL /Pd
  4329.  myfile.pas". Note that the PL form of the PAS1 switch is "/P",
  4330.  followed by the PAS1 option letter in lowercase.
  4331.  
  4332.  Several exceptions to this general rule are documented on Pages
  4333.  Update-18 and Update-19 in the "Microsoft Pascal 4.0 Update." Also see
  4334.  Pages Update-20 to Update-27 for additional PL options not available
  4335.  with PAS1.
  4336.  
  4337.  
  4338.  107. Pascal 4.00 README.DOC: Filenames under OS/2
  4339.  
  4340.  Product Version(s): 4.00   | 4.00
  4341.  Operating System:   MS-DOS | OS/2
  4342.  Flags: ENDUSER |
  4343.  Last Modified: 26-SEP-1988    ArticleIdent: Q33268
  4344.  
  4345.  The following information was taken from the Pascal Version 4.00
  4346.  README.DOC file.
  4347.  
  4348.  File Names under OS/2
  4349.  
  4350.  Although DOS ignores any characters beyond the first eight in file and
  4351.  path names, OS/2 does not and instead reports an error. If you are
  4352.  using old batch or make files for OS/2 development, you may need to
  4353.  modify the files so that only eight characters and an extension are
  4354.  used in file and path names.
  4355.  
  4356.  
  4357.  108. PL Driver Uses /Zi Switch; PAS1 Uses /Z
  4358.  
  4359.  Product Version(s): 4.00   | 4.00
  4360.  Operating System:   MS-DOS | OS/2
  4361.  Flags: ENDUSER | MS-DOS OS/2 docerr
  4362.  Last Modified: 18-AUG-1988    ArticleIdent: Q32256
  4363.  
  4364.  Problem:
  4365.     I am trying to compile a Pascal source-code file with the option to
  4366.  allow me to debug my program with CodeView. However, when I issue the
  4367.  following command:
  4368.  
  4369.     PAS1 /Zi myfile.pas;
  4370.  
  4371.  I get the following compiler error message for the file "i.PAS", even
  4372.  though I am not using "i.PAS":
  4373.  
  4374.     File Access Error In i.PAS; Code 1140; Status 110
  4375.     Compiler Cannot Continue
  4376.  
  4377.  Response:
  4378.     The "/Zi" compiler option is intended to be used only with the PL
  4379.  compiler-linker driver. When using PAS1, the equivalent switch is
  4380.  "/Z". The correct syntax would be one of the following:
  4381.  
  4382.           PAS1 /Z  myfile;
  4383.  
  4384.           PL   /Zi myfile.pas
  4385.  
  4386.     These options are documented in Table 2.1 on Page Update-19 of the
  4387.  "Microsoft Pascal 4.0 Update." Please note that the CodeView option
  4388.  under PL is incorrectly documented in the table as "/Z:" (/Z with a
  4389.  colon). The correct PL option for including CodeView information is
  4390.  "/Zi" (/Z followed by the lowercase letter "i").
  4391.  
  4392.  
  4393.  109. Building LIBPASE.LIB Using the Library Manager
  4394.  
  4395.  Product Version(s): 4.00
  4396.  Operating System:   MS-DOS
  4397.  Flags: ENDUSER |
  4398.  Last Modified: 20-OCT-1988    ArticleIdent: Q34925
  4399.  
  4400.  To build the combined emulator math Pascal library LIBPASE.LIB for DOS
  4401.  (which may be named LIBPASER.LIB if using both DOS and OS/2 without
  4402.  specifying the DOS mode library for the default), the component
  4403.  libraries below must be combined using LIB Version 3.11, the Library
  4404.  Manager.
  4405.  
  4406.  The component libraries listed below should be placed in the current
  4407.  working directory. The PATH environment variable should be set so
  4408.  LIB.EXE is in the path. The Library Manager should be run from the
  4409.  directory that contains the component libraries.
  4410.  
  4411.  The syntax is as follows:
  4412.  
  4413.  LIB LIBPASE.LIB
  4414.  
  4415.  Library does not exist.  Create? (y/n) y
  4416.  
  4417.  OPERATIONS: +PARTIAL.LIB +ENTX6L.OBJ +DOS30P.LIB&
  4418.              +IEEEMATH.LIB +EMR.LIB
  4419.  
  4420.  LIST FILE:  <Enter>
  4421.  
  4422.  OUTPUT LIBRARY:  <Enter>
  4423.  
  4424.  At this point, the Library Manager combines the component libraries
  4425.  into the combined library LIBPASE.LIB for DOS.
  4426.  
  4427.  For the combined emulator math library for OS/2 (named LIBPASEP.LIB if
  4428.  the default library naming convention was not requested for OS/2), the
  4429.  commands to LIB are as follows:
  4430.  
  4431.  LIB LIBPASEP.LIB
  4432.  
  4433.  Library does not exist.  Create? (y/n) y
  4434.  
  4435.  OPERATIONS: +PARTIAL.LIB +5ENTX6L.OBJ +DOS50P.LIB&
  4436.              +DOSCALLS.LIB+IEEEMATH.LIB +EM.LIB
  4437.  
  4438.  LIST FILE:  <Enter>
  4439.  
  4440.  OUTPUT LIBRARY:  <Enter>
  4441.  
  4442.  
  4443.  110. Defining Constants with /D and $IFDECL Metacommand
  4444.  
  4445.  Product Version(s): 4.00   | 4.00
  4446.  Operating System:   MS-DOS | OS/2
  4447.  Flags: ENDUSER | MS-DOS OS/2 docerr
  4448.  Last Modified: 29-SEP-1988    ArticleIdent: Q32454
  4449.  
  4450.  Pascal Version 4.00 now provides the /D compiler command-line option
  4451.  for defining constants (but not variables) with values of integer,
  4452.  real, or single quotation-mark delimited strings of up to 76
  4453.  characters.
  4454.  
  4455.  This information is documented in the "Microsoft Pascal 4.0 Update" on
  4456.  Pages Update-21 and Update-22.
  4457.  
  4458.  There is also the new {$ifdecl <constant> $then} and associated
  4459.  {$else} and {$end} metacommands that provide conditional compilation
  4460.  of source code based on whether the <constant> has been previously
  4461.  defined at the command line with the /D option. The documentation for
  4462.  these metacommands is on Pages Update-35 and Update-36. (Constants
  4463.  defined in the CONST section of the source file are not used for the
  4464.  conditional compilation metacommands.)
  4465.  
  4466.  With the /D compiler option, no value needs to be explicitly assigned
  4467.  to the constant to use with {$if <constant> $then}. The default
  4468.  constant value will be the integer 1. Do not include spaces in a
  4469.  /D<constant> or /D<constant>=<value> option string.
  4470.  
  4471.  Remember the dollar sign before "$then" in the {$if <constant> $then}
  4472.  metacommand. Leaving the "$" off of "$then" results in Warning 122
  4473.  Invalid Metacommand Skipped.
  4474.  
  4475.  Note that the value assigned to the constant with /D can be redefined
  4476.  later, such as when compiling an assignment to the same constant in
  4477.  the CONST section of the source file. The /D option defines constants
  4478.  first, then assignments may be made in the CONST section of source
  4479.  code. The last definition of a constant will be the one used for later
  4480.  calculations and output.
  4481.  
  4482.  
  4483.  111. Using Exponentiation Functions Prsrqq and Prdrqq
  4484.  
  4485.  Product Version(s): 4.00
  4486.  Operating System:   MS-DOS
  4487.  Flags: ENDUSER | docerr
  4488.  Last Modified: 26-SEP-1988    ArticleIdent: Q32455
  4489.  
  4490.  The functions prsrqq and prdrqq perform exponentiation on single- or
  4491.  double-precision floating-point numbers respectively.
  4492.  
  4493.  The definitions of these functions are incorrectly documented on
  4494.  Page 249 of the "Microsoft Pascal 4.0 Compiler Reference Manual." The
  4495.  parameters for both functions must be defined as VARS, not as value
  4496.  parameters as documented.
  4497.  
  4498.  The program below demonstrates the use of the Pascal library functions
  4499.  that perform exponentiation for floating-point bases and exponents.
  4500.  
  4501.  Function prsrqq performs exponentiation on real4 values; function
  4502.  prdrqq performs exponentiation on real8 values. The purpose of each
  4503.  function is to raise the first argument "a" to the "b" power, or a**b.
  4504.  
  4505.  Note that both prsrqq and prdrqq must be declared extern, and the
  4506.  parameters must be declared with VARS. The documentation on Page 249
  4507.  of the "Microsoft Pascal 4.0 Compiler Reference Manual" is incorrect
  4508.  in defining the parameters as being passed by value. Defining the
  4509.  parameters as passed by value will result in function return values of
  4510.  0.0, 1.0, or #INF (Infinite).
  4511.  
  4512.  Defining the parameters passed to prsrqq by VAR (not VARS) also
  4513.  results in 0.0. Defining the parameters passed to prdrqq by VAR
  4514.  results in the run-time error "Error: negative REAL to REAL Power"
  4515.  "Error Code 2133"
  4516.  
  4517.  The following program demonstrates the use of the prsrqq and prdrqq
  4518.  functions:
  4519.  
  4520.  program Exponentiation_Functions(input,output);
  4521.  var a4,b4,r4 : real4;  {operands, return value for prsrqq function call}
  4522.      a8,b8,r8 : real8;  {operands, return value for prdrqq function call}
  4523.  
  4524.  function prsrqq (vars a,b: real4): real4; extern; {Single precision a**b}
  4525.  function prdrqq (vars a,b: real8): real8; extern; {Double precision a**b}
  4526.  
  4527.  begin {main}
  4528.      a4 := 2.5;
  4529.      b4 := 3.0;
  4530.      r4 := prsrqq(a4,b4);
  4531.  
  4532.      a8 := 3.1415927;
  4533.      b8 := 2.0;
  4534.      r8 := prdrqq(a8,b8);
  4535.  
  4536.      writeln;
  4537.      writeln('Single precision prsrqq of 2.5       ** 3.0 = ',r4);
  4538.      writeln('Double precision prdrqq of 3.1415927 ** 2.0 = ',r8)
  4539.  end.  {main}
  4540.  
  4541.  
  4542.  112. Substitutes for Unimplemented SHL, SHR Operators
  4543.  
  4544.  Product Version(s): 4.00   | 4.00
  4545.  Operating System:   MS-DOS | OS/2
  4546.  Flags: ENDUSER |
  4547.  Last Modified: 26-SEP-1988    ArticleIdent: Q32456
  4548.  
  4549.  The unsigned left- and right-shift operators Shift Left (SHL) and
  4550.  Shift Right (SHR) have never been implemented in Microsoft Pascal.
  4551.  They are referred to in several areas of the "Microsoft Pascal 4.0
  4552.  Compiler User's Guide" and the "Microsoft Pascal 4.0 Compiler
  4553.  Reference" manual, including Appendix B.3 "Unimplemented Features" on
  4554.  Page 166 of the "Microsoft Pascal 4.0 Compiler User's Guide."
  4555.  
  4556.  The program below demonstrates user-defined procedures that can be
  4557.  used instead of SHL and SHR. Note that the names SHL and SHR are
  4558.  reserved by the compiler, so the procedures used to replace them
  4559.  cannot use the names SHL or SHR.
  4560.  
  4561.  The program below demonstrates simple substitutes for the
  4562.  unimplemented unsigned SHL and SHR operators.
  4563.  
  4564.  No range checking of initial values or the results of calculations is
  4565.  performed.
  4566.  
  4567.  The value being shifted is a 16-bit word. Digits shifted beyond the
  4568.  range of the word are dropped. Zero fill is used.
  4569.  
  4570.  While not implemented, SHL and SHR are compiler reserved words so the
  4571.  substitute procedures have the names "mySHL" and "mySHR".
  4572.  
  4573.  The following is a sample program:
  4574.  
  4575.  program SHL_SHR_Substitutes(input,output);
  4576.  var w   : word;     {word to shift left or right     }
  4577.      n,i : integer;  {shift positions: + left, - right}
  4578.  
  4579.  {Using integer2 math, raise 2 to the Nth power. Return word.}
  4580.  function Int_2toNth(n : integer) : word;
  4581.      var i   : integer;
  4582.          sum : word;
  4583.      begin
  4584.          sum := 1;
  4585.          for i := 1 to n do
  4586.              sum := wrd(sum + sum);
  4587.          Int_2toNth := sum
  4588.      end;
  4589.  
  4590.  {Shift word logical left (unsigned) the equivalent of n binary digits.}
  4591.  procedure mySHL(var w : word; n : integer);
  4592.      begin
  4593.          w := wrd(w * Int_2toNth(n))
  4594.      end;
  4595.  
  4596.  {Shift word logical right (unsigned) the equivalent of n binary digits.}
  4597.  procedure mySHR(var w : word; n : integer);
  4598.      begin
  4599.          w := wrd(w DIV Int_2toNth(abs(n)))
  4600.      end;
  4601.  
  4602.  begin         {begin main}
  4603.      writeln;
  4604.      writeln;
  4605.      writeln('Demonstration of substitutes for SHL and SHR.');
  4606.      writeln;
  4607.      write('Enter word to operate on              : ');
  4608.      readln(w);
  4609.      writeln;
  4610.      write('Enter digits to shift ("-" for right) : ');
  4611.      readln(n);
  4612.      writeln;
  4613.      if n < 0 then
  4614.          mySHR(w,n)
  4615.      else
  4616.          mySHL(w,n);
  4617.      writeln('Result = ',w:5)
  4618.  end.          {end main}
  4619.  
  4620.  
  4621.  113. Incorrect Pascal Compiler Option for CodeView in README.DOC
  4622.  
  4623.  Product Version(s): 4.00
  4624.  Operating System:   MS-DOS
  4625.  Flags: ENDUSER | docerr
  4626.  Last Modified: 18-AUG-1988    ArticleIdent: Q32722
  4627.  
  4628.     The README.DOC file on the Microsoft Pascal Version 4.00 Compiler
  4629.  distribution disk labeled "Setup and Compiler" has the following
  4630.  errors:
  4631.     In the section titled "Microsoft Codeview Debugger," in the
  4632.  subsection "Microsoft Pascal Programs," the sentence for correcting
  4633.  the compiler options is itself incorrect. The option for including
  4634.  CodeView symbolic information when compiling with PAS1 is "/Z", not
  4635.  "/Zz" as stated in the README text, and not "/Zi" as printed in the
  4636.  Microsoft CodeView and Utilities manual. Both /Zi and /Zz are options
  4637.  for the PL compiler-linker driver only.
  4638.  
  4639.  
  4640.  114. Linker Error L4051: "Cannot Find Library"
  4641.  
  4642.  Product Version(s): 4.00   | 4.00
  4643.  Operating System:   MS-DOS | OS/2
  4644.  Flags: ENDUSER |
  4645.  Last Modified: 18-AUG-1988    ArticleIdent: Q32792
  4646.  
  4647.     When linking modules compiled under older versions of the Pascal
  4648.  compiler, it is common to receive the linker error message L4051:
  4649.  "Library not found." This is because the multiple libraries used with
  4650.  Versions 3.32 and prior have been combined into single library for
  4651.  Version 4.00.
  4652.     The old component library names are embedded into the .OBJ files of
  4653.  modules compiled with Pascal Versions 3.32 and prior. To avoid the
  4654.  linker error, use the /NOD option (or /NODEFAULTLIBRARYSEARCH) at link
  4655.  time and specify the libraries to be used as in the following:
  4656.  
  4657.  link /NOD my.obj, my.exe, my.map, libpaser.lib;
  4658.  
  4659.  
  4660.  
  4661.  115. PACKING.LST for Pascal Compiler Version 4.00
  4662.  
  4663.  Product Version(s): 4.00   | 4.00
  4664.  Operating System:   MS-DOS | OS/2
  4665.  Flags: ENDUSER |
  4666.  Last Modified: 20-OCT-1988    ArticleIdent: Q33216
  4667.  
  4668.  The following article was taken from the PACKING.LST file for Pascal
  4669.  Version 4.00.
  4670.  
  4671.  PACKING.LST for Microsoft(R) Pascal Compiler Version 4.0 (C) Copyright
  4672.  1987, 1988 Microsoft Corporation
  4673.  
  4674.  Documentation
  4675.  
  4676.  There are six manuals:
  4677.  
  4678.  Microsoft Pascal Compiler Version 4.0 Update
  4679.  Microsoft Pascal Compiler User's Guide
  4680.  Microsoft Pascal Compiler Reference
  4681.  Microsoft Mixed-Language Programming Guide
  4682.  Microsoft CodeView(R) and Utilities manual
  4683.  Microsoft Editor User's Guide
  4684.  
  4685.  The package also includes a quick reference guide and templates:
  4686.  
  4687.  Microsoft Pascal Compiler Quick Reference Guide
  4688.  Two function-key templates for the Microsoft CodeView debugger
  4689.  
  4690.  Disks
  4691.  
  4692.  The Microsoft Pascal compiler is distributed on nine 5- 1/4" disks or
  4693.  four 3-1/2" disks. The 3-1/2" disks are not included in this package.
  4694.  To obtain 3-1/2" disks, telephone Microsoft Consumer Response at
  4695.  1-800-426-9400 (in Washington and Alaska, call 206-882-8088). Please
  4696.  have your manuals handy when you call. The following two lists
  4697.  describe the layout of the 5-1/4" disks and show how the contents of
  4698.  the 5-1/4" disks are combined to make up the 3-1/2" disks.
  4699.  
  4700.  5-1/4" Disk Layout
  4701.  
  4702.  Disk 1 of 9: Setup and Compiler
  4703.  
  4704.  README        DOC    Information made available after manuals
  4705.                       were printed
  4706.  PACKING       LST    Packing-list file (this file)
  4707.  SETUP         EXE    Pascal SETUP program
  4708.  87            EXE    80x87 Coprocessor presence detector
  4709.  BIND          EXE    Operating System/2 BIND
  4710.  ECH           EXE    Character echoing utility used by Microsoft
  4711.                       Editor
  4712.  EXP           EXE    Expunge utility (used with RM)
  4713.  ERROUT        EXE    STDERR Redirection Utility
  4714.  EXEHDR        EXE    EXE Header Utility
  4715.  EXEMOD        EXE    EXE File Header Utility
  4716.  EXEPACK       EXE    EXE File Compression Utility
  4717.  IMPLIB        EXE    Import Library Manager
  4718.  SETENV        EXE    Environment Expansion Utility
  4719.  
  4720.  (13 files)
  4721.  
  4722.  Disk 2 of 9: Utilities
  4723.  
  4724.  PAS1  EXE    Pascal compiler, Pass 1
  4725.  PAS2  EXE    Pascal compiler, Pass 2
  4726.  PAS3  EXE    Pascal compiler, Pass 3
  4727.  MAKE  EXE    Program Maintenance Utility
  4728.  
  4729.  (4 files)
  4730.  
  4731.  Disk 3 of 9: Examples
  4732.  
  4733.  LINK  EXE    Segmented-Executable Linker
  4734.  PL    EXE    Pascal/Link driver
  4735.  RM    EXE    File removing utility
  4736.  FINK         Unit F/U file definitions
  4737.  FINKXU       Unit F/U file definitions
  4738.  FINU         Unit F/U file definitions
  4739.  CLOCK INT    Time/date definitions
  4740.  INTRP INT    Interrupt definitions
  4741.  PASEXEC  INC Demo include file for demoexec.pas
  4742.  PORT  INT    INPORT OUTPORT definitions
  4743.  BSE   INT    OS/2 API definitions
  4744.  BSEDOS INT   OS/2 API definitions
  4745.  BSEERR INT   OS/2 API definitions
  4746.  BSESUB INT   OS/2 API definitions
  4747.  OS2   INT    OS/2 API definitions
  4748.  OS2DEF INT   OS/2 API definitions
  4749.  DEMOEXEC PAS Pascal demo program
  4750.  PRIMES   PAS Pascal demo program
  4751.  SORTDEMO PAS Pascal sort demo program
  4752.  MAKESORT BAT Pascal sort demo program makefile (DOS)
  4753.  MAKESORT CMD Pascal sort demo program makefile (OS/2)
  4754.  EMOEM ASM    MASM source to modify 87.LIB for
  4755.               non-IBM(R) compatibles
  4756.  ENTX6L ASM   Pascal startup source
  4757.  ENTXSTUB ASM Pascal startup source stub for OS/2
  4758.  
  4759.  (24 Files)
  4760.  
  4761.  Disk 4 of 9: Library 1
  4762.  
  4763.  UNDEL         EXE    File undeletion utility (used with RM)
  4764.  LVARSTCK OBJ  Variable heap support
  4765.  APILMR        OBJ    Binder helper
  4766.  ENTX6L        OBJ    MS-DOS  Pascal startup
  4767.  5ENTX6L  OBJ  MS OS/2 Pascal startup
  4768.  ENTX6W   OBJ  MS-DOS  Pascal startup Windows
  4769.  5ENTX6W  OBJ  MS OS/2 Pascal startup Windows
  4770.  API   LIB     OS/2 API interface
  4771.  DOS30P LIB    DOS helper library used during library build
  4772.  DOS50P LIB    OS/2 helper library used during library build
  4773.  EMR   LIB     Emulator library (DOS)
  4774.  EM    LIB     Emulator library (OS/2)
  4775.  87R   LIB     8087/80287 math library (DOS)
  4776.  87    LIB     8087/80287 math library (OS/2)
  4777.  CEXEC LIB     SPAWN/EXEC support for DOS only
  4778.  DOSCALLS LIB  API definitions
  4779.  PASLIBW  LIB  Windows startup for Pascal (Only for 2.03 SDK)
  4780.  WIN87EM  LIB  Windows Emulator math      (Only for 2.03 SDK)
  4781.  MAKELIB  BAT  Alternate Library build batch file (DOS)
  4782.  
  4783.  (19 Files)
  4784.  
  4785.  Disk 5 of 9: Library 2
  4786.  
  4787.  LIB   EXE    Library manager
  4788.  EXEC  EXE    Utility used only by ILINK
  4789.  ILINK EXE    Incremental linker
  4790.  NULF  OBJ    Runtime file i/o stub
  4791.  NULE6 OBJ    Math stub
  4792.  PARTIAL  LIB Helper library used during library build
  4793.  ALTMATH  LIB Large-model alternate-math library
  4794.  DECMATH  LIB Large-model decimal math library
  4795.  IEEEMATH LIB IEEE math library
  4796.  8087  LIB    8087/80287 math library (model independent)
  4797.  MAKELIB  BAT Alternate Library build batch file (DOS)
  4798.  MAKELIB2 BAT Alternate Library build batch file (DOS) part 2.
  4799.  
  4800.  (12 Files)
  4801.  
  4802.  Disk 6 of 9: Microsoft CodeView(R) for MS-DOS
  4803.  
  4804.  CV    EXE    Microsoft CodeView debugger
  4805.  CV    HLP    Help file for the Microsoft CodeView debugger
  4806.  CVPACK EXE   Debugging information packing utility
  4807.  MOUSE  COM   Mouse driver
  4808.  
  4809.  (4 Files)
  4810.  
  4811.  Disk 7 of 9: Microsoft CodeView(R) for MS OS/2
  4812.  
  4813.  CVP   EXE    Microsoft OS/2 CodeView debugger
  4814.  CVP   HLP    Help file for the Microsoft CodeView debugger
  4815.  
  4816.  (2 Files)
  4817.  
  4818.  Disk 8 of 9: Microsoft Editor
  4819.  
  4820.  CALLTREE EXE Produces book-mark files for C and ASM programs
  4821.  M     EXE    Microsoft Editor (MS-DOS)
  4822.  MEP   EXE    Microsoft Editor (MS OS/2)
  4823.  MEGREP EXE   Pattern finding utility (GREP)
  4824.  BRIEF INI    Brief editor key definitions
  4825.  EPSILON  INI Epsilon editor key definitions
  4826.  QUICK INI    Quick product editor key definitions
  4827.  WS    DLL    WordStar key emulation
  4828.  WS    ZXT    WordStar key emulation
  4829.  EXT   DOC    -
  4830.  EXT   H      -
  4831.  EXTHDR OBJ   - Files used to create user Editor macros
  4832.  EXTHDRP  OBJ -
  4833.  SKEL  C      -
  4834.  SKEL  DEF    -
  4835.  
  4836.  (15 Files)
  4837.  
  4838.  Disk 9 of 9: Startup Source Code
  4839.  
  4840.  DOS       <DIR>
  4841.  OS2       <DIR>
  4842.  PATCH32   <DIR>
  4843.  BRKCTL   INC
  4844.  CHKSTK   ASM
  4845.  CHKSUM   ASM
  4846.  CMACROS  INC
  4847.  CRT0FP   ASM
  4848.  FMSGHDR  ASM
  4849.  MAKEFILE
  4850.  MSDOS    H
  4851.  MSDOS    INC
  4852.  NULBODY  C
  4853.  README   DOC
  4854.  REGISTER
  4855.  SETARGV  ASM
  4856.  STARTUP  BAT
  4857.  VERSION  INC
  4858.  WILD  C
  4859.  
  4860.  (16 Files)
  4861.  
  4862.  \DOS Subdirectory
  4863.  
  4864.  CRT0  ASM
  4865.  CRT0DAT  ASM
  4866.  CRT0MSG  ASM
  4867.  EXECMSG  ASM
  4868.  NMSGHDR  ASM
  4869.  NULBODY  LNK
  4870.  STDALLOC ASM
  4871.  STDARGV  ASM
  4872.  STDENVP  ASM
  4873.  
  4874.  (9 Files)
  4875.  
  4876.  \OS2 Subdirectory
  4877.  
  4878.  CRT0  ASM
  4879.  CRT0DAT  ASM
  4880.  CRT0MSG  ASM
  4881.  EXECMSG  ASM
  4882.  NMSGHDR  ASM
  4883.  NULBODY  LNK
  4884.  STDALLOC ASM
  4885.  STDARGV  ASM
  4886.  STDENVP  ASM
  4887.  
  4888.  (9 Files)
  4889.  
  4890.  \PATCH32 Subdirectory
  4891.  
  4892.  PATCH87  DOC
  4893.  PATCH87  EXE
  4894.  SETRHS   EXE
  4895.  RMRHS    EXE
  4896.  STKPAT   BAT
  4897.  STKPAT   SCR
  4898.  PTRACE87 PAT
  4899.  PATCH320 DOC
  4900.  OS2PATCH EXE
  4901.  OS2PATCH DOC
  4902.  
  4903.  (10 Files)
  4904.  
  4905.  3-1/2" Disk Layout
  4906.  
  4907.  The four 3-1/2" disks combine the 5-1/4" disks as follows:
  4908.  
  4909.  Disk 1:  Setup, Compiler, and Utilities
  4910.  Disk 2:  Examples and Library
  4911.  Disk 3:  Microsoft CodeView(R) for MS-DOS and OS/2
  4912.  Disk 4:  Microsoft Editor and Startup Source Code
  4913.  
  4914.  
  4915.  116. Pascal 4.00 README.DOC: Introduction to README.DOC
  4916.  
  4917.  Product Version(s): 4.00   | 4.00
  4918.  Operating System:   MS-DOS | OS/2
  4919.  Flags: ENDUSER |
  4920.  Last Modified: 26-SEP-1988    ArticleIdent: Q33235
  4921.  
  4922.  The following information was taken from the Pascal Version 4.00
  4923.  README.DOC file.
  4924.  
  4925.  README.DOC (C) Copyright Microsoft(R) Corporation, 1987, 1988
  4926.  
  4927.  This file contains information about Version 4.0 of the Microsoft
  4928.  Pascal compiler, libraries, and utilities. Microsoft updates its
  4929.  documentation when it is reprinted, so you may find that some of the
  4930.  information in this on-line file has already been included in your
  4931.  manuals.
  4932.  
  4933.  NOTE
  4934.  
  4935.  Current information about low-level implementation details can be
  4936.  found in the Microsoft Mixed-Language Programming Guide and the
  4937.  Microsoft CodeView(R) and Utilities manual. These manuals take
  4938.  precedence over sections in older manuals.
  4939.  
  4940.  
  4941.  117. Pascal 4.00 README.DOC: Reporting Compiler
  4942.  
  4943.  Product Version(s): 4.00   | 4.00
  4944.  Operating System:   MS-DOS | OS/2
  4945.  Flags: ENDUSER |
  4946.  Last Modified: 26-SEP-1988    ArticleIdent: Q33236
  4947.  
  4948.  The following information was taken from the Pascal Version 4.00
  4949.  README.DOC file.
  4950.  
  4951.  README.DOC (C) Copyright Microsoft(R) Corporation, 1987, 1988
  4952.  
  4953.  Reporting Compiler Problems
  4954.  
  4955.  When reporting problems with the compiler, please first reduce the
  4956.  program causing the problem to the smallest program that causes the
  4957.  error. Also, please provide Microsoft Corporation with the following
  4958.  information to help in tracking down the problem:
  4959.  
  4960.  The compiler version number (from the logo that appears on the
  4961.  screen when you invoke the compiler using the PL command).
  4962.  
  4963.  The version of DOS you are running (use the DOS VER command).
  4964.  
  4965.  Your system configuration (which machine, total memory, total free
  4966.  memory at compiler execution time).
  4967.  
  4968.  The command line used in the compilation.
  4969.  
  4970.  All object files/libraries used to link, if necessary. You need not
  4971.  provide standard object files/libraries, but please state which ones
  4972.  you are using.
  4973.  
  4974.  Providing this information will help us solve your problem quickly.
  4975.  
  4976.  
  4977.  118. The Correct Syntax for Forward Referencing a Function
  4978.  
  4979.  Product Version(s): 3.3x 4.00 | 4.00
  4980.  Operating System:   MS-DOS    | OS/2
  4981.  Flags: ENDUSER |
  4982.  Last Modified: 18-AUG-1988    ArticleIdent: Q33397
  4983.  
  4984.  Question:
  4985.     What is the correct syntax for forward referencing a function in
  4986.  Pascal? Forward referencing is necessary if you are doing a recursive
  4987.  routine of the following form:
  4988.  
  4989.  subrt A
  4990.      call B        (* Notice B is undefined at this point *)
  4991.  
  4992.  subrt B
  4993.      call A
  4994.  
  4995.  BEGIN (* Main program *)
  4996.      call A
  4997.  END.
  4998.  
  4999.  Response:
  5000.     Below is a sample program that contains the structure described
  5001.  above. Pascal must know about all items before it uses them, which is
  5002.  why it is necessary to use the "forward" keyword.
  5003.     The following is a sample program:
  5004.  
  5005.  program rec (input, output) ;
  5006.  
  5007.  var
  5008.      a: integer ;
  5009.  
  5010.  (* Forward Reference *)
  5011.  function RecurB ( a:integer ):integer ; forward ;
  5012.  
  5013.  (*--------------------------------------------------------*)
  5014.  
  5015.  function RecurA ( a:integer ):integer ;
  5016.  
  5017.  begin
  5018.      if a = 1 then
  5019.          return
  5020.      else
  5021.          RecurA := RecurB ( a ) ;
  5022.  end ;
  5023.  
  5024.  (*--------------------------------------------------------*)
  5025.  
  5026.  (* Note Commented parameter list will avoid a warning     **
  5027.  ** about the forward declaration already being made       *)
  5028.  
  5029.  function RecurB (* ( a:integer ):integer *) ;
  5030.  
  5031.  begin
  5032.      RecurB := RecurA ( a-1 )  ;
  5033.  end ;
  5034.  
  5035.  (*--------------------------------------------------------*)
  5036.  
  5037.  BEGIN (* Main program *)
  5038.      a := RecurA ( 5 ) ;
  5039.      write (' a = ',a ) ;
  5040.  END.
  5041.  
  5042.  
  5043.  119. Pascal 4.00 README.DOC: General Notes
  5044.  
  5045.  Product Version(s): 4.00   | 4.00
  5046.  Operating System:   MS-DOS | OS/2
  5047.  Flags: ENDUSER |
  5048.  Last Modified: 26-SEP-1988    ArticleIdent: Q33238
  5049.  
  5050.  The following information was taken from the Pascal Version 4.00
  5051.  README.DOC file.
  5052.  
  5053.  README.DOC (C) Copyright Microsoft(R) Corporation, 1987, 1988
  5054.  
  5055.  General Notes
  5056.  
  5057.  SETUP
  5058.  
  5059.  Using the SETUP program is optional. You may want to copy the compiler
  5060.  files to your disk and use the MAKELIB program on the Pascal Library 1
  5061.  Disk (rather than SETUP) to create the required libraries.
  5062.  
  5063.  If you set up for dual-mode operation, remember that you must use
  5064.  either the /Lr (real mode) or /Lp (protected mode) switch on the PL
  5065.  command line.
  5066.  
  5067.  You can use the SETUP program to create additional libraries by
  5068.  using the /L option. When you run SETUP with the /L option, SETUP
  5069.  only takes you through the questions required to create a library.
  5070.  
  5071.  
  5072.  120. Pascal 4.00 README.DOC: OS/2 Systems Support
  5073.  
  5074.  Product Version(s): 4.00   | 4.00
  5075.  Operating System:   MS-DOS | OS/2
  5076.  Flags: ENDUSER |
  5077.  Last Modified: 26-SEP-1988    ArticleIdent: Q33239
  5078.  
  5079.  The following information was taken from the Pascal Version 4.00
  5080.  README.DOC file.
  5081.  
  5082.  README.DOC (C) Copyright Microsoft(R) Corporation, 1987, 1988
  5083.  
  5084.  OS/2 Systems Support
  5085.  
  5086.  PASCAL 4.0 now supports OS/2. The compiler runs under both OS/2 and
  5087.  DOS, and applications may be linked to run under either OS/2 or DOS.
  5088.  You may bind an OS/2 program so it runs under either protected-mode
  5089.  OS/2 or real-mode OS/2 and DOS. Chapter 2 of the update tells you how
  5090.  to set up for both operating systems. Creating both protected-mode
  5091.  and bound programs is described in Chapter 3, "OS/2 Systems Support,"
  5092.  of the update.
  5093.  
  5094.  
  5095.  121. Pascal 4.00 README.DOC: Floating-Point Operations
  5096.  
  5097.  Product Version(s): 4.00   | 4.00
  5098.  Operating System:   MS-DOS | OS/2
  5099.  Flags: ENDUSER |
  5100.  Last Modified: 19-AUG-1988    ArticleIdent: Q33269
  5101.  
  5102.     The following information was taken from the Pascal Version 4.00
  5103.  README.DOC file.
  5104.  
  5105.  Floating-Point Operations under MS-DOS 3.2
  5106.     This information is important only if your system has ALL of the
  5107.  following characteristics:
  5108.  
  5109.     1. You use Microsoft DOS (MS-DOS) version 3.20.
  5110.     2. You boot from a hard disk drive.
  5111.     3. Your system has a math coprocessor (for instance, an 8087 chip).
  5112.     4. You run programs that use floating-point math.
  5113.  
  5114.     For systems that satisfy all of the preceding conditions, you may
  5115.  be able to eliminate floating-point math problems by installing a
  5116.  small patch in DOS. If you are not sure whether you need the patch,
  5117.  perform the following steps:
  5118.  
  5119.     1. Copy the program PATCH87.EXE (included on the distribution disks)
  5120.        to the root directory of your hard disk drive.
  5121.     2. Reboot your system from the hard disk and DO NOT PERFORM ANY FLOPPY-
  5122.        DISK OPERATIONS after rebooting. It is very important that you avoid
  5123.        floppy-disk I/O after rebooting, since that will affect the
  5124.        reliability of the diagnostic test that you are about to perform.
  5125.     3. If necessary, use the CD command to move to the root directory
  5126.        of your hard disk drive.
  5127.     4. Run the PATCH87.EXE program by entering this command at the DOS
  5128.        prompt:
  5129.  
  5130.        PATCH87
  5131.  
  5132.     5. The program performs a diagnostic test on your system to determine
  5133.        whether it needs the DOS patch, and, if the patch is needed,
  5134.        whether it can be performed successfully. If the program tells you
  5135.        that you need to install the DOS patch, and that it can be done,
  5136.        follow the procedure described in the next section.
  5137.  
  5138.     NOTE: The floating-point problem has been eliminated in versions
  5139.  of MS-DOS higher than 3.20. This includes MS-DOS versions 3.21 and
  5140.  3.30.
  5141.     If you performed the preceding test and determined that you should
  5142.  install the DOS patch on your system, perform the following steps:
  5143.  
  5144.     1. Format a blank floppy disk. (Do NOT use the /s formatting option to
  5145.        transfer system files to the disk.)
  5146.     2. Use the SYS command to copy IO.SYS and MSDOS.SYS from the root
  5147.        directory of your hard disk to the new floppy disk. For instance,
  5148.        if you boot from drive C:, you would enter the following commands:
  5149.  
  5150.        C:
  5151.        SYS A:
  5152.  
  5153.     3. Use the COPY command to copy COMMAND.COM and SYS.COM to the same
  5154.        floppy disk.
  5155.     4. Use the COPY command to copy the program PATCH87.EXE (included in this
  5156.        release) to the same floppy disk.
  5157.     5. Change the current drive and directory to the floppy disk, by entering
  5158.        the following command:
  5159.  
  5160.        A:
  5161.  
  5162.     7. Install the DOS patch by entering the following command:
  5163.  
  5164.        PATCH87 /F
  5165.  
  5166.      WARNING: If you experience any disk errors during steps 2 through
  5167.  7, do NOT proceed with step 8. Reboot from your hard disk and repeat
  5168.  the entire process.
  5169.     8. If you have not experienced any errors, use the SYS command to
  5170.        transfer the files IO.SYS and MSDOS.SYS from the floppy disk back
  5171.        to your hard disk. For instance, if the boot directory of your system
  5172.        is the root directory of drive C:, you would enter the following
  5173.        command at the DOS prompt:
  5174.  
  5175.        A:
  5176.        SYS C:
  5177.     9. The DOS patch has been installed. Reboot the system.
  5178.  
  5179.  
  5180.  
  5181.  122. Pascal 4.00 README.DOC: Setting Error Level
  5182.  
  5183.  Product Version(s): 4.00   | 4.00
  5184.  Operating System:   MS-DOS | OS/2
  5185.  Flags: ENDUSER |
  5186.  Last Modified: 19-AUG-1988    ArticleIdent: Q33276
  5187.  
  5188.     The following information was taken from the Pascal Version 4.00
  5189.  README.DOC file.
  5190.  
  5191.  README.DOC (C) Copyright Microsoft(R) Corporation, 1987, 1988
  5192.  Setting Error Level
  5193.     The PL driver includes a switch, /w, that sets the error- return
  5194.  threshold at which PL stops execution. For example, the following
  5195.  command line compiles AVERAGES.PAS with an error return threshold of 1
  5196.  (the colon (:) is optional):
  5197.  
  5198.     PL /w:1 AVERAGES.PAS
  5199.  
  5200.     Compiler warning errors are in the range 1-3.  Compiler hard errors
  5201.  are greater than 3.  If the compiler returns an error GREATER than the
  5202.  threshold you specify, PL terminates.  The default level is 3.  That
  5203.  is, PL terminates only for hard errors, not warnings. The previous
  5204.  example causes PL to terminate if there is a warning message.
  5205.  
  5206.  
  5207.  
  5208.  123. Pascal 4.00 README.DOC: INCLUDE
  5209.  
  5210.  Product Version(s): 4.00   | 4.00
  5211.  Operating System:   MS-DOS | OS/2
  5212.  Flags: ENDUSER |
  5213.  Last Modified: 19-AUG-1988    ArticleIdent: Q33277
  5214.  
  5215.     The following information was taken from the Pascal Version 4.00
  5216.  README.DOC file.
  5217.  
  5218.  INCLUDE
  5219.     By default, PL looks for include files in the directory specified
  5220.  by the INCLUDE environment variable. You must set this variable: SETUP
  5221.  does not create a default setting in the NEW-VARS.BAT file.
  5222.  
  5223.  
  5224.  
  5225.  124. Pascal 4.00 README.DOC: Stack Size
  5226.  
  5227.  Product Version(s): 4.00   | 4.00
  5228.  Operating System:   MS-DOS | OS/2
  5229.  Flags: ENDUSER |
  5230.  Last Modified: 19-AUG-1988    ArticleIdent: Q33278
  5231.  
  5232.     The following information was taken from the Pascal Version 4.00
  5233.  README.DOC file.
  5234.  
  5235.  Stack Size
  5236.     Pascal programs compiled for use under OS/2 have 256 fewer bytes
  5237.  allocated to the stack.  The 256 bytes are reserved to provide for
  5238.  OS/2's additional stack use.
  5239.  
  5240.  
  5241.  
  5242.  125. Pascal 4.00 README.DOC: LMULOK
  5243.  
  5244.  Product Version(s): 4.00   | 4.00
  5245.  Operating System:   MS-DOS | OS/2
  5246.  Flags: ENDUSER |
  5247.  Last Modified: 19-AUG-1988    ArticleIdent: Q33279
  5248.  
  5249.    The following information was taken from the Pascal Version 4.00
  5250.  README.DOC file.
  5251.  
  5252.  LMULOK
  5253.     Results calculated when an overflow occurs (LMULOK returns FALSE)
  5254.  may be inaccurate because the calculation halts when the overflow is
  5255.  detected.
  5256.  
  5257.  
  5258.  
  5259.  126. Pascal 4.00 README.DOC: $rom Metacommand
  5260.  
  5261.  Product Version(s): 4.00   | 4.00
  5262.  Operating System:   MS-DOS | OS/2
  5263.  Flags: ENDUSER |
  5264.  Last Modified: 26-SEP-1988    ArticleIdent: Q33280
  5265.  
  5266.     The following information was taken from the Pascal Version 4.00
  5267.  README.DOC file.
  5268.  
  5269.  $rom Metacommand
  5270.     The $rom metacommand generates an error when used with a VALUE
  5271.  section.
  5272.  
  5273.  
  5274.  
  5275.  127. Pascal 4.00 README.DOC: Making OS/2 Function Calls
  5276.  
  5277.  Product Version(s): 4.00   | 4.00
  5278.  Operating System:   MS-DOS | OS/2
  5279.  Flags: ENDUSER |
  5280.  Last Modified: 30-SEP-1988    ArticleIdent: Q33281
  5281.  
  5282.  The following information was taken from the Pascal Version 4.00
  5283.  README.DOC file.
  5284.  
  5285.  Making OS/2 Function Calls
  5286.  
  5287.  Pascal Version 4.0 includes header files containing function,
  5288.  procedure, and data declarations for OS/2 function calls. The
  5289.  demonstration program SORTDEMO.PAS shows a use of the header files and
  5290.  contains numerous examples of OS/2 function calls. The main header
  5291.  file is OS2.INT, which in turn uses several other header files. See
  5292.  the PACKING.LST file for the location of the header files and of the
  5293.  SORTDEMO.PAS program.
  5294.  
  5295.  Your program only needs to include the OS2.INT file: OS2.INT
  5296.  automatically includes the other files.
  5297.  
  5298.  By defining specific constants you can include some or all of the
  5299.  various declarations. These constants are described at the beginning
  5300.  of each header file. For example, the following fragment would include
  5301.  only the KBD and VIO definitions:
  5302.  
  5303.  CONST
  5304.          INCL_KBD = 1;
  5305.          INCL_VIO = 1;
  5306.          INCL_NOCOM = 1;  (* Do not include default
  5307.  declarations. *)
  5308.  
  5309.  (* $include:'os2.int' *)
  5310.  
  5311.  The names in the header files match the names used in the OS/2
  5312.  manuals. See the MS OS/2 1.0 Programmer's Reference for detailed
  5313.  information about each function.
  5314.  
  5315.  Because the Pascal run-time routines are not reentrant, OS/2 functions
  5316.  involving multiple threads or requiring reentrancy cannot be safely
  5317.  called from Pascal without extensive additional programming. (You may
  5318.  write your own reentrant libraries, or you may use semaphores to
  5319.  control library access--these are both advanced techniques which
  5320.  Microsoft does not support.) Definitions for these functions are
  5321.  included for completeness and for the advanced programmer. The OS/2
  5322.  functions that use multiple threads or require reentrancy include the
  5323.  following:
  5324.  
  5325.  DOSCREATETHREAD
  5326.  DOSRESUMETHREAD
  5327.  DOSSUSPENDTHREAD
  5328.  DOSSETSIGHANDLER
  5329.  DOSSETVEC
  5330.  DOSMONOPEN
  5331.  DOSMONCLOSE
  5332.  DOSMONREAD
  5333.  DOSMONWRITE
  5334.  DOSMONREG
  5335.  
  5336.  
  5337.  128. Pascal 4.00 README.DOC: New Error Message
  5338.  
  5339.  Product Version(s): 4.00   | 4.00
  5340.  Operating System:   MS-DOS | OS/2
  5341.  Flags: ENDUSER |
  5342.  Last Modified: 19-AUG-1988    ArticleIdent: Q33282
  5343.  
  5344.     The following information was taken from the Pascal Version 4.00
  5345.  README.DOC file.
  5346.  
  5347.  New Error Message 380 - Stack or var with SS <> DS
  5348.     An attempt is being made to address a stack variable with adr or ^
  5349.  when $windows+ or $stackseg+ is set. These metacommands make SS not
  5350.  equal to DS so short addresses (adr or ^) cannot completely reference
  5351.  stack variable parameters.
  5352.  
  5353.  
  5354.  
  5355.  129. Pascal 4.00 README.DOC: CodeView Using the 7 Command
  5356.  
  5357.  Product Version(s): 4.00   | 4.00
  5358.  Operating System:   MS-DOS | OS/2
  5359.  Flags: ENDUSER |
  5360.  Last Modified: 19-AUG-1988    ArticleIdent: Q33283
  5361.  
  5362.    The following information was taken from the Pascal Version 4.00
  5363.  README.DOC file.
  5364.  
  5365.  Using the 7 Command in Protected Mode
  5366.     If you are using OS/2 protected mode and have a math coprocessor,
  5367.  then you need to use a patch before you can use the CVP 7 command. To
  5368.  apply the patch, use the OS2PATCH.EXE and PTRACE87.PAT files that come
  5369.  on the same disk that CVP.EXE is on. You also need to locate the
  5370.  PATCH.EXE file that comes with OS/2 and make sure that this file is in
  5371.  a directory listed in your PATH environment variable. Then follow
  5372.  these steps:
  5373.  
  5374.     1. Change the current drive and directory to the root directory of
  5375.        the boot disk. (If the boot disk is a floppy, make sure it is
  5376.        inserted in the drive you used to boot from.)
  5377.  
  5378.     2. Give the following command line at the DOS prompt:
  5379.  
  5380.     OS2PATCH /A PTRACE87.PAT
  5381.  
  5382.     Note that you may need to give the complete path names for the
  5383.  OS2PATCH.EXE and for the PTRACE87.PAT file. You do not need to give a
  5384.  path name for the OS2PATCH.EXE file if you have placed this file in a
  5385.  directory listed in your PATH environment variable.
  5386.  
  5387.  
  5388.  
  5389.  130. Pascal 4.00 README.DOC: Note for Window Developers
  5390.  
  5391.  Product Version(s): 4.00
  5392.  Operating System:   MS-DOS
  5393.  Flags: ENDUSER | appnote SP0284
  5394.  Last Modified: 14-DEC-1990    ArticleIdent: Q33284
  5395.  
  5396.  The following information was taken from the Microsoft Pascal version
  5397.  4.00 README.DOC file. To obtain the updated versions of WIN87EM.EXE
  5398.  and WIN87EM.LIB mentioned below, contact Microsoft Product Support
  5399.  Services and ask for the application note (number SP0284) "Updated
  5400.  WIN87EM.* for Pascal Version 4.00". Please specify which disk size you
  5401.  would like, 5.25-inch or 3.5-inch.
  5402.  
  5403.  Excerpt from Pascal 4.00 README.DOC
  5404.  -----------------------------------
  5405.  
  5406.  Note for Windows Developers
  5407.  
  5408.  The STACK segment is no longer defined in object files produced by the
  5409.  Pascal compiler. It has also been removed from all of the run-time
  5410.  modules except ENTX6L.
  5411.  
  5412.  This was done to facilitate user declaration of stack size for
  5413.  Windows.
  5414.  
  5415.  The STACK segment is defined in the module ENTX6L for MS-DOS and
  5416.  5ENTX6L for OS/2.
  5417.  
  5418.  SETUP builds a library containing (5)ENTX6L (non-Windows) or (5)ENTX6W
  5419.  (Windows).
  5420.  
  5421.  Applications linking with the Pascal library containing (5)ENTX6W in
  5422.  place of (5)ENTX6L must specify stack size with the /STACK: link
  5423.  switch or in a .DEF file. (If this is not done, the application will
  5424.  get a zero size stack).
  5425.  
  5426.  If your Windows programs use the emulator library (LIBPASE.LIB), you
  5427.  need to make a modified version of PASLIBW.LIB using updated versions
  5428.  of WIN87EM.EXE and WIN87EM.LIB. Call Microsoft Product Support to get
  5429.  the updated files. To create the modified library, use the LIB utility
  5430.  by typing the following command:
  5431.  
  5432.     lib paslibw-noemstar+win87em.lib,,paslibwe.lib
  5433.  
  5434.  This command creates a library, PASLIBWE.LIB, to use instead of
  5435.  PASLIBW.LIB for applications linking with the emulator library,
  5436.  LIBPASE.LIB.
  5437.  
  5438.  
  5439.  131. Pascal 4.00 README.DOC: Corrections to the Update
  5440.  
  5441.  Product Version(s): 4.00   | 4.00
  5442.  Operating System:   MS-DOS | OS/2
  5443.  Flags: ENDUSER | docerr
  5444.  Last Modified: 26-SEP-1988    ArticleIdent: Q33285
  5445.  
  5446.  The following information was taken from the Pascal Version 4.00
  5447.  README.DOC file.
  5448.  
  5449.  Corrections to the Update
  5450.  
  5451.  p. 8 In Section 1.5.2, \PWORK should be \WORK.
  5452.  
  5453.  p. 9 If you use SETUP to install Pascal in a subdirectory, SETUP
  5454.  places the files mentioned in Section 1.5.3, "Environment Variable and
  5455.  Configuration Files," in the WORK directory under the specified
  5456.  subdirectory.
  5457.  
  5458.  p. 16 The line reading
  5459.  
  5460.  @PROG=PL /Lr AVERAGES.PAS
  5461.  
  5462.  should read
  5463.  
  5464.  PL /Lr AVERAGES.PAS
  5465.  
  5466.  p. 53 The correct name of the LVARSTK.OBJ file mentioned in  6.4.3 is
  5467.  LVARSTCK.OBJ.
  5468.  
  5469.  p. 63 The use of "module" in Section 7.3, "Program Module,"is
  5470.  misleading. Windows development using multiple Pascal source files
  5471.  requires the use of units, not modules. Pascal units generate the
  5472.  implementation and interface code required under Windows; modules do
  5473.  not. See pp. 300-311, "Units," in the Pascal Language Reference Manual
  5474.  for information about Pascal units.
  5475.  
  5476.  
  5477.  132. Pascal 4.00 README.DOC: Notes on CodeView and Utilities
  5478.  
  5479.  Product Version(s): 4.00   | 4.00
  5480.  Operating System:   MS-DOS | OS/2
  5481.  Flags: ENDUSER |
  5482.  Last Modified: 26-SEP-1988    ArticleIdent: Q33286
  5483.  
  5484.  The following information was taken from the Pascal Version 4.00
  5485.  README.DOC file.
  5486.  
  5487.  Notes on CodeView and Utilities
  5488.  
  5489.  The Mouse Driver
  5490.  
  5491.  If you will be using the Microsoft Mouse with the Microsoft CodeView
  5492.  debugger you must have Version 6.0 or later of the Microsoft Mouse. If
  5493.  you do not, use the version of the MOUSE.COM driver provided in this
  5494.  package. Copy MOUSE.COM to the appropriate mouse directory. When you
  5495.  are ready to use the mouse, type
  5496.  
  5497.  mouse
  5498.  
  5499.  at the DOS command level. If you want to install the mouse driver
  5500.  automatically every time you reboot, insert the "mouse" command in
  5501.  your AUTOEXEC.BAT file.
  5502.  
  5503.  Note that in earlier releases of Microsoft C, both the MOUSE.SYS and
  5504.  the MOUSE.COM driver were provided. If you have been using an earlier
  5505.  version of the MOUSE.SYS driver, delete the following line from your
  5506.  CONFIG.SYS file:
  5507.  
  5508.  device=\<directory>\mouse.sys
  5509.  
  5510.  where <directory> is the directory where the earlier mouse driver
  5511.  resides.
  5512.  
  5513.  
  5514.  133. Pascal 4.00 README.DOC: CodeView New Command-Line Option
  5515.  
  5516.  Product Version(s):
  5517.  Operating System:   4.00   | 4.00
  5518.  Flags: MS-DOS | OS/2
  5519.  Last Modified: 26-SEP-1988    ArticleIdent: Q33287
  5520.  ENDUSER |
  5521.  
  5522.  The following information was taken from the Pascal Version 4.00
  5523.  README.DOC file.
  5524.  
  5525.  Microsoft CodeView Debugger New Command-Line Option
  5526.  
  5527.  If you have an IBM Personal System/2, then you can use the /50
  5528.  command-line option to start the CodeView debugger in 50- line mode.
  5529.  
  5530.  Note that you must be in 25-line mode to effectively use either the
  5531.  /43 or /50 command-line option.
  5532.  
  5533.  
  5534.  134. Pascal 4.00 README.DOC: CodeView CONFIG.SYS
  5535.  
  5536.  Product Version(s): 4.00   | 4.00
  5537.  Operating System:   MS-DOS | OS/2
  5538.  Flags: ENDUSER |
  5539.  Last Modified: 18-AUG-1988    ArticleIdent: Q33288
  5540.  
  5541.     The following information was taken from the Pascal Version 4.00
  5542.  README.DOC file.
  5543.  
  5544.  CONFIG.SYS Setting for CVP
  5545.     To run the protected-mode CodeView debugger (CVP.EXE), you must
  5546.  have the following line in your CONFIG.SYS or CONFIG.OS2 file:
  5547.  
  5548.     IOPL=YES
  5549.  
  5550.  
  5551.  
  5552.  135. Pascal 4.00 README.DOC: Using Real-Mode Debugger
  5553.  
  5554.  Product Version(s): 4.00   | 4.00
  5555.  Operating System:   MS-DOS | OS/2
  5556.  Flags: ENDUSER |
  5557.  Last Modified: 18-AUG-1988    ArticleIdent: Q33289
  5558.  
  5559.     The following information was taken from the Pascal Version 4.00
  5560.  README.DOC file.
  5561.  
  5562.  Using the Real-Mode Debugger in the Compatibility Box
  5563.     When running the real-mode CodeView debugger in the DOS 3.x
  5564.  compatibility box, start the debugger with the /S command- line
  5565.  option. Otherwise, the mouse pointer will not appear.
  5566.  
  5567.  
  5568.  136. Pascal 4.00 README.DOC: Using Real-Mode with BIND
  5569.  
  5570.  Product Version(s): 4.00   | 4.00
  5571.  Operating System:   MS-DOS | OS/2
  5572.  Flags: ENDUSER |
  5573.  Last Modified: 22-AUG-1988    ArticleIdent: Q33433
  5574.  
  5575.     The following information was taken from the Pascal Version 4.00
  5576.  README.DOC file.
  5577.  
  5578.  Using the CodeView Debugger with BIND
  5579.     The real-mode CodeView debugger cannot debug bound (dual- mode)
  5580.  applications. However, the protected-mode CodeView debugger, CVP, can
  5581.  debug bound applications.
  5582.  
  5583.  
  5584.  137. Pascal 4.00 README.DOC: Stack Trace Command
  5585.  
  5586.  Product Version(s): 4.00   | 4.00
  5587.  Operating System:   MS-DOS | OS/2
  5588.  Flags: ENDUSER |
  5589.  Last Modified: 22-AUG-1988    ArticleIdent: Q33434
  5590.  
  5591.     The following information was taken from the Pascal Version 4.00
  5592.  README.DOC file.
  5593.  
  5594.  Stack Trace Command
  5595.     In order for the Stack Trace command (or the Calls menu) to work
  5596.  reliably, you need to execute to at least the beginning of the main
  5597.  function or procedure, and the current module should have full
  5598.  CodeView information (a module has full CodeView information if
  5599.  compiled or assembled with /Zi).
  5600.  
  5601.  
  5602.  
  5603.  138. Pascal 4.00 README.DOC: Error Messages in Pascal
  5604.  
  5605.  Product Version(s): 4.00   | 4.00
  5606.  Operating System:   MS-DOS | OS/2
  5607.  Flags: ENDUSER |
  5608.  Last Modified: 22-AUG-1988    ArticleIdent: Q33435
  5609.  
  5610.     The following information was taken from the Pascal Version 4.00
  5611.  README.DOC file.
  5612.  
  5613.  Error Messages
  5614.     The error message "? cannot display" indicates that the Display
  5615.  Expression command (?) has been passed a valid symbol that it cannot
  5616.  display. In previous versions of the debugger, structures and records
  5617.  could not be displayed. With current version of the debugger, only
  5618.  enumerated types cannot be displayed.
  5619.     The error message "Expression not a memory address" occurs when the
  5620.  Tracepoint command is given without a symbol that evaluates to a
  5621.  single memory address. For example, the commands "TP?1" and "TP?a+b"
  5622.  each produce this error message. The proper way to put a tracepoint
  5623.  on the word at address 1 is with the command "TPW 1".
  5624.     The error message "Function call before 'main'" occurs when you
  5625.  attempt to evaluate a program-defined function before you have entered
  5626.  the main function. Execute to at least to the beginning of the main
  5627.  function before attempting to evaluate program-defined functions.
  5628.     The error message "Bad emulator info" occurs when CodeView cannot
  5629.  read data from the floating-point emulator.
  5630.     The error message "Floating point not loaded" has a special meaning
  5631.  for CVP (in addition to the explanation given in the CodeView and
  5632.  Utilities manual). Each thread has its own floating-point emulator.
  5633.  This message is issued when the current thread has not initialized its
  5634.  own emulator.
  5635.  
  5636.  
  5637.  139. Pascal 4.00 README.DOC: Pascal Programs: PAS1 /Zz TEST;
  5638.  
  5639.  Product Version(s): 4.00   | 4.00
  5640.  Operating System:   MS-DOS | OS/2
  5641.  Flags: ENDUSER | docerr
  5642.  Last Modified: 19-AUG-1988    ArticleIdent: Q33436
  5643.  
  5644.     The following information was taken from the Pascal Version 4.00
  5645.  README.DOC file.
  5646.  
  5647.  Microsoft Pascal Programs
  5648.     The Pascal example on pg. 61 of the Microsoft CodeView and
  5649.  Utilities manual should read
  5650.  
  5651.          PAS1 /Zz TEST;
  5652.  
  5653.  rather than
  5654.  
  5655.          PAS1 /Zi TEST;
  5656.  
  5657.  
  5658.  
  5659.  140. Pascal 4.00 README.DOC: Exit Codes for Utilities: LINK
  5660.  
  5661.  Product Version(s): 4.00   | 4.00
  5662.  Operating System:   MS-DOS | OS/2
  5663.  Flags: ENDUSER |
  5664.  Last Modified: 22-AUG-1988    ArticleIdent: Q33437
  5665.  
  5666.     The following information was taken from the Pascal Version 4.00
  5667.  README.DOC file.
  5668.  
  5669.  Exit Codes for Utilities
  5670.     The exit codes for LINK and the utilities in the Microsoft CodeView
  5671.  and Utilities manual should appear as follows:
  5672.  
  5673.  LINK    Code    Meaning
  5674.  
  5675.          0       No error.
  5676.  
  5677.          2       Program error--something was wrong with the commands
  5678.                  or files input to the linker.
  5679.  
  5680.          4       System error. The linker ran out of space on output
  5681.                  files was unable to reopen the temporary file
  5682.                  experienced an internal error was interrupted by the user.
  5683.  
  5684.  
  5685.  
  5686.  141. Pascal 4.00 README.DOC: LIB, EXEPACK, EXEMOD, MAKE, SETENV
  5687.  
  5688.  Product Version(s): 4.00   | 4.00
  5689.  Operating System:   MS-DOS | OS/2
  5690.  Flags: ENDUSER |
  5691.  Last Modified: 22-AUG-1988    ArticleIdent: Q33438
  5692.  
  5693.     The following information was taken from the Pascal Version 4.00
  5694.  README.DOC file.
  5695.  
  5696.  LIB, EXEPACK, EXEMOD, MAKE, and SETENV
  5697.  
  5698.          Code    Meaning
  5699.  
  5700.          0       No error.
  5701.  
  5702.          2       Program error--something was wrong with the
  5703.                  commands or files input to the utility.
  5704.  
  5705.          4       System error.The utility ran out of memory, was
  5706.                  interrupted by the user, or experienced an
  5707.                  internal error.
  5708.  
  5709.  
  5710.  
  5711.  142. Pascal 4.00 README.DOC: New LINK Error Messages
  5712.  
  5713.  Product Version(s): 4.00   | 4.00
  5714.  Operating System:   MS-DOS | OS/2
  5715.  Flags: ENDUSER |
  5716.  Last Modified: 22-AUG-1988    ArticleIdent: Q33440
  5717.  
  5718.     The following information was taken from the Pascal Version 4.00
  5719.  README.DOC file.
  5720.  
  5721.  New LINK Error Messages
  5722.  L1003   /QUICKLIB, /EXEPACK incompatible
  5723.     You cannot link with both the /QU option and the /E option.
  5724.  
  5725.  L1006   <option-text>: stack size exceeds 65535 bytes
  5726.     The value given as a parameter to the /STACKSIZE option
  5727.  exceeds the maximum allowed.
  5728.  
  5729.  L1063   out of memory for CodeView information
  5730.     The linker was given too many object files with debug information,
  5731.  and the linker ran out of space to store it.  Reduce the number of
  5732.  object files that have debug information.
  5733.  
  5734.  L1115   /QUICKLIB, overlays incompatible
  5735.     You specified overlays and used the /QUICKLIB option. These cannot
  5736.  be used together.
  5737.  
  5738.  L2013   LIDATA record too large
  5739.     An LIDATA record contained more than 512 bytes.  This is probably a
  5740.  compiler error.
  5741.  
  5742.  L2024   <name>: special symbol already defined
  5743.     Your program defined a symbol name that is already used by the
  5744.  linker for one of its own low-level symbols.  (For example, the linker
  5745.  generates special symbols used in overlay support and other
  5746.  operations.) Choose another name for the symbol in order to avoid
  5747.  conflict.
  5748.  
  5749.  L2025   <segmentname>: segment with > 1 class name not
  5750.  allowed with /INC
  5751.     Your program defined a segment more than once, giving the segment
  5752.  different class names.  Different class names for the same segment are
  5753.  not allowed when you link with the /INCREMENTAL option. Normally, this
  5754.  error should never appear unless you are programming with MASM. For
  5755.  example, if you give the two MASM statements
  5756.  
  5757.  _BSS segment 'BSS'
  5758.  
  5759.  and
  5760.  
  5761.  _BSS segment 'DATA'
  5762.  
  5763.  then the statements have the effect of declaring two distinct
  5764.  segments. ILINK does not support this situation, so it is disallowed
  5765.  when the /INCREMENTAL option is used.
  5766.  
  5767.  L2041   stack plus data exceed 64K
  5768.     The total of near data and requested stack size exceeds 64K, and
  5769.  the program will not run correctly.  Reduce the stack size. The linker
  5770.  only checks for this condition if /DOSSEG is enabled, which is done
  5771.  automatically in the library startup module.
  5772.  
  5773.  L2043   Quick Library support module missing
  5774.     When creating a Quick library, you did not link with the required
  5775.  QUICKLIB.OBJ module.
  5776.  
  5777.  L2044   <name> : symbol multiply defined, use /NOE
  5778.     The linker found what it interprets as a public-symbol
  5779.  redefinition, probably because you have redefined a symbol that is
  5780.  defined in a library.  Relink with the /NOEXTDICTIONARY (/NOE) option.
  5781.  If error L2025 results for the same symbol, then you have a genuine
  5782.  symbol-redefinition error.
  5783.  
  5784.  L4003   intersegment self-relative fixup at <offset> in
  5785.  segment <name>
  5786.          pos: <offset> Record type: 9C target external '<name>'
  5787.     The linker found an intersegment self-relative fixup. This error
  5788.  may be caused by compiling a small-model program with the /NT option.
  5789.  
  5790.  L4034   more than 239 overlay segments; extra put in root
  5791.     Your program designated more than the limit of 239 segments to go
  5792.  in overlays.  Starting with the 234th segment, they are assigned to
  5793.  the root (that is, the permanently resident portion of the program).
  5794.  
  5795.  
  5796.  
  5797.  143. Pascal 4.00 README.DOC: LIB New Option
  5798.  
  5799.  Product Version(s): 4.00   | 4.00
  5800.  Operating System:   MS-DOS | OS/2
  5801.  Flags: ENDUSER |
  5802.  Last Modified: 19-AUG-1988    ArticleIdent: Q33441
  5803.  
  5804.     The following information was taken from the Pascal Version 4.00
  5805.  README.DOC file.
  5806.  
  5807.  Microsoft Library Manager (LIB)
  5808.  New Option
  5809.     There is a new option for LIB:  /NOIGNORECASE (abbreviated as
  5810.  /NOI). This option tells LIB to not ignore case when comparing
  5811.  symbols. names. By default, LIB ignores case. Multiple symbols that
  5812.  are the same except for case can be put in the same library. An
  5813.  example of this is: "_Open" and "_open". Normally you could notadd
  5814.  both these symbols to the same library.
  5815.     Note that if a library is built with /NOI, the library is
  5816.  internally "marked" to indicate /NOI. All libraries built with
  5817.  earlier versions of LIB are not marked.
  5818.     If you combine multiple libraries, and any one of them is marked
  5819.  /NOI, then /NOI is assumed for the output library.
  5820.     In addition, LIB also supports the option /IGNORECASE (/I), which is
  5821.  completely analogous to /NOIGNORECASE. /I is the default. The only
  5822.  reason to use it would be if you have an existing library marked /NOI
  5823.  that you wanted to combine with other libraries which were not marked,
  5824.  and have the output library be not marked. If you don't use
  5825.  /IGNORECASE, the output is marked /NOI (see above).
  5826.  
  5827.  
  5828.  144. Pascal 4.00 README.DOC: Changed LIB Error Message
  5829.  
  5830.  Product Version(s): 4.00   | 4.00
  5831.  Operating System:   MS-DOS | OS/2
  5832.  Flags: ENDUSER |
  5833.  Last Modified: 19-AUG-1988    ArticleIdent: Q33442
  5834.  
  5835.     The following information was taken from the Pascal Version 4.00
  5836.  README.DOC file.
  5837.  
  5838.  Changed LIB Error Messages
  5839.     Warning messages U4152, U4155, and U4157-U4159 for LIB are now
  5840.  nonfatal error messages U2152, U2155, and U2157-U2159, respectively.
  5841.     Warning message U4151 has been changed to read as follows:
  5842.  
  5843.     U4151   '<name>' : symbol defined in module <name>,
  5844.  redefinition ignored
  5845.  
  5846.  
  5847.  
  5848.  145. Pascal 4.00 README.DOC: MAKE Minus Sign in Description Files
  5849.  
  5850.  Product Version(s): 4.00   | 4.00
  5851.  Operating System:   MS-DOS | OS/2
  5852.  Flags: ENDUSER |
  5853.  Last Modified: 19-AUG-1988    ArticleIdent: Q33443
  5854.  
  5855.     The following information was taken from the Pascal Version 4.00
  5856.  README.DOC file.
  5857.  
  5858.  Microsoft Program Maintenance Utility (MAKE)
  5859.  Minus Sign in Description File
  5860.      The documentation is in error when it says that a minus sign at
  5861.  the beginning of a description block causes errors to be ignored
  5862.  (CodeView and Utilities manual, p. 311).  The minus sign cannot be
  5863.  used.
  5864.  
  5865.  
  5866.  
  5867.  146. Pascal 4.00 README.DOC: MAKE New Error Message
  5868.  
  5869.  Product Version(s): 4.00   | 4.00
  5870.  Operating System:   MS-DOS | OS/2
  5871.  Flags: ENDUSER |
  5872.  Last Modified: 19-AUG-1988    ArticleIdent: Q33444
  5873.  
  5874.     The following information was taken from the Pascal Version 4.00
  5875.  README.DOC file.
  5876.  
  5877.  Inference Rules
  5878.     You cannot have inference rules in both the TOOLS.INI and the
  5879.  description file that use both the same inextension and outextension.
  5880.  For example, you cannot place the following inference rule in the
  5881.  TOOLS.INI file:
  5882.  
  5883.          .c.obj:
  5884.                  cl /c /Zi /Od $*.c
  5885.  
  5886.  while also placing the following line in the description
  5887.  file:
  5888.  
  5889.          .c.obj:
  5890.                  cl /Ot $*.c
  5891.  
  5892.     However, you may define the same macro in both the TOOLS.INI and
  5893.  the description file.  In such cases, the definition in the TOOLS.INI
  5894.  file takes precedence.  You may avoid this problem by copying the
  5895.  TOOLS.INI to the same directory as your make file and modifying the
  5896.  make section.
  5897.  
  5898.  
  5899.  147. Pascal 4.00 README.DOC: MAKE Backslash
  5900.  
  5901.  Product Version(s): 4.00   | 4.00
  5902.  Operating System:   MS-DOS | OS/2
  5903.  Flags: ENDUSER |
  5904.  Last Modified: 19-AUG-1988    ArticleIdent: Q33445
  5905.  
  5906.     The following information was taken from the Pascal Version 4.00
  5907.  README.DOC file.
  5908.  
  5909.  Backslash (\) as Continuation Character
  5910.     Note that MAKE considers a backslash immediately followed by a
  5911.  new-linecharacter to be a continuation character.  When it finds this
  5912.  combinationin a description file, MAKE concatenates the line
  5913.  immediately followingthe combination with the line where the
  5914.  combination appears.If you define a macro that ends in a backslash,
  5915.  make sure that you put aspace after the terminating backslash.For
  5916.  example, if you want to definemacros for the path C:\SRC\BIN and
  5917.  C:\SRC\LIB, you must use the formatillustrated
  5918.  below:BINPATH=C:\SRC\BIN\
  5919.  
  5920.  
  5921.  148. Pascal 4.00 README.DOC: STDERR Redirection Utility
  5922.  
  5923.  Product Version(s): 4.00   | 4.00
  5924.  Operating System:   MS-DOS | OS/2
  5925.  Flags: ENDUSER |
  5926.  Last Modified: 19-AUG-1988    ArticleIdent: Q33446
  5927.  
  5928.     The following information was taken from the Pascal Version 4.00
  5929.  README.DOC file.
  5930.  
  5931.  Microsoft STDERR Redirection Utility (ERROUT)
  5932.     The ERROUT utility does not accept batch files. To redirect
  5933.  standard-error output from a batch file, you must enter a command of
  5934.  the following form:
  5935.  
  5936.          ERROUT COMMAND /c <batchcommand>
  5937.  
  5938.     If no /f option is given, then ERROUT redirects standard- error
  5939.  output to the standard-output device.
  5940.  
  5941.  
  5942.  149. Pascal 4.00 README.DOC: C Naming Conventions
  5943.  
  5944.  Product Version(s): 4.00   | 4.00
  5945.  Operating System:   MS-DOS | OS/2
  5946.  Flags: ENDUSER |
  5947.  Last Modified: 18-AUG-1988    ArticleIdent: Q33494
  5948.  
  5949.     The following information was taken from the Pascal Version 4.00
  5950.  README.DOC file.
  5951.  
  5952.  Mixed-Language Programming C Naming Conventions
  5953.     C recognizes the first 31 characters of a symbolic name.
  5954.  
  5955.  
  5956.  
  5957.  150. Pascal 4.00 README.DOC: Pascal Function Fact
  5958.  
  5959.  Product Version(s): 4.00   | 4.00
  5960.  Operating System:   MS-DOS | OS/2
  5961.  Flags: ENDUSER |
  5962.  Last Modified: 18-AUG-1988    ArticleIdent: Q33495
  5963.  
  5964.     The following information was taken from the Pascal Version 4.00
  5965.  README.DOC file.
  5966.  
  5967.  Pascal Function Fact
  5968.     The following line in the Pascal function Fact on pages 30, 44, and
  5969.  57 in the Mixed-Language Programming Guide is incorrect:
  5970.  
  5971.     Fact := Fact * n;
  5972.  
  5973.     The line should read as follows:
  5974.  
  5975.     Fact := result(Fact) * n;
  5976.  
  5977.  
  5978.  
  5979.  151. Pascal 4.00 README.DOC: Mixed-Language Accessing Parameter
  5980.  
  5981.  Product Version(s): 4.00   | 4.00
  5982.  Operating System:   MMS-DOS | OS/2
  5983.  Flags: ENDUSER |
  5984.  Last Modified: 18-AUG-1988    ArticleIdent: Q33496
  5985.  
  5986.     The following information was taken from the Pascal Version 4.00
  5987.  README.DOC file.
  5988.  
  5989.  Enhanced Error Handling Accessing Parameters on the Stack
  5990.     In Section 6.1.5 of the Microsoft Mixed Languages Programming
  5991.  Guide, the instruction
  5992.  
  5993.     mov     bx, [bp+6]
  5994.  
  5995.  loads the argument into the BX register rather than the BP
  5996.  register.
  5997.  
  5998.  
  5999.  
  6000.  152. Pascal 4.00 PATCH87.DOC: Patching MS-DOS Version 3.20
  6001.  
  6002.  Product Version(s): 4.00   | 4.00
  6003.  Operating System:   MS-DOS | OS/2
  6004.  Flags: ENDUSER |
  6005.  Last Modified: 18-AUG-1988    ArticleIdent: Q33554
  6006.  
  6007.     The following information was taken from the Pascal Version 4.00
  6008.  PATCH87.DOC file.
  6009.  
  6010.  PATCH87.DOC File
  6011.  Notes on patching MS-DOS(R) Version 3.20 (C) Copyright Microsoft
  6012.  Corporation, 1988
  6013.     Version 3.20 of MS-DOS(R) contains a bug that can cause unexpected
  6014.  results in programs that use floating-point math. This file explains
  6015.  how to eliminate that problem by using PATCH87.EXE, a program included
  6016.  in this release.
  6017.     Note that IBM(R) PC-DOS 3.20 contains another, different
  6018.  floating-point bug. The README.DOC file for this release tells you
  6019.  where to find more information about installing a patch for that bug.
  6020.  If you use any version of DOS 3.20 other than IBM PC-DOS 3.20 or
  6021.  MS-DOS 3.20, contact your hardware manufacturer to determine whether
  6022.  the problem exists in your version.
  6023.  
  6024.  Do I Need to Use This Program?
  6025.     You do not need to read any further unless your system has ALL of
  6026.  the following characteristics:
  6027.  
  6028.     1. You use MS-DOS version 3.20.
  6029.     2. You boot from a hard-disk drive.
  6030.     3. Your system has a math coprocessor (for instance,
  6031.        an 8087 chip).
  6032.     4. You run programs that use floating-point math.
  6033.  
  6034.     For systems that satisfy all of the preceding conditions, you may
  6035.  be able to eliminate floating-point math problems by installing a
  6036.  small patch in DOS. If you are not sure whether you need the patch,
  6037.  perform the following steps:
  6038.  
  6039.     1. Copy the program PATCH87.EXE (included in this release) to the
  6040.        root directory of your hard-disk drive.
  6041.     2. Reboot your system from the hard disk and DO NOT PERFORM ANY
  6042.        FLOPPY-DISK OPERATIONS after rebooting. It is very important
  6043.        that you avoid floppy-disk I/O after rebooting, since that will
  6044.        affect the reliability of the diagnostic test that you are about
  6045.        to perform.
  6046.     3. If necessary, use the CD command to move to the root directory
  6047.        of your hard-disk drive.
  6048.     4. Run the PATCH87.EXE program by entering this command at the DOS
  6049.        prompt:
  6050.  
  6051.        PATCH87
  6052.  
  6053.           The program performs a diagnostic test on your system to
  6054.        determine whether it needs the DOS patch, and, if the patch is
  6055.        needed, whether it can be performed successfully.
  6056.  
  6057.     5. Follow the procedure described in the next section if the
  6058.        program tells you that you need to install the DOS patch, and that
  6059.        it can be done.
  6060.  
  6061.        NOTE: The floating-point problem has been eliminated in versions
  6062.        of MS-DOS higher than 3.20. This includes MS-DOS versions 3.21 and
  6063.        3.30.
  6064.  
  6065.  If You Need to Install the Patch
  6066.     If you performed the preceding test and determined that you should
  6067.  install the DOS patch on your system, perform the following steps:
  6068.  
  6069.     1. Format a blank floppy disk. (Do NOT use the /s formatting
  6070.        option to transfer system files to the disk.)
  6071.     2. Use the SYS command to copy IO.SYS and MSDOS.SYS from the root
  6072.        directory of your hard disk to the new floppy disk. For instance,
  6073.        if you boot from drive C:, you would enter the following commands:
  6074.  
  6075.        C:
  6076.        SYS A:
  6077.  
  6078.     3. Use the COPY command to copy COMMAND.COM and SYS.COM to the same
  6079.        floppy disk.
  6080.     4. Use the COPY command to copy the program PATCH87.EXE (included
  6081.        in this release) to the same floppy disk.
  6082.     5. Change the current drive and directory to the floppy disk, by
  6083.        entering the following command:
  6084.  
  6085.        A:
  6086.  
  6087.     7. Install the DOS patch by entering the following
  6088.        command:
  6089.  
  6090.        PATCH87 /F
  6091.  
  6092.           WARNING: If you experience any disk errors during steps 2
  6093.        through 7, do NOT proceed with step 8. Reboot from your hard
  6094.        disk and repeat the entire process.
  6095.  
  6096.     8. If you have not experienced any errors, use the SYS command to
  6097.        transfer the files IO.SYS and MSDOS.SYS from the floppy disk back
  6098.        to your hard disk. For instance, if the boot directory of your
  6099.        system is the root directory of drive C:, you would enter the
  6100.        following command at the DOS prompt:
  6101.  
  6102.        A:
  6103.        SYS C:
  6104.  
  6105.        This installs the DOS patch.
  6106.     9. Reboot the system.
  6107.  
  6108.  
  6109.  153. Pascal 4.00 README.DOC: Mixed-Language BASIC
  6110.  
  6111.  Product Version(s): 4.00   | 4.00
  6112.  Operating System:   MS-DOS | OS/2
  6113.  Flags: ENDUSER |
  6114.  Last Modified: 18-AUG-1988    ArticleIdent: Q33498
  6115.  
  6116.     The following information was taken from the Pascal Version 4.00
  6117.  README.DOC file.
  6118.  
  6119.  BASIC Return Values
  6120.     BASIC functions use the FORTRAN/Pascal conventions, rather than the
  6121.  C conventions, for receiving return values.
  6122.  
  6123.  
  6124.  
  6125.  154. Pascal 4.00 README.DOC: Passing C Strings to BASIC
  6126.  
  6127.  Product Version(s): 4.00   | 4.00
  6128.  Operating System:   MS-DOS | OS/2
  6129.  Flags: ENDUSER |
  6130.  Last Modified: 18-AUG-1988    ArticleIdent: Q33499
  6131.  
  6132.     The following information was taken from the Pascal Version 4.00
  6133.  README.DOC file.
  6134.  
  6135.  Passing C Strings to BASIC
  6136.     In Section 8.4.3 of the Microsoft Mixed Languages Programming
  6137.  Guide, in the example illustrating how C passes string arguments to
  6138.  BASIC functions, the sd_len field should be declared as shown below:
  6139.  
  6140.     int sd_len
  6141.  
  6142.  
  6143.  
  6144.  155. Pascal 4.00 README.DOC: Mixed-Language BASIC Array
  6145.  
  6146.  Product Version(s): 4.00   | 4.00
  6147.  Operating System:   MS-DOS | OS/2
  6148.  Flags: ENDUSER |
  6149.  Last Modified: 18-AUG-1988    ArticleIdent: Q33500
  6150.  
  6151.     The following information was taken from the Pascal Version 4.00
  6152.  README.DOC file.
  6153.  
  6154.  BASIC Array Declarations
  6155.     The sample BASIC array declaration in Table 9.1 of the Microsoft
  6156.  Mixed Language Guide should read
  6157.  
  6158.     DIM x(c-1, r-1)
  6159.  
  6160.  
  6161.  
  6162.  156. Pascal 4.00 README.DOC: Linking Mixed-Language Programs
  6163.  
  6164.  Product Version(s): 4.00   | 4.00
  6165.  Operating System:   MS-DOS | OS/2
  6166.  Flags: ENDUSER |
  6167.  Last Modified: 26-SEP-1988    ArticleIdent: Q33501
  6168.  
  6169.  The following information was taken from the Pascal Version 4.00
  6170.  README.DOC file.
  6171.  
  6172.  Linking Mixed-Language Programs
  6173.  
  6174.  This section explains how to link Microsoft C modules with modules
  6175.  created by other Microsoft languages. The discussions assume that you
  6176.  are linking with the Microsoft Segmented-Executable Linker, LINK.
  6177.  (This is the version of LINK provided with Version 5.10 of the
  6178.  Microsoft C Optimizing Compiler and this version of Pascal.)
  6179.  
  6180.  To link object modules created using the Microsoft C Optimizing
  6181.  Compiler, Version 5.10, with those created using the Microsoft FORTRAN
  6182.  Optimizing Compiler Version 4.00 or 4.01, you must create a special
  6183.  version of each of the FORTRAN libraries you intend to use. Create one
  6184.  FORTRAN library to correspond to each C library you are using; that
  6185.  is, create a FORTRAN library that supports the same
  6186.  memory-model/math-option combination as the corresponding C library.
  6187.  Be sure that you choose the "C compatibility" option when you build
  6188.  each FORTRAN library.
  6189.  
  6190.  Next, use the SETUP program provided with Microsoft C, Version 5.10,
  6191.  to create all the combined C 5.10 libraries that you will need. SETUP
  6192.  creates a subdirectory named \MIXLANG under the C 5.10 base directory.
  6193.  
  6194.  Place the FORTRAN libraries you have created in this directory. Then
  6195.  make the \MIXLANG directory the current directory and run F4COMPAT,
  6196.  which brings the FORTRAN libraries up to date and makes them
  6197.  compatible with C 5.10. F4COMPAT takes two arguments: one specifying
  6198.  the memory model and one specifying the floating-point-math package
  6199.  that the library supports. For example,
  6200.  
  6201.  F4COMPAT L 7
  6202.  
  6203.  makes a C 5.10-compatible version of LLIBFOR7.LIB. Once the libraries
  6204.  are built, use the following LINK command line to link the appropriate
  6205.  C library with the FORTRAN library that you converted in the previous
  6206.  example:
  6207.  
  6208.  LINK /NOE objs,,,LLIBC7.LIB LLIBFOR7.LIB;
  6209.  
  6210.  The LINK command lines for other memory models and floating-point math
  6211.  packages are similar. Note that the C library must be given first on
  6212.  the command line. Specify the \MIXLANG subdirectory either in the LIB
  6213.  environment variable or on the LINK command line so that the linker
  6214.  can find the FORTRAN library. Use only large- and medium-model
  6215.  libraries. Huge-model programs use large-model libraries.
  6216.  
  6217.  To link other combinations of language libraries, the BASIC libraries
  6218.  (either BCOM40 or BRUN40) should be listed first on the LINK command
  6219.  line, since the main program must be written in BASIC. Other wise, the
  6220.  C 5.1 library should be listed first. (Or, if you are using C 4.0 with
  6221.  FORTRAN 4.0 or later, the FORTRAN library should be listed first.) For
  6222.  best results, using large-memory-model C is suggested.
  6223.  
  6224.  
  6225.  157. Pascal 4.00 README.DOC: BIND Utility Specifying Libraries
  6226.  
  6227.  Product Version(s): 4.00   | 4.00
  6228.  Operating System:   MS-DOS | OS/2
  6229.  Flags: ENDUSER |
  6230.  Last Modified: 26-SEP-1988    ArticleIdent: Q33502
  6231.  
  6232.  The following information was taken from the Pascal Version 4.00
  6233.  README.DOC file.
  6234.  
  6235.  The BIND Utility
  6236.  
  6237.  Specifying Libraries
  6238.  
  6239.  You need to include DOSCALLS.LIB on the BIND command line. If
  6240.  DOSCALLS.LIB is not in the current directory, you must give the
  6241.  complete path name to DOSCALLS.LIB.
  6242.  
  6243.  BIND automatically searches for API.LIB by looking in directories
  6244.  listed in the LIB environment variable. However, if API.LIB is
  6245.  specified on the command line, then BIND does not check the LIB
  6246.  environment variable; instead, you need to give the complete path
  6247.  name.
  6248.  
  6249.  For example, the following command line successfully uses BIND, if
  6250.  API.LIB is located in a directory listed in the LIB environment
  6251.  variable:
  6252.  
  6253.  BIND MYPROG.EXE \LIB\DOSCALLS.LIB
  6254.  
  6255.  
  6256.  158. Pascal 4.00 README.DOC: Using BIND with Packed Files
  6257.  
  6258.  Product Version(s): 4.00   | 4.00
  6259.  Operating System:   MS-DOS | OS/2
  6260.  Flags: ENDUSER |
  6261.  Last Modified: 18-AUG-1988    ArticleIdent: Q33503
  6262.  
  6263.     The following information was taken from the Pascal Version 4.00
  6264.  README.DOC file.
  6265.  
  6266.  Using BIND with Packed Files
  6267.     The version of BIND released with this package does not work with
  6268.  files that have been linked with the /EXEPACK linker option.
  6269.  
  6270.  
  6271.  
  6272.  159. Pascal 4.00 README.DOC: Running Bound Files with DOS 2.1
  6273.  
  6274.  Product Version(s): 4.00   | 4.00
  6275.  Operating System:   MS-DOS | OS/2
  6276.  Flags: ENDUSER |
  6277.  Last Modified: 26-SEP-1988    ArticleIdent: Q33504
  6278.  
  6279.  The following information was taken from the Pascal Version 4.00
  6280.  README.DOC file.
  6281.  
  6282.  Running Bound Files with DOS 2.1
  6283.  
  6284.  A dual-mode executable file produced with BIND can be run in both DOS
  6285.  3.x and DOS 2.x environments. However, if you change the name of an
  6286.  executable file produced by BIND, then it will not run under DOS 2.1.
  6287.  
  6288.  
  6289.  160. Pascal 4.00 README.DOC: Mix-Language Linking with MASM Files
  6290.  
  6291.  Product Version(s): 4.00   | 4.00
  6292.  Operating System:   MS-DOS | OS/2
  6293.  Flags: ENDUSER |
  6294.  Last Modified: 18-AUG-1988    ArticleIdent: Q33505
  6295.  
  6296.     The following information was taken from the Pascal Version 4.00
  6297.  README.DOC file.
  6298.  
  6299.  Linking with MASM Files
  6300.     If you are linking C modules with modules created by the Microsoft
  6301.  Macro Assembler, either assemble the MASM modules with the /MX option
  6302.  to preserve case sensitivity in these modules; or, use the LINK
  6303.  command to link in a separate step, and do NOT specify the /NOI linker
  6304.  option.
  6305.  
  6306.  
  6307.  161. Pascal 4.00 README.DOC: Editor and Linking
  6308.  
  6309.  Product Version(s): 4.00   | 4.00
  6310.  Operating System:   MS-DOS | OS/2
  6311.  Flags: ENDUSER |
  6312.  Last Modified: 18-AUG-1988    ArticleIdent: Q33534
  6313.  
  6314.     The following information was taken from the Pascal Version 4.00
  6315.  README.DOC file.
  6316.  
  6317.  Linking Extensions in Protected Mode
  6318.     To link C extension modules in protected mode, link with the object
  6319.  file EXTHDRP.OBJ, instead of the real-mode header EXTHDR.OBJ.
  6320.  
  6321.  
  6322.  162. Pascal 4.00 README.DOC: Incremental Linker Fatal
  6323.  
  6324.  Product Version(s): 4.00   | 4.00
  6325.  Operating System:   MS-DOS | OS/2
  6326.  Flags: ENDUSER |
  6327.  Last Modified: 18-AUG-1988    ArticleIdent: Q33535
  6328.  
  6329.     The following information was taken from the Pascal Version 4.00
  6330.  README.DOC file.
  6331.  
  6332.  The Microsoft Incremental Linker (ILINK)
  6333.     ILINK Fatal Error Messages
  6334.  
  6335.     .sym seek error
  6336.     .sym read error
  6337.  
  6338.     The .SYM file is corrupted. Do a full link. If the error
  6339.  persists, contact Microsoft.
  6340.  
  6341.     .sym write error
  6342.  
  6343.     The disk is full or the .SYM file already exists with the READONLY
  6344.  attribute.
  6345.  
  6346.     map for segment <name> exceeds 64K
  6347.  
  6348.     The symbolic information associated with the given segment exceeds
  6349.  64K bytes, which is more than ILINK can handle.
  6350.  
  6351.     can't ilink library <name>
  6352.  
  6353.     You tried to incrementally link an altered library. ILINK does not
  6354.  link .LIB files but only .OBJ files. Use a full link instead.
  6355.  
  6356.     .obj close error
  6357.  
  6358.     The operating system returned an error when ILINK attempted to
  6359.  close one of the .OBJ files. Do a full link. If the error persists,
  6360.  contact Microsoft.
  6361.  
  6362.     too many LNAMES in <modname>
  6363.  
  6364.     An object module has more than 255 LNAME records.
  6365.  
  6366.     too many SEGDEFs in <modname>
  6367.  
  6368.     The given object module has more than 100 SEGDEF records.
  6369.  
  6370.     too many GRPDEFs in <modname>
  6371.  
  6372.     The given object module has more than 10 GRPDEF records.
  6373.  
  6374.     symbol <name> multiply defined
  6375.  
  6376.     The given symbol is defined more than once.
  6377.  
  6378.     #3
  6379.  
  6380.     Please report this error to Microsoft.
  6381.  
  6382.     Out of Memory
  6383.  
  6384.     ILINK ran out of memory for processing the input. If you are
  6385.  running ILINK under MAKE, try running it from the shell. Otherwise, do
  6386.  a full link.
  6387.  
  6388.     could not run exec
  6389.  
  6390.     ILINK was unable to find the file EXEC.EXE, which should be placed
  6391.  somewhere in the search path or in the current directory.
  6392.  
  6393.     .exe file too big, change alignment
  6394.  
  6395.     The segment sector alignment value in the .EXE file is too small to
  6396.  express the size of one of the segments.  Do a full link and increase
  6397.  the alignment value with the /ALIGNMENT option to LINK.
  6398.  
  6399.     .ilk seek error
  6400.  
  6401.     The .ILK file is corrupted. Do a full link. If the error
  6402.  persists, contact Microsoft.
  6403.  
  6404.     Too many defined segments
  6405.  
  6406.     ILINK has a limit of 255 defined segments, which are segments
  6407.  defined in an object module as opposed to an executable segment.
  6408.  Reduce the number of segments if you want to use ILINK.
  6409.  
  6410.     too many library files
  6411.  
  6412.     ILINK has a limit of 32 runtime libraries (.LIB files). Reduce the
  6413.  number of libraries.
  6414.  
  6415.     too many modules
  6416.  
  6417.     ILINK has a limit of 1204 modules in a program. Reduce the number
  6418.  of modules.
  6419.  
  6420.     .ilk write error
  6421.  
  6422.     The disk is full, or else ILINK cannot write to the .SYM file
  6423.  because a .SYM file currently exists and has the READONLY attribute.
  6424.  
  6425.     file <name> does not exist
  6426.  
  6427.     ILINK was unable to open the given file. The file named was in the
  6428.  file list in the .ILK file.
  6429.  
  6430.     seek error on library
  6431.  
  6432.     A .LIB file was corrupted. Do a full link and check your .LIB
  6433.  files.
  6434.  
  6435.     library close error
  6436.  
  6437.     The operating system returned an error when ILINK attempted to
  6438.  close one of the .LIB files. Do a full link. If the error persists,
  6439.  contact Microsoft.
  6440.  
  6441.     error closing EXE file
  6442.  
  6443.     The operating system returned an error when ILINK attempted to
  6444.  close the .EXE file. Do a full link. If the error persists, contact
  6445.  Microsoft.
  6446.  
  6447.     Invalid module reference <module>
  6448.  
  6449.     The program makes a dynamic link reference to a dynamic link
  6450.  module which is not represented in the .EXE file.
  6451.  
  6452.     could not update time on <filename>
  6453.  
  6454.     The operating system returned an error when ILINK attempted to
  6455.  update the time on the given file.  Possibly the file had the READONLY
  6456.  attribute set.
  6457.  
  6458.     invalid flag <flag> only one -e command allowed
  6459.  
  6460.     The ILINK command syntax is incorrect.
  6461.  
  6462.     User Abort
  6463.  
  6464.     The user issued CTRL+C or CTRL+BREAK.
  6465.  
  6466.     file <name> write protected
  6467.  
  6468.     The .EXE, .ILK, or .SYM file needed to be updated and has the
  6469.  READONLY attribute. Change attribute to READWRITE.
  6470.  
  6471.     file <name> missing
  6472.  
  6473.     One of the .OBJ files specified on the command line is missing.
  6474.  
  6475.     file <name> invalid .OBJ format
  6476.     file <name> has invalid <recordtype> record
  6477.  
  6478.     The given .OBJ file has an invalid format or one that is not
  6479.  recognized by ILINK.  This may have been caused by a compiler or
  6480.  assembler.
  6481.  
  6482.     file <module> was not full linked
  6483.  
  6484.     An .OBJ file was specified as input to ILINK, which was not in the
  6485.  list of files in the original full link.
  6486.  
  6487.     LOBYTE seg-relative fixups not supported
  6488.  
  6489.     This error message should occur only with MASM files. See the
  6490.  Microsoft Macro Assembler 5.0 Programmer's Guide. This type of object
  6491.  module is not supported by ILINK.
  6492.  
  6493.     <number> undefined symbols
  6494.  
  6495.     The given number of symbols were referred to in fixups but never
  6496.  publicly defined in the program.
  6497.  
  6498.  
  6499.  
  6500.  163. Pascal 4.00 README.DOC: Incremental Linker
  6501.  
  6502.  Product Version(s): 4.00   | 4.00
  6503.  Operating System:   MS-DOS | OS/2
  6504.  Flags: ENDUSER |
  6505.  Last Modified: 18-AUG-1988    ArticleIdent: Q33536
  6506.  
  6507.     The following information was taken from the Pascal Version 4.00
  6508.  README.DOC file.
  6509.  
  6510.  Incremental Violations (ILINK errors)
  6511.     These errors cause a full link to occur if the -e option is used
  6512.  and -i is not used, else they are fatal errors:
  6513.  
  6514.     symbol <name> deleted
  6515.  
  6516.     A symbol was deleted from an incrementally-linked module.
  6517.  
  6518.     <modname> contains new SEGMENT
  6519.  
  6520.     A segment was added to the program.
  6521.  
  6522.     <modname> contains changed segment <name>
  6523.  
  6524.     The segment contribution (code or data which the module
  6525.  contributes to a segment) changed for the given module: it contributed
  6526.  to a segment it didn't previously contribute to, or a contribution was
  6527.  removed.
  6528.  
  6529.     <modname>'s segment <name> grew too big
  6530.  
  6531.     The given segment grew beyond the padding for the given module.
  6532.  
  6533.     <modname> contains new GROUP <name>
  6534.  
  6535.     A new group was defined, via the GROUP directive in assembly
  6536.  language or via the /ND C compiler option.
  6537.  
  6538.     <modname> redefines group <name> to include <name>
  6539.  
  6540.     The members of the given group changed.
  6541.  
  6542.     symbol <name> changed
  6543.  
  6544.     The given data symbol was moved.
  6545.  
  6546.     can't add new communal data symbol <name>
  6547.  
  6548.     A new communal data symbol was added as an uninitialized variable
  6549.  in C or with the COMM feature in MASM.
  6550.  
  6551.     communal variable <name> grew too big
  6552.  
  6553.     The given communal variable changed size too much.
  6554.  
  6555.     invalid symbol type for <name>
  6556.  
  6557.     A symbol which was previously code became data, or vice versa.
  6558.  
  6559.     too many COMDEFS
  6560.     too many EXTDEFS
  6561.  
  6562.     The limit on the total of COMDEF records (communal data variables)
  6563.  and EXTDEF records (external references) is 2000.
  6564.  
  6565.     invalid CodeView information in .EXE file
  6566.  
  6567.     The CodeView information found is invalid.
  6568.  
  6569.     <name> contains new CodeView symbolic info
  6570.  
  6571.     A module previously compiled without -Zi was compiled with -Zi.
  6572.  
  6573.     <name> contains new linnum info
  6574.  
  6575.     A module previously compiled without -Zi or -Zd was compiled with
  6576.  -Zi or -Zd.
  6577.  
  6578.     <name> contains new public CV info
  6579.  
  6580.     New information on public-symbol addresses was added.
  6581.  
  6582.     invalid .exe file
  6583.  
  6584.     The .EXE file is invalid. Make sure you are using an up-to-date
  6585.  linker. If the error persists, contact Microsoft.
  6586.  
  6587.     invalid .ilk file
  6588.     .ilk read error
  6589.     .ilk seek error
  6590.  
  6591.     The .ILK file is invalid.  Make sure you are using an up-to-date
  6592.  linker. If the error persists, contact Microsoft.
  6593.  
  6594.     .SYM/.ILK mismatch
  6595.  
  6596.     The .SYM and .ILK files are out of sync. Make sure you are using
  6597.  an up-to-date linker.  If the error persists, contact Microsoft.
  6598.  
  6599.     <libname> has changed
  6600.  
  6601.     The given library has changed.
  6602.  
  6603.     can't link 64K-length segments
  6604.  
  6605.     ILINK cannot handle segments greater than 65,535 bytes long.
  6606.  
  6607.     can't link iterated segments
  6608.  
  6609.     ILINK cannot handle programs linked with /EXEPACK.
  6610.  
  6611.     Entry table expansion not implemented
  6612.  
  6613.     The program call tree changed in such a way that ILINK could not
  6614.  handle it.
  6615.  
  6616.     file <name> does not exist
  6617.  
  6618.     The .EXE, .SYM, or .ILK files are missing.
  6619.  
  6620.     <name> has changed
  6621.  
  6622.     The given library module name has changed.
  6623.  
  6624.  
  6625.  164. Pascal 4.00 README.DOC: Incremental Linker Warning
  6626.  
  6627.  Product Version(s): 4.00   | 4.00
  6628.  Operating System:   MS-DOS | OS/2
  6629.  Flags: ENDUSER |
  6630.  Last Modified: 26-SEP-1988    ArticleIdent: Q33537
  6631.  
  6632.  The following information was taken from the Pascal Version 4.00
  6633.  README.DOC file.
  6634.  
  6635.  ILINK Warning Messages
  6636.  
  6637.  Fixup frame relative to an (as yet) undefined symbol - assuming ok
  6638.  
  6639.  See documentation for LINK error messages L4001 and L4002, in the
  6640.  Microsoft CodeView and Utilities manual.
  6641.  
  6642.  <name> contains TYPEDEFs - ignored
  6643.  <name> contains BLKDEFs - ignored
  6644.  
  6645.  The .OBJ file contains records no longer supported by Microsoft
  6646.  language compilers.
  6647.  
  6648.  old .EXE free information lost
  6649.  
  6650.  The free list in the .EXE file has been corrupted. The free list keeps
  6651.  track of "holes" of free space in the EXE file. These holes are made
  6652.  available when segments are moved to new locations.
  6653.  
  6654.  file <name> has no useful contribution
  6655.  
  6656.  The given module makes no contribution to any segment.
  6657.  
  6658.  Main entry point moved
  6659.  
  6660.  The program starting address changed. You may want to consider doing a
  6661.  full link.
  6662.  
  6663.  
  6664.  165. Passing Pascal Function or Procedure Pointers to C Function
  6665.  
  6666.  Product Version(s): 4.00   | 4.00
  6667.  Operating System:   MS-DOS | OS/2
  6668.  Flags: ENDUSER | docerr
  6669.  Last Modified: 18-AUG-1988    ArticleIdent: Q33705
  6670.  
  6671.     Microsoft Pascal has the procedure and function address types
  6672.  adsproc and adsfunc for use in mixed-language programming. Pascal
  6673.  cannot call a procedure or function by their pointers; however, C can,
  6674.  as the following corrected and modified example of Page 141 of the
  6675.  "Microsoft Pascal 4.0 Compiler User's Guide" shows.
  6676.  
  6677.     The C module must be compiled for medium or large model with either
  6678.  the /AM or /AL compiler switches, respectively. The linker options
  6679.  /NOE and /NOD should be used, and the C library should be linked in
  6680.  first to prevent multiple-symbol definition errors.
  6681.     Pascal only can obtain the address of external functions or
  6682.  procedures using the ads operator. In Pascal, the ads operator will
  6683.  not obtain the address of a procedure or function within the current
  6684.  modules.
  6685.     Below is the main Pascal program module. It contains the corrected
  6686.  version of the Pascal user's guide example for addressing procedures and
  6687.  functions.
  6688.     The example passes procedure and function pointers obtained by the
  6689.  ads operator to the C function. C then calls the procedure and
  6690.  function by their pointers.
  6691.     Note that Pascal cannot call a routine by its pointer. Pascal can
  6692.  obtain the address of an external routine, but it cannot obtain the
  6693.  address of a routine within the current module with the ads or adr
  6694.  operators, so the routines must be declared "extern" here and reside
  6695.  in a different module.
  6696.     You must link with /NOE and /NOD options, and first specify C
  6697.  run-time library to prevent multiple-symbol definition linker
  6698.  errors.
  6699.     The following is the main Pascal program module:
  6700.  
  6701.  {Originally was "program p(output);". Could formally include "input" for
  6702.   readln in function pfunc, but not actually required in this example.}
  6703.  
  6704.  program p(input,output);
  6705.  
  6706.      {Routines must be external for Pascal to obtain the addresses}
  6707.      procedure pproc(i : integer); extern;
  6708.      function  pfunc : integer; extern;
  6709.  
  6710.      {This procedure declaration requires ";" here v}
  6711.      procedure cproc(ap: adsproc; af: adsfunc ) [c]; extern;
  6712.  
  6713.  begin {begin main Pascal program p}
  6714.      cproc( ads pproc, ads pfunc); {originally missing ads operators}
  6715.  end.  {end main Pascal program p}
  6716.  
  6717.  {--------- External Pascal Module Defining Procedure and Function ----------}
  6718.  
  6719.  { From corrected and modified example in "Microsoft Pascal 4.0 Compiler
  6720.    User's Guide" Page 141. The routines below cannot be in the same module
  6721.    that uses the ads operator to obtain their addresses.
  6722.  }
  6723.  
  6724.  module SecondPascalModule;
  6725.  
  6726.  procedure pproc( i : integer );
  6727.  begin
  6728.      writeln('In Pascal procedure pproc within second Pascal module.');
  6729.      writeln('Pascal proc integer = ', i );
  6730.  end;
  6731.  
  6732.  function pfunc : integer;
  6733.  var
  6734.      i : integer;
  6735.  begin
  6736.      write('Please Enter an integer for the function return value : ');
  6737.      readln( i );
  6738.      writeln;
  6739.      pfunc := i;
  6740.  end;
  6741.  
  6742.  end. {SecondPascalModule}
  6743.  
  6744.  {-------- C Function to Receive Pointers and Call Pascal Routines by them --}
  6745.  
  6746.  /* C function cproc called by Pascal main program. printf the address of the
  6747.   Pascal procedure and function from the second Pascal module, then call them
  6748.   by their function pointers. Note that the Pascal procedure pproc has one
  6749.   integer argument of 7 in this example, while the Pascal function pfunc has
  6750.   no arguments but returns an integer.
  6751.  
  6752.   Compile this with /AM or /AL. Link with /NOE /NOD and specify the
  6753.   C libraries first to avoid multiple symbol definitions.
  6754.  */
  6755.  
  6756.  #include <stdio.h>
  6757.  
  6758.  /* Prototype for function cproc. Do not specify argument to pproc here. */
  6759.  void cproc( void (pascal * pproc)(), int (pascal * pfunc)() );
  6760.  
  6761.  void cproc (void(pascal * pproc)(), int(pascal * pfunc)()) {
  6762.      int ReturnCode;
  6763.  
  6764.      printf("\nIn cproc(); address of pproc at %p, pfunc at %p\n",pproc,pfunc)
  6765.      printf("\nExecute the Pascal procedure:\n");
  6766.      (*pproc)(7);
  6767.      printf("\nExecute the Pascal function :\n");
  6768.      ReturnCode = (*pfunc)();
  6769.      printf("Integer Entered in Pascal function was %d. Bye!\n",ReturnCode);
  6770.      }
  6771.  
  6772.  
  6773.  166. Pascal 4.00 README.DOC: Installing Editor
  6774.  
  6775.  Product Version(s): 4.00   | 4.00
  6776.  Operating System:   MS-DOS | OS/2
  6777.  Flags: ENDUSER |
  6778.  Last Modified: 18-AUG-1988    ArticleIdent: Q33539
  6779.  
  6780.     The following information was taken from the Pascal Version 4.00
  6781.  README.DOC file.
  6782.  
  6783.  Microsoft Editor
  6784.  Installing the Editor
  6785.     The Pascal SETUP program installs the Microsoft Editor on your hard
  6786.  disk if you request it during setup.
  6787.  
  6788.  
  6789.  167. Pascal 4.00 README.DOC: Editor Keystroke
  6790.  
  6791.  Product Version(s): 4.00   | 4.00
  6792.  Operating System:   MS-DOS | OS/2
  6793.  Flags: ENDUSER |
  6794.  Last Modified: 18-AUG-1988    ArticleIdent: Q33540
  6795.  
  6796.     The following information was taken from the Pascal Version 4.00
  6797.  README.DOC file.
  6798.  
  6799.  Keystroke Configurations
  6800.     Some of the keystroke configurations listed in Table A.2 of the
  6801.  Microsoft Editor User's Guide may need to be changed.
  6802.     In the Quick/WordStar(R) configuration, the Sinsert function is
  6803.  assigned to ALT+INS, not CTRL+INS.
  6804.     In the BRIEF(R) configuration, the Plines function is assigned to
  6805.  ALT+D, and the Refresh function is assigned to CTRL+].
  6806.     In the EPSILON(TM) configuration, the Ppage function is assigned to
  6807.  PGDN, and the Sdelete function is assigned to DEL and CTRL+D.
  6808.  
  6809.  
  6810.  
  6811.  168. Pascal 4.00 README.DOC: Editor Compile Function
  6812.  
  6813.  Product Version(s): 4.00   | 4.00
  6814.  Operating System:   MS-DOS | OS/2
  6815.  Flags: ENDUSER |
  6816.  Last Modified: 26-SEP-1988    ArticleIdent: Q33541
  6817.  
  6818.  The following information was taken from the Pascal Version 4.00
  6819.  README.DOC file.
  6820.  
  6821.  The Compile Function
  6822.  
  6823.  The commands
  6824.  
  6825.  Arg streamarg Compile
  6826.  Arg textarg Compile
  6827.  
  6828.  each use the command specified by the extmake:text switch.
  6829.  
  6830.  The editor does not check the extension of the file name given as an
  6831.  argument, but instead uses the "text" extension. The streamarg or
  6832.  textarg replaces a %s in the command. These commands are typically
  6833.  used to invoke MAKE.
  6834.  
  6835.  
  6836.  169. Pascal 4.00 README.DOC: Editor Setfile Function
  6837.  
  6838.  Product Version(s): 4.00   | 4.00
  6839.  Operating System:   MS-DOS | OS/2
  6840.  Flags: ENDUSER |
  6841.  Last Modified: 18-AUG-1988    ArticleIdent: Q33542
  6842.  
  6843.     The following information was taken from the Pascal Version 4.00
  6844.  README.DOC file.
  6845.  
  6846.  The Setfile Function
  6847.     The commands that use Setfile, along with a streamarg or textarg,
  6848.  accept a variety of input: either the name of a file, a file name with
  6849.  a wild-card character (* or ?), the name of a directory, or the name
  6850.  of a disk drive. File names can also include environment variables,
  6851.  such as $INIT. If the streamarg or textarg is a directory name, then
  6852.  the editor changes the current directory. If the argument is a drive
  6853.  name, then the editor changes the current drive. Environment variables
  6854.  are translated into directories to be searched for a file. For
  6855.  example, the following macro directs the editor to search the $INIT
  6856.  environment variable in order to find the tools.ini file:
  6857.  
  6858.     tools.ini := Arg "$INIT:tools.ini" Setfile
  6859.  
  6860.  
  6861.  
  6862.  170. Pascal 4.00 README.DOC: Editor and Entering Strings in Macros
  6863.  
  6864.  Product Version(s): 4.00   | 4.00
  6865.  Operating System:   MS-DOS | OS/2
  6866.  Flags: ENDUSER |
  6867.  Last Modified: 26-SEP-1988    ArticleIdent: Q33543
  6868.  
  6869.  The following information was taken from the Pascal Version 4.00
  6870.  README.DOC file.
  6871.  
  6872.  Entering Strings in Macros
  6873.  
  6874.  When you enter a text argument directly, no characters have special
  6875.  meaning (except when the argument is interpreted as a regular
  6876.  expression). However, when you enter text as part of a macro, then
  6877.  strings inside of quotes are interpreted according to the C string
  6878.  format. This format uses a backslash followed by double quotes (\")
  6879.  to represent double quotes and it uses two backslashes (\\) to
  6880.  represent a single backslash. Therefore, to find the next occurrence
  6881.  of the string
  6882.  
  6883.  She wrote, "Here is a backslash: \ "
  6884.  
  6885.  you could use the following macro definition:
  6886.  
  6887.  findit := Arg "She wrote, \"Here is a backslash: \\ \""
  6888.  Psearch
  6889.  
  6890.  Note that to indicate a backslash for a regular expression that is
  6891.  also part of a macro definition, you must use four consecutive
  6892.  backslashes.
  6893.  
  6894.  
  6895.  171. Pascal 4.00 README.DOC: Editor and Using Text Switches
  6896.  
  6897.  Product Version(s): 4.00   | 4.00
  6898.  Operating System:   MS-DOS | OS/2
  6899.  Flags: ENDUSER |
  6900.  Last Modified: 18-AUG-1988    ArticleIdent: Q33544
  6901.  
  6902.     The following information was taken from the Pascal
  6903.  Version 4.00 README.DOC file.
  6904.  
  6905.  Using Text Switches
  6906.     The text switches extmake and readonly each take a special kind of
  6907.  syntax that allows you to specify drive, file name, base name, or file
  6908.  extension. The syntax consists of the characters:
  6909.  
  6910.     %|<letters>F
  6911.  
  6912.  where <letters> consists of any of the following: "p" for path, "d"
  6913.  for drive, "f" for file base name, or "e" for file extension. For
  6914.  example, if you are editing the file c:\dir1\sample.c, and you make
  6915.  the following switch assignment:
  6916.  
  6917.     extmake:c cl /Fod:%|pfF %|dfeF
  6918.  
  6919.  then each time you give the command <Arg><Compile>, the editor
  6920.  performs the following system-level command:
  6921.  
  6922.  cl /Fod:\dir1\sample c:sample.c
  6923.  
  6924.     The expression "%s" is equivalent to "%|feF" except that the former
  6925.  only works once, whereas the latter can appear any number of times in
  6926.  the extmake switch assignment. The expression "%|F" is equivalent to
  6927.  "%|dpfeF".
  6928.  
  6929.  
  6930.  
  6931.  172. Pascal 4.00 README.DOC: Editor and the Filetab Switch
  6932.  
  6933.  Product Version(s): 4.00   | 4.00
  6934.  Operating System:   MS-DOS | OS/2
  6935.  Flags: ENDUSER |
  6936.  Last Modified: 18-AUG-1988    ArticleIdent: Q33545
  6937.  
  6938.     The following information was taken from the Pascal Version 4.00
  6939.  README.DOC file.
  6940.  
  6941.  The Filetab Switch
  6942.     The filetab switch is a numeric switch that determines how the
  6943.  editor translates tabs when loading a file into memory.  The value of
  6944.  the switch gives the number of spaces associated with each tab column.
  6945.  For example, the setting "filetab:4" assumes a tab column every 4
  6946.  positions on each line.  Every time the editor finds a tab character
  6947.  in a file, it loads the buffer with the number of spaces necessary to
  6948.  get to the next tab column.  Depending on the value of the entab
  6949.  switch, the editor also uses the filetab switch to determine how to
  6950.  convert spaces into tabs when writing to a file.  The default value of
  6951.  filetab is 8.
  6952.  
  6953.  
  6954.  
  6955.  173. Pascal 4.00 README.DOC: Editor and Linking Extensions
  6956.  
  6957.  Product Version(s): 4.00   | 4.00
  6958.  Operating System:   MS-DOS | OS/2
  6959.  Flags: ENDUSER |
  6960.  Last Modified: 18-AUG-1988    ArticleIdent: Q33546
  6961.  
  6962.     The following information was taken from the Pascal Version 4.00
  6963.  README.DOC file.
  6964.  
  6965.  Linking Extensions in Protected Mode
  6966.     To link C extension modules in protected mode, link with the object
  6967.  file EXTHDRP.OBJ, instead of the real-mode header EXTHDR.OBJ.
  6968.  
  6969.  
  6970.  174. PL /S And /link Options Together Result in LINK Error L1004
  6971.  
  6972.  Product Version(s): 4.00   | 4.00
  6973.  Operating System:   MS-DOS | OS/2
  6974.  Flags: ENDUSER | buglist4.00
  6975.  Last Modified: 18-AUG-1988    ArticleIdent: Q33708
  6976.  
  6977.     A Pascal Version 4.00 command line using both the /S (Stack size)
  6978.  and /link options, such as
  6979.  
  6980.     PL /S500 hello.pas /link
  6981.  
  6982.  will result in bad input for the following linker's .MAP file prompt
  6983.  and linker error:
  6984.  
  6985.     LINK: fatal error L1004: STACK:500HHELLO.PAS: invalid numeric value
  6986.  
  6987.     Microsoft has confirmed this to be a problem in Version 4.00. We
  6988.  are researching this problem and will post new information as it
  6989.  becomes available.
  6990.  
  6991.     The bad input at the .MAP prompt will consist of ASCII character 2
  6992.  (a dark smiley face on the screen of IBM PCs and compatibles) followed
  6993.  by an extra copy of the first non-blank character following "/S500".
  6994.  The link error message does not display the ASCII 2.
  6995.     Note that with the above PL command line, the first non-blank
  6996.  character following the /S string is the "h" in "hello.pas", which is
  6997.  doubled in both the .MAP file prompt and the link error message. If a
  6998.  blank had occurred between "/S" and "500", the "5" would have been
  6999.  doubled following ASCII 2 at the .MAP prompt.
  7000.     To work around this problem, do not use /S and /link together. Use
  7001.  the linker switch /ST:<stack_size_in_decimal> either after /link or
  7002.  when linking separately. Or you may use the EXEMOD utility with its
  7003.  /Stack <stack_size_in_hex> option on a successfully linked .EXE file.
  7004.  
  7005.  
  7006.  175. Pascal 4.00 PATCH320.DOC: Patching IBM PC-DOS Version 3.20
  7007.  
  7008.  Product Version(s): 4.00   | 4.00
  7009.  Operating System:   MS-DOS | OS/2
  7010.  Flags: ENDUSER |
  7011.  Last Modified: 18-AUG-1988    ArticleIdent: Q33555
  7012.  
  7013.     The following information was taken from the Pascal Version 4.00
  7014.  PATCH320.DOC file.
  7015.  
  7016.  PATCH320.DOC File
  7017.  Notes on patching IBM(R) PC-DOS Version 3.20 (C) Copyright Microsoft
  7018.  Corporation, 1988
  7019.     Version 3.20 of IBM(R) PC-DOS contains a bug that can cause
  7020.  unexpected results in programs that generate floating-point
  7021.  exceptions. This file explains how to install a small patch in DOS to
  7022.  eliminate the problem.
  7023.     It is especially important to install this patch if you wish to use
  7024.  the C run-time routine signal with the SIGFPE parameter, since that
  7025.  routine does not work correctly in the unpatched version of IBM PC-DOS
  7026.  3.20. IBM Corporation also supplies a patch to eliminate this problem.
  7027.     Note that MS-DOS(R) Version 3.20 contains another, different
  7028.  floating-point bug. The README.DOC file for this release tells you
  7029.  where to find more information about installing a patch for that bug.
  7030.  If you use any version of DOS 3.20 other than IBM PC-DOS 3.20 or
  7031.  MS-DOS 3.20, contact your hardware manufacturer to determine whether
  7032.  the problem exists in your version.
  7033.     You can install the DOS patch for IBM PC-DOS 3.20 by following
  7034.  these steps:
  7035.  
  7036.     1. Format a blank floppy disk. (Do NOT use the /s formatting
  7037.        option to transfer system files to the disk.)
  7038.     2. Use the SYS command to copy the files IBMDOS.COM and IBMBIO.COM
  7039.        to the new disk. For example, if you boot from drive C:, you could
  7040.        use these commands:
  7041.  
  7042.        C:
  7043.        SYS A:
  7044.  
  7045.     3. Use the COPY command to copy the files COMMAND.COM, SYS.COM,
  7046.        and DEBUG.COM to the new disk.
  7047.     4. Use the COPY command to copy the files STKPAT.BAT, STKPAT.SCR,
  7048.        RMRHS.EXE, and SETRHS.EXE from the \PATCH directory of your
  7049.        hard-disk drive to the new disk.
  7050.     5. Reboot your system from the floppy disk that you
  7051.        prepared in steps 1-4.
  7052.     6. Run the STKPAT.BAT file to patch the IBMBIO.COM file on the new
  7053.        disk.
  7054.     7. Use the SYS command to transfer the patch from the floppy
  7055.        disk other Version 3.20 disk. For example, if you normally
  7056.        boot from drive C:, you would enter these commands to transfer
  7057.        the patched DOS to your hard-disk drive:
  7058.  
  7059.        to any A:
  7060.        SYS C:
  7061.  
  7062.        This installs the patch.
  7063.     8. Reboot your system as you normally do.
  7064.  
  7065.  
  7066.  176. Pascal 4.00 OS2PATCH.DOC: Patching Microsoft OS/2
  7067.  
  7068.  Product Version(s): 4.00   | 4.00
  7069.  Operating System:   MS-DOS | OS/2
  7070.  Flags: ENDUSER |
  7071.  Last Modified: 18-AUG-1988    ArticleIdent: Q33556
  7072.  
  7073.     The following information was taken from the Pascal Version 4.00
  7074.  OS2PATCH.DOC file.
  7075.  
  7076.  OS2PATCH.DOC File
  7077.  Information on a Patch for Microsoft Operating
  7078.  System/2 (MS(R) OS/2) Version 1.0 (C) Copyright Microsoft Corporation,
  7079.  1987, 1988
  7080.     This file describes the procedure for installing a patch in
  7081.  Microsoft(R) Operating System/2 OS/2 (MS(R) OS/2) Version 1.0 so that
  7082.  you can use the 7 command of the Microsoft CodeView(R) debugger in
  7083.  OS/2 protected mode.
  7084.     If you are using protected mode in OS/2 Version 1.0, and you have a
  7085.  math coprocessor, then you need to use a patch before you can use the
  7086.  CVP 7 command in CodeView. To apply the patch, use the OS2PATCH.EXE
  7087.  and PTRACE87.PAT files that come on the same disk that CVP.EXE is on.
  7088.  You also need to locate the PATCH.EXE file that comes with OS/2 and
  7089.  make sure that this file is in a directory listed in your PATH
  7090.  environment variable. Then follow these steps:
  7091.  
  7092.     1. Change the current drive and directory to the root directory of
  7093.        the boot disk. (If the boot disk is a floppy, make sure that it
  7094.        is inserted in the drive that you boot from.)
  7095.     2. Give the following command line at the DOS prompt:
  7096.  
  7097.        OS2PATCH /A PTRACE87.PAT
  7098.  
  7099.     You may need to give the complete path names for OS2PATCH.EXE and
  7100.  the PTRACE87.PAT file. You do not need to give a path name for the
  7101.  OS2PATCH.EXE file if you have placed this file in a directory listed
  7102.  in your PATH environment variable.
  7103.  
  7104.  
  7105.  177. Pascal 4.00 Startup Source Code README.DOC
  7106.  
  7107.  Product Version(s): 4.00   | 4.00
  7108.  Operating System:   MS-DOS | OS/2
  7109.  Flags: ENDUSER |
  7110.  Last Modified: 18-AUG-1988    ArticleIdent: Q33557
  7111.  
  7112.     The following information was taken from the Pascal Version 4.00
  7113.  Startup Source Code README.DOC.
  7114.  
  7115.  C Runtime Library Startup Sources
  7116.     The directory \startup and its subdirectories contain the files
  7117.  necessary for building the startup portion of the C runtime library.
  7118.  The \startup directory contains the startup source files, the include
  7119.  include files, the batch file and the make file used to build the
  7120.  startup object files.  The subdirectories of \startup contain OS
  7121.  specific sources.
  7122.     The startup object files can be built by invoking startup.bat from
  7123.  within the \startup directory.  This batch file assumes the following:
  7124.  
  7125.     1. make.exe, link.exec, the C compiler, and the assembler must be
  7126.  in the execution path. MASM 5.0 and C 5.0 or later are required to
  7127.  build the startup sources.
  7128.     2. doscalls.lib must be in the directory specified by the LIB
  7129.  environment variable.
  7130.     Startup will create four memory model specific subdirectories
  7131.  (i.e., S, M, C, and L) and place the appropriate object files there.
  7132.  Under each memory model subdirectory, startup creates two addition
  7133.  subdirectories OS2 and DOS where OS specific objects reside.
  7134.     The include files stdio.h and ctype.h are required for building the
  7135.  startup source file wild.c but are not included on the \startup
  7136.  directory because they exist on the directory containing the standard
  7137.  include files. A make variable called CINC controls where the makefile
  7138.  looks for these include files. STARTUP.BAT sets CINC to the current
  7139.  value of the INCLUDE environment variable. This variable should be
  7140.  set to the location of the C include files. CINC can also be set in
  7141.  the makefile if you wish to run the makefile separately.
  7142.     The message "<cEnd - nogen>" is generated when some of the assembly
  7143.  language source files are assembled. This message is expected and is
  7144.  totally benign.
  7145.     The startup batch file requires as arguments a list of capital
  7146.  letters describing the memory models you wish to build. For example,
  7147.  "startup S L" will build the small and large model startup objects.
  7148.  Startup will then link the objects with a sample C program called
  7149.  nulbody.c (consisting of a null main functions) to produce
  7150.  nulbody.exe. [Invoking startup.bat with no arguments will give usage
  7151.  information.]
  7152.     Note: startup sources written in assembly language have been
  7153.  edited with tabstops set to 8. Startup sources written in C have been
  7154.  edited with tabstops set to 4.
  7155.     The following files are contained in the \startup directory:
  7156.  
  7157.     Startup source files (OS independent):
  7158.  
  7159.     chkstk.asm
  7160.     chksum.asm
  7161.     crt0fp.asm
  7162.     setargv.asm
  7163.     wild.c
  7164.  
  7165.     Startup source files (OS specific):
  7166.     crt0.asm
  7167.     crt0dat.asm
  7168.     crt0msg.asm
  7169.     execmsg.asm
  7170.     nmsghdr.asm
  7171.     stdalloc.asm
  7172.     stdenvp.asm
  7173.     stdargv.asm
  7174.  
  7175.     Startup include files:
  7176.     brkctl.inc
  7177.     cmacros.inc
  7178.     msdos.inc
  7179.     register.h
  7180.     msdos.h
  7181.     version.inc
  7182.  
  7183.     File count files:
  7184.     _file.c
  7185.     file2.h
  7186.  
  7187.     Make and batch files:
  7188.  
  7189.     startup.bat:   invokes make file to build objs and link
  7190.                    to null program
  7191.     makefile:      contains rules for building startup sources
  7192.     nulbody.c:     null c program
  7193.     nulbody.lnk:   link script for linking null program
  7194.  
  7195.     Documentation:
  7196.  
  7197.     readme.doc:    information about \startup directory
  7198.                    structure and contents
  7199.  
  7200.    End
  7201.  
  7202.  
  7203.  178. Glockenspiel Turbo Pascal to C Translator Source Code
  7204.  
  7205.  Product Version(s): 3.30 3.31 3.32 4.00
  7206.  Operating System:   MS-DOS
  7207.  Flags: ENDUSER |
  7208.  Last Modified: 18-AUG-1988    ArticleIdent: Q33563
  7209.  
  7210.     The Irish company Glockenspiel writes the Turbo Pascal to C
  7211.  Translator. If you are interested in obtaining the source code, please
  7212.  contact Glockenspiel.
  7213.     The following is the address and phone number:
  7214.  
  7215.     19 Belvedere Place
  7216.     Dublin 1
  7217.  
  7218.     011-353-1-364515
  7219.  
  7220.  
  7221.  
  7222.  179. Pascal 4.00 Compiler Error 380 "Stack or var with SS <> DS"
  7223.  
  7224.  Product Version(s): 4.00   | 4.00
  7225.  Operating System:   MS-DOS | OS/2
  7226.  Flags: ENDUSER | docerr
  7227.  Last Modified: 26-SEP-1988    ArticleIdent: Q33721
  7228.  
  7229.  The Pascal Version 4.00 compiler may issue the following undocumented
  7230.  compiler error message:
  7231.  
  7232.  Error 380 - Stack or var with SS <> DS
  7233.  
  7234.  This error is not listed in the "Microsoft Pascal 4.0 Compiler User's
  7235.  Guide"; however, it is noted in the Pascal Version 4.00 README.DOC
  7236.  file.
  7237.  
  7238.  The the error occurs when attempting to address a stack or near-heap
  7239.  variable with the adr or ^ operators when the $windows+ or $stackseg+
  7240.  metacommands or equivalent compiler switches are set. The $windows+
  7241.  and $stackseg+ metacommands set SS <> DS (Stack Segment not equal to
  7242.  Data Segment), and require that the far address (or long address that
  7243.  consists of the segment and offset) be obtained for addressing stack
  7244.  and near-heap variables.
  7245.  
  7246.  The ads operator may be used for addressing data items with both
  7247.  the segment and offset as indicated in Pages 73-76 of the Pascal
  7248.  user's guide.
  7249.  
  7250.  The adr operator is used for obtaining offset addresses only of data
  7251.  items within the default data segment or Dgroup. The carrot "^"
  7252.  operator is for defining and dereferencing pointers to data items
  7253.  allocated on the near (or short) heap within Dgroup by means of the
  7254.  New function. Both of these operators assume SS = DS.
  7255.  
  7256.  The $windows+ metacommand is equivalent to the PL switch /Pw or the
  7257.  PAS1 switch /W, and has the effect of adding initialization and
  7258.  cleanup code to Windows applications written in Pascal.
  7259.  
  7260.  
  7261.  180. Debug Information Exceeding Segment Bounds, Link Error L1103
  7262.  
  7263.  Product Version(s): 4.00   | 4.00
  7264.  Operating System:   MS-DOS | OS/2
  7265.  Flags: ENDUSER | buglist4.00 SR# G880727-1846
  7266.  Last Modified: 18-AUG-1988    ArticleIdent: Q33899
  7267.  
  7268.  Problem:
  7269.     When compiling and linking my large program, which nearly fills the
  7270.  64K-byte default data segment with defined data, I receive the linker
  7271.  error L1103: "attempt to access data outside segment bounds." Extended
  7272.  run-time debugging information has been added to my program by the
  7273.  metacommand $debug+, or the PL switch /Pd, or the PAS1 switch /D.
  7274.     To avoid error L1103, I do not include extended run-time debugging
  7275.  information when the default data segment is almost full.
  7276.  
  7277.  Response:
  7278.     The linker error L1103 occurs because the extended run-time
  7279.  debugging information is added to the 64K default data segment, or
  7280.  Dgroup. The addition of this debugging information increases the
  7281.  size of Dgroup, which is readily noticeable in the map file. If Dgroup
  7282.  is nearly filled with defined data, the debugging information can
  7283.  increase the size of Dgroup beyond 64K, which causes linker error
  7284.  L1103.
  7285.     Microsoft has confirmed this to be a problem in Version 4.00. We
  7286.  are researching this problem and will post new information as it
  7287.  becomes available.
  7288.     The $debug+ metacommand is described in the "Microsoft Pascal 4.0
  7289.  Compiler Reference Manual" section 18.2 "Debugging and Error Handling."
  7290.  The addition of this debugging information provides the source code
  7291.  filename, routine name or main program module name, and line number
  7292.  for run-time error messages.
  7293.     If you would like to debug programs that have nearly 64K of defined
  7294.  data, use the /Zi CodeView information option, which does not store
  7295.  any information in Dgroup. This process allows you to use CodeView to
  7296.  debug your program without running into any linker problems. Note that
  7297.  the CodeView information PL switch /Zi (or PAS1 /Z) is incompatible
  7298.  with the extended run-time debugging PL switch /Pd (or PAS1 /D); do
  7299.  not compile with both /Zi and /Pd, or /Z and /D.
  7300.  
  7301.  
  7302.  181. Check Sum Errors in Pascal Libraries
  7303.  
  7304.  Product Version(s): 4.00   | 4.00
  7305.  Operating System:   MS-DOS | OS/2
  7306.  Flags: ENDUSER |
  7307.  Last Modified: 26-SEP-1988    ArticleIdent: Q34362
  7308.  
  7309.     Check Sum errors are generated when a simple Pascal program is
  7310.  linked with PLINK86 Version 2.01.
  7311.     Microsoft is researching this problem, and will post more
  7312.  information as it becomes available.
  7313.     The errors occur in the following modules which were reported to
  7314.  be associated with PLINK86:
  7315.  
  7316.     filf.pas
  7317.     strf.pas
  7318.     misoe.pas
  7319.  
  7320.     These errors occur when using either libpase.lib or libpas7.lib.
  7321.  
  7322.  
  7323.  182. PL /FPi Option Is for Coprocessor Math
  7324.  
  7325.  Product Version(s): 4.00   | 4.00
  7326.  Operating System:   MS-DOS | OS/2
  7327.  Flags: ENDUSER |
  7328.  Last Modified: 26-SEP-1988    ArticleIdent: Q33710
  7329.  
  7330.  The PL compiler-linker driver option /FPi is for using coprocessor
  7331.  math and linking with the combined library LIBPAS7.LIB. The default
  7332.  math option is /FPe for emulator math, which will call the library
  7333.  LIBPASE.LIB. In C or FORTRAN, /FPi is used for emulator math; /FPi87
  7334.  is used for coprocessor math.
  7335.  
  7336.  If you are accustomed to Microsoft C or FORTRAN, you may inadvertently
  7337.  use /FPi for specifying emulator math with Pascal. If LIBPAS7.LIB is
  7338.  not present in the current working directory or a directory specified
  7339.  by the LIB environment variable, the linker will issue the following
  7340.  warning and prompt:
  7341.  
  7342.  LINK: warning L4051: LIBPAS7.LIB: cannot find library
  7343.  Enter new file spec:
  7344.  
  7345.  Either entering the existing library name LIBPASE or recompiling
  7346.  without /FPi allows you to link to the emulator-math library. If you
  7347.  do link with LIBPAS7.LIB, your program will require a 80x87
  7348.  coprocessor to run correctly.
  7349.  
  7350.  Note that if you set up for dual-mode (DOS or OS/2 rear mode, and
  7351.  OS/2 protected mode), the actual names for the emulator-math combined
  7352.  libraries may be LIBPASER.LIB for real mode or LIBPASEP.LIB for
  7353.  protected mode.
  7354.  
  7355.  
  7356.  183. PAS1 Switch /Xsymbol Is Not Handled Correctly
  7357.  
  7358.  Product Version(s): 4.00
  7359.  Operating System:   MS-DOS | OS/2
  7360.  Flags: ENDUSER | buglist4.00
  7361.  Last Modified: 26-SEP-1988    ArticleIdent: Q34935
  7362.  
  7363.  Passing the /Xsymbol[=value] switch to PAS1 of the Microsoft
  7364.  Pascal Version 4.00 compiler generates a "Line invalid" error.
  7365.  This problem only occurs when /X switch precedes the filename.
  7366.  
  7367.  For example, if the following is used,
  7368.  
  7369.  pas1 /Xabc filename;
  7370.  
  7371.  the following error is generated because the filename is not being
  7372.  read by pas1:
  7373.  
  7374.  Line invalid: ';', start again.
  7375.  Source filename [.PAS] :
  7376.  
  7377.  Microsoft has confirmed this to be a problem in Version 4.00. We are
  7378.  researching this problem and will post new information as it becomes
  7379.  available.
  7380.  
  7381.  If one or more switches follows the /Xsymbol, it works correctly.
  7382.  
  7383.  The following is an example:
  7384.  
  7385.  pas1 /Xabc /N filename;
  7386.  
  7387.  Also, placing the /X switch after the filename works properly, as
  7388.  follows:
  7389.  
  7390.  pas1 filename /Xabc ;
  7391.  
  7392.  In addition, you can use the PL driver as an alternative (/D switch),
  7393.  as follows:
  7394.  
  7395.  "pl /Dabc filename.pas"
  7396.  
  7397.  
  7398.  184. File Error Trapping when Using lm_lock
  7399.  
  7400.  Product Version(s): 3.20 4.00 | 4.00
  7401.  Operating System:   MS-DOS    | OS/2
  7402.  Flags: ENDUSER |
  7403.  Last Modified: 26-SEP-1988    ArticleIdent: Q34971
  7404.  
  7405.  In Pascal, the procedure locking() and the TYPE lockmodes have been
  7406.  defined to allow you to lock a specific range of records in a DIRECT
  7407.  mode file, as follows:
  7408.  
  7409.  TYPE            lockmodes = (lm_unlck,lm_lock,lm_nblck,lm_rick,
  7410.                  lm_nbrick);
  7411.  
  7412.  PROCEDURE locking(VAR f: FCBFQQ; MODE: lockmodes;
  7413.                    M,N : INTEGER4);
  7414.  
  7415.  When a process is using the lm_lock value of lockmodes in the
  7416.  procedure locking (as described on Page 146 of the "Microsoft Pascal
  7417.  4.0 Compiler User's Guide"), and it encounters a locked record, it
  7418.  will wait for 10 seconds before returning a run-time file-system error
  7419.  #16.
  7420.  
  7421.  This error is not documented and can be described as a Record
  7422.  Locked - share error. The run-time file-system errors are described on
  7423.  Pages 257-258 of the user's guide.
  7424.  
  7425.  
  7426.  185. Pascal File System Explained
  7427.  
  7428.  Product Version(s): 3.32 4.00 | 4.00
  7429.  Operating System:   MS-DOS    | OS/2
  7430.  Flags: ENDUSER |
  7431.  Last Modified: 26-SEP-1988    ArticleIdent: Q35136
  7432.  
  7433.  The following information explains the Pascal file system.
  7434.  
  7435.  The Pascal file system is similar to, but not compatible with,
  7436.  buffered stream files in C. There is a File Control Block (FCB) with a
  7437.  file buffer allocated in the near heap when the file is opened. All
  7438.  I/O goes from/to the file buffer to the DOS device buffer.
  7439.  
  7440.  To flush a file buffer in Pascal, use the CLOSE procedure, or end the
  7441.  program normally. There is no buffer flushing routine. Because a
  7442.  Pascal FCB has a different record format than a C FILE * struct, you
  7443.  cannot use C run-time library routines to try flushing a Pascal FCB.
  7444.  
  7445.  Sequential files in Pascal allow reading only if opened by Reset, or
  7446.  writing only if opened by Rewrite; however they do not allow both
  7447.  reading and writing. Direct files may be both read and written.
  7448.  
  7449.  Sequential is the default file mode unless the file mode is explicitly
  7450.  specified as in the following:
  7451.  
  7452.  FileVar.Mode := direct;
  7453.  
  7454.  The following code fragment demonstrates how to setup file error
  7455.  trapping for handling I/O errors within your program rather than
  7456.  exiting to the operating system:
  7457.  
  7458.  var  f : text;
  7459.  begin
  7460.          assign(f,'afile');
  7461.          f.trap := true;
  7462.          f.errs := 0;
  7463.  
  7464.  After every file I/O operation, you can check f.errs for a non-0
  7465.  value. Errors 1-15 are document prior to error 1000 in the back of the
  7466.  "Microsoft Pascal Compiler User's Guide." Undocumented error 16
  7467.  usually indicates a network file or record sharing violation has
  7468.  occurred. Pascal automatically reads the first record of a file when
  7469.  it is opened, so do not lock the first record of a file if you want
  7470.  other processes to be able to access any records in the file.
  7471.  
  7472.  Make sure you reassign zero to f.errs after handling a file error so
  7473.  you can detect any future errors.
  7474.  
  7475.  
  7476.  186. Calling DOS Interrupt 21 Hex Functions from Pascal
  7477.  
  7478.  Product Version(s): 3.3x 4.00 | 4.00
  7479.  Operating System:   MS-DOS    | OS/2
  7480.  Flags: ENDUSER |
  7481.  Last Modified: 26-SEP-1988    ArticleIdent: Q35165
  7482.  
  7483.  In Pascal, you may call a subset of the DOS interrupt 21 hex functions
  7484.  by means of the DOSXQQ function. DOSXQQ is documented on Pages 161-162
  7485.  in Appendix B.1 of the "Microsoft Pascal Compiler User's Guide."
  7486.  
  7487.  The DOSXQQ function is documented as passing a byte to the AH register
  7488.  and an additional argument to the DX register. The return value from
  7489.  DOSXQQ is a byte that corresponds to the DOS function value returned
  7490.  in the AL register. By defining the public variables CRCXQQ and CRDXQQ
  7491.  as EXTERN, you may use these variables to view the contents of the CX
  7492.  and DX registers, respectively, after the DOSXQQ call. CRCXQQ also may
  7493.  be used to load CX prior to the DOSXQQ call.
  7494.  
  7495.  
  7496.  187. Correction to Page 120 of the Pascal 4.0 Reference Manual
  7497.  
  7498.  Product Version(s): 5.10   | 5.10
  7499.  Operating System:   MS-DOS | OS/2
  7500.  Flags: ENDUSER | docerr
  7501.  Last Modified: 19-AUG-1988    ArticleIdent: Q34578
  7502.  
  7503.  The bottom of Page 120 of the "Microsoft Pascal 4.0 Compiler Reference
  7504.  Manual" states the following:
  7505.  
  7506.  -1..50000   Invalid : becomes 65535..50000 (i.e., -1 is treated as
  7507.              65536)
  7508.  
  7509.  When converted to a two-byte unsigned word, -1 is treated as 65535
  7510.  instead of 65536.
  7511.  
  7512.  In addition, the Pascal compiler will issue "Warning 199 Integer Type
  7513.  Not Compatible With Word Type" and error "275 Invalid Range" if the
  7514.  above range is specified for a type or variable.
  7515.  
  7516.  Pascal does not allow integer4 subranges to be specified as constants.
  7517.  The 50000 upper bound of the subrange exceeds the maximum signed
  7518.  two-byte integer of 32767, so it is converted to an unsigned two-byte
  7519.  word type. The unsigned word equivalent of -1 is 65535; consequently
  7520.  the subrange -1..50000 apparently would be treated as 65535..50000.
  7521.  However, because Pascal does not allow a range to be specified from a
  7522.  high value to a lower value, the invalid range error results.
  7523.  
  7524.  
  7525.  188. Directory Listing for Pascal 3.32 Distribution Disks
  7526.  
  7527.  Product Version(s): 3.32
  7528.  Operating System:   MS-DOS
  7529.  Flags: ENDUSER |
  7530.  Last Modified: 26-SEP-1988    ArticleIdent: Q35299
  7531.  
  7532.  The following is a listing of the directories for each of the
  7533.  Microsoft Pascal Version 3.32 Compiler distribution disks (5.25-inch disks).
  7534.  The information is the resulting output when the DOS command "dir" is
  7535.  performed on each directory and subdirectory.
  7536.  
  7537.  A line of colons (:::::) separates each disk; subdirectories are
  7538.  listed below their parent directory. The first line of each disk
  7539.  description is the name of the disk as it is printed on the label.
  7540.  
  7541.  The following is a listing of directories for Pascal Version 3.32
  7542.  distribution disks:
  7543.  
  7544.  Disk 1 of 2  --
  7545.  
  7546.  Volume in drive A is DISK 1
  7547.  Directory of  A:\
  7548.  
  7549.  PAS1     EXE    98284  11-20-86   4:39p
  7550.  PAS2     EXE   114760  11-20-86   4:35p
  7551.  PAS3     EXE    28310  11-20-86   4:36p
  7552.  LINK     EXE    48471   6-12-86   3:04p
  7553.  README   DOC    26972  11-20-86   5:34p
  7554.  CODEVIEW DOC     2375  11-20-86   5:26p
  7555.  LIB      EXE    29359   6-25-86   5:38p
  7556.          7 File(s)     10240 bytes free
  7557.  
  7558.  :::::::::::::::::::::::::::::::::::::::
  7559.  
  7560.  Disk 2 of 2  --
  7561.  
  7562.   Volume in drive A is DISK 2
  7563.   Directory of  A:\
  7564.  
  7565.  MATH     LIB    40960  10-31-86   6:58p
  7566.  ALTMATH  LIB    39936  10-31-86   6:59p
  7567.  DECMATH  LIB    28160  10-31-86   6:59p
  7568.  8087     LIB    29696  10-31-86   6:59p
  7569.  PASEXEC  INC     4406  11-03-86   7:03p
  7570.  DEMOEXEC PAS     1211  11-04-86  12:31p
  7571.  FINU             5482   1-25-85   4:22p
  7572.  NULE6    OBJ      586   1-25-85   4:23p
  7573.  FINK             3472   1-25-85   4:22p
  7574.  FINKXU           4361   1-25-85   4:22p
  7575.  LVARSTCK OBJ      442   3-04-85   5:54p
  7576.  SORT     PAS     2097  12-10-83  12:11p
  7577.  PRIMES   PAS      770  12-10-83  12:11p
  7578.  EXEPACK  EXE    11684   3-29-86   8:22a
  7579.  EXEMOD   EXE    11034  10-01-85   3:29p
  7580.  EMOEM    ASM    11485   9-02-85  12:24p
  7581.  CEXEC    LIB    13824  10-29-86   3:09a
  7582.  87       EXE     4680   9-16-86   4:00p
  7583.  87       DOC      921  11-04-86  12:46p
  7584.  PASCAL   LIB    93696  11-19-86   7:17p
  7585.         20 File(s)     44032 bytes free
  7586.  
  7587.  
  7588.  189. Directory Listing for Pascal 4.00 Distribution Disks
  7589.  
  7590.  Product Version(s): 4.00   | 4.00
  7591.  Operating System:   MS-DOS | OS/2
  7592.  Flags: ENDUSER |
  7593.  Last Modified: 26-SEP-1988    ArticleIdent: Q35300
  7594.  
  7595.  Below is a listing of the directories for each of the Microsoft Pascal
  7596.  Version 4.00 Compiler distribution disks (5.25-inch disks). The
  7597.  information is the resulting output when the DOS command "dir" is
  7598.  performed on each directory and subdirectory.
  7599.  
  7600.  A line of colons (:::::) separates each disk, and subdirectories are
  7601.  listed below their parent directory. The first line of each disk
  7602.  description is the name of the disk as it is printed on the label.
  7603.  Information in parentheses is supplemental and not contained on the
  7604.  disk label.
  7605.  
  7606.  The following is a listing of directories of the Pascal Version 4.00
  7607.  distribution disks:
  7608.  
  7609.  (Disk 1 of 9)  -  Setup and Compiler
  7610.  
  7611.   Volume in drive A is SETUP
  7612.   Directory of  A:\
  7613.  
  7614.  README   DOC    48065   4-29-88   9:30a
  7615.  PACKING  LST     6520   4-27-88  10:31a
  7616.  SETUP    EXE    81181   4-22-88   2:27p
  7617.  87       EXE     8798   7-23-87   1:34p
  7618.  BIND     EXE    36946  10-26-87   4:01p
  7619.  ECH      EXE    19351  11-16-87  10:22a
  7620.  EXP      EXE    32220  11-17-87   3:38p
  7621.  ERROUT   EXE    10729  11-09-87   4:42p
  7622.  EXEHDR   EXE    29942   1-14-88   8:44p
  7623.  EXEMOD   EXE    12336  11-09-87   4:42p
  7624.  EXEPACK  EXE    14803   8-20-87   4:02p
  7625.  IMPLIB   EXE    30166   1-29-88  10:23a
  7626.  SETENV   EXE    10870  11-09-87   4:43p
  7627.         13 File(s)     13312 bytes free
  7628.  
  7629.  :::::::::::::::::::::::::::::::::::::::
  7630.  
  7631.  (Disk 2 of 9)  -  Utilities
  7632.  
  7633.   Volume in drive A is UTILITIES
  7634.   Directory of  A:\
  7635.  
  7636.  PAS1     EXE   139623   4-21-88  10:05p
  7637.  PAS2     EXE   131199   4-21-88  10:05p
  7638.  PAS3     EXE    40401   4-21-88  10:06p
  7639.  MAKE     EXE    38613   1-29-88  10:26a
  7640.          4 File(s)     10240 bytes free
  7641.  
  7642.  :::::::::::::::::::::::::::::::::::::::
  7643.  
  7644.  (Disk 3 of 9)  -  Examples
  7645.  
  7646.   Volume in drive A is EXAMPLES
  7647.   Directory of  A:\
  7648.  
  7649.  LINK     EXE   117001   2-23-88   5:07p
  7650.  PL       EXE    31861   3-25-88  10:29a
  7651.  RM       EXE    24884  11-16-87  10:20a
  7652.  FINK             3472   1-25-85   4:22p
  7653.  FINKXU           4331   8-27-87   4:09p
  7654.  FINU             5482   1-25-85   4:22p
  7655.  CLOCK    INT      308   5-15-87   4:15p
  7656.  INTRP    INT      225   5-15-87   4:15p
  7657.  PASEXEC  INC     4450   5-14-87   6:00p
  7658.  PORT     INT      129   5-15-87   4:15p
  7659.  BSE      INT     1062   1-15-88   8:46p
  7660.  BSEERR   INT    18185   1-15-88   8:46p
  7661.  BSESUB   INT    20490   2-05-88   6:15p
  7662.  OS2      INT      716   1-15-88   8:46p
  7663.  OS2DEF   INT     1835   1-22-88   9:31a
  7664.  BSEDOS   INT    39921   2-12-88   6:43p
  7665.  DEMOEXEC PAS     1211  10-29-86   2:55a
  7666.  PRIMES   PAS      634   3-06-87   2:38p
  7667.  SORTDEMO PAS    27342   2-02-88  10:31a
  7668.  MAKESORT BAT     1326   2-11-88  10:06a
  7669.  MAKESORT CMD     1313   2-19-88   7:52p
  7670.  EMOEM    ASM    12125  10-22-87   6:46p
  7671.  ENTX6L   ASM    10863  12-16-87   2:46a
  7672.  ENTXSTUB ASM      394  10-06-87   7:01p
  7673.         24 File(s)     18432 bytes free
  7674.  
  7675.  :::::::::::::::::::::::::::::::::::::::
  7676.  
  7677.  (Disk 4 of 9)  -  Libraries 1
  7678.  
  7679.   Volume in drive A is LIBRARY-1
  7680.   Directory of  A:\
  7681.  
  7682.  UNDEL    EXE    30046  11-16-87  10:24a
  7683.  LVARSTCK OBJ      487   2-09-88   1:28p
  7684.  APILMR   OBJ      105  10-15-87   6:01p
  7685.  ENTX6L   OBJ     1357   3-09-88  10:54p
  7686.  5ENTX6L  OBJ     1320   3-09-88  10:54p
  7687.  ENTX6W   OBJ     1339   3-09-88  10:55p
  7688.  5ENTX6W  OBJ     1302   3-09-88  10:55p
  7689.  API      LIB    81408  12-11-87   1:51p
  7690.  DOS30P   LIB    26919   4-21-88   9:31p
  7691.  DOS50P   LIB    25443   4-21-88   9:31p
  7692.  EMR      LIB    16409   1-14-88   4:33p
  7693.  EM       LIB    16921   1-14-88   4:33p
  7694.  87R      LIB     4121   1-14-88   4:33p
  7695.  87       LIB     4121   1-14-88   4:33p
  7696.  CEXEC    LIB    14089   4-21-88   9:12p
  7697.  DOSCALLS LIB    29184   1-07-88  11:34a
  7698.  PASLIBW  LIB    82441   4-21-88   9:32p
  7699.  WIN87EM  LIB     1055  10-03-87   6:17p
  7700.  MAKELIB  BAT     3148   3-09-88  10:44p
  7701.         19 File(s)      8192 bytes free
  7702.  
  7703.  :::::::::::::::::::::::::::::::::::::::
  7704.  
  7705.  (Disk 5 of 9)  -  Libraries
  7706.  
  7707.   Volume in drive A is LIBRARY-2
  7708.   Directory of  A:\
  7709.  
  7710.  LIB      EXE    49661   2-09-88  10:53a
  7711.  EXEC     EXE     9299  12-29-87  10:25a
  7712.  ILINK    EXE    88929   2-03-88  10:30a
  7713.  NULF     OBJ      957   1-06-87   3:42p
  7714.  NULE6    OBJ      586   1-25-85   4:23p
  7715.  PARTIAL  LIB    56763   4-21-88   9:31p
  7716.  ALTMATH  LIB    41989   1-14-88   3:55p
  7717.  DECMATH  LIB    27969   1-14-88   3:55p
  7718.  IEEEMATH LIB    24847   1-14-88   3:54p
  7719.  8087     LIB    24849   1-14-88   3:54p
  7720.  MAKELIB  BAT     3148   3-09-88  10:44p
  7721.  MAKELIB2 BAT     3846   3-09-88  10:48p
  7722.         12 File(s)     22528 bytes free
  7723.  
  7724.  :::::::::::::::::::::::::::::::::::::::
  7725.  
  7726.  (Disk 6 of 9)  -  Microsoft CodeView for MS-DOS
  7727.  
  7728.   Volume in drive A is CODEVIEW
  7729.   Directory of  A:\
  7730.  
  7731.  CV       EXE   263890   3-09-88   1:54a
  7732.  CV       HLP    22444   1-12-88   4:57p
  7733.  CVPACK   EXE    49400   3-01-88  12:07a
  7734.  MOUSE    COM    14551   3-06-88   9:41a
  7735.          4 File(s)     10240 bytes free
  7736.  
  7737.  :::::::::::::::::::::::::::::::::::::::
  7738.  
  7739.  (Disk 7 of 9)  -  Microsoft CodeView for MS OS/2
  7740.  
  7741.   Volume in drive A is CODEVIEWOS2
  7742.   Directory of  A:\
  7743.  
  7744.  CVP      EXE   233249   3-09-88   1:56a
  7745.  CVP      HLP    22444   1-12-88   4:57p
  7746.          2 File(s)    106496 bytes free
  7747.  
  7748.  :::::::::::::::::::::::::::::::::::::::
  7749.  
  7750.  (Disk 8 of 9)  -  Microsoft Editor
  7751.  
  7752.   Volume in drive A is EDITOR
  7753.   Directory of  A:\
  7754.  
  7755.  CALLTREE EXE    31233  12-29-87   4:03p
  7756.  M        EXE    94821   2-02-88   5:35p
  7757.  MEP      EXE    97063   2-02-88   5:36p
  7758.  MEGREP   EXE    31915  11-16-87  10:23a
  7759.  BRIEF    INI     2094   1-14-88  10:38p
  7760.  EPSILON  INI      978   1-14-88  10:42p
  7761.  QUICK    INI     1058   1-14-88  10:51p
  7762.  WS       DLL     2609  12-15-87   5:14p
  7763.  WS       ZXT     2084  12-15-87   5:14p
  7764.  EXT      DOC    15877   1-07-88  11:25a
  7765.  EXT      H       8730  12-15-87   4:06p
  7766.  EXTHDR   OBJ     1893  12-15-87   5:13p
  7767.  EXTHDRP  OBJ     2021  12-15-87   5:14p
  7768.  SKEL     C       2457  10-23-87   9:29a
  7769.  SKEL     DEF      211  12-14-87   3:08p
  7770.         15 File(s)     59392 bytes free
  7771.  
  7772.  :::::::::::::::::::::::::::::::::::::::
  7773.  
  7774.  (Disk 9 of 9)  -  Startup Source Code
  7775.  
  7776.   Volume in drive A is STARTUP
  7777.   Directory of  A:\
  7778.  
  7779.  DOS          <DIR>      4-22-88   2:16p
  7780.  OS2          <DIR>      4-22-88   2:16p
  7781.  PATCH32      <DIR>      4-22-88   2:16p
  7782.  BRKCTL   INC      784   2-09-88  10:08p
  7783.  CHKSTK   ASM     2044   2-21-88   6:54p
  7784.  CHKSUM   ASM     3524   2-09-88  10:09p
  7785.  CMACROS  INC    12066   2-09-88  10:08p
  7786.  CRT0FP   ASM     2223   2-09-88  10:09p
  7787.  FMSGHDR  ASM     2429   2-09-88  10:09p
  7788.  MAKEFILE         4148   2-21-88   6:50p
  7789.  MSDOS    H       6849   2-09-88  10:10p
  7790.  MSDOS    INC     6181   2-21-88   6:53p
  7791.  NULBODY  C         13   2-09-88  10:10p
  7792.  README   DOC     3199   1-27-88   4:57p
  7793.  REGISTER H        922   2-09-88  10:10p
  7794.  SETARGV  ASM      971   2-09-88  10:09p
  7795.  STARTUP  BAT     1663   1-27-88   4:57p
  7796.  VERSION  INC      503   2-09-88  10:08p
  7797.  WILD     C       7182   2-09-88  10:09p
  7798.  FILE2    H       1027   2-09-88  10:10p
  7799.  _FILE    C       1691   2-09-88  10:09p
  7800.         21 File(s)    158720 bytes free
  7801.  
  7802.   Volume in drive A is STARTUP
  7803.   Directory of  A:\DOS
  7804.  
  7805.  .            <DIR>      4-22-88   2:16p
  7806.  ..           <DIR>      4-22-88   2:16p
  7807.  CRT0     ASM     7612   2-09-88  10:09p
  7808.  CRT0DAT  ASM    14175   2-09-88  10:09p
  7809.  CRT0MSG  ASM     2840   2-09-88  10:09p
  7810.  EXECMSG  ASM     1337   2-09-88  10:09p
  7811.  NMSGHDR  ASM     3010   2-24-88   3:37p
  7812.  NULBODY  LNK      149   2-21-88   6:51p
  7813.  STDALLOC ASM     2825   2-09-88  10:09p
  7814.  STDARGV  ASM    13852   2-09-88  10:09p
  7815.  STDENVP  ASM     3780   2-21-88   6:54p
  7816.         11 File(s)    158720 bytes free
  7817.  
  7818.   Volume in drive A is STARTUP
  7819.   Directory of  A:\OS2
  7820.  
  7821.  .            <DIR>      4-22-88   2:16p
  7822.  ..           <DIR>      4-22-88   2:16p
  7823.  CRT0     ASM    10312   2-21-88   6:54p
  7824.  CRT0DAT  ASM    10496   2-09-88  10:09p
  7825.  CRT0MSG  ASM     2891   2-09-88  10:09p
  7826.  EXECMSG  ASM     2231   2-17-88   8:49a
  7827.  NMSGHDR  ASM     3486   2-09-88  10:10p
  7828.  NULBODY  LNK      168   2-21-88   6:51p
  7829.  STDALLOC ASM     3245   2-09-88  10:10p
  7830.  STDARGV  ASM    13623   2-09-88  10:10p
  7831.  STDENVP  ASM     5362   2-21-88   6:54p
  7832.         11 File(s)    158720 bytes free
  7833.  
  7834.   Volume in drive A is STARTUP
  7835.   Directory of  A:\PATCH32
  7836.  
  7837.  .            <DIR>      4-22-88   2:16p
  7838.  ..           <DIR>      4-22-88   2:16p
  7839.  PATCH87  DOC     3937   2-19-88   4:30p
  7840.  PATCH87  EXE     4206   1-29-88   2:30p
  7841.  SETRHS   EXE      543   6-29-86   4:00a
  7842.  RMRHS    EXE      543   6-29-86   4:00a
  7843.  STKPAT   BAT       94   6-29-86   4:00a
  7844.  STKPAT   SCR       30   6-29-86   4:00a
  7845.  PTRACE87 PAT      188   1-06-88  10:57p
  7846.  PATCH320 DOC     2169   2-19-88   4:29p
  7847.  OS2PATCH EXE     1069   1-19-88   4:29p
  7848.  OS2PATCH DOC     1401   2-19-88   4:28p
  7849.         12 File(s)    158720 bytes free
  7850.  
  7851.  
  7852.  190. Example of File I/O and Writing to Printer in Pascal
  7853.  
  7854.  Product Version(s): 3.1x 3.20 3.3x 4.00 | 4.00
  7855.  Operating System:   MS-DOS              | OS/2
  7856.  Flags: ENDUSER | appnote
  7857.  Last Modified: 26-SEP-1988    ArticleIdent: Q35557
  7858.  
  7859.  The following is an example of simple file I/O, and writing to the
  7860.  printer in Pascal.
  7861.  
  7862.  The following is a sample program:
  7863.  
  7864.  {Program to demonstrate file and device I/O.
  7865.  
  7866.   First, perform console I/O by prompting user for keyboard input
  7867.   and sending input to screen.
  7868.  
  7869.   Then do same to and from a text file named "test.txt".
  7870.  
  7871.   Finally, open the printer and send a user-specified string to it.
  7872.  
  7873.   Text files are terminated by an End Of Line marker (a line feed),
  7874.   which must be written and read by writeln and readln instead of
  7875.   read and write.
  7876.  }
  7877.  
  7878.  program IO(input,output);
  7879.    var filevar : text;
  7880.        str     : lstring(80);
  7881.  
  7882.  begin
  7883.    {perform simple console string I/O}
  7884.    writeln;
  7885.    writeln('Input string of 80 or fewer characters : ');
  7886.    readln(str);
  7887.    writeln;
  7888.    writeln('String was : ',str);
  7889.  
  7890.    {create file "test.txt", and perform string I/O}
  7891.    assign(filevar, 'test.txt');  {assign name to file variable}
  7892.    rewrite(filevar);             {open new file for writing}
  7893.    writeln;
  7894.    writeln('Input string to write and read from file :');
  7895.    readln(str);
  7896.    writeln(filevar, str);   {write string to file}
  7897.    reset(filevar);          {reset file pointer to beginning of file}
  7898.    readln(filevar, str);    {read string & then display it}
  7899.    writeln('String was : ',str);
  7900.    close(filevar);          {close file, flushing file buffer, and
  7901.                              making filevar reusable}
  7902.  
  7903.    {open printer device and write string to it}
  7904.    assign(filevar, 'prn');  {"prn" is name of printer}
  7905.    rewrite(filevar);
  7906.    writeln;
  7907.    writeln('Input string to send to printer :');
  7908.    readln(str);
  7909.    writeln(filevar, str);
  7910.    close(filevar);
  7911.  
  7912.    writeln;
  7913.    writeln('Program completed. Good-bye.')
  7914.  end.
  7915.  
  7916.  
  7917.  191. Example of Allocating Memory on the far/long Heap in Pascal
  7918.  
  7919.  Product Version(s): 3.3x 4.00 | 4.00
  7920.  Operating System:   MS-DOS    | OS/2
  7921.  Flags: ENDUSER |
  7922.  Last Modified: 26-DEC-1990    ArticleIdent: Q35561
  7923.  
  7924.  The following is an example of dynamically allocating memory on the
  7925.  far (or long) heap in Pascal. This information applies to Microsoft
  7926.  Pascal Compiler versions 3.3x and 4.00 for MS-DOS, and version 4.00
  7927.  for MS-DOS and MS OS/2.
  7928.  
  7929.  The following is a program to show far (or long) heap allocation
  7930.  routines:
  7931.  
  7932.  {First allocate a maximum size block of 65,516 bytes. Assign values to
  7933.   the first bytes by an assignment statement and the fillsc procedure
  7934.   and display the memory contents on the screen.
  7935.  
  7936.   Allocate 64K byte blocks, then allocate 4K blocks until
  7937.   there are no more blocks of memory. Then free the blocks.
  7938.  
  7939.   The function allmqq is used to allocate blocks of memory, and
  7940.   returns a segment:offset "ads" type pointer. The function fremqq
  7941.   is used to free the blocks. An ads type has a ".s" field for the
  7942.   segment pointed to, and a ".r" type for the offset. If ".r" = 0,
  7943.   there is insufficient memory available for the request.
  7944.   If ".r" = 1, memory is corrupted.
  7945.  
  7946.   Unlike their counterparts getmqq and dismqq, allmqq and fremqq
  7947.   do not display error messages, so error checking is done within
  7948.   the program.
  7949.  
  7950.   Like the equivalent large-memory model C run-time library function
  7951.   malloc(), allmqq will first allocate blocks in the far/long heap
  7952.   above the default data segment (or Dgroup) until it is exhausted,
  7953.   then it will allocate blocks from the near heap in the default
  7954.   data segment.
  7955.  
  7956.   The NEW and DISPOSE routines can be used to allocate memory within
  7957.   the 64K byte or smaller default data segment too, though these are
  7958.   not demonstrated here. NEW and DISPOSE do not allocate memory on
  7959.   the far/long heap.
  7960.  
  7961.   For more information on far heap allocation, see pages 73-76 of the
  7962.   "Microsoft Pascal Compiler User's Guide," and the alphabetical
  7963.   listing of routines in the "Microsoft Pascal Compiler Reference
  7964.   Manual."
  7965.  }
  7966.  
  7967.  program AllocHeapMemory(input,output);
  7968.    const maxsize = 65516; {max size of far heap allocation block}
  7969.    type  bigptr_type   = ads of array [wrd(1)..wrd(maxsize)] of byte;
  7970.          smallptr_type = ads of array [1..4096] of byte;
  7971.    var   bigptr        : bigptr_type;           {pointer to 64K block}
  7972.          smallptr      : smallptr_type;         {pointer to 4K  block}
  7973.          {define arrays of pointers}
  7974.          arrbigptr     : array [1..50]   of bigptr_type;
  7975.          arrsmallptr   : array [1..1000] of smallptr_type;
  7976.          retcode       : word;            {return code from fremqq   }
  7977.          bigallocs,                       {number of big  allocations}
  7978.          smallallocs,                     {number of small allocs    }
  7979.          i             : integer;         {index to array of pointers}
  7980.          goodsmallptrs,                   {to indicate errors from   }
  7981.          goodbigptrs   : boolean;         {  freeing blocks          }
  7982.  
  7983.    {far heap allocation and free routines}
  7984.    function allmqq(allocsize : word)   : adsmem; extern; {alloc block}
  7985.    function fremqq(ptr       : adsmem) : word;   extern; {free  block}
  7986.  
  7987.  begin
  7988.    writeln;
  7989.    writeln('Allocate and free a single block on far/long heap:');
  7990.    bigptr := allmqq(sizeof(bigptr^));
  7991.    if (bigptr.r = 0) then
  7992.      writeln('Far heap allocation failed due to lack of memory.')
  7993.    else
  7994.      if (bigptr.r = 1) then
  7995.        writeln('Far heap allocation failed due to corrupted memory')
  7996.      else
  7997.        begin
  7998.          write('Segment:Offset of pointer to allocated block is ');
  7999.          writeln(bigptr.s:5, ':', bigptr.r:-5);
  8000.          {free block}
  8001.          retcode := fremqq(bigptr);
  8002.          if (retcode = 1) then
  8003.            writeln('Error freeing far pointer.')
  8004.        end;
  8005.  
  8006.    writeln;
  8007.    writeln('Begin allocation of 65516 byte blocks in far heap.');
  8008.    writeln;
  8009.    writeln('Display address of blocks allocated:');
  8010.    i := 1;
  8011.    bigallocs := 0;
  8012.    arrbigptr[i] := allmqq(sizeof(arrbigptr[i]^));
  8013.    while (arrbigptr[i].r <> 0) do
  8014.      begin
  8015.        write('Segment:Offset = ');
  8016.        writeln(arrbigptr[i].s:5, ':', arrbigptr[i].r:-5);
  8017.        bigallocs := bigallocs + 1;
  8018.        i := i + 1;
  8019.        arrbigptr[i] := allmqq(sizeof(arrbigptr[i]^))
  8020.      end;
  8021.  
  8022.    writeln;
  8023.    writeln('No more large blocks available in far heap.');
  8024.    writeln('Allocate 4K blocks -- notice that near heap is used');
  8025.    writeln('after far heap is exhausted as shown by pointers to');
  8026.    writeln('blocks in lower memory');
  8027.    writeln;
  8028.    writeln('Display address of blocks allocated:');
  8029.    i := 1;
  8030.    smallallocs := 0;
  8031.    arrsmallptr[i] := allmqq(sizeof(arrsmallptr[i]^));
  8032.    while (arrsmallptr[i].r <> 0) do
  8033.      begin
  8034.        write('Segment:Offset = ', arrsmallptr[i].s:5, ':');
  8035.        writeln(arrsmallptr[i].r:-5);
  8036.        smallallocs := smallallocs + 1;
  8037.        i := i + 1;
  8038.        arrsmallptr[i] := allmqq(sizeof(arrsmallptr[i]^))
  8039.      end;
  8040.  
  8041.    writeln;
  8042.    writeln('Far and near heap allocated. Now free blocks:');
  8043.    goodbigptrs := true;
  8044.    {free large blocks in far/long heap}
  8045.    for i := 1 to bigallocs do
  8046.      begin
  8047.        retcode := fremqq(arrbigptr[i]);
  8048.        if (retcode <> 0) then
  8049.          begin
  8050.            goodbigptrs := false;
  8051.            write('Bad pointer segment:offset at ');
  8052.            writeln(arrbigptr[i].s:5, ':', arrbigptr[i].r:-5)
  8053.          end
  8054.      end; {for}
  8055.    if (goodbigptrs) then
  8056.      writeln('Large blocks freed without error.');
  8057.  
  8058.    {free small blocks in far and near heap}
  8059.    goodsmallptrs := true;
  8060.    for i := 1 to smallallocs do
  8061.      begin
  8062.        retcode := fremqq(arrsmallptr[i]);
  8063.        if (retcode <> 0) then
  8064.          begin
  8065.            goodsmallptrs := false;
  8066.            write('Bad pointer segment:offset at ');
  8067.            writeln(arrsmallptr[i].s:5, ':', arrsmallptr[i].r:-5)
  8068.          end
  8069.      end; {for}
  8070.    if (goodsmallptrs) then
  8071.      writeln('Small blocks freed without error.');
  8072.  
  8073.    writeln;
  8074.    writeln('Program completed. Good-bye.')
  8075.  end.
  8076.  
  8077.  
  8078.  192. Pascal 4.00 TMP Varible Setting Causes "Line invalid" Error
  8079.  
  8080.  Product Version(s): 4.00   | 4.00
  8081.  Operating System:   MS-DOS | OS/2
  8082.  Flags: ENDUSER | buglist4.00
  8083.  Last Modified: 26-SEP-1988    ArticleIdent: Q35813
  8084.  
  8085.  The TMP environment variable set to C:\C\TMP causes the pl driver to
  8086.  fail when one or more options other than /c is given.
  8087.  
  8088.  The following is an example:
  8089.  
  8090.  pl /Zi /Pd foo.pas
  8091.  
  8092.  The result is as follows:
  8093.  
  8094.  Line invalid: 'junk', start again.
  8095.  Source filename [.PAS] :
  8096.  
  8097.  Microsoft has confirmed this to be a problem in Version 4.00. We are
  8098.  researching this problem and will post new information as it becomes
  8099.  available.
  8100.  
  8101.  The workaround to this problem is to change the TMP variable setting.
  8102.  
  8103.  
  8104.  193. The Standards to which MS Pascal Conforms
  8105.  
  8106.  Product Version(s): 4.00   | 4.00
  8107.  Operating System:   MS-DOS | OS/2
  8108.  Flags: ENDUSER |
  8109.  Last Modified: 18-OCT-1988    ArticleIdent: Q36802
  8110.  
  8111.  The ISO standard ISO 7185 for Pascal has two levels, 0 and 1. Level 0
  8112.  is identical to the ANSI/IEEE Pascal standard. Pascal Version 4.00
  8113.  supports the ANSI/IEEE Pascal standard, so Microsoft also supports ISO
  8114.  level 0.
  8115.  
  8116.  Note: level 1 of ISO is level 0 plus conformant array parameters.
  8117.  
  8118.  
  8119.  
  8120.  194. Pascal Versions 3.3x and Later Support Linker /STACK Switch
  8121.  
  8122.  Product Version(s): 3.2x 3.3x 4.00 | 4.00
  8123.  Operating System:   MS-DOS         | 4.00
  8124.  Flags: ENDUSER | s_link
  8125.  Last Modified: 24-OCT-1988    ArticleIdent: Q37207
  8126.  
  8127.  Microsoft Pascal, Versions 3.2x, do not support the linker switch
  8128.  /STACK for changing the stack size at link time. This option is
  8129.  supported in Versions 3.3x and later.
  8130.  
  8131.  In Versions 3.2x, a program was set to provide a variable size stack.
  8132.  Setting a stack size with the linker switch, and then having that size
  8133.  changed by a program, could cause unpredictable results. For this
  8134.  reason, you should not use the /STACK switch. This information is
  8135.  documented in the note at the bottom of Page 66 in the "Microsoft
  8136.  Pascal User's Guide" for Versions 3.2x and later.
  8137.  
  8138.  In Versions 3.3x and later, the stack size is fixed by the compiler.
  8139.  Therefore, changing stack size when linking is safe. The documentation
  8140.  note on Page 66 in the user's guide for Versions 3.3x and 4.00 is
  8141.  outdated. You will find more information on the /STACK linker switch
  8142.  in the README.DOC file that comes with Versions 3.3x and on Page 270
  8143.  in the "Microsoft CodeView and Utilities" manual that comes with
  8144.  Version 4.00.
  8145.  
  8146.  
  8147.  195. Error R6009 Not Enough Space for Environment in Pascal
  8148.  
  8149.  Product Version(s): 4.00
  8150.  Operating System:   MS-DOS
  8151.  Flags: ENDUSER | SR# S881020-4
  8152.  Last Modified: 12-FEB-1990    ArticleIdent: Q37217
  8153.  
  8154.  Question:
  8155.  
  8156.  I receive the following error at run time (or as I walk through the
  8157.  startup code in CodeView):
  8158.  
  8159.     R6009  not enough space for environment
  8160.  
  8161.  How can I remove this error?
  8162.  
  8163.  Response:
  8164.  
  8165.  The startup code loads the environment strings into the near heap.
  8166.  This behavior may cause the program to run out of heap space if you
  8167.  have a large amount of data or if your stack is large. Essentially,
  8168.  you are running out of space in DGROUP. To correct this problem,
  8169.  insert the following two procedures into the same module that defines
  8170.  the main program:
  8171.  
  8172.     procedure _setargv [public, c];
  8173.     begin
  8174.     end;
  8175.  
  8176.     procedure _setenvp [public, c];
  8177.     begin
  8178.     end;
  8179.  
  8180.  You will need to link with the /NOE option so that you do not get
  8181.  multiple definitions of these two routines.
  8182.  
  8183.  Note: This is basically a Pascal translation of the procedure
  8184.  described on Page 131 of the "Microsoft C Optimizing Compiler User's
  8185.  Guide" for Versions 5.00 and 5.10.
  8186.  
  8187.  
  8188.  196. Determining Available Memory
  8189.  
  8190.  Product Version(s): 4.00   | 4.00
  8191.  Operating System:   MS-DOS | OS/2
  8192.  Flags: ENDUSER | docerr
  8193.  Last Modified:  8-NOV-1988    ArticleIdent: Q37610
  8194.  
  8195.  Page Update-45 (section 5.3) of the "Microsoft Pascal Compiler for MS
  8196.  OS/2 and MS-DOS Operating System Version 4.0 Update" manual
  8197.  incorrectly states the following:
  8198.  
  8199.     FREECT(0) * 2 - MEMAVL returns the number of free bytes in the
  8200.     heap itself.
  8201.  
  8202.  This should read as follows:
  8203.  
  8204.     FREECT(0) * 2 returns the number of free bytes in the heap
  8205.     itself.
  8206.  
  8207.  
  8208.  197. Using packed Type Has No Effect on Variable's Storage.
  8209.  
  8210.  Product Version(s): 4.00   | 4.00
  8211.  Operating System:   MS-DOS | OS/2
  8212.  Flags: ENDUSER | sizeof
  8213.  Last Modified: 23-NOV-1988    ArticleIdent: Q38165
  8214.  
  8215.  In Microsoft Pascal, packed type will not affect storage of the
  8216.  variables with the packed type. This is specified in the "Microsoft
  8217.  Pascal Compiler User's Guide." (See section 9.2 Internal Representation
  8218.  of Data Type.) Therefore, the "sizeof" function will return unpacked
  8219.  size. The following is an example:
  8220.  
  8221.  Type
  8222.      packed_type = packed array [1..9] of byte ;
  8223.      unpacked_type = array [1..9] of byte ;
  8224.  var
  8225.      var1 : packed_type ;
  8226.      var2 : unpacked_type ;
  8227.  
  8228.  'var1' and 'var2' both occupy 10 bytes in memory.
  8229.  
  8230.  In Microsoft, storage of variables is word aligned.
  8231.  
  8232.  A component of a packed structure cannot be passed as a reference
  8233.  parameter unless the structure is of a string type. Therefore,
  8234.  following usage of sizeof function is illegal.
  8235.  
  8236.  The following is an example:
  8237.  
  8238.  var
  8239.      var_arr: packed array [1..10] of unpacked_type ;
  8240.  begin
  8241.      sizeof (var1[1]) ;
  8242.  end.
  8243.  
  8244.  
  8245.  198. Pascal Version 4.00 Can't Watch lstring in CodeView
  8246.  
  8247.  Product Version(s): 4.00    | 4.00
  8248.  Operating System:   MS-DOS  | OS/2
  8249.  Flags: ENDUSER | s_CodeView
  8250.  Last Modified: 23-NOV-1988    ArticleIdent: Q38300
  8251.  
  8252.  The Microsoft CodeView debugger Version 2.20 does not allow watching a
  8253.  lstring variable directly. The command "w ? lstr_var" responds with a
  8254.  "?CANNOT DISPLAY" message. The workaround is to use the "wa a l10".
  8255.  This is the watch ASCII expression at address lstr_var with a length
  8256.  of 10.
  8257.  
  8258.  The "w ? lstr_var" instruction was not implemented in CodeView Version
  8259.  2.20.
  8260.  
  8261.  
  8262.  199. CodeView Does Not Watch Non-Zero Based Arrays Correctly
  8263.  
  8264.  Product Version(s): 4.00   | 4.00
  8265.  Operating System:   MS-DOS | OS/2
  8266.  Flags: ENDUSER | S_Codeview
  8267.  Last Modified:  2-MAR-1989    ArticleIdent: Q40382
  8268.  
  8269.  Problem:
  8270.  
  8271.  I have written a program that defines an array with a non-zero base.
  8272.  The following is an example:
  8273.  
  8274.     data : array[2..5] of integer;
  8275.  
  8276.  In CodeView, I do not see the correct values when I set a watch on
  8277.  elements of this array.
  8278.  
  8279.  Response:
  8280.  
  8281.  This is a problem with the symbolic information generated by the Pascal
  8282.  compiler. Given the information passed to it, CodeView determines that
  8283.  all Pascal arrays have a base of zero -- even when they don't.
  8284.  
  8285.  A workaround to this problem is to adjust for this miscalculation by
  8286.  offsetting the index of any watched array so that its effective base
  8287.  is zero. For example, given the array defined above, you would
  8288.  actually set a watch on data[1] to watch data[3]. To watch data[x],
  8289.  set a watch on data[x-2].
  8290.  
  8291.  
  8292.  200. "Unresolved Externals" from DOSCALLS.LIB under OS/2.
  8293.  
  8294.  Product Version(s): 4.00
  8295.  Operating System:   OS/2
  8296.  Flags: ENDUSER |
  8297.  Last Modified: 23-NOV-1988    ArticleIdent: Q38357
  8298.  
  8299.  When compiling and linking in protected mode under OS/2 and using any
  8300.  systems calls, it is necessary to use the /Lp switch to bring in the
  8301.  library DOSCALLS.LIB. Attempting to use routines from DOSCALLS.LIB
  8302.  without using the /Lp switch results in the error "L2029: unresolved
  8303.  externals." This error occurs because the linker only brings in the
  8304.  standard Pascal library when you do not specify the /Lp switch. An
  8305.  alternate solution is to link separately, and specify both
  8306.  LIBPASEP.LIB and DOSCALLS.LIB on the link line.
  8307.  
  8308.  For example, to compile and link the file "EXAMPLE.PAS" for OS/2
  8309.  protected mode, use one of the following commands:
  8310.  
  8311.     PL /Lp EXAMPLE.PAS
  8312.  
  8313.     PL /c EXAMPLES.PAS
  8314.     LINK EXAMPLES.OBJ,,,LIBPASEP.LIB DOSCALLS.LIB
  8315.  
  8316.  
  8317.  201. Enumerated Types Input/Output as String Is Not Implemented
  8318.  
  8319.  Product Version(s): 4.00   | 4.00
  8320.  Operating System:   MS-DOS | OS/2
  8321.  Flags: ENDUSER |
  8322.  Last Modified: 14-FEB-1991    ArticleIdent: Q38393
  8323.  
  8324.  The sample program below uses the write format P::1 described on page
  8325.  284 of the "Microsoft Pascal Reference Manual" to output an enumerated
  8326.  type variable as a string. The program generates the following
  8327.  run-time error:
  8328.  
  8329.     ? Error: Data format error in file USER
  8330.       Error Code 1125
  8331.  
  8332.  The reading and writing of enumerated types is not possible in
  8333.  Microsoft Pascal. This limitation is explained in the "Microsoft
  8334.  Pascal User's Guide," Appendix B.3, "Unimplemented Features."
  8335.  
  8336.  The following is a sample program:
  8337.  
  8338.  (* Sample program *)
  8339.  program enumtype (input, output) ;
  8340.  type
  8341.      enumtype = (abc, xyz) ;
  8342.  var
  8343.      evar : enumtype ;
  8344.  
  8345.  begin
  8346.      evar := abc ;
  8347.      writeln(evar::1) ;  (* attempt to output 'abc' *)
  8348.  
  8349.  
  8350.  202. Error 133 Type Size Overflow with /Zi or /Z.
  8351.  
  8352.  Product Version(s): 4.00
  8353.  Operating System:   MS-DOS
  8354.  Flags: ENDUSER |
  8355.  Last Modified: 28-NOV-1988    ArticleIdent: Q38474
  8356.  
  8357.  Page 231 of the "Microsoft Pascal User's Guide" defines the "133 Type
  8358.  Size Overflow" error as follows:
  8359.  
  8360.     "The data type declared implies a structure bigger than the maximum
  8361.     of 65534 bytes"
  8362.  
  8363.  Pascal does not support data structures larger than 64K. However, this
  8364.  error sometimes occurs only when a program is compiled with the
  8365.  CodeView switches /Zi (for the PL driver) or /Z (for the PAS1 driver).
  8366.  This behavior occurs when a reference is made to a data structure that
  8367.  exceeds 64K in size, but the structure is never initialized and no
  8368.  memory allocation is made in the code.
  8369.  
  8370.  For example, the following line of code compiles with no errors if the
  8371.  CodeView switch is not used; however, it generates "133 Type Size
  8372.  Overflow" if the /Z or /Zi switch is used:
  8373.  
  8374.     XPTR:   ADS OF ARRAY [0..37500] OF REAL;
  8375.  
  8376.  This error occurs even if no allocation or initialization of the array
  8377.  occurs. If the structure itself is declared as follows, or if an
  8378.  attempt is made in the program to allocate memory for the array, the
  8379.  error occurs at compile time, regardless of the combination of
  8380.  command-line switches used:
  8381.  
  8382.     X : ARRAY [0..37500] OF REAL;
  8383.  
  8384.  Apparently, using the /Zi or /Z switch causes the compiler to check
  8385.  the referenced data type more closely, and detect the error before the
  8386.  allocation is actually made.
  8387.  
  8388.  
  8389.  203. Printing Formfeeds in Pascal
  8390.  
  8391.  Product Version(s): 4.00   | 4.00
  8392.  Operating System:   MS-DOS | OS/2
  8393.  Flags: ENDUSER |
  8394.  Last Modified:  2-MAR-1989    ArticleIdent: Q40078
  8395.  
  8396.  Problem:
  8397.  
  8398.  I'm sending output to my printer in Pascal. When my application is
  8399.  finished, I send a form feed to reset the page, but when I close the
  8400.  printer file, I get an extra line feed. The following code produces
  8401.  the problem:
  8402.  
  8403.      program printage(output);
  8404.  
  8405.      var filevar : text;
  8406.  
  8407.      begin
  8408.  
  8409.          assign(filevar, 'prn');
  8410.          rewrite(filevar);
  8411.  
  8412.          writeln(filevar, 'This is the first line!');
  8413.          write(filevar, chr(12));
  8414.  
  8415.          close(filevar)
  8416.  
  8417.      end.
  8418.  
  8419.  Response:
  8420.  
  8421.  By default, Pascal's file system uses records ending with LF. When
  8422.  the printer file from the Pascal source above is closed, a linefeed
  8423.  is appended to the file automatically to terminate the record that has
  8424.  been started, i.e., the single formfeed character.
  8425.  
  8426.  A simple solution to this situation is to not close the printer file.
  8427.  Normal files are closed by the exit code, but device files are handled
  8428.  differently, and will not have any unfinished records terminated.
  8429.  
  8430.  
  8431.  204. Printf() Example Is Wrong in Mixed-Language Guide
  8432.  
  8433.  Product Version(s): 4.00   | 4.00
  8434.  Operating System:   MS-DOS | OS/2
  8435.  Flags: ENDUSER | docerr s_c h_fortran h_masm
  8436.  Last Modified:  7-MAR-1990    ArticleIdent: Q58178
  8437.  
  8438.  The sample program TEST on Page 135 of the "Microsoft Mixed-Language
  8439.  Programming Guide" is incorrect, not only in syntax but also in its
  8440.  functionality.
  8441.  
  8442.  The program is presented to demonstrate the use of the VARYING
  8443.  attribute, which allows you to call functions from the C run-time
  8444.  library with a different number of arguments each time. This is
  8445.  demonstrated in this case by calling the C run-time function printf()
  8446.  directly from Pascal.
  8447.  
  8448.  However, the TYPE declaration and the three assignment statements in
  8449.  the main program body are syntactically incorrect. Replace the colon
  8450.  (:) in the "TYPE stype30 : string(30)" statement with an equal sign
  8451.  (=), and replace each of the equal signs in the assignment statements
  8452.  with Pascal assignment operators (:=).
  8453.  
  8454.  After correcting the syntax errors, the program still will not work.
  8455.  When linked with the large model C run-time library LLIBCE.LIB, it
  8456.  will return an incomplete string under DOS and will cause a
  8457.  protection violation under OS/2.
  8458.  
  8459.  For this program to work correctly, the argument(s) passed to printf()
  8460.  must be ADS pointers of type ADSMEM. ADSMEM is a predefined address
  8461.  type, which is equivalent to a far pointer type in C. When the ADS
  8462.  pointer type is used, the full segment:offset addresses of the strings
  8463.  are passed. The following is the corrected version of the program:
  8464.  
  8465.  Code Example
  8466.  ------------
  8467.  
  8468.  program Test(input,output);
  8469.  type
  8470.          stype30 = string(30);
  8471.  
  8472.  var
  8473.          str1 : string(30);
  8474.          str2 : string(10);
  8475.          n    : integer;
  8476.  
  8477.  procedure printf (s1 : ADSMEM) [C, VARYING]; extern;
  8478.  begin
  8479.          str1 :='This is %s string, number %d.' * chr(0);
  8480.          str2 :='formatted' * chr(0);
  8481.          n := 1;
  8482.          printf(ADS str1, ADS str2, n);
  8483.  end.
  8484.  
  8485.  This code runs correctly under DOS and OS/2. The output is as follows:
  8486.  
  8487.     This is formatted string, number 1.
  8488.  
  8489.  
  8490.  205. Using a function to set the offset of a ptr is unreliable
  8491.  
  8492.  Product Version(s): 4.00   | 4.00
  8493.  Operating System:   MS-DOS | OS/2
  8494.  Flags: ENDUSER | pointers offset
  8495.  Last Modified:  2-MAR-1989    ArticleIdent: Q40483
  8496.  
  8497.  The use of a function to change the offset of a pointer does not
  8498.  always work reliably. If used within a decision structure, such a
  8499.  function does not return the expected value. However, if assigned to a
  8500.  pointer, and then used within a similar decision structure, the
  8501.  function returns the proper offset. Although the function returns the
  8502.  expected offset when assigned to a pointer, it does not actually alter
  8503.  the offset of the pointer within the function.
  8504.  
  8505.  The following code sample exhibits this performance:
  8506.  
  8507.  PROGRAM pointertest(output);
  8508.  
  8509.  TYPE
  8510.    ptrtyp = ADS OF WORD;
  8511.  
  8512.  FUNCTION get_ptr : ptrtyp;
  8513.  {  This function will return an offset of 1, however get_ptr.R will
  8514.     never actually be set to 1 }
  8515.  Begin
  8516.    get_ptr.R := 1;
  8517.  End;
  8518.  
  8519.  VAR
  8520.    ptr : ptrtyp;
  8521.  
  8522.  BEGIN
  8523.    if get_ptr.R = 0 then     ! Because get_ptr never actually sets
  8524.                              ! the offset to 1, this comparison fails;
  8525.      writeln ('Returned 0')
  8526.    else
  8527.      writeln ('It worked!');
  8528.    writeln;
  8529.    ptr := get_ptr;           ! however, because get_ptr returns a
  8530.                              ! proper value, the following decision
  8531.    if ptr.R = 0 then         ! structure fuctions as expected.
  8532.      writeln ('Improper operation')
  8533.    else
  8534.      writeln ('This should work properly.');
  8535.  END.
  8536.  
  8537.  
  8538.  206. Example on Page 16 of Pascal Utilities Manual Is Incorrect
  8539.  
  8540.  Product Version(s): 4.00   | 4.00
  8541.  Operating System:   MS-DOS | OS/2
  8542.  Flags: ENDUSER | docerr
  8543.  Last Modified:  2-MAR-1989    ArticleIdent: Q41221
  8544.  
  8545.  The example on Page 16 of the "Microsoft Pascal 4.0 Compiler Microsoft
  8546.  CodeView and Utilities and Microsoft Editor" manual is incorrect. The
  8547.  command line: PL /Zi /c TEST does not produce an object file because
  8548.  no .PAS extension was given. To work around the problem, add the .PAS
  8549.  extension.
  8550.  
  8551.  
  8552.  207. Include Files Not Handled as Documentation Describes
  8553.  
  8554.  Product Version(s): 4.00   | 4.00
  8555.  Operating System:   MS-DOS | OS/2
  8556.  Flags: ENDUSER | docerr
  8557.  Last Modified: 28-MAR-1989    ArticleIdent: Q42238
  8558.  
  8559.  Page Update-34 of the "Microsoft Pascal 4.0 Compiler User's Guide" states
  8560.  the following:
  8561.  
  8562.     When you use the $INCLUDE metacommand, the compiler looks for the
  8563.     specified file in this order:
  8564.  
  8565.     1. The specified directory, if you give a complete path name
  8566.  
  8567.     2. The current working directory
  8568.  
  8569.     3. Each directory listed in the INCLUDE environment variable
  8570.  
  8571.     For example, suppose that your source file contains the following
  8572.     metacommand:
  8573.  
  8574.         $INCLUDE \PAS\IAS
  8575.  
  8576.      In addition, the INCLUDE environment variable is set as below:
  8577.  
  8578.         C:\INC;C:\PAS\INC
  8579.  
  8580.      In this case, the compiler attempts to find the file IAS by
  8581.      searching directories in this order:
  8582.  
  8583.      1. The \PAS option on the current drive
  8584.  
  8585.      2. The current working directory
  8586.  
  8587.      3. The \INC option on drive C
  8588.  
  8589.      4. The \PAS\INC option on drive C
  8590.  
  8591.  There are a couple of problems with these statements.
  8592.  
  8593.  First, the proper syntax for an INCLUDE metacommand is as follows:
  8594.  
  8595.     { $INCLUDE: '\PAS\IAS' }
  8596.  
  8597.  Second, the specified directories is NOT searched. Because \PAS\INC
  8598.  fully qualifies the include file pathname, it only is found if INC is
  8599.  in the PAS directory immediately off the root. In the four cases
  8600.  above, the filespec actually searched for will be as follows:
  8601.  
  8602.  1. \PAS\IAS                     (This is correct)
  8603.  
  8604.  2. \PAS\IAS                     (Not starting at CWD)
  8605.  
  8606.  3. \INC\\PAS\IAS                (Violates DOS pathname spec)
  8607.  
  8608.  4. \PAS\INC\\PAS\IAS            (Violates DOS pathname spec)
  8609.  
  8610.  The directories would be properly searched if the include file IAS was
  8611.  not fully qualified.
  8612.  
  8613.  
  8614.  208. SORTDEMO Needs to Be Bound in Order to Run in DOS
  8615.  
  8616.  Product Version(s): 4.00   | 4.00
  8617.  Operating System:   MS-DOS | OS/2
  8618.  Flags: ENDUSER |
  8619.  Last Modified:  6-APR-1989    ArticleIdent: Q42944
  8620.  
  8621.  Question:
  8622.  
  8623.  Why do I get the following message from the Pascal compiler while
  8624.  trying to compile SORTDEMO.PAS in DOS?
  8625.  
  8626.     File Access Error In os2.int; code: 1140; Status: 110
  8627.     Compiler cannot continue
  8628.  
  8629.  Response:
  8630.  
  8631.  In order to be able to run SORTDEMO.PAS in DOS, you must BIND it. You
  8632.  will not have the necessary files to compile and BIND SORTDEMO if you
  8633.  set up for DOS only.
  8634.  
  8635.  OS2.INT is the include file that SORTDEMO.PAS uses. If you have not
  8636.  set up the Pascal compiler for OS/2, the OS2.INT file will not be
  8637.  copied to the hard disk during setup. Therefore, the compiler will not
  8638.  be able to open this file and will generate the error mentioned above.
  8639.  
  8640.  
  8641.  209. fremqq Fails to Free Memory Block
  8642.  
  8643.  Product Version(s): 4.00   | 4.00
  8644.  Operating System:   MS-DOS | OS-2
  8645.  Flags: ENDUSER |
  8646.  Last Modified: 28-MAR-1989    ArticleIdent: Q42765
  8647.  
  8648.  The following PASCAL program will not produce correct results under
  8649.  DOS, and causes a GP fault in OS/2. The program allocates a block of
  8650.  memory using the allmqq function, and then frees it using fremqq.
  8651.  
  8652.  Under DOS, the memory is never really freed, even though the fremqq
  8653.  returns a 0, indicating the free was successful. In OS/2 protect mode,
  8654.  a GP fault is generated immediately upon execution of the program.
  8655.  
  8656.  To prevent the problem, change the following statement:
  8657.  
  8658.      IF (ads0 <> ads out_im[1])
  8659.         THEN ww := fremqq (ads0);
  8660.  
  8661.  to the following:
  8662.  
  8663.      IF (ads0 <> ads out_im[1])
  8664.         THEN BEGIN
  8665.                  IF TRUE THEN ;
  8666.                  ww := fremqq (ads0);
  8667.              END;
  8668.  
  8669.  Also, a "WRITELN(' ');" statement will work in place of the dummy IF
  8670.  statement, as well. A "WRITE;" will NOT work. Also, installing the
  8671.  PASCAL 4.00 lstring patch has no effect.
  8672.  
  8673.  Microsoft has confirmed this to be a problem in Pascal Version 4.00.
  8674.  We are researching the problem and will post new information as it
  8675.  becomes available.
  8676.  
  8677.  The complete program is as follows:
  8678.  
  8679.  PROGRAM memtest (INPUT, OUTPUT);
  8680.  
  8681.  FUNCTION allmqq (wants : WORD) : adsmem ; EXTERNAL;
  8682.  FUNCTION fremqq (block : adsmem) : WORD ; EXTERNAL;
  8683.  
  8684.  VAR [PUBLIC]
  8685.      out_im : LSTRING (128);
  8686.  
  8687.  PROCEDURE insert_bchrec2 (CONST bytes : INTEGER4) [PUBLIC];
  8688.  
  8689.  VAR
  8690.     ads0     : adsmem;
  8691.     ww       : WORD;
  8692.  
  8693.  VAR [STATIC]
  8694.     buffersize : WORD;
  8695.     VALUE buffersize := 65408;
  8696.  
  8697.  BEGIN
  8698.      ads0.r := 0;
  8699.  
  8700.      WHILE ((buffersize >=128) AND (ads0.r <= 1)) DO
  8701.          BEGIN
  8702.              ads0 := allmqq(buffersize);
  8703.              IF (ads0.r <= 1)
  8704.                 THEN buffersize := buffersize - 128;
  8705.          END;
  8706.  
  8707.      IF (ads0 <> ads out_im[1])
  8708.          THEN ww := fremqq (ads0);
  8709.  
  8710.      WRITELN (buffersize:1, ',',ads0.s:1,',',ads0.r:1,',',ww:1);
  8711.  
  8712.  END;
  8713.  
  8714.  BEGIN
  8715.      FOR VAR ii := 1 TO 50 DO
  8716.          BEGIN
  8717.              WRITE (ii:3,': ');
  8718.              insert_bchrec2(0);
  8719.          END
  8720.  END.
  8721.  
  8722.  
  8723.  
  8724.  210. Prsrqq() and Prdrqq() prototypes not documented correctly
  8725.  
  8726.  Product Version(s): 4.00   | 4.00
  8727.  Operating System:   MS-DOS | OS/2
  8728.  Flags: ENDUSER | buglist4.00
  8729.  Last Modified:  6-APR-1989    ArticleIdent: Q43044
  8730.  
  8731.  Prsrqq() and prdrqq(), as documented on Page 249 of the Version 4.00
  8732.  "Microsoft Pascal Compiler Reference Manual," should return the first
  8733.  argument to the power of the second argument. When compiled, linked,
  8734.  and run, the code below generates a general protection fault in OS/2
  8735.  and, in DOS, generates the following error message:
  8736.  
  8737.  ? Error : negative REAL to REAL power
  8738.    Error Code 2133
  8739.  
  8740.  To correct the problem you must change the function prototype
  8741.  from:
  8742.  
  8743.  function prsrqq(a,b:REAL4):REAL4;EXTERN;
  8744.  
  8745.  to:
  8746.  
  8747.  function prsrqq(consts a,b:REAL4):REAL4;EXTERN;
  8748.  
  8749.  
  8750.  
  8751.  211. Pascal: Bad Code Produced by Union of Sets
  8752.  
  8753.  Product Version(s): 4.00   | 4.00
  8754.  Operating System:   MS-DOS | OS/2
  8755.  Flags: ENDUSER | buglist4.00
  8756.  Last Modified:  3-MAY-1989    ArticleIdent: Q43509
  8757.  
  8758.  The Microsoft Pascal Version 4.00 Compiler will generate incorrect
  8759.  code for the line containing the union and assignment in the program
  8760.  fragment below. The problem will arise only if the sets that are
  8761.  unioned contain less than 16 elements and the set receiving the union
  8762.  has greater than 16 elements.
  8763.  
  8764.      TYPE
  8765.          SSet = SET OF 1..8;     (* Must have fewer than 16 elements. *)
  8766.          LSet = SET OF 1..16;    (* Must have 16 or more elements.    *)
  8767.  
  8768.      VAR
  8769.          Set1  : SSet;
  8770.          Set2  : SSet;
  8771.          Union : LSet;
  8772.  
  8773.      BEGIN
  8774.          Set1 := [1..3];
  8775.          Set2 := [5..7];
  8776.  
  8777.          Union := Set1 + Set2;   (* Trouble right here! *)
  8778.      END.
  8779.  
  8780.  The union in this example is done properly in a single register, but
  8781.  its assignment to a variable requiring more than a word is incorrect.
  8782.  Under DOS, this will create an inaccurate assignment. Under OS/2, the
  8783.  assignment also will be inaccurate and may cause a GP fault.
  8784.  
  8785.  A pair of temporary variables that are the same size as the variable
  8786.  receiving the union can be used to work around the problem. First,
  8787.  assign the two smaller sets to the temporary variables, then use the
  8788.  temporary variables in the union.
  8789.  
  8790.  Microsoft has confirmed this to be a problem in Version 4.00. We are
  8791.  researching this problem and will post new information as it becomes
  8792.  available.
  8793.  
  8794.  
  8795.  212. Setup Fails When Installing Libraries for Windows Programming
  8796.  
  8797.  Product Version(s): 4.00
  8798.  Operating System:   MS-DOS
  8799.  Flags: ENDUSER | buglist4.00
  8800.  Last Modified:  3-MAY-1989    ArticleIdent: Q43973
  8801.  
  8802.  If the Pascal 4.00 Setup program is invoked with the /L switch to
  8803.  install libraries, and you select "Remove stack segment for Windows
  8804.  compatibility", Setup will fail. Setup will ask for the Libraries 1
  8805.  disk, and upon copying the six necessary files, it will ask again for
  8806.  the same disk. Whether you remove the disk, or try other disks, Setup
  8807.  continues to ask for the Libraries 1 disk.
  8808.  
  8809.  The workaround is to install the libraries without Windows
  8810.  compatibility, and make the changes manually. After building the
  8811.  library, copy the file ENTX6W.OBJ from the disk marked "Libraries 1"
  8812.  into your LIB directory. Change to your LIB directory, and type "LIB
  8813.  LIBPASE.LIB". The LIB utility will start and prompt you with the
  8814.  following:
  8815.  
  8816.     Operations:
  8817.  
  8818.  Type "-ENT6L.OBJ+ENTX6W" at this prompt, and press ENTER. Press ENTER
  8819.  twice more after this. LIB will convert your library for use with
  8820.  Windows programming.
  8821.  
  8822.  Microsoft is researching this problem and will post new information as
  8823.  it becomes available.
  8824.  
  8825.  
  8826.  213. Pascal Runs Out of Memory Compiling a Unit
  8827.  
  8828.  Product Version(s): 4.00  | 4.00
  8829.  Operating System:   MS-DOS | OS/2
  8830.  Flags: ENDUSER | SR# G890725-23266 buglist4.00
  8831.  Last Modified: 26-SEP-1989    ArticleIdent: Q47743
  8832.  
  8833.  When compiling the following Pascal unit with the command line
  8834.  
  8835.     pl /c /Zi newbits.pas
  8836.  
  8837.  the error "Error:  Compiler Out Of Memory" occurs.
  8838.  
  8839.  To work around the problem, use one of the following command lines:
  8840.  
  8841.     pl /c newbits.pas
  8842.     pl /c /Zd newbits.pas
  8843.  
  8844.  Including the /Zd option gives line number information that will help
  8845.  make debugging in CodeView a little easier.
  8846.  
  8847.  The following is the source code for the unit that demonstrates the
  8848.  problem:
  8849.  
  8850.  *** FILE NEWBITS.PAS ***
  8851.  
  8852.  {$include: 'newbits.INT'}
  8853.  {$message: 'newbits.PAS'}
  8854.  
  8855.  implementation of newbits;
  8856.  
  8857.  {$message: '1'}
  8858.  
  8859.  var MACHT2_TABEL: array [bit_NR] of Byte;
  8860.  
  8861.  {$message: '2'}
  8862.  
  8863.  function MACHT2;
  8864.  
  8865.  {$message: '3'}
  8866.  
  8867.  begin
  8868.  {$message: '4'}
  8869.    MACHT2:=MACHT2_TABEL[exponent];
  8870.  {$MESSAGE: '5'}
  8871.  end; {MACHT2}
  8872.  
  8873.  {$MESSAGE: '6'}
  8874.  
  8875.  procedure SET_BIT {var B:byte; BN:BIT_NR; STATUS:SWITCH};
  8876.  
  8877.  begin if not (status = bit_status(b,bn)) then
  8878.        begin case status of
  8879.               off: B:= B and not macht2_tabel[BN];
  8880.               on : B:= B or macht2_tabel[bn]
  8881.              end
  8882.        end
  8883.  end; {setbit}
  8884.  
  8885.  function BIT_STATUS {b:byte; BN:BIT_NR):switch};
  8886.  
  8887.  begin if (b and macht2_tabel[bn]) = 0 then bit_status := off
  8888.                                        else BIT_STATUS := on
  8889.  end; {bit_status}
  8890.  
  8891.  {$message: '7'}
  8892.  
  8893.  {$message: '8'}
  8894.  begin {newbits}
  8895.        macht2_tabel[0] :=    1;
  8896.        macht2_tabel[1] :=    2;
  8897.        macht2_tabel[2] :=    4;
  8898.        macht2_tabel[3] :=    8;
  8899.        macht2_tabel[4] :=   16;
  8900.        macht2_tabel[5] :=   32;
  8901.        macht2_tabel[6] :=   64;
  8902.        macht2_tabel[7] :=  128;
  8903.  
  8904.        Nil_adr.R:= 16#0000;
  8905.  
  8906.        NIL_ads.S:= 16#0000;
  8907.        NIL_ADS.S:= 16#ffff
  8908.  end. {newbits}
  8909.  
  8910.  *** FILE NEWBITS.INT ***
  8911.  
  8912.  {$message: 'newbits.int'}
  8913.  
  8914.  interface;
  8915.  
  8916.  unit newbits(MAX_BIT_NR,
  8917.                SWITCH, OFF, ON,
  8918.                BIT_NR,
  8919.                SEG_ADDRESS, REL_ADDRESS,
  8920.                NIL_ADR, NIL_ADS,
  8921.                MACHT2,
  8922.                SET_BIT, BIT_STATUS);
  8923.  
  8924.  const MAX_BIT_NR = 7;
  8925.  
  8926.  type SWITCH = (OFF,ON);
  8927.  
  8928.       BIT_NR = 0..MAX_BIT_NR;
  8929.  
  8930.       SEG_ADDRESS = ADS OF SEG_ADDRESS;
  8931.       REL_ADDRESS = ADS OF REL_ADDRESS;
  8932.  
  8933.  var NIL_ADR: REL_ADDRESS;
  8934.      NIL_ADS: SEG_ADDRESS;
  8935.  
  8936.  function macht2(exponent:BIT_NR):BYTE ;
  8937.  
  8938.  procedure SET_BIT(VAR B:BYTE; BN:BIT_NR; STATUS:SWITCH);
  8939.  
  8940.  FUNCTION BIT_STATUS(B:BYTE; BN:BIT_NR):SWITCH;
  8941.  
  8942.  BEGIN {newbits}
  8943.  END; {newbits}
  8944.  
  8945.  
  8946.  214. Add Path to Data Filename for Pascal Debugging with CVP2.2
  8947.  
  8948.  Product Version(s): 4.00
  8949.  Operating System:   OS/2
  8950.  Flags: ENDUSER | S_CodeView
  8951.  Last Modified: 19-MAY-1989    ArticleIdent: Q44032
  8952.  
  8953.  The version of CodeView Protect (CVP) mode that comes with Pascal 4.00
  8954.  (i.e., CVP 2.20) does not know where the current working directory is
  8955.  located as a result of using the DosStartSession API from OS/2 Version
  8956.  1.00, which did not provide this information. With OS/2 Version 1.10's
  8957.  DosStartSession, the path of the current working directory would be
  8958.  known, but CVP Version 2.20 does not make use of it. Later versions of
  8959.  CVP provided with the OS/2 Software Development Kit, such as CVP
  8960.  Version 2.30 from OS/2 SDK Version 1.06, do not support Pascal Version
  8961.  4.00.
  8962.  
  8963.  If you have access to a second monitor the problem goes away with
  8964.  the /2 option.
  8965.  
  8966.  The following example allows the current working directory, or any
  8967.  other path on the current drive, to be defined with the compiler
  8968.  option /Ddatafilename=<path>, where <path> is the path to the data
  8969.  file to be opened.
  8970.  
  8971.  Note: A colon cannot be used in the defined constant for <path>,
  8972.  although another symbol could be used and replaced in the {$ifdecl}
  8973.  block within the program.
  8974.  
  8975.  This program allows the data file's path to be coded into the .EXE so
  8976.  that it may be found when debugging the program with CVP 2.20.
  8977.  
  8978.  {   Program to prepend path to data filename using compile line
  8979.      defined constant "datafilepath", using /Ddatafilepath=\path...
  8980.      (Note that path cannot include a colon for a drive letter.)
  8981.  
  8982.      This program helps overcome a limitation of CVP 2.20 for Pascal 4.00
  8983.      under either OS/2 1.00 or 1.10 of not knowing where the current
  8984.      working directory is located, especially if the current directory
  8985.      contains the data file in question. An alternative would be to
  8986.      hard code the path in the data filename, or debug with all files
  8987.      in the root directory of the boot drive.
  8988.  }
  8989.  
  8990.  program FilePathName(input,output);
  8991.  var filevar  : text;          {data text file variable}
  8992.      filename,                 {optionally fully qualified file name}
  8993.      data     : lstring(80);   {for data to read from file}
  8994.  
  8995.  begin
  8996.      filename := 'foo';
  8997.  
  8998.      {$ifdecl datafilepath $then}
  8999.          insert ('\', filename, 1); {insert path in front of file name}
  9000.          insert (datafilepath, filename, 1);
  9001.      {$end}
  9002.  
  9003.      writeln('filename = ',filename);
  9004.  
  9005.      {assign file name to file variable, open, read from & close file}
  9006.      assign(filevar,filename);
  9007.      reset(filevar);
  9008.      readln(filevar,data);
  9009.      writeln('read file, data = ',data);
  9010.      close(filevar);
  9011.  end.
  9012.  
  9013.  
  9014.  215. Different ADR Types and Different ADS Types Not Compatible
  9015.  
  9016.  Product Version(s): 4.00   | 4.00
  9017.  Operating System:   MS-DOS | OS/2
  9018.  Flags: ENDUSER | docerr
  9019.  Last Modified: 25-MAY-1989    ArticleIdent: Q44561
  9020.  
  9021.  Pascal is ordinarily a strongly typed language, but for ADR or ADS
  9022.  address types, Pascal assures only that they are both ADR or both ADS.
  9023.  However, Page 108 of the "Microsoft Pascal Reference Manual" for the
  9024.  Microsoft Pascal Compiler Version 4.00 is incorrect when stating the
  9025.  following:
  9026.  
  9027.     ...If P1 is type ADR OF STRING(200) and P2 is any ADR OF type, the
  9028.     assignment P1^:=P2^ generates fast code with no range checking.
  9029.     Although this capability is not safe, operating systems and other
  9030.     software sometimes require it.
  9031.  
  9032.  This statement is not correct. Address types can be assigned to each
  9033.  other regardless of the data type they point to as long as they are
  9034.  both ADR or ADS address types; however, the data they refer to with
  9035.  the caret (^) may not be freely assigned to a different type.
  9036.  
  9037.  For the address variables P1 and P2 above, assigning one address type
  9038.  to another as in the following statement would be correct:
  9039.  
  9040.     P1 := P2;  (* ADR := ADR is correct *)
  9041.  
  9042.  As with other incompatible data-type assignments in Pascal, a
  9043.  data-type conversion function must be used before the assignment is
  9044.  made. For the data types referred to by P1 and P2, a correct
  9045.  assignment would be as follows:
  9046.  
  9047.     P1^[1] := chr(P2^);
  9048.  
  9049.  P1^[1] is a single char element of the string referred to by P1, and
  9050.  the Pascal chr function converts the data type referred to by P2 to
  9051.  the char type that is compatible with a string element.
  9052.  
  9053.  The following program demonstrates the ADS OF type incompatibility and
  9054.  the associated error message (also produced for ADR OF types):
  9055.  
  9056.   program main(input,output);
  9057.   var
  9058.      p1 : ads of string(200);
  9059.      p2 : ads of word;
  9060.   begin
  9061.      p1^ := p2^;
  9062.   end.
  9063.  
  9064.  Microsoft (R) Pascal Compiler
  9065.  Version 4.00
  9066.  (C) Copyright Microsoft Corp 1987-1988. All rights reserved.
  9067.      11      9       p1^ := p2^;
  9068.              9   -------------^201 Types Not Assignment Compatible
  9069.   Pass One     1 Errors Detected.
  9070.  
  9071.  
  9072.  216. Program Fails to Receive First Character of Arguments
  9073.  
  9074.  Product Version(s): 4.00
  9075.  Operating System:   MS-DOS
  9076.  Flags: ENDUSER |
  9077.  Last Modified: 26-SEP-1989    ArticleIdent: Q47817
  9078.  
  9079.  When passing command-line arguments into a Pascal program, the first
  9080.  character of the first argument is lost if a space is not used as the
  9081.  delimiter. Pascal has built-in routines for reading and parsing
  9082.  command line arguments. These routines ignore the first character of
  9083.  the argument tail (usually the space delimiter).
  9084.  
  9085.  This problem appears to be an oversight of the Pascal start-up code.
  9086.  The start-up code parses the argument tail with the assumption that
  9087.  the first character is always a space. This works in most cases
  9088.  because options are usually separated from the program name with a
  9089.  space character. However, to pass arguments into a program without
  9090.  using the space delimiter. The "/" delimiter is an example that
  9091.  exhibits the problem.
  9092.  
  9093.  Another way this problem can occur is by spawning or execing the
  9094.  Pascal program from within another application. Arguments that are
  9095.  passed with spawn/exec are specified in an argument list. This
  9096.  argument list does not normally have a space as the first character.
  9097.  The arguments begin without any delimiter, and therefore, Pascal loses
  9098.  the first character of the first argument.
  9099.  
  9100.  Microsoft is researching this problem and will post new information as
  9101.  it becomes available.
  9102.  
  9103.  
  9104.  217. Additional Explanations of File System Errors 1030 to 1048
  9105.  
  9106.  Product Version(s): 3.30 3.31 3.32 4.00
  9107.  Operating System:   MS-DOS
  9108.  Flags: ENDUSER |
  9109.  Last Modified: 18-SEP-1989    ArticleIdent: Q45181
  9110.  
  9111.  The following are additional potential or actual explanations for the
  9112.  list of file-related run-time errors in Appendix F.4.1, Pages 259-60,
  9113.  of the Version 4.00 "Microsoft Pascal Compiler for the MS-DOS
  9114.  Operating System User's Guide":
  9115.  
  9116.     Error                 Potential or Actual Cause
  9117.     -----                 -------------------------
  9118.  
  9119.     1030 File system      Misc., see paragraphs below
  9120.     1031 Operation        Current user is not owner
  9121.     1032 File not found   No such file or directory
  9122.     1033 File not found   No such process
  9123.     1034 File system      Interrupted system call
  9124.     1035 Protected file   Input/Output error
  9125.     1036 File system      No such device
  9126.     1037 File system      Argument/assignment too long
  9127.     1038 File system      Executable file format error
  9128.     1039 File system      Bad file number
  9129.     1040 File system      No child process
  9130.     1041 Data format      No more processes
  9131.     1042 File system      Not enough space
  9132.     1043 Data format      Permission denied
  9133.     1044 File system      Bad address
  9134.     1045 Unknown device   Block device required
  9135.     1046 File system      Device busy
  9136.     1047 File system      File exists
  9137.     1048 File system      Cross-device link
  9138.  
  9139.  Note: The above explanations may not be completely accurate for every
  9140.  occurrence of their associated error, but they are usually correct.
  9141.  
  9142.  Run-time error 1030 can occur for a variety of reasons. It is a
  9143.  nonspecific file-handling error that does not fit exactly with any
  9144.  one of above categories each time it occurs. However, it does occur
  9145.  for one or more of the reasons listed above, or because of not having
  9146.  enough file handles in DOS.
  9147.  
  9148.  The number of file handles can be increased from the default of 8 to
  9149.  20 or more, for many implementations of DOS Versions 3.3x and 4.x,
  9150.  with the "FILES=" statement followed by a specified number of file
  9151.  handles in the root directory file CONFIG.SYS.
  9152.  
  9153.  
  9154.  218. Accessing PSP and Command-Line Arguments in Pascal
  9155.  
  9156.  Product Version(s): 3.30 3.31 3.32 4.00
  9157.  Operating System:   MS-DOS
  9158.  Flags: ENDUSER | docerr
  9159.  Last Modified:  7-JUN-1989    ArticleIdent: Q45197
  9160.  
  9161.  The Pascal public variable "cesxqq" provides the Program Segment
  9162.  Prefix (PSP) of the application and is equivalent to the Microsoft C
  9163.  variable "_psp". The Version 4.00 "Microsoft Pascal Compiler for the
  9164.  MS-DOS Operating System User's Guide" documents "cesxqq" on Page 163.
  9165.  
  9166.  Please note that the information regarding "cesxqq" on Page 164 of the
  9167.  above manual is entirely correct. Its use of the variable "LOMADS"
  9168.  gives only an approximate value for the beginning of the available far
  9169.  (or long) heap. Its use of the variable "HIMADS" appears incorrect due
  9170.  to the light print of the caret "^" following "MSDATA" in the
  9171.  statement that should appear as in the following:
  9172.  
  9173.     HIMADS.S := MSDATA^ ;
  9174.  
  9175.  The following is a program demonstrating the use of "cesxqq":
  9176.  
  9177.  {   This program uses Pascal's public variable "cesxqq" to find
  9178.      the segment containing its Program Segment Prefix under DOS.
  9179.      Cesxqq is equivalent to the _psp variable in Microsoft C.
  9180.  
  9181.      Due to Pascal's data-type checking, two pointers to
  9182.      different data types are used, even though the pointers will
  9183.      all point to the PSP's segment.
  9184.  
  9185.      PSP offset 128 contains a copy of the program's command
  9186.      line arguments. Note: This will be blank unless command line
  9187.      arguments are given when the program is invoked.
  9188.  
  9189.      PSP offset 2 contains the last segment allocated from DOS
  9190.      for this program, which is the top of the near heap.
  9191.  
  9192.      For additional information on the PSP, please consult a DOS
  9193.      programmer's reference.
  9194.  }
  9195.  
  9196.  Program GetPointerToPSPsSegment(input,output);
  9197.  var PtrCmdLn : ads of lstring(128);  {Far pointer to command line}
  9198.      PtrAllocTop : ads of word; {Pointer to last allocated segment}
  9199.  
  9200.      cesxqq [extern] : word; {Segment value of Program Segment Prefix}
  9201.  
  9202.  begin
  9203.      PtrCmdLn.s    := cesxqq; {PSP's segment assigned to ptr's .Segment}
  9204.      PtrAllocTop.s := cesxqq;
  9205.      PtrCmdLn.r    := 128; {PSP's offset 128 has copy of command line}
  9206.      PtrAllocTop.r := 2;   {PSP's offset 2 contains top allocated seg}
  9207.      writeln;
  9208.      writeln('Command line of program         = ',PtrCmdLn^);
  9209.      writeln('Last segment allocated from DOS = ',PtrAllocTop^:6)
  9210.  end.
  9211.  
  9212.  
  9213.  219. Passing Arguments into a Pascal Program
  9214.  
  9215.  Product Version(s): 3.30 4.00
  9216.  Operating System:   MS-DOS
  9217.  Flags: ENDUSER |
  9218.  Last Modified: 26-SEP-1989    ArticleIdent: Q47818
  9219.  
  9220.  Microsoft Pascal provides an easy method to pass command-line
  9221.  arguments into a Pascal program. One of the functions of the Pascal
  9222.  start-up code is to parse the command line for arguments. These
  9223.  arguments are then passed into the program just as if they were being
  9224.  passed in as parameters, their associated names appearing on the
  9225.  PROGRAM line. The parameter types should be specified in the global
  9226.  variable section of the program. This is documented starting on Page
  9227.  295 of the "Microsoft Pascal 4.00 Reference Manual."
  9228.  
  9229.  The parameters "input" and "output" receive special treatment by the
  9230.  start-up code and therefore should not be declared in the variable
  9231.  section. They should, however, be included in the parameter list.
  9232.  
  9233.  Each argument must be of simple type (INTEGER, REAL, etc.) or of
  9234.  STRING, LSTRING, or FILE type. All type checking/conversion is
  9235.  performed by the start-up code. If arguments are not specified on the
  9236.  command line or if the arguments are of the wrong type, you will be
  9237.  prompted for the correct argument(s).
  9238.  
  9239.  The following program demonstrates the use of command-line arguments:
  9240.  
  9241.  PROGRAM Add(input, output, i1, i2, txt);
  9242.  
  9243.  VAR
  9244.    txt : LSTRING(20);
  9245.    i1,
  9246.    i2  : INTEGER;
  9247.  
  9248.  BEGIN
  9249.    writeln(txt,': ',i1+i2);
  9250.  END.
  9251.  
  9252.  Program execution appears as follows:
  9253.  
  9254.  c:\>add 5 10 the sum is
  9255.  the sum is:         15
  9256.  
  9257.  
  9258.  220. At Sign (@) Same As Caret (^)
  9259.  
  9260.  Product Version(s): 4.00   | 4.00
  9261.  Operating System:   MS-DOS | OS/2
  9262.  Flags: ENDUSER |
  9263.  Last Modified: 18-SEP-1989    ArticleIdent: Q46171
  9264.  
  9265.  For keyboards that do not have the caret key (^), the "at" sign (@)
  9266.  may be substituted. These symbols are synonymous and will generate
  9267.  identical code. The caret sign is used in referencing a file or
  9268.  pointer variable.
  9269.  
  9270.  The following program demonstrates the use of this symbol:
  9271.  
  9272.  PROGRAM foooo (input,output);
  9273.  
  9274.  VAR
  9275.    f : file of integer;
  9276.    x : @integer;        { same as x : ^integer; }
  9277.  
  9278.  BEGIN
  9279.    new (x);
  9280.    x@ := 87;            { same as x^ := 87; }
  9281.  
  9282.    assign (f, 'data');
  9283.    rewrite (f);
  9284.  
  9285.    f@ := x@;            { same as f^ := x^; }
  9286.    put (f);
  9287.  END.
  9288.  
  9289.  
  9290.  221. Accessing Variables Declared in a Pascal Interface File
  9291.  
  9292.  Product Version(s): 4.00   | 4.00
  9293.  Operating System:   MS-DOS | OS/2
  9294.  Flags: ENDUSER | docerr
  9295.  Last Modified: 26-SEP-1989    ArticleIdent: Q48280
  9296.  
  9297.  Question:
  9298.  
  9299.  I am trying to access variables that I have declared in a Microsoft
  9300.  Pascal Version 4.00 interface file. Pages 142 and 306 of the
  9301.  "Microsoft Pascal Reference Manual," imply that variables declared in
  9302.  an interface file are automatically given the PUBLIC attribute. Does
  9303.  this mean that I can declare the variables in my interface file,
  9304.  include that interface file in my main and implementation files, and
  9305.  with the USES statement in my main file I will then have access to
  9306.  those variables? When I try to do this I receive compiler errors in
  9307.  both the main and implementation files, indicating that the variable
  9308.  is an unknown symbol.
  9309.  
  9310.  Response:
  9311.  
  9312.  The documentation is incorrect in this case. The only way to make
  9313.  variables declared in an interface file global and accessible to the
  9314.  main and implementation files is to include the variables in the
  9315.  constituent list along with the procedures and functions.
  9316.  
  9317.  The following code gives an example of declaring a function and a
  9318.  variable in an interface file and the usage of the implementation
  9319.  file:
  9320.  
  9321.  Interface File
  9322.  --------------
  9323.  
  9324.  INTERFACE;
  9325.  UNIT TESTUNIT (known,n);  { variable and function in the constituent list }
  9326.  VAR  n : INTEGER;         { variable to be made global }
  9327.  FUNCTION known : BOOLEAN; { function to be made global }
  9328.  BEGIN
  9329.  { BEGIN implies initialization code in the implementation file }
  9330.  END;
  9331.  
  9332.  Implementation File
  9333.  -------------------
  9334.  
  9335.  {$INCLUDE:'INTER'}
  9336.  IMPLEMENTATION OF TESTUNIT;
  9337.  
  9338.  FUNCTION known; { note that parameters and attributes are NOT listed again }
  9339.  BEGIN
  9340.      known := TRUE;
  9341.  END;
  9342.  
  9343.  { initialization code }
  9344.  BEGIN
  9345.      n := 10;
  9346.  END.
  9347.  
  9348.  Main File
  9349.  ---------
  9350.  
  9351.  {$INCLUDE:'INTER'}
  9352.  PROGRAM test(input,output);
  9353.  USES TESTUNIT (known,n);
  9354.  
  9355.  BEGIN
  9356.      if (n = 10) then          { n is declared in the interface file and }
  9357.          writeln('10')         { initialized in the implementation file }
  9358.      else
  9359.          writeln('unknown');
  9360.      if known then             { known is also from the interface and }
  9361.          writeln('known')      { implementation files }
  9362.      else
  9363.          writeln('unknown');
  9364.  END.
  9365.  
  9366.  This is compiled by the following:
  9367.  
  9368.     pl mainprogram.pas implementation.pas
  9369.  
  9370.  When the program is run, the following is output to the screen:
  9371.  
  9372.     10
  9373.     known
  9374.  
  9375.  More information on using Units and Interfaces can be found in the
  9376.  "Microsoft Pascal Reference Manual" starting on Page 300. Additional
  9377.  information on "Units and Interfaces: Examples" is available as an
  9378.  application note and can be requested by calling the the Microsoft
  9379.  Product Support at (206) 454-2030.
  9380.  
  9381.  
  9382.  222. The /Fl Switch Is Not Recognized in the Environment Variable
  9383.  
  9384.  Product Version(s): 4.00   | 4.00
  9385.  Operating System:   MS-DOS | OS/2
  9386.  Flags: ENDUSER |
  9387.  Last Modified: 26-SEP-1989    ArticleIdent: Q48841
  9388.  
  9389.  To produce a source listing for your program with the Microsoft C Compiler,
  9390.  you can specify the /Fs switch in the CL environment variable.
  9391.  However, if you try to specify the /Fl switch with Pascal Version 4.00
  9392.  in the PL environment variable, the compiler just ignores the switch.
  9393.  
  9394.  PL's /Fl switch does not behave the same as CL's /Fs switch. The PL
  9395.  driver ignores the /Fl switch if it is specified in the PL environment
  9396.  variable. Another difference is that the /Fl applies only to the first
  9397.  Pascal source file that follows the option. It must be used once for
  9398.  each source file that you want listed. The /Fs switch for the CL
  9399.  driver creates source listings for all source files.
  9400.  
  9401.  The following command produces a source listing for test1.pas only:
  9402.  
  9403.     PL /Fl test1.pas test2.pas
  9404.  
  9405.  To produce a source listing for both source files, give the following
  9406.  command:
  9407.  
  9408.     PL /Fl test1.pas /Fl test2.pas
  9409.  
  9410.  
  9411.  223. Long Strings Displayed Incorrectly in Debug Window
  9412.  
  9413.  Product Version(s): 1.00
  9414.  Operating System:   MS-DOS
  9415.  Flags: ENDUSER | buglist1.00
  9416.  Last Modified: 10-OCT-1989    ArticleIdent: Q49115
  9417.  
  9418.  If a string is so long that it cannot be displayed in the
  9419.  255-character line allowed in the debug window, the string is
  9420.  truncated. QuickPascal should place ellipses (...) at the end of a
  9421.  truncated string to make it clear that the line was truncated.
  9422.  
  9423.  To reproduce this problem, use the following code and follow the steps
  9424.  outlined below:
  9425.  
  9426.  Code Example
  9427.  ------------
  9428.  
  9429.  program longexamp;
  9430.  
  9431.  var longchar: string[255];
  9432.  
  9433.  begin
  9434.     longchar := 'This is information being put into a string to ';
  9435.     longchar := longchar + 'test Quick Pascal handling long ';
  9436.     longchar := longchar + 'strings.  Information could also be ';
  9437.     longchar := longchar + 'put into the string using a for next ';
  9438.     longchar := longchar + 'loop.  This method is being used, ';
  9439.     longchar := longchar + 'however, for simplicity.  The rest ';
  9440.     longchar := longchar + 'of this text is merely useless filler ';
  9441.     longchar := longchar + 'material of no consequence.  ';
  9442.  end.
  9443.  
  9444.  Use the following steps to reproduce this problem:
  9445.  
  9446.  1. Put a watch on the string longchar using the debug watch window.
  9447.  
  9448.  2. Move to the watch window using the F6 key.
  9449.  
  9450.  3. Using the arrow keys, place the cursor on the line containing
  9451.     "longchar".
  9452.  
  9453.  4. Press the END key to move the cursor to the end of the string.
  9454.  
  9455.     Note that the line is truncated without ellipses.
  9456.  
  9457.  Microsoft has confirmed this to be a problem with QuickPascal Version
  9458.  1.00. We are researching this problem and will post new information as
  9459.  it becomes available.
  9460.  
  9461.  
  9462.  224. "USER" Is Not a Valid Filename
  9463.  
  9464.  Product Version(s): 3.20 3.3x 4.00 | 4.00
  9465.  Operating System:   MS-DOS         | OS/2
  9466.  Flags: ENDUSER |
  9467.  Last Modified: 30-NOV-1989    ArticleIdent: Q49570
  9468.  
  9469.  Microsoft Pascal does not open a file if the filename is called
  9470.  "USER". The word USER is a special filename that Microsoft Pascal
  9471.  recognizes for reading from the keyboard and writing to the screen.
  9472.  
  9473.  This is documented on Page 45, Section 5.2, of the "Microsoft Pascal
  9474.  Compiler User's Guide".
  9475.  
  9476.  The following code demonstrates this feature in Microsoft Pascal:
  9477.  
  9478.  program File_test;
  9479.  
  9480.  var fh : Text;
  9481.  
  9482.  Begin
  9483.      assign (fh, 'USER.TXT');
  9484.      rewrite (fh);
  9485.      writeln (fh, 'This is a test file');
  9486.      close (fh);
  9487.  End.
  9488.  
  9489.  When you run this program, the string 'This is a test file' is printed
  9490.  to the screen. The file USER.TXT is not created because USER is a
  9491.  special filename that Microsoft Pascal uses to write to the screen.
  9492.  
  9493.  
  9494.  225. PASCAL.LIB Does Not Exist in Pascal 4.00
  9495.  
  9496.  Product Version(s): 4.00   | 4.00
  9497.  Operating System:   MS-DOS | OS/2
  9498.  Flags: ENDUSER | docerr
  9499.  Last Modified: 30-NOV-1989    ArticleIdent: Q50338
  9500.  
  9501.  On Page 30 of the "Microsoft Pascal Compiler for the MS-DOS Operating
  9502.  System User's Guide," there is a documentation error for Version 4.00.
  9503.  The reference to PASCAL.LIB is correct for Version 3.20 and Version
  9504.  3.3x, but should be LIBPASER.LIB for real mode and LIBPASEP.LIB for
  9505.  protected mode in Version 4.00.
  9506.  
  9507.  
  9508.  226. Pascal 4.00: Compiler Treats Far Index As Near
  9509.  
  9510.  Product Version(s): 4.00   | 4.00
  9511.  Operating System:   MS-DOS | OS/2
  9512.  Flags: ENDUSER | buglist4.00 subscript
  9513.  Last Modified:  4-JAN-1990    ArticleIdent: Q51519
  9514.  
  9515.  The example below demonstrates a problem when using a far index with
  9516.  the Microsoft PASCAL Compiler Version 4.00. The error occurs in
  9517.  compiling line 24 of the source file. In that line, IDX is used as a
  9518.  memory offset index to the address pointed to by the ADSMEM component
  9519.  of FAR_STRING.
  9520.  
  9521.  First the ES register is loaded with the segment of FAR_STRING, then
  9522.  loaded with the segment to which FAR_STRING.STR_ADS points. The ES is
  9523.  loaded with the segment in which IDX is located, without saving the
  9524.  previous segment address.
  9525.  
  9526.  By the time of the MOV to AL, ES incorrectly points to IDX and so
  9527.  cannot correctly access a byte within the FAR_STRING.STR_ADS' memory
  9528.  area.
  9529.  
  9530.  Changing the index from far to near (VARS to VAR) corrects the
  9531.  problem.
  9532.  
  9533.  Microsoft has confirmed this to be a problem in Pascal Version 4.00.
  9534.  We are researching this problem and will post new information here as
  9535.  it becomes available.
  9536.  
  9537.  The following code and assembly listing demonstrate the problem:
  9538.  
  9539.  Compile options: pl /c /Fc farsub.pas libpas7p.lib
  9540.  
  9541.  Source Code
  9542.  -----------
  9543.  
  9544.  MODULE BUG;
  9545.  
  9546.  {$LIST-}          { Set default listing behavior. }
  9547.  {$DEBUG-}         { Turn off all debug. }
  9548.  {$LINESIZE:132}   { Listing width. }
  9549.  {$REAL:8}         { All reals are 8 bytes. }
  9550.  {$FLOATCALLS-}    { Inline floating point operations. }
  9551.  {$SYMTAB-}
  9552.  
  9553.  TYPE
  9554.    FAR_STRING_TYPE = RECORD
  9555.      MAX_LEN : WORD;
  9556.      STR_ADS : ADSMEM;
  9557.      STR_LEN : WORD;
  9558.      END;
  9559.  
  9560.  FUNCTION  FIND_3
  9561.   (CONSTS FAR_STRING:FAR_STRING_TYPE;
  9562.   VARS IDX:WORD):BOOLEAN;
  9563.  
  9564.    BEGIN
  9565.    WHILE IDX < FAR_STRING.STR_LEN DO
  9566.      BEGIN
  9567.      IF FAR_STRING.STR_ADS^[IDX] = 3 THEN
  9568.        BEGIN
  9569.        BREAK;
  9570.        END
  9571.      ELSE
  9572.        BEGIN
  9573.        IDX := IDX + 1;
  9574.        END;
  9575.      END;
  9576.    FIND_3 := TRUE;
  9577.    END;
  9578.  
  9579.  END.  { MODULE BUG. }
  9580.  
  9581.  Object Code
  9582.  -----------
  9583.  
  9584.  L21:
  9585.  
  9586.  Procedure/Function : FIND_3
  9587.  
  9588.      ** 000001    PUSH      BP
  9589.      ** 000002    MOV       BP,SP
  9590.      ** 000004    SUB       SP,0002H
  9591.      ** 000008    PUSH      DI
  9592.      ** 000009    PUSH      SI
  9593.  L22:
  9594.  I4:
  9595.      ** 00000A    LES       DI,[BP].0AH
  9596.      ** 00000D    MOV       AX,ES:06H[DI]
  9597.      ** 000011    LES       SI,[BP].06H
  9598.      ** 000014    CMP       AX,ES:[SI]
  9599.      ** 000017    JBE       I5            !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  9600.  L24:                                     ! Pascal 4.0 created a bug here.
  9601.      ** 000019    LES       DI,[BP].0AH   ! DI,DWord Ptr [FAR_STRING]
  9602.      ** 00001C    LES       BX,ES:02H[DI] !
  9603.      ** 000020    LES       DI,[BP].06H   ! DI,DWord Ptr [IDX]
  9604.      ** 000023    MOV       DI,ES:[DI]    !
  9605.      ** 000026    MOV       SP,AX         !
  9606.      ** 000028    MOV       AL,ES:[BX][DI]! ES points to IDX's segment;
  9607.      ** 00002B    XOR       AH,AH         !  not to FAR_STRING.STR_ADS's
  9608.      ** 00002D    CMP       AX,0003H      !  segment as it should.
  9609.      ** 000030    JNE       I6            !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  9610.  L26:
  9611.      ** 000032    JMP       I5
  9612.  L27:
  9613.      ** 000034    JMP       I7
  9614.  I6:
  9615.  L30:
  9616.      ** 000036    LES       DI,[BP].06H
  9617.      ** 000039    INC       ES:[DI]
  9618.  L31:
  9619.  I7:
  9620.  L32:
  9621.      ** 00003C    JMP       I4
  9622.  I5:
  9623.  L33:
  9624.      ** 00003E    MOV       [BP].FEH,01H
  9625.  L34:
  9626.  I3:
  9627.      ** 000042    MOV       AX,[BP].FEH
  9628.      ** 000045    POP       SI
  9629.      ** 000046    POP       DI
  9630.      ** 000047    MOV       SP,BP
  9631.      ** 000049    POP       BP
  9632.      ** 00004A    LRET      0008H
  9633.  L36:
  9634.  
  9635.  Procedure/Function : BUG
  9636.  
  9637.      ** 00004D    PUSH      BP
  9638.      ** 00004E    MOV       BP,SP
  9639.      ** 000050    SUB       SP,0004H
  9640.      ** 000054    PUSH      DI
  9641.      ** 000055    PUSH      SI
  9642.      ** 000056    MOV       STKBQQ,BP
  9643.  I8:
  9644.      ** 00005A    POP       SI
  9645.      ** 00005B    POP       DI
  9646.      ** 00005C    MOV       SP,BP
  9647.      ** 00005E    POP       BP
  9648.      ** 00005F    LRET
  9649.  
  9650.  
  9651.  227. Pascal 4.00 Supports COM1:
  9652.  
  9653.  Product Version(s): 4.00   | 4.00
  9654.  Operating System:   MS-DOS | OS/2
  9655.  Flags: ENDUSER |
  9656.  Last Modified: 30-NOV-1989    ArticleIdent: Q50476
  9657.  
  9658.  The communications port COM1: is accessible by file operations in
  9659.  Pascal Version 4.00. To access this device, you must assign a file to
  9660.  "COM1" and call the REWRITE function to open it. After this is done,
  9661.  you can read and write characters to the communications port just as
  9662.  if it were a file. Remember, COM1: is an unbuffered device; therefore,
  9663.  characters can be lost at high baud rates.
  9664.  
  9665.  The following example compiled with Pascal Version 4.00 under both
  9666.  OS/2 and MS-DOS.
  9667.  
  9668.  PROGRAM SendOutputToCom1(input,output);
  9669.  
  9670.  var f : text;
  9671.  
  9672.  BEGIN
  9673.    assign(f, 'com1');
  9674.    rewrite(f);
  9675.    writeln(f, 'Hi com1...');
  9676.  END.
  9677.  
  9678.  
  9679.  228. Passing PROCEDUREs as Arguments Can Hang Computer
  9680.  
  9681.  Product Version(s): 4.00
  9682.  Operating System:   MS-DOS
  9683.  Flags: ENDUSER |
  9684.  Last Modified:  4-JAN-1990    ArticleIdent: Q51584
  9685.  
  9686.  The computer will hang when the main program calls Proc2 with Proc1 as
  9687.  a parameter. In addition, the following must be true:
  9688.  
  9689.     Proc1 is the first procedure in the source code file.
  9690.     Proc2 calls Proc1 which is passed as an argument.
  9691.  
  9692.  There are two workarounds, as follows:
  9693.  
  9694.  1. Make Proc1 a [PUBLIC] procedure.
  9695.  
  9696.  2. Don't allow Proc1 to be the first procedure in the source file
  9697.     (i.e., there must be at least one procedure defined above Proc1 in
  9698.     the source file).
  9699.  
  9700.  The following program illustrates the above problem with the two
  9701.  workarounds demonstrated in the commented out sections.
  9702.  
  9703.  PROGRAM Hang (INPUT, OUTPUT);
  9704.  
  9705.     { PROCEDURE Dummy;
  9706.         BEGIN
  9707.            WriteLn ('This Procedure declaration must be');
  9708.            WriteLn ('uncommented to implement workaround #2');
  9709.         END; }
  9710.  
  9711.     PROCEDURE Proc1 { [PUBLIC] };
  9712.        BEGIN
  9713.           WriteLn ('The above keyword, [PUBLIC], must be');
  9714.           WriteLn ('uncommented to implement workaround #1');
  9715.        END;
  9716.  
  9717.     PROCEDURE Proc2 (PROCEDURE ProcArg);
  9718.        BEGIN
  9719.           ProgArg;     { Calling ProcArg }
  9720.        END;
  9721.  
  9722.     BEGIN  { main program }
  9723.        Proc2 (Proc1);  { Cause Proc2 to call Proc1 }
  9724.     END.
  9725.  
  9726.  
  9727.  229. No Appendix H in the Microsoft Pascal Reference Manual
  9728.  
  9729.  Product Version(s): 4.00   | 4.00
  9730.  Operating System:   MS-DOS | OS/2
  9731.  Flags: ENDUSER | docerr
  9732.  Last Modified: 26-FEB-1990    ArticleIdent: Q51747
  9733.  
  9734.  On Page 124 of the "Microsoft Pascal Compiler for the MS-DOS Operating
  9735.  System User's Guide" supplied with Microsoft Pascal Version 4.00, it
  9736.  incorrectly states the following:
  9737.  
  9738.     In Microsoft Pascal, the message describes the error, and the
  9739.     number can be used to look up more information (see Appendix H,
  9740.     "Messages," in the Microsoft Pascal Reference Manual).
  9741.  
  9742.  Also, on Page 96 of the "Microsoft Pascal Reference Manual," it
  9743.  incorrectly states the following:
  9744.  
  9745.     See Appendix H, "Messages," for a complete listing of error
  9746.     messages and warnings.
  9747.  
  9748.  There is no Appendix H in the reference manual. The correct location
  9749.  for error messages is Appendix F of the "Microsoft Pascal Compiler for
  9750.  the MS-DOS Operating System User's Guide," starting on Page 221.
  9751.  
  9752.  
  9753.  230. User Error #905 Program Size Too Large
  9754.  
  9755.  Product Version(s): 4.00   | 4.00
  9756.  Operating System:   MS-DOS | OS/2
  9757.  Flags: ENDUSER | docerr
  9758.  Last Modified:  4-JAN-1990    ArticleIdent: Q51762
  9759.  
  9760.  In Pascal, user error #905 is not documented. The entire error
  9761.  is as follows:
  9762.  
  9763.     user error #905  Program size too large (exceeds 64K bytes of code)
  9764.  
  9765.  This error is generated in pass two of the compiler. In Pascal, each
  9766.  module must have less than 64K of code, though a multiple module
  9767.  program can be larger than this.
  9768.  
  9769.  Chapter 8 ("Compiling and Linking Large Programs") of the "Microsoft
  9770.  Pascal Compiler for the MS-DOS Operating System User's Guide," Version
  9771.  4.0, explains the full process of setting up multiple module programs.
  9772.  
  9773.  
  9774.  231. Manual Setup for Microsoft Pascal Version 4.00
  9775.  
  9776.  Product Version(s): 4.00   | 4.00
  9777.  Operating System:   MS-DOS | OS/2
  9778.  Flags: ENDUSER |
  9779.  Last Modified: 14-MAR-1990    ArticleIdent: Q51900
  9780.  
  9781.  The following information demonstrates how to manually set up
  9782.  Microsoft Pascal Version 4.00 for DOS and OS/2 mode on a hard drive.
  9783.  It will show you how to set up in the same way as the SETUP.EXE
  9784.  program.
  9785.  
  9786.  This information demonstrates how to set up Microsoft Pascal Version
  9787.  4.00 under the directory "PASCAL" on Drive C. You may change the
  9788.  directory name or the drive name.
  9789.  
  9790.   1. Create the following directories:
  9791.  
  9792.         C:\PASCAL\BINR      (Create only if you want DOS mode.)
  9793.         C:\PASCAL\BINB
  9794.         C:\PASCAL\BINP      (Create only if you want OS/2 mode.)
  9795.         C:\PASCAL\LIB
  9796.         C:\PASCAL\INCLUDE
  9797.         C:\PASCAL\TMP
  9798.         C:\PASCAL\LIB
  9799.         C:\PASCAL\INIT
  9800.         C:\PASCAL\WORK
  9801.  
  9802.   2. Add the following to your AUTOEXEC.BAT file or a separate batch
  9803.      file:
  9804.  
  9805.         SET PATH=C:\PASCAL\BINB;C:\PASCAL\BINR  (for DOS mode)
  9806.         or
  9807.         SET PATH=C:\PASCAL\BINB;C:\PASCAL\BINP  (for OS/2 mode)
  9808.         or
  9809.         SET PATH=C:\PASCAL\BINB;C:\PASCAL\BINR;C:\PASCAL\BINP (for DUAL mode)
  9810.  
  9811.         SET INCLUDE=C:\PASCAL\INCLUDE
  9812.         SET LIB=C:\PASCAL\LIB
  9813.         SET TMP=C:\PASCAL\TMP
  9814.         SET INIT=C:\PASCAL\INIT
  9815.  
  9816.      Note: It is important that you do NOT add spaces inside these
  9817.      commands. For example, "SET LIB = C:\PASCAL\LIB" or
  9818.      "SET LIB=C:\PASCAL\LIB" are incorrect. The correct method for setting
  9819.      this path is "SET LIB=C:\PASCAL\LIB".
  9820.  
  9821.      Note: For the OS/2, if you want these changes to be global for all
  9822.      screen groups, include these commands in your CONFIG.SYS file.
  9823.      Otherwise, follow the above procedure, and then rename your
  9824.      AUTOEXEC.BAT to AUTOEXEC.CMD.
  9825.  
  9826.   3. Add the following lines to your CONFIG.SYS file, if they do not
  9827.      already exist:
  9828.  
  9829.         FILES=20
  9830.         BUFFERS=20
  9831.  
  9832.      (You must reboot after this step for these changes to take effect.)
  9833.  
  9834.   4. Copy the following files into C:\PASCAL\BINR. (You can skip this
  9835.      step if you do not want to install for DOS mode.)
  9836.  
  9837.         File                           Distribution Disk
  9838.         ----                           -----------------
  9839.  
  9840.         ERROUT   EXE    10729          Setup and Compiler
  9841.         EXEMOD   EXE    12336          Setup and Compiler
  9842.         EXEPACK  EXE    14803          Setup and Compiler
  9843.         SETENV   EXE    10870          Setup and Compiler
  9844.         EXEC     EXE     9299          Library 2 disk
  9845.         CV       EXE   263890          Microsoft CodeView for MS-DOS
  9846.         CV       HLP    22444          Microsoft CodeView for MS-DOS
  9847.         MOUSE    COM    14551          Microsoft CodeView for MS-DOS
  9848.         CALLTREE EXE    31233          Microsoft Editor
  9849.         M        EXE    94821          Microsoft Editor
  9850.  
  9851.   5. Copy the following files into C:\PASCAL\BINB:
  9852.  
  9853.         SETUP    EXE    81181          Setup and Compiler
  9854.         87       EXE     8798          Setup and Compiler
  9855.         BIND     EXE    36946          Setup and Compiler
  9856.         ECH      EXE    19351          Setup and Compiler
  9857.         EXP      EXE    32220          Setup and Compiler
  9858.         EXEHDR   EXE    29942          Setup and Compiler
  9859.         IMPLIB   EXE    30166          Setup and Compiler
  9860.         PAS1     EXE   139623          Utilities
  9861.         PAS2     EXE   131199          Utilities
  9862.         PAS3     EXE    40401          Utilities
  9863.         MAKE     EXE    38613          Utilities
  9864.         LINK     EXE   117001          Examples
  9865.         PL       EXE    31861          Examples
  9866.         RM       EXE    24884          Examples
  9867.         UNDEL    EXE    30046          Library 1 disk
  9868.         LIB      EXE    49661          Library 2 disk
  9869.         ILINK    EXE    88929          Library 2 disk
  9870.         CVPACK   EXE    49400          Microsoft CodeView for MS-DOS
  9871.         MEGREP   EXE    31915          Microsoft Editor
  9872.  
  9873.   6. Copy the following files into C:\PASCAL\BINP. (You can skip this
  9874.      step if you do not want to install for OS/2 mode.)
  9875.  
  9876.         CVP      EXE   233249          Microsoft CodeView for MS OS/2
  9877.         CVP      HLP    22444          Microsoft CodeView for MS OS/2
  9878.         MEP      EXE    97063          Microsoft Editor
  9879.  
  9880.   7. Copy the following files into C:\PASCAL\INCLUDE:
  9881.  
  9882.         FINK             3472          Examples
  9883.         FINKXU           4331          Examples
  9884.         FINU             5482          Examples
  9885.         CLOCK    INT      308          Examples
  9886.         INTRP    INT      225          Examples
  9887.         PORT     INT      129          Examples
  9888.         BSE      INT     1062          Examples
  9889.         BSEDOS   INT    39921          Examples
  9890.         BSEERR   INT    18185          Examples
  9891.         BSESUB   INT    20490          Examples
  9892.         OS2      INT      716          Examples
  9893.         OS2DEF   INT     1835          Examples
  9894.  
  9895.   8. Copy the following files into C:\PASCAL\INIT:
  9896.  
  9897.         WS       DLL     2609          Microsoft Editor
  9898.         WS       ZXT     2084          Microsoft Editor
  9899.  
  9900.   9. To create the TOOLS.INI file, choose the type of editor you would
  9901.      like to use (these files are located on the "Microsoft Editor"
  9902.      distribution disk):
  9903.  
  9904.         BRIEF.INI
  9905.         EPSILON.INI
  9906.         QUICK.INI
  9907.  
  9908.      Then, rename the file you choose to TOOLS.INI, and place it in the
  9909.      INIT subdirectory pointed to by the "SET INIT=C:\INIT" environment
  9910.      variable.
  9911.  
  9912.  10. Copy the following files into C:\PASCAL\WORK:
  9913.  
  9914.         README   DOC    48065          Setup and Compiler
  9915.         PASEXEC  INC     4450          Examples
  9916.         DEMOEXEC PAS     1211          Examples
  9917.         PRIMES   PAS      634          Examples
  9918.         SORTDEMO PAS    27342          Examples
  9919.         MAKESORT BAT     1326          Examples
  9920.         MAKESORT CMD     1313          Examples
  9921.         EMOEM    ASM    12125          Examples
  9922.         ENTX6L   ASM    10863          Examples
  9923.         ENTXSTUB ASM      394          Examples
  9924.         EXT      DOC    15877          Microsoft Editor
  9925.         EXT      H       8730          Microsoft Editor
  9926.         EXTHDR   OBJ     1893          Microsoft Editor
  9927.         EXTHDRP  OBJ     2021          Microsoft Editor
  9928.         SKEL     C       2457          Microsoft Editor
  9929.         SKEL     DEF      211          Microsoft Editor
  9930.  
  9931.  11. Copy all the files from the Library 1 and Library 2 disks into the
  9932.      C:\PASCAL directory. This directory will be used to temporarily
  9933.      store the component libraries.
  9934.  
  9935.  12. There is a file called MAKELIB.BAT, which will automatically build
  9936.      the libraries for DOS and/or OS/2 mode. By typing "MAKELIB" by
  9937.      itself at the DOS prompt with no arguments, it will show a list of
  9938.      parameters to use when building a library.
  9939.  
  9940.      The following is an example to build a DOS emulator library:
  9941.  
  9942.         Type:  C:\PASCAL> MAKELIB C:\PASCAL DOS \LIB EMULATOR
  9943.  
  9944.      After the desired libraries have been created, delete all the
  9945.      files in C:\PASCAL by changing the working directory to C:\PASCAL
  9946.      and typing DEL *.*. This will regain the lost disk space used by
  9947.      the component libraries.
  9948.  
  9949.  
  9950.  232. Setting Up Pascal 4.00 on a Dual Floppy Machine
  9951.  
  9952.  Product Version(s): 4.00   | 4.00
  9953.  Operating System:   MS-DOS | OS/2
  9954.  Flags: ENDUSER |
  9955.  Last Modified: 10-JAN-1990    ArticleIdent: Q51936
  9956.  
  9957.  Question:
  9958.  
  9959.  How do I set up Pascal Version 4.00 on dual 5.25-inch floppy disks?
  9960.  
  9961.  Response:
  9962.  
  9963.  The following is one configuration that allows you to run the Pascal
  9964.  compiler with a minimum of disk swaps. This is only one of a large
  9965.  number of possible configurations; feel free to change any settings as
  9966.  you like.
  9967.  
  9968.  This particular configuration takes five 5.25-inch floppy disks. The
  9969.  file to place on the floppy disk is listed on the left, and its source
  9970.  disk is listed on the right.
  9971.  
  9972.  Disk One: Compiler
  9973.  ------------------
  9974.  
  9975.     File                          Source Disk
  9976.     ----                          -----------
  9977.  
  9978.     PAS1.EXE                      Disk 2: Utilities
  9979.     PAS2.EXE                                "
  9980.     PAS3.EXE                                "
  9981.     PL.EXE                        Disk 3: Examples
  9982.  
  9983.  Disk Two : Utilities 1
  9984.  ----------------------
  9985.  
  9986.     File                          Source Disk
  9987.     ----                          -----------
  9988.  
  9989.     ERROUT.EXE                    Disk 1: Setup and Compiler
  9990.     EXEMOD.EXE                              "
  9991.     EXEPACK.EXE                             "
  9992.     SETENV.EXE                              "
  9993.     EXEC.EXE                      Disk 5: Libraries 2
  9994.     MOUSE.COM                     Disk 6: CodeView for MS-DOS
  9995.     CALLTREE.EXE                  Disk 8: Microsoft Editor
  9996.     M.EXE                                   "
  9997.     87.EXE                        Disk 1: Setup and Compiler
  9998.     ECH.EXE                                 "
  9999.     EXP.EXE                                 "
  10000.     EXEHDR.EXE                              "
  10001.     IMPLIB.EXE                              "
  10002.     RM.EXE                        Disk 3: Examples
  10003.  
  10004.  Disk Three: Utilities 2
  10005.  -----------------------
  10006.  
  10007.     File                          Source Disk
  10008.     ----                          -----------
  10009.  
  10010.     MAKE.EXE                      Disk 2: Utilities
  10011.     LINK.EXE                      Disk 3: Examples
  10012.     ILINK.EXE                     Disk 5: Libraries 2
  10013.     UNDEL.EXE                     Disk 4: Libraries 1
  10014.  
  10015.  Disk Four: CodeView
  10016.  -------------------
  10017.  
  10018.     File                          Source Disk
  10019.     ----                          -----------
  10020.  
  10021.     CV.EXE                        Disk 6: CodeView for MS-DOS
  10022.     CV.HLP                                  "
  10023.     CVPACK.EXE                              "
  10024.  
  10025.  Disk Five: Libraries
  10026.  --------------------
  10027.  
  10028.     File                          Source Disk
  10029.     ----                          -----------
  10030.  
  10031.     LIB.EXE                       Disk 5: Libraries 2
  10032.  
  10033.  Notice that the Libraries disk contains only LIB.EXE, the library
  10034.  manager. You need to build the run-time library from the floppy disks,
  10035.  using the following procedure:
  10036.  
  10037.  1. Enter the following line at the DOS prompt:
  10038.  
  10039.        set path=a:\;b:\
  10040.  
  10041.  2. Insert the Libraries disk into Drive B. Put the Setup and Compiler
  10042.     source disk in Drive A. After making sure the current drive is Drive
  10043.     A, type the following:
  10044.  
  10045.        setup /l
  10046.  
  10047.     The /l option only builds libraries; it does not install the
  10048.     compiler. The Setup program invoked with the /l option only asks
  10049.     questions that pertain to the run-time libraries that you want
  10050.     built. The resulting combined library is placed on your Libraries
  10051.     disk along with modules to which you may want to link in the
  10052.     future.
  10053.  
  10054.  3. Add the following lines to your AUTOEXEC.BAT file:
  10055.  
  10056.        SET TMP=b:\
  10057.        SET INCLUDE=b:\
  10058.        SET LIB=b:\
  10059.  
  10060.  4. Add the following lines to your CONFIG.SYS file, if they do not
  10061.     already exist:
  10062.  
  10063.        FILES=20
  10064.        BUFFERS=20
  10065.  
  10066.  5. You must reboot for the changes in the CONFIG.SYS file to take
  10067.     effect.
  10068.  
  10069.  You may want to write a test program to compile and link in order to
  10070.  familiarize yourself with the disk swapping process.
  10071.  
  10072.  This is by no means the only way to set up Pascal 4.00 on a 360K
  10073.  floppy disk system, but it has been tested and works correctly. Feel
  10074.  free to change any settings or disk contents as you see fit, so that
  10075.  your environment is set up as you would like.
  10076.  
  10077.  
  10078.  233. Increasing the Maximum Number of Open Files in Pascal 4.00
  10079.  
  10080.  Product Version(s): 4.00
  10081.  Operating System:   MS-DOS
  10082.  Flags: ENDUSER |
  10083.  Last Modified:  4-JAN-1990    ArticleIdent: Q52104
  10084.  
  10085.  The following procedure allows you increase the maximum number of open
  10086.  files running DOS Version 3.3 or OS/2 Version 1.1:
  10087.  
  10088.  1. Increase the number of file handles, starting at 20 for this
  10089.     example, by editing the startup source file CRT0DAT.ASM. This is
  10090.     located on the Startup Source Code disk. Change the following line
  10091.     to the desired amount.
  10092.  
  10093.        _NFILE_ = 20
  10094.  
  10095.  2. Increase the per-process limit in the DOS version of the same file,
  10096.     CRT0DAT.ASM, by uncommenting the code duplicated below (remove the
  10097.     ';'):
  10098.  
  10099.                       ;     mov     ah,67h
  10100.                       ;     mov     bx,_NFILE_
  10101.                       ;     callos
  10102.  
  10103.     In the OS/2 version of CRT0DAT.ASM, you must enable the line
  10104.  
  10105.                       ;extrn  DOSETMAXFH:far
  10106.  
  10107.     and also enable the code below in the same manner:
  10108.  
  10109.                       ;     mov     ax,_NFILE_
  10110.                       ;     push    ax
  10111.                       ;     call    DOSSETMAXFH
  10112.  
  10113.  3. Increase the system-wide limit by editing your CONFIG.SYS. Change
  10114.     the following line to the desired amount:
  10115.  
  10116.        FILES=20
  10117.  
  10118.  4. Assemble the modified CRT0DAT.ASM using the batch file STARTUP.BAT
  10119.     on the Startup Source Code disk. This file also contains sample
  10120.     command lines.
  10121.  
  10122.  5. To use the new CRT0DAT.OBJ, either use the LIB utility to replace
  10123.     the .OBJ in the appropriate Pascal run-time library, or explicitly
  10124.     link your program with it.
  10125.  
  10126.  
  10127.  234. ADS and ADR: Pascal Operators -- Documentation Supplement
  10128.  
  10129.  Product Version(s): 3.20 3.30 4.00 | 4.00
  10130.  Operating System:   MS-DOS         | OS/2
  10131.  Flags: ENDUSER | docsup
  10132.  Last Modified: 16-JAN-1990    ArticleIdent: Q57494
  10133.  
  10134.  The ADS and ADR operators in Pascal evaluate to the address of the
  10135.  object to which they are applied. ADS (ADdress Segmented) evaluates to
  10136.  the full address (segment|offset) of the object, and ADR (ADdress
  10137.  Relative) evaluates only to the offset into the default data segment.
  10138.  These operators have the same precedence as the Pascal NOT operator,
  10139.  and have a higher precedence than the other Pascal operators.
  10140.  
  10141.  Note 1: Pascal Version 3.20 used incorrect precedence rules for the ADS
  10142.  and ADR operators. See Note 2 below for details.
  10143.  
  10144.  Documentation for ADS and ADR can be found in the "Microsoft Pascal
  10145.  Reference Manual" on Pages 104-109 and 147, and in the "Microsoft
  10146.  Pascal User's Guide" on Pages 139-141.
  10147.  
  10148.  Syntax of ADS/ADR Expressions
  10149.  -----------------------------
  10150.  
  10151.  The ADS and ADR operators are used to take the address of any symbol
  10152.  or expression. For example,
  10153.  
  10154.     ADS x
  10155.  and
  10156.     ADS (i + j * k)
  10157.  
  10158.  are legal expressions for all Pascal versions except 3.20. Parentheses
  10159.  must be used in the second example because ADS (or ADR) has a higher
  10160.  precedence than the + and * operators.
  10161.  
  10162.  Note 2: In Version 3.20, the ADS and ADR operators would evaluate the
  10163.  entire expression following it, disregarding precedence. Therefore,
  10164.  the following expression
  10165.  
  10166.     ADR a + b   (where a and b are variables)
  10167.  
  10168.  would be incorrectly evaluated as
  10169.  
  10170.     ADR (a + b)
  10171.  
  10172.  rather than
  10173.  
  10174.     (ADR a) + b
  10175.  
  10176.  as the correct precedence rules would dictate.
  10177.  
  10178.  Syntax of ADS/ADR Declarations and Statements
  10179.  ---------------------------------------------
  10180.  
  10181.  ADS and ADR can be used both as type clause prefixes (declaring a type
  10182.  as an ADR of something, for example, a pointer) and as prefix
  10183.  operators (ADR of a variable, for example, taking the address). The
  10184.  following code example displays this:
  10185.  
  10186.  PROGRAM TEST(INPUT,OUTPUT);
  10187.  
  10188.  TYPE ARRAY_TYPE     = ARRAY [1..10] OF INTEGER;
  10189.  
  10190.  VAR  CHAR_VAR       : CHAR;
  10191.       ADR_CHAR       : ADR OF CHAR;           { ADR used as type
  10192.                                                 clause prefix    }
  10193.       INT_ARRAY      : ARRAY_TYPE;
  10194.       ADS_ARRAY      : ADS OF ARRAY_TYPE;
  10195.  
  10196.  BEGIN
  10197.       CHAR_VAR := 'Z';
  10198.       INT_ARRAY[1] := 2;
  10199.  
  10200.       ADR_CHAR := ADR CHAR_VAR;               { ADR used as prefix
  10201.                                                 operator         }
  10202.       ADS_ARRAY := ADS INT_ARRAY;
  10203.  
  10204.       WRITELN(ADR_CHAR^, ADS_ARRAY^[1]);      { up arrow (^) used
  10205.                                                 to dereference
  10206.                                                 address type     }
  10207.  END.
  10208.  
  10209.  The output for this program would be as follows:
  10210.  
  10211.     Z       2
  10212.  
  10213.  Note 3: If you want to return the actual physical address of any
  10214.  object, use the field notations .s and .r for the segment and relative
  10215.  offset addresses, respectively. However, these addresses are expressed
  10216.  only in decimal notation by the compiler. For example, you could add
  10217.  the following line to the above program to obtain the relative offset
  10218.  address of CHAR_VAR and the segment and relative offset addresses of
  10219.  ARRAY_TYPE:
  10220.  
  10221.     WRITELN(ADR_CHAR.R, ADS_ARRAY.R, ADS_ARRAY.S);
  10222.  
  10223.  The output for this line would be similar to the following:
  10224.  
  10225.     66      70      25478
  10226.  
  10227.  This feature is documented in the "Microsoft Pascal Reference Manual"
  10228.  on Pages 105-107.
  10229.  
  10230.  ADS with Functions
  10231.  ------------------
  10232.  
  10233.  When taking the address of a function, the usage of parentheses
  10234.  changes the meaning of the expression. The expression
  10235.  
  10236.     ADS func
  10237.  
  10238.  (where "func" is a function) will evaluate to the address of the
  10239.  function a, and the expression
  10240.  
  10241.     ADS (func)
  10242.  
  10243.  will evaluate to the address of the return value of the function.
  10244.  
  10245.  When using ADS to get the address of a function or procedure, ADS will
  10246.  return a value of the type ADSFUNC or ADSPROC, respectively. These two
  10247.  predefined types are compatible with C function pointers.
  10248.  
  10249.  To call a function or procedure with variables or parameters of these
  10250.  types, their value must be passed, externally, to a non-Pascal
  10251.  routine, which in turn will call the function or procedure. For more
  10252.  information on ADSFUNC and ADSPROC, see the "Microsoft Pascal User's
  10253.  Guide," Page 140.
  10254.  
  10255.  
  10256.  235. Pascal 4.00 Setup Cannot Find WIN86EM.LIB
  10257.  
  10258.  Product Version(s): 4.00    | 4.00
  10259.  Operating System:   MS-DOS  | OS/2
  10260.  Flags: ENDUSER |
  10261.  Last Modified: 15-FEB-1990    ArticleIdent: Q58643
  10262.  
  10263.  An unexpected warning can occur with the Microsoft Pascal Version 4.00
  10264.  Setup program when the compiler is being installed with options to
  10265.  write Windows applications.
  10266.  
  10267.  If you answer yes to the following prompt
  10268.  
  10269.     Remove STACK segment from library for Windows? [y]
  10270.  
  10271.  Setup will attempt to copy a file called WIN86EM.LIB from the Library
  10272.  1 Disk. The file does not exist. Setup will issue a warning message
  10273.  such as the following:
  10274.  
  10275.    WARNING: File copy failed : A:\win86em.lib to
  10276.    C:\PASCAL\lib\win86em.lib
  10277.  
  10278.  Although the file WIN86EM.LIB does not exist, the Library 1 Disk does
  10279.  contain the file WIN87EM.LIB. This is the file that Setup should have
  10280.  attempted to copy.
  10281.  
  10282.  The solution is to copy the file WIN87EM.LIB into the Pascal LIB
  10283.  subdirectory. WIN87EM.LIB is not intended to be included in any of the
  10284.  combined libraries so there is no danger of the Setup program having
  10285.  problems when it creates the combined libraries. WIN87EM.LIB is meant
  10286.  to be a stand-alone library file in the LIB subdirectory.
  10287.  
  10288.  
  10289.  236. The PUBLIC and EXTERN Attributes in Mixed-Language Programming
  10290.  
  10291.  Product Version(s): 4.00
  10292.  Operating System:   OS/2
  10293.  Flags: ENDUSER | s_c L4001
  10294.  Last Modified: 26-FEB-1990    ArticleIdent: Q58648
  10295.  
  10296.  The PUBLIC attribute, when applied to variables in Microsoft Pascal
  10297.  Version 4.00, indicates that a variable may be accessed by other
  10298.  loaded modules, and instructs the compiler to make a variable visible
  10299.  and available to other modules, by implication allocating memory for
  10300.  the variable.
  10301.  
  10302.  This behavior is in contrast to the EXTERN attribute, which identifies
  10303.  to the compiler a variable that resides in some other loaded module,
  10304.  instructing the compiler not to allocate memory for the variable
  10305.  because it has been declared (and memory allocated for it) in another
  10306.  module and will be resolved by the linker at link time.
  10307.  
  10308.  This behavior is not always consistent when performing mixed-language
  10309.  calls between C and Pascal under OS/2. When passing pointer variables
  10310.  that have been allocated space in a shared memory segment, although
  10311.  the variable has been declared (far) in the main C calling module, it
  10312.  must also be declared PUBLIC in the Pascal module. Failure to do so
  10313.  will result in the following linker warning:
  10314.  
  10315.     PASCAL1.OBJ(PASCAL1.pas) : warning L4001: frame-relative fixup,
  10316.     frame ignored near 000A in segment NAME pos: 23C Record type:
  10317.     75E8 target external 'identifier'
  10318.  
  10319.  The warning is defined in the "Microsoft CodeView and Utilities
  10320.  Software Development Tools for MS OS/2 and MS-DOS Operating Systems
  10321.  Update" as follows:
  10322.  
  10323.     A reference is made relative to a segment which is different from
  10324.     the target segment of the reference. For example, if _foo is
  10325.     defined in segment _TEXT, the instruction "call DGROUP:_foo" will
  10326.     result in this warning. The frame DGROUP is ignored, so the linker
  10327.     will treat the call as if it were "call _TEXT:_foo".
  10328.  
  10329.  Under OS/2, if multiple pointer variables are using the same shared
  10330.  segment, the above warning may lead to a protection violation if the
  10331.  executable is run. This may be somewhat counter-intuitive according to
  10332.  the definitions of PUBLIC and EXTERN detailed in the "Microsoft Pascal
  10333.  Reference Manual" for Version 4.0, Section 11.5.2. The following code
  10334.  demonstrates the problem.
  10335.  
  10336.  Sample Code
  10337.  -----------
  10338.  
  10339.  { Pascal Module: compile with pl /c }
  10340.  
  10341.  MODULE PASCAL1;
  10342.  
  10343.  TYPE
  10344.  
  10345.      SAMPLE = RECORD
  10346.             DEC   : INTEGER;
  10347.             NAME  : ARRAY[1..3] OF INTEGER;
  10348.             SCALE : REAL
  10349.           END;
  10350.  
  10351.  SARRAY = ARRAY[1..100] OF SAMPLE;
  10352.  
  10353.  VAR
  10354.  
  10355.           FOO  [C, EXTERN]:  ADS OF SARRAY;
  10356.  
  10357.           { Change EXTERN to PUBLIC to correct the problem }
  10358.  
  10359.           GOO             :  ADS OF SARRAY;
  10360.  
  10361.  PROCEDURE DEMO(A:ADSMEM);
  10362.  
  10363.   BEGIN
  10364.     GOO := FOO;
  10365.     writeln('Hello World');
  10366.     writeln(GOO.S); { Observe the segment address for GOO }
  10367.  
  10368.   END;
  10369.  
  10370.  END.
  10371.  
  10372.  /* C module: compile with cl -c -AL */
  10373.  
  10374.  #define INCL_DOSPROCESS
  10375.  #define INCL_DOSMEMMGR
  10376.  #define SHRSEGNAME  "FOOBAR"
  10377.  #include <os2def.h>
  10378.  #include <bsedos.h>
  10379.  #include <stdio.h>
  10380.  #include <process.h>
  10381.  
  10382.  struct sample far *foo;
  10383.  /* Pointer to be passed back to pascal module */
  10384.  
  10385.  SEL SharedSel;
  10386.  
  10387.  extern pascal demo(struct sample far *);
  10388.  
  10389.  extern pascal pascal1;
  10390.  
  10391.  main()
  10392.  {
  10393.  
  10394.  /* allocate shared memory segment */
  10395.  DosAllocShrSeg(256, SHRSEGNAME, &SharedSel);
  10396.  
  10397.  /* foo allocated memory in shared segment */
  10398.  foo = (struct sample far *) MAKEP(SharedSel,0);
  10399.  
  10400.  demo(foo);    /* call Pascal procedure */
  10401.  
  10402.  DosFreeSeg(SharedSel);
  10403.  
  10404.  exit(0);
  10405.  }
  10406.  
  10407.  Compile each of the above modules separately and link with the
  10408.  following command:
  10409.  
  10410.     link /NOD /NOE pascal1+Cmodule,,,LLIBCE+OS2+LIBPASE;
  10411.  
  10412.  The above warning will be observed. If the EXTERN attribute for FOO is
  10413.  changed to PUBLIC, the program will link without warnings and will run
  10414.  correctly.
  10415.  
  10416.  
  10417.  237. Location and Description of File System Error Numbers
  10418.  
  10419.  Product Version(s): 3.x 4.00
  10420.  Operating System:   OS/2
  10421.  Flags: ENDUSER |
  10422.  Last Modified: 18-APR-1990    ArticleIdent: Q59988
  10423.  
  10424.  After opening a file in Pascal, you can check for file errors by
  10425.  verifying the .errs field of the file record. This field will either
  10426.  contain 0 (zero), which indicates no error, or a number between 1 and
  10427.  15. These error codes (1-15) are listed on Pages 257-258 of the
  10428.  "Microsoft Pascal Compiler for the MS-DOS Operating System User's
  10429.  Guide" for Version 4.0 manual under the section marked as follows:
  10430.  
  10431.     Runtime File System Errors(1000-1199)
  10432.  
  10433.  A number between 1-15 is returned in the .errs field of the Pascal
  10434.  file record, as shown in the following, indicating any errors that may
  10435.  have occurred while opening the file:
  10436.  
  10437.     f : text; {File}
  10438.     error : integer; {Receives error}
  10439.     error := f.errs; {Return a number 1-15}
  10440.  
  10441.  The value returned by f.errs may be one of the following:
  10442.  
  10443.   1 - Hard Data Error: Parity, CRC, check sum, etc.
  10444.   2 - Device Name Invalid: Unit/device/volume name, format, or number
  10445.   3 - Operation: Invalid operation (for example, RESET a printer)
  10446.   4 - File System: File system internal error
  10447.   5 - Device Offline
  10448.   6 - Lost File: File itself is no longer available.
  10449.   7 - File Name: Invalid syntax (name too long, etc.)
  10450.   8 - Device Full: Disk full, directory full, all channels allocated
  10451.   9 - Unknown Device
  10452.  10 - File Not Found
  10453.  11 - Protected File: Duplicate filename or file write-protected
  10454.  12 - File in Use: File in use, concurrency lock, already open
  10455.  13 - File Not Open: File closed, I/O to unopened FCB
  10456.  14 - Data Format: Data format error, decode error, range error
  10457.  15 - Line Too Long: Buffer overflow, line too long
  10458.  
  10459.  
  10460.  238. Writing to a segment:offset Memory Location Using MS Pascal
  10461.  
  10462.  Product Version(s): 4.00   | 4.00
  10463.  Operating System:   MS-DOS | OS/2
  10464.  Flags: ENDUSER |
  10465.  Last Modified: 15-AUG-1990    ArticleIdent: Q64806
  10466.  
  10467.  The following steps outline how to write directly to a specific
  10468.  segment:offset memory location using the Microsoft Pascal compiler
  10469.  version 4.00 (the information below is contained in the "Microsoft
  10470.  Pascal Reference Manual," Section 9.1.2, Pages 104-109):
  10471.  
  10472.  1. Declare a variable of type "ADS OF <type>", where <type> is the
  10473.     data type that you want to write; for example:
  10474.  
  10475.        var ptr : ads of byte;
  10476.  
  10477.  2. Set the segment and offset of the variable by using the ".s" and
  10478.     ".r" record elements; for example:
  10479.  
  10480.        ptr.s := 16#5F00;       { Segment value = 5F00 hex }
  10481.        ptr.r := 16#04CD;       { Offset value  = 04CD hex }
  10482.  
  10483.  3. To read and write from/to the address, use the dereference operator
  10484.     "^"; for example:
  10485.  
  10486.        ptr^  := 65;
  10487.        value := ^ptr;
  10488.  
  10489.  The sample program below was written in Microsoft Pascal and reads and
  10490.  writes bytes near memory location B800:0000 (hex), which is the start
  10491.  of standard video memory:
  10492.  
  10493.  Sample Code
  10494.  -----------
  10495.  
  10496.  program screen;
  10497.  
  10498.  var ptr   : ads of byte;  { The pointer variable }
  10499.      value : word;         { Something to read memory into }
  10500.  
  10501.  begin
  10502.    ptr.s := 16#b800;       { Assign the segment value of the pointer }
  10503.    ptr.r := 16#0000;       { Assign the offset value of the pointer }
  10504.    ptr^  := 65;            { Write 65 to location B800:0000 (hex) }
  10505.  
  10506.    ptr.r := 16#0024;       { Set the offset to a new value }
  10507.    value := ptr^;          { Read from location B800:0024 (hex) }
  10508.  end.
  10509.  
  10510.  Note: The sample program will only work under DOS. It will generate a
  10511.  GP fault under OS/2 because writing to video memory directly is
  10512.  prohibited under OS/2.
  10513.  
  10514.  
  10515.  239. Pascal 4.00 PC, SS, FP, and SP Can't Find Run-Time Errors
  10516.  
  10517.  Product Version(s): 4.00
  10518.  Operating System:   MS-DOS
  10519.  Flags: ENDUSER | SR# S900822-32 docerr
  10520.  Last Modified: 31-AUG-1990    ArticleIdent: Q65324
  10521.  
  10522.  When a run-time error occurs in the Microsoft Pascal 4.00 program, the
  10523.  program will display the values for the PC, SS, FP, and SP. The values
  10524.  are called the "machine error context" in the "Microsoft Pascal 4.0:
  10525.  User's Guide."
  10526.  
  10527.  The values generated by the program are incorrect, are not meaningful,
  10528.  and do not represent the values of the machines registers at the time
  10529.  the error occurred. Consequently, these values cannot be used to find
  10530.  run-time errors.
  10531.  
  10532.  On Page 225, the "Microsoft Pascal 4.0: User's Guide" incorrectly
  10533.  states that these values can be used to find run-time errors. In
  10534.  particular, it incorrectly states that you can use the Program Counter
  10535.  (PC) along with a linker map file (.MAP file) to find the routine in
  10536.  which the error occurred.
  10537.  
  10538.  The only way to easily find run-time errors in Pascal 4.00 programs is
  10539.  to compile and link the program for debugging in the CodeView
  10540.  debugger.
  10541.  
  10542.  This information applies to Microsoft Pascal 4.00 for MS-DOS and MS
  10543.  OS/2.
  10544.  
  10545.  
  10546.  240. SCO Now Supports All Versions of Pascal for XENIX
  10547.  
  10548.  Product Version(s): 3.30 3.31
  10549.  Operating System:   XENIX
  10550.  Flags: ENDUSER | SR# S900924-11
  10551.  Last Modified: 26-DEC-1990    ArticleIdent: Q65887
  10552.  
  10553.  The Santa Cruz Operation (SCO) has assumed responsibility for sales
  10554.  and support of all versions of the Microsoft Pascal Compiler
  10555.  (including versions 3.30 and 3.31) for the XENIX operating system.
  10556.  
  10557.  SCO is fully committed to the UNIX marketplace and solidly backs
  10558.  Microsoft applications and languages. SCO is also committed to
  10559.  updating and adding versions of the Pascal Compiler for XENIX.
  10560.  
  10561.  SCO has the resources required to support this product on a variety of
  10562.  configurations and terminals.
  10563.  
  10564.  Such support is not free. As is typical in the UNIX world, SCO charges
  10565.  for support on a variety of levels. A comprehensive explanation of the
  10566.  sales and support programs can be obtained directly from SCO at the
  10567.  following address:
  10568.  
  10569.     Support Department
  10570.     The Santa Cruz Operation
  10571.     400 Encinal Street
  10572.     Santa Cruz, CA  95061
  10573.  
  10574.     Phone Numbers: (800) 347-4381 Support
  10575.                    (800) 726-8649 Sales
  10576.                    (408) 425-7222 Main Number
  10577.  
  10578.  
  10579.  241. Pascal Error 201 "Types Not Assignment Compatible" in UNIT
  10580.  
  10581.  Product Version(s): 4.00   | 4.00
  10582.  Operating System:   MS-DOS | OS/2
  10583.  Flags: ENDUSER | SR# S900924-27 buglist4.00
  10584.  Last Modified: 26-DEC-1990    ArticleIdent: Q66138
  10585.  
  10586.  The error "201 Types Not Assignment Compatible" incorrectly occurs
  10587.  when an enumerated data type is used as an array index if the array is
  10588.  declared as a procedure parameter within a Pascal UNIT.
  10589.  
  10590.  This information applies only to the Microsoft Pascal Compiler version
  10591.  4.00 for MS-DOS and OS/2.
  10592.  
  10593.  Microsoft has confirmed this to be a problem with the Microsoft Pascal
  10594.  Compiler version 4.00. We are researching this problem and will post
  10595.  new information here as it becomes available.
  10596.  
  10597.  The error occurs only if all of the following conditions are met:
  10598.  
  10599.  1. A Pascal UNIT is being compiled.
  10600.  
  10601.  2. The array is a parameter to a Pascal PROCEDURE within the UNIT.
  10602.  
  10603.  3. An enumerated data type is used as an index to the array.
  10604.  
  10605.  The following code example reproduces the error:
  10606.  
  10607.  Code Example
  10608.  ------------
  10609.  
  10610.  INTERFACE;
  10611.  UNIT FOO(PROC1);
  10612.  
  10613.       TYPE enum = (a,b,c,d,e);
  10614.            enarr = array[enum] of INTEGER;
  10615.  
  10616.       PROCEDURE PROC1(EnumArray : enarr);
  10617.  BEGIN
  10618.  END;
  10619.  
  10620.  IMPLEMENTATION OF FOO;
  10621.  
  10622.       TYPE enum = (a,b,c,d,e);
  10623.            enarr = array[enum] of INTEGER;
  10624.  
  10625.  PROCEDURE PROC1;
  10626.       VAR  en    : enum;
  10627.            local : enarr;
  10628.            x     : INTEGER;
  10629.       BEGIN
  10630.            FOR en := a TO e DO BEGIN
  10631.                 WRITELN ( EnumArray[en]); { Error 201.}
  10632.                 x := EnumArray[en];       { Error 201.}
  10633.                 WRITELN ( local[en]);   { Compiles ok.}
  10634.                 x := local[en];         { Compiles ok.}
  10635.            END;
  10636.       END;
  10637.  END.
  10638.  
  10639.  
  10640.  242. Trapping I/O Errors Using the "TRAP" Flag in Pascal 4.00
  10641.  
  10642.  Product Version(s): 4.00   | 4.00
  10643.  Operating System:   MS-DOS | OS/2
  10644.  Flags: ENDUSER | SR# S901009-56
  10645.  Last Modified: 26-DEC-1990    ArticleIdent: Q66318
  10646.  
  10647.  When a file variable is defined within Pascal version 4.00, that file
  10648.  variable automatically has three associated flags that are not
  10649.  explicitly defined through a Record type. These three flags are
  10650.  accessed in the same way you would access a field within a Record
  10651.  Type:
  10652.  
  10653.  FileVar.Trap - Determines whether I/O errors should be trapped for this
  10654.                 file.
  10655.  
  10656.  FileVar.Mode - Mode in which the File or Device was opened.
  10657.  
  10658.  FileVar.Errs - Error number, when an I/O error occurs if the Trap flag
  10659.                 is set to "True".
  10660.  
  10661.  Utilizing the "Trap" and "Errs" flags, you can perform error trapping
  10662.  on all file or device I/O.
  10663.  
  10664.  This information applies to the Microsoft Pascal Compiler version
  10665.  4.00 for MS-DOS and OS/2.
  10666.  
  10667.  Once a File variable is assigned to a file or device, error trapping
  10668.  can be performed by setting the "Trap" flag to "True" and then
  10669.  checking the value of the "Errs" flag after I/O is performed on the
  10670.  file or device. If "Errs" is nonzero, an error has occurred allowing
  10671.  you to process the error. If the "Trap" flag is set to "False" and an
  10672.  I/O error occurs, the program will terminate with an I/O error.
  10673.  
  10674.  The following sample program demonstrates how to trap errors while
  10675.  printing to the standard device PRN. The same method is used for data
  10676.  files.
  10677.  
  10678.  Compile and Link with the following command:
  10679.  
  10680.     PL PrnTest.Pas
  10681.  
  10682.  PrnText.Pas
  10683.  -----------
  10684.  
  10685.  Program ErrorTrap;
  10686.  
  10687.  Var prn: Text; {Declare File variable of type Text
  10688.                  which will be used for the standard
  10689.                  device PRN}
  10690.  
  10691.  { This procedure will be called when the value of
  10692.    prn.Errs is non-zero following any I/O on prn.
  10693.    This procedure is not automatically called.
  10694.    The value of prn.Errs must be checked, and
  10695.    depending on its value, control should be
  10696.    passed to this Procedure. Prn.Errs must be
  10697.    set back to zero after the error has been
  10698.    processed to allow error trapping to continue. }
  10699.  
  10700.  Procedure ErrorHandler;
  10701.  Begin
  10702.    Writeln('An error occurred, Number: ', prn.Errs);
  10703.    prn.Errs:=0;
  10704.  End;
  10705.  
  10706.  Begin
  10707.    Assign(prn, 'PRN');  {Assign Standard device PRN to file
  10708.                          variable prn}
  10709.  
  10710.    prn.Trap:= True;     {Activate Error trapping for prn}
  10711.  
  10712.  {The following Writeln statement will generate an error
  10713.   because the file PRN has not yet been opened, but only
  10714.   associated with the device PRN. The flag Prn.Errs is
  10715.   then checked for a nonzero value and control is passed
  10716.   to the Error Handler Procedure if an error occurred.}
  10717.  
  10718.    Writeln(prn, 'This Should Not Print');
  10719.    If prn.Errs <> 0 Then ErrorHandler;
  10720.  
  10721.    ReWrite(prn);  {Open up the file (PRN device) so the
  10722.                    the following Writeln statement will
  10723.                    execute successfully.}
  10724.  
  10725.    Writeln(prn, 'This Should Print');
  10726.    Close(prn);
  10727.  End.
  10728.  
  10729.  
  10730.  243. Pascal Reply Letters: Appnotes BP0359, BP0360, BP0361
  10731.  
  10732.  Product Version(s): 3.13 3.20 3.30 3.3x 4.00 | 4.00
  10733.  Operating System:   MS-DOS                   | OS/2
  10734.  Flags: ENDUSER | S_QuickPas policy appnote BP0359 BP0360 BP0361
  10735.  Last Modified: 26-DEC-1990    ArticleIdent: Q66492
  10736.  
  10737.  Below are the three form letters that Microsoft sends in response to
  10738.  unsolicited letters from customers who have Pascal or QuickPascal:
  10739.  
  10740.     Appnote Number   Title
  10741.     --------------   -----
  10742.  
  10743.     BP0359           Pascal Suggestion Reply Letter
  10744.     BP0360           Pascal Question Reply Letter
  10745.     BP0361           Pascal Problem/Docerr Reply Letter
  10746.  
  10747.  This information applies to all Microsoft Pascal versions (including
  10748.  3.13, 3.20, 3.30, 3.3x, 4.00) and to Microsoft QuickPascal version
  10749.  1.00.
  10750.  
  10751.  Note: Page 1 of 2 is shown below for each reply letter. Page 2 of 2,
  10752.  the "Product Assistance Checklist," is the same for each reply letter,
  10753.  and is shown in a separate article found by querying for the following
  10754.  words:
  10755.  
  10756.     product and assistance and checklist
  10757.  
  10758.  BP0359: Pascal Suggestion Reply Letter
  10759.  --------------------------------------
  10760.  
  10761.  Dear PASCAL Customer:
  10762.  
  10763.  Thank you for your letter concerning your suggestion to our PASCAL
  10764.  language product. Although we are unable to respond to your technical
  10765.  questions by letter, we do forward your letters to our PASCAL
  10766.  development team. This procedure provides developers with customer
  10767.  feedback, which will in turn make Microsoft's products even better.
  10768.  Now that we can no longer respond to letters (unless solicited by
  10769.  Microsoft), we are providing the following new service:
  10770.  
  10771.  Our toll-line number, (206) 637-7096, is available Monday through
  10772.  Friday (except holidays), 8 AM to 5 PM Pacific Standard Time, and is
  10773.  designed to answer questions about set up and installation procedures,
  10774.  problem reports, and documentation errors. We also address most
  10775.  programming, code debugging, and problem solving issues.
  10776.  
  10777.  There are many supplemental sources of information relating to the
  10778.  PASCAL languages, including reference guides and books published by
  10779.  Microsoft Press. Support is also available electronically through
  10780.  Microsoft OnLine and CompuServe. One of the features of these services
  10781.  is to provide access to the Microsoft Knowledge Base. The Microsoft
  10782.  Knowledge Base contains the latest technical information about
  10783.  Microsoft language products. For more information about Microsoft
  10784.  OnLine, which is designed for software developers, call (800) 443-
  10785.  4672. For more information about CompuServe, which is the largest
  10786.  general online information service for personal computer users, call
  10787.  (800) 848-8199.
  10788.  
  10789.  Sincerely,
  10790.  
  10791.  Blain Barton
  10792.  Business Languages Team Manager
  10793.  Product Support Services
  10794.  BP0359
  10795.  
  10796.  BP0360: Pascal Question Reply Letter
  10797.  ------------------------------------
  10798.  
  10799.  Dear PASCAL Customer:
  10800.  
  10801.  Thank you for your letter concerning our PASCAL language product.
  10802.  Although we are unable to respond to your technical questions by
  10803.  letter, we do forward your letters to our PASCAL development team.
  10804.  This procedure provides developers with customer feedback, which will
  10805.  in turn make Microsoft's products even better. Now that we can no
  10806.  longer respond to letters (unless solicited by Microsoft), we are
  10807.  providing the following new service:
  10808.  
  10809.  Our toll-line number, (206) 637-7096, is available Monday through
  10810.  Friday (except holidays), 8 AM to 5 PM Pacific Standard Time, and is
  10811.  designed to answer questions about set up and installation procedures,
  10812.  problem reports, and documentation errors. We also address most
  10813.  programming, code debugging, and problem solving issues.
  10814.  
  10815.  There are many supplemental sources of information relating to the
  10816.  PASCAL languages, including reference guides and books published by
  10817.  Microsoft Press. Support is also available electronically through
  10818.  Microsoft OnLine and CompuServe. One of the features of these services
  10819.  is to provide access to the Microsoft Knowledge Base. The Microsoft
  10820.  Knowledge Base contains the latest technical information about
  10821.  Microsoft language products. For more information about Microsoft
  10822.  OnLine, which is designed for software developers, call (800) 443-
  10823.  4672. For more information about CompuServe, which is the largest
  10824.  general online information service for personal computer users, call
  10825.  (800) 848-8199.
  10826.  
  10827.  Sincerely,
  10828.  
  10829.  Blain Barton
  10830.  Business Languages Team Manager
  10831.  Product Support Services
  10832.  BP0360
  10833.  
  10834.  BP0361: Pascal Problem/Docerr Reply Letter
  10835.  ------------------------------------------
  10836.  
  10837.  Dear PASCAL Customer:
  10838.  
  10839.  Thank you for your letter concerning your problem and/or documentation
  10840.  error pertaining to our PASCAL language product. Although we are
  10841.  unable to respond to your technical questions by letter, we do forward
  10842.  your letters to our PASCAL development team. This procedure provides
  10843.  developers with customer feedback, which will in turn make Microsoft's
  10844.  products even better. Now that we can no longer respond to letters
  10845.  (unless solicited by Microsoft), we are providing the following new
  10846.  service:
  10847.  
  10848.  Our toll-line number, (206) 637-7096, is available Monday through
  10849.  Friday (except holidays), 8 AM to 5 PM Pacific Standard Time, and is
  10850.  designed to answer questions about set up and installation procedures,
  10851.  problem reports, and documentation errors. We also address most
  10852.  programming, code debugging, and problem solving issues.
  10853.  
  10854.  There are many supplemental sources of information relating to the
  10855.  PASCAL languages, including reference guides and books published by
  10856.  Microsoft Press. Support is also available electronically through
  10857.  Microsoft OnLine and CompuServe. One of the features of these services
  10858.  is to provide access to the Microsoft Knowledge Base. The Microsoft
  10859.  Knowledge Base contains the latest technical information about
  10860.  Microsoft language products. For more information about Microsoft
  10861.  OnLine, which is designed for software developers, call (800) 443-
  10862.  4672. For more information about CompuServe, which is the largest
  10863.  general online information service for personal computer users, call
  10864.  (800) 848-8199.
  10865.  
  10866.  Sincerely,
  10867.  
  10868.  Blain Barton
  10869.  Business Languages Team Manager
  10870.  Product Support Services
  10871.  BP0361
  10872.  
  10873.  
  10874.  244. SIZEOF Returns Wrong Value with Multidimensional Super Array
  10875.  
  10876.  Product Version(s): 3.32 4.00
  10877.  Operating System:   MS-DOS
  10878.  Flags: ENDUSER | SR# S901107-110 buglist3.32 buglist4.00
  10879.  Last Modified: 10-NOV-1990    ArticleIdent: Q66807
  10880.  
  10881.  If a multidimensional super array is declared with different values
  10882.  for the lower array bounds, the sizeof() function will return an
  10883.  incorrect value for the size of the array. This problem is illustrated
  10884.  in the program below.
  10885.  
  10886.  Microsoft has confirmed this to be a problem in Microsoft Pascal
  10887.  versions 3.32 and 4.00 for MS-DOS. We are researching this problem and
  10888.  will post new information here as it becomes available.
  10889.  
  10890.  After examining the resulting assembly code using CodeView, it appears
  10891.  that the sizeof() function assumes that the base value of both the
  10892.  dimensions is the same. For example, if the "sup" type is modified to
  10893.  read as follows
  10894.  
  10895.       sup = super array[1..*,1..*] of integer;
  10896.  
  10897.  this will return the correct answer of 20 bytes for the size.
  10898.  Apparently, memory is being referenced and allocated correctly;
  10899.  however, the sizeof() function is clearly returning the wrong value in
  10900.  the first case.
  10901.  
  10902.  Code Example
  10903.  ------------
  10904.  
  10905.  program sample(input, output);
  10906.  
  10907.  type
  10908.    sup = super array[1..*,0..*] of integer;
  10909.  
  10910.  var
  10911.    x : ^sup;
  10912.    y : word;
  10913.  
  10914.  begin
  10915.    new(x, 1, 10);     { 1 integer * 11 integers (0..10) = 11 integers }
  10916.  
  10917.    y := sizeof(x^);   { 11 integers * 2 bytes/integer = 22 bytes }
  10918.    writeln(y);        { writeln prints 20 }
  10919.  end.
  10920.  
  10921.  
  10922.  245. Patch for PASCAL.LIB 3.30; DIRECT Access File SEEK/PUT Problem
  10923.  
  10924.  Product Version(s): 3.30
  10925.  Operating System:   MS-DOS
  10926.  Flags: ENDUSER | appnote SP0281 buglist3.30 fixlist4.00
  10927.  Last Modified: 14-DEC-1990    ArticleIdent: Q67000
  10928.  
  10929.  The application note "Patch for PASCAL.LIB 3.30" is available from
  10930.  Microsoft Product Support Services.
  10931.  
  10932.  This application note corrects a problem with DIRECT file access in
  10933.  Microsoft Pascal version 3.30. Microsoft has confirmed this to be a
  10934.  problem in Microsoft Pascal Compiler version 3.30 for MS-DOS. (This
  10935.  problem was corrected in Microsoft Pascal Compiler version 4.00;
  10936.  therefore, owners of Pascal version 4.00 do not need this application
  10937.  note.)
  10938.  
  10939.  This application note includes the following four files:
  10940.  
  10941.  1. PASNEW.LIB replaces the PASCAL.LIB shipped with Pascal 3.30. You
  10942.     can rename PASNEW.LIB to PASCAL.LIB to replace the old PASCAL.LIB,
  10943.     or you can specify PASNEW.LIB at the library (.LIB) prompt at link
  10944.     time. Make sure to keep the original 3.30 PASCAL.LIB as an archive.
  10945.  
  10946.  2. FILF.OBJ is a corrected version of the module that is incorrect in
  10947.     the old PASCAL.LIB library. Specifying FILF.OBJ at the object
  10948.     module (.OBJ) prompt at link time will also implement the patch
  10949.     without using the PASNEW.LIB library.
  10950.  
  10951.  3. DIRECT.PAS is a code example that shows the DIRECT file access
  10952.     problem.
  10953.  
  10954.  4. READ.ME is a copy of the text of this application note.
  10955.  
  10956.  The following steps (shown in the DIRECT.PAS example on the enclosed
  10957.  disk) demonstrate the problem with DIRECT file access in Pascal 3.30:
  10958.  
  10959.  1. Open a file with DIRECT access and write to it.
  10960.  
  10961.  2. Close the file and open it again.
  10962.  
  10963.  3. SEEK to one of the records you previously wrote.
  10964.  
  10965.  4. Attempt to PUT a new value in the record and close the file again.
  10966.  
  10967.  The above steps cause the new value to not be placed in the record.
  10968.  Also, the directory length of the file may be incorrect. The
  10969.  PASNEW.LIB and FILF.OBJ files on the enclosed disk correct this
  10970.  problem.
  10971.  
  10972.  Code Example (DIRECT.PAS)
  10973.  -------------------------
  10974.  
  10975.  Program test(INPUT,OUTPUT);
  10976.  
  10977.  Var
  10978.      f: file of word;
  10979.      i: integer;
  10980.      J:INTEGER;
  10981.  
  10982.  Begin
  10983.      WRITE('ENTER NUMBER OF RECORDS ');
  10984.      READLN(J);
  10985.      assign(f, 'testfile');
  10986.      f.mode:=direct;
  10987.      f.share:=sm_denyrd;
  10988.      rewrite(f);
  10989.      f^:=0;                          { fill value    }
  10990.      FOR I:=1 TO J DO PUT(F);          {J RECORDS GET FILLED WITH 0}
  10991.      close(f);
  10992.  
  10993.      WRITE('ENTER RECORD NUMBER TO SEEK ');
  10994.      READLN(J);
  10995.      RESET(F);
  10996.      SEEK(F,J);
  10997.      f^:=1;                          { put a 1 in the buffer }
  10998.      put(f);                         { write it }
  10999.      close(f);
  11000.  
  11001.      RESET(F);
  11002.      SEEK(F,J);
  11003.      GET(F);
  11004.      WRITELN;
  11005.      WRITELN('F^=',F^:2,'       F^ SHOULD EQUAL 1');
  11006.      CLOSE(F);
  11007.  End.
  11008.  
  11009.  
  11010.  246. Incorrect Reference of ADSMEM EXTERN FUNCTION; Pascal Example
  11011.  
  11012.  Product Version(s): 4.00   | 4.00
  11013.  Operating System:   MS-DOS | OS/2
  11014.  Flags: ENDUSER | SR# S901116-96 buglist4.00
  11015.  Last Modified: 26-DEC-1990    ArticleIdent: Q67375
  11016.  
  11017.  The PASCAL compiler fails to flag an incorrect usage of a FUNCTION
  11018.  that returns an ADSMEM value.
  11019.  
  11020.  Microsoft has confirmed this to be a problem with the Microsoft Pascal
  11021.  Compiler version 4.00 for MS-DOS and MS OS/2. To work around the
  11022.  problem, learn and use the correct syntax.
  11023.  
  11024.  The code below shows both the correct syntax and the illegal syntax of
  11025.  the use of a FUNCTION that returns an ADSMEM value. The correct logic
  11026.  is to assign the value returned by the FUNCTION to an ADSMEM variable,
  11027.  then reference the desired part of the ADSMEM variable.
  11028.  
  11029.  PROGRAM test1(output,input);
  11030.  
  11031.  var
  11032.     a: WORD;
  11033.     b: ADSMEM;
  11034.  
  11035.  FUNCTION Getmqq: ADSMEM; EXTERN;
  11036.  
  11037.  ! Program to display how to reference the correct offset of a
  11038.  ! memory address.
  11039.  
  11040.  BEGIN
  11041.     a := Getmqq.r;                  !wrong assignment statement
  11042.     WRITELN (output,'a.r = ',a.r);  !wrong result
  11043.     b := Getmqq;                    !correct assignment
  11044.     WRITELN (output,'b.r = ',b.r);  !correct results
  11045.  END.
  11046.  
  11047.  
  11048.  247. Pascal 4.00 Manual Incorrectly Refers to SORT.PAS File
  11049.  
  11050.  Product Version(s): 4.00   | 4.00
  11051.  Operating System:   MS-DOS | OS/2
  11052.  Flags: ENDUSER | docerr
  11053.  Last Modified: 26-DEC-1990    ArticleIdent: Q67376
  11054.  
  11055.  Pages 22 to 31 of the "Microsoft Pascal Compiler: User's Guide" for
  11056.  Pascal 4.00 incorrectly make reference to the program, SORT.PAS. In
  11057.  this section of the manual, SORT.PAS serves as a sample program for
  11058.  demonstrating the use of the PASx compile and LINK commands from DOS.
  11059.  Attempting to follow the examples in this part of the manual using
  11060.  Pascal 4.00 will fail because SORT.PAS was not shipped with Pascal
  11061.  version 4.00. It was only shipped with Pascal version 3.32.
  11062.  
  11063.  The reference to SORT.PAS on pages 22 to 31 should be changed to a
  11064.  different demo program, such as SORTDEMO.PAS. SORTDEMO.PAS can be used
  11065.  in place of SORT.PAS for the purpose of demonstrating the compile and
  11066.  link commands from DOS.
  11067.  
  11068.  This information applies to Microsoft Pascal version 4.00 for MS-DOS
  11069.  and MS OS/2.
  11070.  
  11071.  Note that SORTDEMO.PAS and SORT.PAS are not the same program.
  11072.  SORTDEMO.PAS contains many sorting algorithms, such as bubble sort,
  11073.  quick sort, insertion sort, and so on. SORT.PAS just contains a simple
  11074.  bubble sort algorithm.
  11075.  
  11076.  If Pascal 4.00 is configured to run only under DOS (and not OS/2) on
  11077.  your system, you will need to copy the file OS2.INT from the Examples
  11078.  disk to the INCLUDE path of your hard drive. The PAS1 compiler will
  11079.  need to open this file when compiling SORTDEMO from DOS. Absence of
  11080.  this file will result in the error "File access error ... " at compile
  11081.  time. For more information on this problem, query on the following
  11082.  words:
  11083.  
  11084.     Pascal and sortdemo and bound
  11085.  
  11086.  
  11087.  248. "Symbol Defined More Than Once: SUBSQQ" Error
  11088.  
  11089.  Product Version(s): 3.04
  11090.  Operating System:   MS-DOS
  11091.  Flags: ENDUSER | TAR56929
  11092.  Last Modified:  2-JAN-1991    ArticleIdent: Q11985
  11093.  
  11094.  Question:
  11095.  
  11096.  While adding a Pascal language-user interface to our FORTRAN language
  11097.  system, a run-time library compatibility problem has surfaced. When we
  11098.  search both run-time libraries during a link, a "Symbol defined more
  11099.  than once: SUBSQQ" error is reported in the second run-time library
  11100.  searched.
  11101.  
  11102.  This is both an operational problem (our MAKEs terminate at the error)
  11103.  and a potential run-time problem. The only run-time problem we know of
  11104.  occurs when the FORTRAN substring is used (for example, TEST(I:I)=' ')
  11105.  and the Pascal library is searched first. This problem will generally
  11106.  lock up a system at run time.
  11107.  
  11108.  We would like to know the following:
  11109.  
  11110.  1. Is there a patch for the libraries?
  11111.  
  11112.  2. Is there a potential Pascal run-time problem when we link the
  11113.     FORTRAN library first to solve the FORTRAN substring crash?
  11114.  
  11115.  Response:
  11116.  
  11117.  No. You are not likely to have a problem using the executable you
  11118.  created.
  11119.  
  11120.  For the first problem with the MAKE file, you should use conditional
  11121.  execution based on whether or not you receive certain error levels.
  11122.  
  11123.  In regard to the library problem, you may have a FORTRAN main program
  11124.  that calls Pascal routines that, for example, provide a user interface
  11125.  to your system. However, there may be something in the structure of
  11126.  your program that tangles the linker.
  11127.  
  11128.  Examine the contents of the FORTRAN and Pascal libraries using the LIB
  11129.  utility. You can see that the function SUBSQQ is present in both
  11130.  PASCAL.LIB and FORTRAN.LIB. You also can see that the object module
  11131.  contains the SUBSQQ function in the Pascal library, which contains
  11132.  many other entry points. This is in contrast to the FORTRAN object
  11133.  module containing SUBSQQ, which only has three entry points. The
  11134.  following is an example:
  11135.  
  11136.  PASCAL.LIB:
  11137.  ----------
  11138.  
  11139.  sets              Offset: 000101d0H  Code and data size: 4c5H
  11140.    ADDSQQ            CEQSQQ            CLESQQ            CLTSQQ
  11141.    MIN               MULSQQ            O3ESQQ            SETSQQ
  11142.   *SUBSQQ*           T3OSQQ            Z3RSQQ
  11143.  
  11144.  FORTRAN.LIB:
  11145.  -----------
  11146.  
  11147.  fstl              Offset: 0000fb00H  Code and data size: 19eH
  11148.    FCPSQQ            FSTLQQ            SUBSQQ
  11149.  
  11150.  An entry point is not necessarily a function. For example, in the
  11151.  FORTRAN library module containing SUBSQQ, FCPSQQ is actually a module
  11152.  name, while SUBSQQ is a procedure and FSTLQQ a function.
  11153.  
  11154.  Your program uses at least one entry point contained in both of these
  11155.  two modules. The entry point does not necessarily need to be SUBSQQ.
  11156.  
  11157.  For example, if you first link in the Pascal library and then the
  11158.  FORTRAN library (and if your program generates calls to ADDSQQ and
  11159.  FSTLQQ), the linker will first pull in the "sets" module from the
  11160.  PASCAL.LIB to resolve the reference to ADDSQQ. The linker then must
  11161.  pull in the "fstl" module from the FORTRAN.LIB to resolve the
  11162.  reference to FSTLQQ. The linker will then check all its entry points
  11163.  for duplicates, find that now it has duplicates of the SUBSQQ
  11164.  procedure, and generate a message that you have pulled in two
  11165.  (possibly different) versions of SUBSQQ.
  11166.  
  11167.  This procedure should generate a fatal error and make it impossible
  11168.  for you to proceed. If this occurs and your machine hangs, try
  11169.  switching your link order. Everything should work properly because you
  11170.  are using two Microsoft compilers, as well as using the same version
  11171.  number of two particularly compatible compilers (they share the same
  11172.  source code for many routines). In fact, the SUBSQQ procedure is
  11173.  indeed identical in FORTRAN and Pascal version 3.31.
  11174.  
  11175.  We recommend that you proceed with the executable you created by
  11176.  linking in FORTRAN first, then Pascal. You should not encounter any
  11177.  problems using this procedure.
  11178.  
  11179.  
  11180.  249. ADS of Function/Procedure May Gives Incorrect Results
  11181.  
  11182.  Product Version(s): 4.00   | 4.00
  11183.  Operating System:   MS-DOS | OS/2
  11184.  Flags: ENDUSER | SR# S901116-69
  11185.  Last Modified:  2-JAN-1991    ArticleIdent: Q67888
  11186.  
  11187.  ADS returns the segment and offset of a variable, function, or
  11188.  procedure. When calling ADS of a intrinsic function, it will return
  11189.  the incorrect address of zero. ADS of an external function/procedure
  11190.  will produce the correct results unless an ADS call to an intrinsic
  11191.  was performed first. In the latter case, it will then assign zero to
  11192.  the variable of the ADS of the external function/procedure and assign
  11193.  the ADS of the external function/procedure to the variable that holds
  11194.  the ADS of the intrinsic function/procedure.
  11195.  
  11196.  This information applies to Microsoft Pascal version 4.00 for MS-DOS
  11197.  and MS OS/2.
  11198.  
  11199.  In the code example below, the wrong addresses are printed. If Getmmq
  11200.  had been the only use of the ADS function, the correct results would
  11201.  have be printed. With the second use of the ADS function on the
  11202.  external, the addresses are incorrectly switched and the ADS of F1
  11203.  procedure prints the address of Getmmq, and the ADS of Getmmq function
  11204.  prints zero. Had the ADS of the intrinsic function been the only call,
  11205.  then ADS would have returned zero.
  11206.  
  11207.  PROGRAM t(output,input);
  11208.  VAR
  11209.     a,b: ADSMEM;
  11210.  
  11211.  FUNCTION F1:INTEGER;
  11212.  BEGIN
  11213.     F1 := 5;
  11214.  END;
  11215.  
  11216.  FUNCTION Getmqq(wants : WORD):ADSMEM;EXTERN;
  11217.  
  11218.  BEGIN
  11219.    a := ADS F1;
  11220.    b := ADS Getmmq;
  11221.    WRITELN(output,'F1    =',RETYPE(INTEGER4,b)); !prints ADS of GETMQQ
  11222.    WRITELN(output,'GETMQQ=',retype(INTEGER4,a)); !prints "0"
  11223.  END.
  11224.  
  11225.  
  11226.  250. PASCAL 4.0 Can Fail to Report Bad RETYPE Arguments; Cause Hang
  11227.  
  11228.  Product Version(s): 4.00   | 4.00
  11229.  Operating System:   MS-DOS | OS/2
  11230.  Flags: ENDUSER | SR# S901220-19
  11231.  Last Modified:  9-JAN-1991    ArticleIdent: Q68022
  11232.  
  11233.  The Pascal compiler does not always detect errors in the arguments of
  11234.  the RETYPE function, which can cause the program to hang at run time.
  11235.  
  11236.  Microsoft has confirmed this to be a problem with Microsoft Pascal
  11237.  Compiler version 4.00 (buglist4.00). We are researching this problem
  11238.  and will post more information here as it becomes available. To work
  11239.  around the problem, pass the correct arguments to the RETYPE function.
  11240.  
  11241.  The RETYPE function takes two arguments: the first argument is the
  11242.  type; the second argument is a declared variable. The RETYPE command
  11243.  will type-cast the second argument using the first argument. In the
  11244.  code below, the compiler does not detect an error. When the program
  11245.  below is run, the computer will hang.
  11246.  
  11247.  program test(output,input);
  11248.  type
  11249.     t = ads of integer;   !segment address of integer
  11250.  var
  11251.     a : ads of word;      !segment address of word
  11252.  
  11253.  procedure p(const x: integer4);
  11254.     begin writeln('X = ',x); end;
  11255.  
  11256.  begin
  11257.     p(retype (t,a)^);                  ! correct code
  11258.     p(retype (t, ads a^)^);            ! incorrect code..
  11259.  end.                                  ! ..convert the address of
  11260.                                        ! ..pointer into a type???
  11261.  
  11262.  The compiler should detect this error on the first pass and generate
  11263.  the "^201 Types Not Assignment Compatible" error on the second call to
  11264.  procedure p.
  11265.  
  11266.  
  11267.  251. Summary of Pascal 4.00 Compiler's Command-Line Switches
  11268.  
  11269.  Product Version(s): 4.00
  11270.  Operating System:   MS-DOS
  11271.  Flags: ENDUSER | SR# S910201-74
  11272.  Last Modified: 14-FEB-1991    ArticleIdent: Q69175
  11273.  
  11274.  The following is a summary of the command-line switches for Microsoft
  11275.  Pascal Compiler version 4.00. All switches correspond to Pascal
  11276.  metacommands, so you can either use the metacommand in the source file
  11277.  or give the command as a switch to the compiler. Any instruction given
  11278.  as a metacommand in the source file overrides the corresponding switch
  11279.  given at compile time.
  11280.  
  11281.  For more information about the compiler and its switches, see Chapter
  11282.  5, "More About Compiling" in the "Microsoft Pascal Compiler for MS-DOS
  11283.  Operating System: User's Guide" for version 4.00.
  11284.  
  11285.     Switch     Default     Metacommand     Action
  11286.     ------     -------     -----------     ------
  11287.  
  11288.     /A         Off         $indexck        Checks for array index values
  11289.                                            in range, including super
  11290.                                            array indices.
  11291.  
  11292.     /C         Off         $decmath        Directs the compiler to use
  11293.                                            the decimal math routines in
  11294.                                            the math run-time library,
  11295.                                            DECMATH.LIB.
  11296.  
  11297.     /D         Off         $debug          Switches on all debugging
  11298.                                            switches.
  11299.  
  11300.     /E         Off         $entry          Generates procedure entry and
  11301.                                            exit calls for the debugger.
  11302.  
  11303.     /I         Off         $initck         Checks for use of
  11304.                                            uninitialized values.
  11305.  
  11306.     /L         Off         $line           Generates line-number calls
  11307.                                            for debugger.
  11308.  
  11309.     /M         Off         $mathck         Checks for mathematical errors,
  11310.                                            such as overflow and division
  11311.                                            by zero.
  11312.  
  11313.     /N         Off         $nilck          Checks for dereferencing of
  11314.                                            any pointers that are NIL.
  11315.  
  11316.     /Q         Off         $debug          Switches off all debugging
  11317.                                            switches.
  11318.  
  11319.     /R         Off         $rangeck        Checks for subrange validity
  11320.                                            including assignments.
  11321.  
  11322.     /S         Off         $stackck        Checks for stack overflow at
  11323.                                            procedure or function entry.
  11324.  
  11325.     /T         Off         $tagck          Checks tag fields in variant
  11326.                                            records.
  11327.  
  11328.  The debug (/D) switch will turn on all debug switches (those whose
  11329.  metacommand ends with "CK"). The error-checking switches and
  11330.  corresponding metacommands cause a significant increase in the size of
  11331.  code generated. Therefore, you may want to use them in the early
  11332.  stages of program development, then recompile your program without
  11333.  them once you have thoroughly debugged your program (for example, use
  11334.  the /Q switch to turn off debug switches). Removing the debug switches
  11335.  will reduce your program's code size.
  11336.  
  11337.  
  11338.  
  11339.  
  11340.  
  11341.  
  11342.  Microsoft QuickPASCAL Compiler
  11343.  =============================================================================
  11344.  
  11345.  
  11346.  1. QuickPascal Does Not Support Installable Graphics Drivers
  11347.  
  11348.  Product Version(s): 1.00
  11349.  Operating System:   MS-DOS
  11350.  Flags: ENDUSER |
  11351.  Last Modified:  3-MAY-1989    ArticleIdent: Q43769
  11352.  
  11353.  Turbo Pascal has a routine called InstallUserDriver to install a
  11354.  vendor-added graphics device driver. QuickPascal Version 1.00 does not
  11355.  implement installable graphics device drivers.
  11356.  
  11357.  At this point, we know of no programs that have been written that have
  11358.  implemented this call because no one has developed these vendor-added
  11359.  graphics device drivers.
  11360.  
  11361.  
  11362.  2. QuickPascal Does Not Link TPUs
  11363.  
  11364.  Product Version(s): 1.00
  11365.  Operating System:   MS-DOS
  11366.  Flags: ENDUSER |
  11367.  Last Modified:  3-MAY-1989    ArticleIdent: Q43770
  11368.  
  11369.  A file with an extension of .TPU is a precompiled unit file used in
  11370.  Turbo Pascal. QuickPascal Version 1.00 does not link Turbo Pascal .TPU
  11371.  files. If the source code for .TPU files is available, compile it using
  11372.  QuickPascal. This will create a .QPU file (QuickPascal unit file),
  11373.  which then can be used by QuickPascal.
  11374.  
  11375.  
  11376.  3. QuickPascal Not Compatible with Turbo Pascal 3.0
  11377.  
  11378.  Product Version(s): 1.00
  11379.  Operating System:   MS-DOS
  11380.  Flags: ENDUSER |
  11381.  Last Modified:  3-MAY-1989    ArticleIdent: Q43771
  11382.  
  11383.  Microsoft QuickPascal Version 1.00 is not compatible with Turbo Pascal
  11384.  Version 3.0. It is source compatible with Turbo Pascal 5.0.
  11385.  
  11386.  The Turbo Pascal 5.0 package includes TURBO3.TPU and GRAPH3.TPU units
  11387.  to make Turbo Pascal 5.0 compatible with Version 3.0.
  11388.  
  11389.  The units equivalent to TURBO3.TPU and GRAPH3.TPU are not included in
  11390.  QuickPascal Version 1.00.
  11391.  
  11392.  
  11393.  4. Description of units and their use
  11394.  
  11395.  Product Version(s): 1.00
  11396.  Operating System:   MS-DOS
  11397.  Flags: ENDUSER |
  11398.  Last Modified:  3-MAY-1989    ArticleIdent: Q43970
  11399.  
  11400.  Question:
  11401.  
  11402.  How do I implement the idea of modules in QuickPascal?
  11403.  
  11404.  Response:
  11405.  
  11406.  To use modules in QuickPascal you must create a "unit."  A unit is
  11407.  a collection of constants, data types, variables, procedures, and
  11408.  functions.
  11409.  
  11410.  To create a unit, do the following:
  11411.  
  11412.  1. Create a program (call it MODULE1.PAS, for example) that adheres to
  11413.     the unit specification. More information on unit specification is
  11414.     given below.
  11415.  
  11416.  2. Compile MODULE1.PAS. QuickPascal produces a file by the name of
  11417.     MODULE1.QPU. MODULE1.QPU is a unit.
  11418.  
  11419.  In the main program, include the line after the program statement:
  11420.  
  11421.     uses module1;
  11422.  
  11423.  The module1 unit is now automatically "linked" with the main program.
  11424.  
  11425.  A unit starts with the reserved word UNIT, followed by the unit's name.
  11426.  The unit also contains INTERFACE and IMPLEMENTATION sections. The
  11427.  INTERFACE section is "visible" to any other units or programs that use
  11428.  this unit. The IMPLEMENTATION section is not "visible" to any programs
  11429.  that use this unit. The IMPLEMENTATION section usually is used by
  11430.  "visible" procedures and functions that appear in the INTERFACE
  11431.  section.
  11432.  
  11433.  See also "Pascal By Example," Chapter 7, Pages 87-93.
  11434.  
  11435.  
  11436.  5. QuickPascal Accepts a Function Name as an Argument
  11437.  
  11438.  Product Version(s): 1.00
  11439.  Operating System:   MS-DOS
  11440.  Flags: ENDUSER |
  11441.  Last Modified: 19-MAY-1989    ArticleIdent: Q44473
  11442.  
  11443.  The Microsoft QuickPascal Compiler Version 1.00 accepts a function
  11444.  name as an argument to a procedure as shown below; however, Turbo
  11445.  Pascal Version 5.00 does not accept it.
  11446.  
  11447.  Turbo Pascal Version 5.00 thinks that the Foo is a recursive call when
  11448.  it is specified in the Val procedure. In QuickPascal, this is a way to
  11449.  assign a value to the Foo function. No recursion is performed.
  11450.  
  11451.  function Foo(Var.....) : REAL;
  11452.  
  11453.  begin
  11454.     .
  11455.     .
  11456.     Val(Mystring,Foo,Error);
  11457.  end;
  11458.  
  11459.  
  11460.  6. Example of QuickPascal to Assembler Procedure Call
  11461.  
  11462.  Product Version(s): 1.00
  11463.  Operating System:   MS-DOS
  11464.  Flags: ENDUSER |
  11465.  Last Modified:  6-SEP-1989    ArticleIdent: Q44474
  11466.  
  11467.  QuickPascal Version 1.00 can interface to assembler object modules.
  11468.  The following example shows how to access global variables from within
  11469.  the assembly routine; it also shows the segment conventions necessary
  11470.  to interface with QuickPascal:
  11471.  
  11472.  Program PasAsmTest;
  11473.  {$F+}                               (* Turn on far call model *)
  11474.  {$L AsmTest}                        (* Turn on local symbol info *)
  11475.  Procedure TestRoutine;  External;   (* Define routine as external *)
  11476.  {$F-}                               (* Turn off far call model *)
  11477.  VAR
  11478.     TestInt : Integer;
  11479.     TestBool: Boolean;
  11480.  
  11481.  BEGIN
  11482.     TestInt := 2;
  11483.     TestBool := FALSE;
  11484.     Writeln ('Before assembly call, variables are:');
  11485.     Writeln ('TestBool = ', TestBool);
  11486.     Writeln ('TestInt = ', TestInt);
  11487.     TestRoutine;
  11488.     Writeln;
  11489.     Writeln ('After assembly call, variables have changed');
  11490.     Writeln ('TestBool now equals ', TestBool);
  11491.     Writeln ('TestInt = ', TestInt);
  11492.  END.
  11493.  
  11494.  ; Assemble command lines
  11495.  ;
  11496.  ; MASM:
  11497.  ;     Assemble with:
  11498.  ;            Masm asmtest.asm;
  11499.  ;
  11500.  ; QuickAssembler command line:
  11501.  ;     Assemble with:
  11502.  ;            qcl /c asmtest.asm
  11503.  ;
  11504.  ; QuickAssembler environment:
  11505.  ;     Choose Options.Make.Build Flags, Release mode (not Debug)
  11506.  ;     Choose Options.Make.Assembly Flags.Labels, Convert to Upper
  11507.  
  11508.  DATA Segment
  11509.     TRUE  Equ  1
  11510.     Extrn TestBool : BYTE
  11511.     Extrn TestInt  : WORD
  11512.  DATA Ends
  11513.  
  11514.  CODE Segment                  ; Setup Code and Data segments
  11515.     ASSUME CS:CODE,DS:DATA
  11516.  
  11517.  Public TestRoutine
  11518.  TestRoutine Proc Far
  11519.     PUSH     BP
  11520.     MOV      BP, SP            ; Preserve required registers on stack
  11521.     PUSH     DS
  11522.  
  11523.     Mov      TestBool, TRUE    ; Change the variables
  11524.     Mov      TestInt, 0010
  11525.  
  11526.     POP      DS
  11527.     MOV      SP, BP            ; Restore to entry state
  11528.     POP      BP
  11529.     RET
  11530.  TestRoutine EndP
  11531.  CODE EndS
  11532.  END
  11533.  
  11534.  Please note the following standard conventions:
  11535.  
  11536.  1. All code is placed within a single segment called Code.
  11537.  
  11538.  2. Data cannot be declared within the assembly routine.
  11539.  
  11540.  3. The BP, SP, and DS are preserved. DS and SS need only be preserved,
  11541.     if used. The above example uses the standard entry and exit form
  11542.     for Microsoft interfacing.
  11543.  
  11544.  
  11545.  7. QuickPascal Fillmasks Are Transparent
  11546.  
  11547.  Product Version(s): 1.00
  11548.  Operating System:   MS-DOS
  11549.  Flags: ENDUSER |
  11550.  Last Modified: 25-MAY-1989    ArticleIdent: Q44476
  11551.  
  11552.  Question:
  11553.  
  11554.  Turbo Pascal Version 5.00 fillmasks are opaque. Does QuickPascal
  11555.  follow this convention?
  11556.  
  11557.  Response:
  11558.  
  11559.  No, it does not. QuickPascal fillmasks are transparent; however, there
  11560.  are differences in how fillmasks are handled by different
  11561.  figure-drawing functions.
  11562.  
  11563.  If you use a _rectangle function and fill the rectangle with a
  11564.  pattern1, then draw an overlapping second rectangle and fill that with
  11565.  a pattern2, you will see both patterns in the overlay area. In Turbo
  11566.  Pascal 5.00, you will only see pattern2 in the overlay area.
  11567.  
  11568.  The _ellipse and _pie functions use a different fill algorithm
  11569.  (floodfill). Thus, if you fill an overlapping ellipse (or pie) it does
  11570.  not fill the entire area; it fills until it hits a solid border.
  11571.  Depending on where the center of the ellipse (or pie) is, either the
  11572.  overlap area or the nonoverlap area is filled; not both. In the case
  11573.  of the overlap area being filled, you see both patterns.
  11574.  
  11575.  The following program draws two overlapping rectangles and two
  11576.  overlapping ellipses with different centers and fills them with
  11577.  different patterns:
  11578.  
  11579.  program fill (input, output);
  11580.  
  11581.  uses MsGraph, Crt;
  11582.  
  11583.  CONST
  11584.     mask1 : _FillMask = (0,66,36,24,0,0,0,0);
  11585.     mask2 : _FillMask = (0,0,0,0,24,36,66,0);
  11586.  
  11587.  VAR
  11588.     errorcode : INTEGER;
  11589.     c         : CHAR;
  11590.  
  11591.  BEGIN
  11592.     errorcode := _setvideomode(_MRES16COLOR);
  11593.  
  11594.     _setcolor(3);
  11595.     _setfillmask (mask1);
  11596.     _ellipse (_GFILLINTERIOR,100,40,160,170);
  11597.     _ellipse (_GFILLINTERIOR,210,40,280,140);
  11598.     _rectangle (_GFILLINTERIOR,0,20,60,80);
  11599.  
  11600.     _setfillmask (mask2);
  11601.     _rectangle (_GFILLINTERIOR,20,40, 80,130);
  11602.     _ellipse (_GFILLINTERIOR,110,40,200,180);
  11603.     _ellipse (_GFILLINTERIOR,260,40,310,200);
  11604.  
  11605.     c := ReadKey;
  11606.     errorcode := _setvideomode(_DEFAULTMODE);
  11607.  END.
  11608.  
  11609.  
  11610.  8. Misleading Error Message in QuickPascal Debug Window
  11611.  
  11612.  Product Version(s): 1.00
  11613.  Operating System:   MS-DOS
  11614.  Flags: ENDUSER | buglist1.00
  11615.  Last Modified: 26-SEP-1989    ArticleIdent: Q44708
  11616.  
  11617.  If a numeric value followed by a letter is entered in the QuickPascal
  11618.  Debug window, the error message "<Error P0008: Invalid end of line>"
  11619.  is displayed. This is misleading. A more accurate error message is
  11620.  "Invalid expression."
  11621.  
  11622.  An example of when this error message appears is if you mistyped the
  11623.  command "32,h" (which is used to print the hexadecimal equivalent of
  11624.  32). The misleading error message will be reported if the command is
  11625.  entered as "32h".
  11626.  
  11627.  Microsoft has confirmed this to be a problem with QuickPascal Version
  11628.  1.00. We are researching this problem and will post new information as
  11629.  it becomes available.
  11630.  
  11631.  
  11632.  9. Byte Used as Parameter Generates Invalid Error Message
  11633.  
  11634.  Product Version(s): 1.00
  11635.  Operating System:   MS-DOS
  11636.  Flags: ENDUSER | buglist1.00
  11637.  Last Modified: 31-MAY-1989    ArticleIdent: Q44709
  11638.  
  11639.  The following program produces "Error 127: Invalid variable reference"
  11640.  when compiled with QuickPascal 1.00. The error message is incorrect
  11641.  because the syntax for the code is correct.
  11642.  
  11643.  PROCEDURE Broken (VAR b : Byte);
  11644.  BEGIN
  11645.  END;
  11646.  
  11647.  VAR
  11648.      x : Boolean;
  11649.  
  11650.  BEGIN
  11651.     Broken ( Byte(x) );
  11652.  END.
  11653.  
  11654.  Microsoft has confirmed this to be a problem in QuickPascal Version
  11655.  1.00. We are researching this problem and will post new information
  11656.  when it becomes available.
  11657.  
  11658.  To work around the problem, use a temporary variable as the parameter
  11659.  passed to Broken, as follows:
  11660.  
  11661.  PROCEDURE Broken (VAR b : BYTE);
  11662.  BEGIN
  11663.  END;
  11664.  
  11665.  VAR
  11666.      x    : BOOLEAN;
  11667.      temp : BYTE;
  11668.  
  11669.  BEGIN
  11670.     temp := Byte (x);
  11671.     Broken ( temp );
  11672.  END.
  11673.  
  11674.  
  11675.  10. QP Cannot Compare Packed Arrays of Char > 255 Elements
  11676.  
  11677.  Product Version(s): 1.00
  11678.  Operating System:   MS-DOS
  11679.  Flags: ENDUSER | docerr
  11680.  Last Modified: 31-MAY-1989    ArticleIdent: Q44710
  11681.  
  11682.  QuickPascal generates "Error 51: Conflicting operands" when packed
  11683.  arrays of characters greater than 255 elements are compared.
  11684.  
  11685.  Turbo Pascal has the same limitation. Packed arrays of characters with
  11686.  more than 255 elements are not supported in QuickPascal. The on-line
  11687.  help should mention this, but does not.
  11688.  
  11689.  The following program demonstrates the problem:
  11690.  
  11691.  CONST
  11692.     max = 256;
  11693.  
  11694.  VAR
  11695.     s1,
  11696.     s2  : PACKED ARRAY [1..max] OF CHAR;
  11697.     i   : INTEGER;
  11698.  
  11699.  BEGIN
  11700.      FOR i := 1 TO max DO
  11701.        BEGIN
  11702.            s1[i] := ' ';
  11703.            s2[i] := ' ';
  11704.        END;
  11705.  
  11706.      IF s1=s2
  11707.         THEN Writeln ('PASS')
  11708.         ELSE Writeln ('FAIL');
  11709.  END.
  11710.  
  11711.  
  11712.  11. Documentation Error in QuickPascal README.DOC: QPENV.ENV
  11713.  
  11714.  Product Version(s): 1.00
  11715.  Operating System:   MS-DOS
  11716.  Flags: ENDUSER | docerr
  11717.  Last Modified: 21-JUN-1989    ArticleIdent: Q45488
  11718.  
  11719.  The README.DOC file from the Setup/Utilities disk of QuickPascal
  11720.  Version 1.00 incorrectly states that information regarding the QP
  11721.  environment is found in the file titled QPENV.ENV. Information on the
  11722.  environment is actually found in the help file named QPENV.HLP.
  11723.  
  11724.  
  11725.  12. _GrStatus Is Documented in the On-line Help Only
  11726.  
  11727.  Product Version(s): 1.00
  11728.  Operating System:   MS-DOS
  11729.  Flags: ENDUSER |
  11730.  Last Modified: 21-JUN-1989    ArticleIdent: Q45489
  11731.  
  11732.  QuickPascal contains the MSGraph function _GrStatus, which returns the
  11733.  status of the most recently executed graphics routine. _GrStatus
  11734.  checks for errors that can occur when executing graphics routines.
  11735.  
  11736.  _GrStatus is not covered in "Pascal by Example," but it is completely
  11737.  documented in the on-line help system.
  11738.  
  11739.  See the on-line help system program, PALETTE1, for an example of how
  11740.  to use _GrStatus.
  11741.  
  11742.  
  11743.  13. QuickPascal Will Hang above 173 Levels of Nested Procedures
  11744.  
  11745.  Product Version(s): 1.00
  11746.  Operating System:   MS-DOS
  11747.  Flags: ENDUSER | buglist1.00
  11748.  Last Modified: 21-JUN-1989    ArticleIdent: Q45491
  11749.  
  11750.  In the Pascal language, procedures may be defined within other
  11751.  procedures. If you nest too many procedures, QuickPascal (and QPL)
  11752.  will hang. The procedures can be nested up to 127 levels with
  11753.  QuickPascal and Turbo Pascal. Above 127 levels, Turbo Pascal generates
  11754.  the error "Too many nested scopes"; above 128 levels, QuickPascal
  11755.  generates the error "Unknown identifier (P128)." However, above 173
  11756.  levels of nesting, QuickPascal will hang.
  11757.  
  11758.  Microsoft has confirmed this to be a problem in QuickPascal Version
  11759.  1.00. We are researching this problem and will post new information
  11760.  as it becomes available.
  11761.  
  11762.  
  11763.  14. QuickPascal Supports Arrays Up to Limit of DOS
  11764.  
  11765.  Product Version(s): 1.00
  11766.  Operating System:   MS-DOS
  11767.  Flags: ENDUSER |
  11768.  Last Modified: 21-JUN-1989    ArticleIdent: Q45492
  11769.  
  11770.  QuickPascal supports static and dynamic allocation of arrays up to 64K
  11771.  in length. When using getmem() to allocate an array dynamically, you
  11772.  may allocate from 0 to 65519 bytes. The static allocation limit is
  11773.  restricted by a total data segment size of 64K. All other static data
  11774.  and start-up and run-time overhead also come out of this 64K.
  11775.  
  11776.  If you would like to allocate data items larger than this amount, you
  11777.  must use BIGHEAP.QPU, which is a unit provided to do so. The sample
  11778.  program BIGMEM.PAS gives an example of how to do this. BIGHEAP.QPU
  11779.  allows allocations up to the amount of free memory under DOS.
  11780.  
  11781.  
  11782.  15. Latest Logitech Mouse Driver Works Fine with QuickPascal
  11783.  
  11784.  Product Version(s): 1.00
  11785.  Operating System:   MS-DOS
  11786.  Flags: ENDUSER |
  11787.  Last Modified: 23-JUN-1989    ArticleIdent: Q45636
  11788.  
  11789.  There were some problems with early Logitech mouse drivers and
  11790.  QuickPascal 1.00. Two of the problems are as follows:
  11791.  
  11792.  1. When QuickPascal was in 43-line mode, the mouse would not go below
  11793.     line 25.
  11794.  
  11795.  2. The mouse cursor appeared to split into two pieces so it appeared
  11796.     as if you had two cursors.
  11797.  
  11798.  All known problems with Logitech Mice and QuickPascal Version 1.00 are
  11799.  solved by obtaining the latest mouse driver (Version 4.00) from
  11800.  Logitech. You can call Logitech at (415) 795-0427.
  11801.  
  11802.  
  11803.  16. Type with STRING Can Hang QP.EXE If Tracing (F8) Through Code
  11804.  
  11805.  Product Version(s): 1.00
  11806.  Operating System:   MS-DOS
  11807.  Flags: ENDUSER | SR# S910111-255 buglist1.00
  11808.  Last Modified:  6-FEB-1991    ArticleIdent: Q68662
  11809.  
  11810.  An assignment to the second string variable within a record type will
  11811.  hang the machine if you try to Trace (F8) through the source code in
  11812.  the QP.EXE environment. This problem will occur when you try to step
  11813.  through any statement after the string assignment.
  11814.  
  11815.  Microsoft has confirmed this to be a problem in Microsoft QuickPascal
  11816.  version 1.00 for MS-DOS. We are researching this problem and will post
  11817.  new information here as it becomes available.
  11818.  
  11819.  The program will execute correctly as an executable .EXE file.
  11820.  
  11821.  The following code will hang the machine after the assignment of
  11822.  F^.Str2 when using the Trace (F8) command in QP.EXE. To duplicate the
  11823.  problem, the second variable within the record must be a string. The
  11824.  length of the string does not matter. The program will hang if you
  11825.  Trace (F8) though the code and then try to step through any statement
  11826.  after the string assignment.
  11827.  
  11828.  Sample Code
  11829.  -----------
  11830.  
  11831.  program test;
  11832.  uses DOS;
  11833.  type
  11834.     FCB = record
  11835.        Str1 : integer;         {anything}
  11836.        Str2 : string[3];       {has to be a string}
  11837.     end;
  11838.  var
  11839.     F : ^FCB;
  11840.  
  11841.  begin
  11842.     F^.Str1 := 34;
  11843.     F^.Str2 := '34';           {step through and hangs}
  11844.  end.
  11845.  
  11846.  
  11847.  17. QP 1.00 README: Special Instructions for QuickPascal Express
  11848.  
  11849.  Product Version(s): 1.00
  11850.  Operating System:   MS-DOS
  11851.  Flags: ENDUSER |
  11852.  Last Modified: 27-JUN-1989    ArticleIdent: Q45968
  11853.  
  11854.  The following information is taken from the QuickPascal Version 1.00
  11855.  README.DOC file.
  11856.  
  11857.  Special Instructions for QP Express
  11858.  -----------------------------------
  11859.  
  11860.  You may have difficulty running the QP Express Computer-Based Training
  11861.  (CBT) program due to your video driver/graphics card combination. Try
  11862.  the following:
  11863.  
  11864.  1. Make a backup copy of the QP Express or QP Express/QP Advisor disk.
  11865.     Use the backup copy for the remainder of this procedure.
  11866.  
  11867.  2. On the backup copy of the QP Express or QP Express/QP Advisor disk,
  11868.     you will find files with the extension .VID. Each of these files is
  11869.     a driver for a specific type of graphics card. The following
  11870.     drivers support the indicated graphics cards:
  11871.  
  11872.        Driver            Graphics Cards
  11873.        ------            --------------
  11874.  
  11875.        ATT6300.VID       For Olivetti and ATT PCs
  11876.        CGASNO.VID        For CGA cards that produce a snow effect
  11877.        ERICSSON.VID      For Ericsson PCs
  11878.        HERC102.VID       For the Hercules 102 card
  11879.        HERC112.VID       For the Hercules 112 card
  11880.  
  11881.     If you use one of these computers/displays, rename the appropriate
  11882.     driver to SCREEN.VID. For example, if you run an AT&T computer,
  11883.     type the following:
  11884.  
  11885.        RENAME ATT6300.VID SCREEN.VID
  11886.  
  11887.  3. You can now resume SETUP or run the CBT directly by typing LEARN.
  11888.  
  11889.  
  11890.  18. QuickPascal Data Type Byte Is Unsigned Not Signed
  11891.  
  11892.  Product Version(s): 1.00
  11893.  Operating System:   MS-DOS
  11894.  Flags: ENDUSER | docerr
  11895.  Last Modified: 23-JUN-1989    ArticleIdent: Q45970
  11896.  
  11897.  The documentation "Pascal by Example" incorrectly states that data
  11898.  type Byte is a signed byte (value range from -128 to 127) on Page 156.
  11899.  
  11900.  The documentation correctly states that data type Byte is an unsigned
  11901.  byte (value range from 0 to 255) on Page 14. Data type Byte is also
  11902.  correctly identified as an unsigned byte in the QuickPascal Advisor
  11903.  (on-line help) under "Pascal Language, Data Types."
  11904.  
  11905.  
  11906.  19. All Objects Must Be Defined Before Methods Can Be Written
  11907.  
  11908.  Product Version(s): 1.00
  11909.  Operating System:   MS-DOS
  11910.  Flags: ENDUSER |
  11911.  Last Modified:  6-SEP-1989    ArticleIdent: Q46008
  11912.  
  11913.  When creating a QuickPascal program involving object-oriented
  11914.  programming (OOP), you must define all objects before writing the
  11915.  methods associated with these objects. It may seem natural to define
  11916.  an object, the methods associated with it, and then the next object;
  11917.  however, this is not the proper way to write QuickPascal OOP code.
  11918.  
  11919.  You get the following error:
  11920.  
  11921.     Source: C:\Workdir\file.pas
  11922.     Error 21: BEGIN expected
  11923.  
  11924.  Instead, you must define all of your objects first, and then define
  11925.  all of their methods.
  11926.  
  11927.  Incorrect Coding
  11928.  ----------------
  11929.  
  11930.  PROGRAM test;
  11931.  
  11932.  Type
  11933.     Texperiment1 = OBJECT
  11934.        ch1 : char;
  11935.        PROCEDURE exp_method1;
  11936.     End;
  11937.     PROCEDURE Texperiment1.exp_method1;
  11938.     Begin
  11939.       { Method code }
  11940.     End;
  11941.  
  11942.     Texperiment2 = OBJECT
  11943.        ch2 : char;
  11944.        PROCEDURE exp_method2;
  11945.     End;
  11946.     PROCEDURE Texperiment2.exp_method2;
  11947.     Begin
  11948.       { Method code }
  11949.     End;
  11950.  
  11951.  BEGIN    { Main Code }
  11952.  END.     { End of main }
  11953.  
  11954.  Correct Coding
  11955.  --------------
  11956.  
  11957.  PROGRAM test;
  11958.  
  11959.  Type
  11960.  { Define Objects }
  11961.     Texperiment1 = OBJECT
  11962.        ch1 : char;
  11963.        PROCEDURE exp_method1;
  11964.     End;
  11965.  
  11966.     Texperiment2 = OBJECT
  11967.        ch2 : char;
  11968.        PROCEDURE exp_method2;
  11969.     End;
  11970.  
  11971.  { Define Methods }
  11972.     PROCEDURE Texperiment1.exp_method1;
  11973.     Begin
  11974.       { Method code }
  11975.     End;
  11976.     PROCEDURE Texperiment2.exp_method2;
  11977.     Begin
  11978.       { Method code }
  11979.     End;
  11980.  
  11981.  BEGIN    { Main Code }
  11982.  END.     { End of main }
  11983.  
  11984.  
  11985.  20. QuickPascal Allows Redirection at the DOS Prompt
  11986.  
  11987.  Product Version(s): 1.00
  11988.  Operating System:   MS-DOS
  11989.  Flags: ENDUSER |
  11990.  Last Modified: 27-JUN-1989    ArticleIdent: Q46132
  11991.  
  11992.  DOS redirection allows you to specify both input and output files for
  11993.  Microsoft QuickPascal programs. In programs that do not use the Crt
  11994.  unit, all that is required is to issue the following command line:
  11995.  
  11996.     programname <inputfile >outputfile
  11997.  
  11998.  If the program uses the Crt unit, the command line above must be used,
  11999.  and in addition, the following four lines must be included in the file
  12000.  prior to the first input or output statement:
  12001.  
  12002.     Assign( Input, '' );
  12003.     Reset( Input, '' );
  12004.     Assign( Output, '' );
  12005.     Reset( Output, '' );
  12006.  
  12007.  The above four lines are required because the Crt unit changes the
  12008.  names of the standard input and output sources; the four lines above
  12009.  reassign them to their original settings. This change is made to speed
  12010.  up the I/O operations. Programs that do not use the Crt unit send the
  12011.  output to the screen through DOS, which adds overhead. Programs that
  12012.  use the Crt unit can send the output directly to the BIOS or directly
  12013.  to video memory.
  12014.  
  12015.  Borland's Turbo Pascal operates the same way. If you want to redirect
  12016.  the I/O and use the Crt unit, you must include the same four lines of
  12017.  code.
  12018.  
  12019.  More information on I/O redirection can be found in the "Microsoft
  12020.  QuickPascal Pascal by Example" manual on Page 104. More information on
  12021.  the Crt unit can be found in the same manual starting on Page 105.
  12022.  
  12023.  
  12024.  21. No Purple-Labeled Disks in QuickPascal Version 1.00
  12025.  
  12026.  Product Version(s): 1.00
  12027.  Operating System:   MS-DOS
  12028.  Flags: ENDUSER | docerr
  12029.  Last Modified: 13-JUL-1989    ArticleIdent: Q46451
  12030.  
  12031.  Problem:
  12032.  
  12033.  On Pages 4 and 5 of the "Microsoft QuickPascal Up and Running" manual,
  12034.  the following instructions are given:
  12035.  
  12036.     Insert the purple-labeled Setup/Utilities distribution disk.
  12037.  
  12038.  I don't have any purple-labeled disks.
  12039.  
  12040.  Response:
  12041.  
  12042.  This is a documentation error. There are no purple-labeled disks with
  12043.  Microsoft QuickPascal Version 1.00. All disks, including the
  12044.  Setup/Utilities disk, are white, blue, and tan.
  12045.  
  12046.  
  12047.  22. Auto Recompile and Debug option
  12048.  
  12049.  Product Version(s): 1.00   | 1.00
  12050.  Operating System:   MS-DOS | OS/2
  12051.  Flags: ENDUSER |
  12052.  Last Modified: 13-JUL-1989    ArticleIdent: Q46730
  12053.  
  12054.  When you turn the "debug information" option Off in the compile
  12055.  options window, the compiler does not recompile when you use F5 to run
  12056.  after a change was made in the source.
  12057.  
  12058.  When you load a file into QuickPascal (QP) and press F5 to run it, QP
  12059.  compiles and runs the program. If you quit the program and go back to
  12060.  the source, change the source, and press F5 to run again, QP
  12061.  recompiles (because the source was changed) and runs just as expected.
  12062.  
  12063.  However, if you turn debug information Off and press F5 to run, QP
  12064.  recompiles the program as expected (because a change was made to the
  12065.  environment). If you quit the program and return to the source, change
  12066.  the source, and press F5 to run again, QP does not recompile here when
  12067.  it should because the source has been changed.
  12068.  
  12069.  With the debug information option Off, you must use the "build main
  12070.  program" option under the Make menu to get the program recompiled.
  12071.  
  12072.  Microsoft is researching this problem and will post new information as
  12073.  it becomes available.
  12074.  
  12075.  
  12076.  23. QuickPascal Editor Cannot Mark Last Line of File
  12077.  
  12078.  Product Version(s): 1.00
  12079.  Operating System:   MS-DOS
  12080.  Flags: ENDUSER | buglist1.00
  12081.  Last Modified: 13-JUL-1989    ArticleIdent: Q46742
  12082.  
  12083.  QuickPascal does not mark (SHIFT+DOWN ARROW) the last line in a file
  12084.  unless the line is followed by a linefeed character. To get around
  12085.  this problem, you should insert a linefeed or use SHIFT+RIGHT ARROW to
  12086.  mark the last line.
  12087.  
  12088.  Microsoft has confirmed this to be a problem in QuickPascal Version
  12089.  1.00. We are researching this problem and will post new information as
  12090.  it becomes available.
  12091.  
  12092.  
  12093.  24. Cannot Get Context-Sensitive Help on Errors in Debug Window
  12094.  
  12095.  Product Version(s): 1.00
  12096.  Operating System:   MS-DOS
  12097.  Flags: ENDUSER | buglist1.00
  12098.  Last Modified: 13-JUL-1989    ArticleIdent: Q46743
  12099.  
  12100.  If you receive an error while in the debug window, you cannot use the
  12101.  on-line help system to get help information. This is a limitation of
  12102.  QuickPascal Version 1.00.
  12103.  
  12104.  Microsoft has confirmed this to be a problem in QuickPascal Version
  12105.  1.00. We are researching this problem and will post new information as
  12106.  it becomes available.
  12107.  
  12108.  
  12109.  25. Undocumented Procedures: _Polygon and _Plygon_wxy
  12110.  
  12111.  Product Version(s): 1.00
  12112.  Operating System:   MS-DOS
  12113.  Flags: ENDUSER |
  12114.  Last Modified: 13-JUL-1989    ArticleIdent: Q46744
  12115.  
  12116.  The following two procedures are included in the graphics unit
  12117.  MSGraph, but are not included in the documentation:
  12118.  
  12119.     PROCEDURE _Polygon( control  : Integer; VAR pointarray;
  12120.                         numpoints: Integer );
  12121.  
  12122.     PROCEDURE _Polygon_wxy( control   : Integer; Var pointarray;
  12123.                             numpoints : Integer);
  12124.  
  12125.  Both procedures draw a polygon in the current color. They either draw
  12126.  just the outline of the shape or fill the entire shape depending on
  12127.  the value of control, either _GBorder or _GFillInterior. The variable
  12128.  pointarray is an array of _XYCoords (or _WXYCoords for _Polygon_wxy),
  12129.  each of which specifies one of the polygon's vertices. The argument
  12130.  numpoints indicates the number of elements in pointarray (the number
  12131.  of vertices).
  12132.  
  12133.  Neither of these procedures is documented in "Pascal by Example" or in
  12134.  the on-line help system. They are documented within the on-line
  12135.  README.DOC file.
  12136.  
  12137.  
  12138.  26. QuickPascal 1.00 PACKING.LST
  12139.  
  12140.  Product Version(s): 1.00
  12141.  Operating System:   MS-DOS
  12142.  Flags: ENDUSER |
  12143.  Last Modified: 24-OCT-1989    ArticleIdent: Q46746
  12144.  
  12145.  Packing List for Microsoft QuickPascal (R) Compiler, Version 1.00
  12146.  5.25-inch disk set is as follows:
  12147.  
  12148.  Disk 1: Setup/Utilities
  12149.  
  12150.     Files                  Description
  12151.     -----                  -----------
  12152.  
  12153.  PACKING.LST            Packing list (this file).
  12154.  SETUP.EXE              SETUP program -- installs QuickPascal.
  12155.  README.DOC             Directs you to README in Help.
  12156.  FIXSHIFT.COM           Fixes BIOS bug for certain Compaq and other
  12157.                         keyboards.
  12158.  MOUSE.COM              Microsoft Mouse driver.
  12159.  MSHERC.COM             TSR -- supports Hercules (R) card graphics.
  12160.  QPMKKEY.EXE            Creates customized keyboard command files.
  12161.  SAMPLES\BIGHEAP.PAS    New versions of GetMem and FreeMem that allocate
  12162.                         heap space in blocks larger than 65520 bytes.
  12163.  SAMPLES\BIGMEM.PAS     BIGMEM.PAS uses the sample BigHeap unit.
  12164.  SAMPLES\MOUSE.PAS      Real mode mouse control routines; derived from
  12165.                         Microsoft OS/2 programmer's reference, Chapter 3.
  12166.  SAMPLES\SORTDEMO.PAS   Demonstrates six common sorting algorithms.
  12167.  SAMPLES\OBJECTS.PAS    Object-oriented demo.
  12168.  SAMPLES\CRLF.PAS       Normalizes all line endings of a text file to CRLF.
  12169.  SAMPLES\GRDMEO.PAS     Demonstrates the QuickPascal graphics library. It
  12170.                         uses two additional units: menu and turtle.
  12171.  SAMPLES\MENU.PAS       Used by Grdemo.
  12172.  SAMPLES\TURTLE         Used by Grdemo (for Turtle graphics).
  12173.  BRIEF.KEY              Keyboard MAP files.
  12174.  EMACS.KEY                " "
  12175.  EPSILON.KEY              " "
  12176.  QP.KEY                   " "
  12177.  ME.KEY                   " "
  12178.  
  12179.  Disk 2 : Program
  12180.  
  12181.     Files                  Description
  12182.     -----                  -----------
  12183.  
  12184.  QP.EXE                 Microsoft QuickPascal program environment.
  12185.  QPL.COM                QuickPascal command-line compiler.
  12186.  QPL.ERR                QuickPascal compiler error messages.
  12187.  
  12188.  Disk 3: Microsoft QuickPascal Advisor
  12189.  
  12190.     Files                  Description
  12191.     -----                  -----------
  12192.  
  12193.  QP.HLP                 QuickPascal help files.
  12194.  QPENV.HLP                " "
  12195.  
  12196.  Disk 4: Libraries
  12197.  
  12198.     Files                  Description
  12199.     -----                  -----------
  12200.  
  12201.  SYSTEM.QPU             System Unit.
  12202.  CRT.QPU                CRT Interface Unit.
  12203.  DOS.QPU                DOS Interface Unit.
  12204.  MSGRAPH.QPU            Graphics Interface Unit.
  12205.  MSGRUTIL.QPU           Graphics Support Unit.
  12206.  GRAPH.QPU              Graphics Support Unit.
  12207.  PRINTER.QPU            Printer Interface Unit.
  12208.  COURB.FON              Font files.
  12209.  ROMAN.FON                " "
  12210.  SCRIPT.FON               " "
  12211.  TMSRB.FON                " "
  12212.  HELVB.FON                " "
  12213.  MODERN.FON               " "
  12214.  
  12215.  Disk 5: Microsoft QuickPascal Express
  12216.  
  12217.     Files                  Description
  12218.     -----                  -----------
  12219.  
  12220.  LEARN.EXE              Computer-Based Training file.
  12221.  QPCBT.CTX                " "
  12222.  QPCBT.SCN                " "
  12223.  QPCBT.SOB                " "
  12224.  LEARN.PIF              Computer-Based Training Windows PIF file.
  12225.  ATT6300.VID            Computer-Based Training display drivers.
  12226.  CGASNOW.VID              " "
  12227.  ERICSSON.VID             " "
  12228.  HERC102.VID              " "
  12229.  HERC112.VID              " "
  12230.  QPERR.HLP              QuickPascal additional help files.
  12231.  QPGRAPH.HLP              " "
  12232.  NOTES.HLP                " "
  12233.  
  12234.  Additional reference words: distribution directory disks qp
  12235.  
  12236.  
  12237.  27. How to View Registers When Debugging Assembly Modules
  12238.  
  12239.  Product Version(s): 1.00
  12240.  Operating System:   MS-DOS
  12241.  Flags: ENDUSER | docerr
  12242.  Last Modified:  6-SEP-1989    ArticleIdent: Q46768
  12243.  
  12244.  In the data sheet for QuickPascal, there is the following statement
  12245.  that describes the ability of QuickPascal to display CPU registers:
  12246.  
  12247.     In addition, the integrated debugger supports debugging assembly-
  12248.     language routines imported into your program with the $L directive,
  12249.     including viewing of CPU registers.
  12250.  
  12251.  This point requires elaboration to successfully view the registers.
  12252.  
  12253.  As an example, if you have an assembly module named foo.asm that will
  12254.  be invoked from your Pascal code, then you can view registers when you
  12255.  have a {$L foo.obj} in your code and you have the assembler source
  12256.  file present in the current directory.
  12257.  
  12258.  When you start debugging and you enter into a procedure from foo.obj,
  12259.  you will automatically see the registers in the debug window, and in
  12260.  another window you will see the assembler file.
  12261.  
  12262.  
  12263.  28. Incorrect Syntax in Var-String Checking Sample Procedure
  12264.  
  12265.  Product Version(s): 1.00
  12266.  Operating System:   MS-DOS
  12267.  Flags: ENDUSER | docerr
  12268.  Last Modified: 18-AUG-1989    ArticleIdent: Q46804
  12269.  
  12270.  The section on Page 78 of Microsoft's "Pascal by Example" that
  12271.  describes var-string checking has a sample procedure header of
  12272.  incorrect syntax.
  12273.  
  12274.  The procedure is declared as follows:
  12275.  
  12276.     PROCEDURE print_str ( data_str : STRING[20]);
  12277.  
  12278.  Compiling this statement results in the following error message:
  12279.  
  12280.     ERROR 19: ")" expected
  12281.  
  12282.  The procedure should be declared as follows:
  12283.  
  12284.     PROCEDURE print_str ( data_str : STRING);
  12285.  
  12286.  
  12287.  29. QuickPascal Uses LIM 4.0 for EMS Swapping When Enabled
  12288.  
  12289.  Product Version(s): 1.00
  12290.  Operating System:   MS-DOS
  12291.  Flags: ENDUSER |
  12292.  Last Modified: 25-AUG-1989    ArticleIdent: Q46842
  12293.  
  12294.  Problem:
  12295.  
  12296.  When attempting to invoke QuickPascal Version 1.00 with the /SWAP:EMS
  12297.  command line option, the following error message occurs:
  12298.  
  12299.     Cannot open swap file
  12300.  
  12301.  This error occurs with 2 MB of expanded memory.
  12302.  
  12303.  Response:
  12304.  
  12305.  QuickPascal Version 1.00 supports LIM specification 4.0 EMS. (the 3.2
  12306.  LIM specification is not supported.)
  12307.  
  12308.  To use this option, you must have at least 1 MB of free expanded
  12309.  memory and a device driver that supports LIM specification 4.0.
  12310.  
  12311.  For more information please see Page 4 of the README.DOC file
  12312.  contained within the QuickPascal on-line help system.
  12313.  
  12314.  
  12315.  30. QP with /Zi Does Not Place CodeView Information into .EXE
  12316.  
  12317.  Product Version(s): 1.00
  12318.  Operating System:   MS-DOS
  12319.  Flags: ENDUSER |
  12320.  Last Modified:  6-SEP-1989    ArticleIdent: Q47015
  12321.  
  12322.  In QuickPascal Version 1.00, it is not possible to use /Zi to get
  12323.  CodeView information into the executable file.
  12324.  
  12325.  CodeView will run QuickPascal executables, but it comes up in assembly
  12326.  mode because there is no symbolic information.
  12327.  
  12328.  Currently, there is no way to get CodeView information into the
  12329.  executable file.
  12330.  
  12331.  This feature is under review and will be considered for inclusion in a
  12332.  future release.
  12333.  
  12334.  
  12335.  31. QuickPascal Sound Function Sounds Different Than Turbo
  12336.  
  12337.  Product Version(s): 1.00
  12338.  Operating System:   MS-DOS
  12339.  Flags: ENDUSER | buglist1.00
  12340.  Last Modified:  6-SEP-1989    ArticleIdent: Q47017
  12341.  
  12342.  I have a program that uses the sound function in the CRT unit. It
  12343.  sounds different when I run it in QuickPascal than when I run it in
  12344.  Turbo.
  12345.  
  12346.  The program plays a short sound that increases in frequency. When I
  12347.  run it in Turbo, it sounds crisp; however, when I run it in
  12348.  QuickPascal, it sounds very grainy and rough.
  12349.  
  12350.  The following repeat loop generates a different quality of sound when
  12351.  run under the two products:
  12352.  
  12353.      i := 440;
  12354.      repeat
  12355.          sound(i);
  12356.          delay(12);
  12357.          inc(i,5);
  12358.      until i > 880;
  12359.      nosound;
  12360.  
  12361.  This loop calls the standard sound function from the QuickPascal unit
  12362.  CRT. It generates slightly different sound than TurboPascal.
  12363.  
  12364.  If it is mandatory that this loop sound identical to Turbo (for
  12365.  compatibility issues), you could replace the built-in sound and
  12366.  nosound functions with the following two procedures in your source
  12367.  code:
  12368.  
  12369.  procedure mysound( hz : word );
  12370.  var ps    : byte;
  12371.      count : word;
  12372.  begin
  12373.      if hz > 0 then
  12374.          begin
  12375.              ps := Port[97];
  12376.              if (ps and $03) = 0 then
  12377.              begin
  12378.                  Port[97] := ps or $03;
  12379.                  Port[67] := 182;
  12380.              end;
  12381.              count := 1193280 div hz;
  12382.              Port[66] := Lo(count);
  12383.              Port[66] := Hi(count);
  12384.          end;
  12385.  end;
  12386.  
  12387.  procedure mynosound;
  12388.  begin
  12389.      Port[97] := Port[97] and not $03;
  12390.  end;
  12391.  
  12392.  Then, call your own sound functions (mysound and mynosound) instead of
  12393.  the regular sound function in CRT. For example, the above repeat loop
  12394.  would now look similar to the following:
  12395.  
  12396.      i := 440;
  12397.      repeat
  12398.          mysound(i);
  12399.          delay(12);
  12400.          inc(i,5);
  12401.      until i > 880;
  12402.      mynosound;
  12403.  
  12404.  Microsoft has confirmed this to be a problem in QuickPascal Version
  12405.  1.00. We are researching this problem and will post new information as
  12406.  it becomes available.
  12407.  
  12408.  
  12409.  32. {$E} and {$O} Directives
  12410.  
  12411.  Product Version(s): 1.00
  12412.  Operating System:   MS-DOS
  12413.  Flags: ENDUSER |
  12414.  Last Modified:  6-SEP-1989    ArticleIdent: Q47022
  12415.  
  12416.  Two compiler directives, {$E} and {$O}, are accepted by the
  12417.  QuickPascal (QP) compiler, yet no help or documentation is available
  12418.  on these directives outside of the README.DOC.
  12419.  
  12420.  The directives are accepted by the compiler for compatibility with
  12421.  TurboPascal. These two directives are actually ignored.
  12422.  
  12423.  The {$E} directive controls the usage of the emulator math package
  12424.  with the Borland product, while the {$O} directive controls overlay
  12425.  code generation. Neither of these directives is supported under QP.
  12426.  
  12427.  Information concerning QP and these two directives is in the
  12428.  README.DOC file included with the QuickPascal package.
  12429.  
  12430.  
  12431.  33. "Error 131: Invalid Real Operation" Constant Out of Range
  12432.  
  12433.  Product Version(s): 1.00
  12434.  Operating System:   MS-DOS
  12435.  Flags: ENDUSER | buglist1.00 docerr
  12436.  Last Modified:  6-SEP-1989    ArticleIdent: Q47032
  12437.  
  12438.  The program shown below generates the following error message:
  12439.  
  12440.     Error 131: Invalid real operation
  12441.  
  12442.     An operation on two real types in this statement resulted in an
  12443.     invalid floating-point operation. Either an overflow occurred or
  12444.     an attempt was made to divide by zero.
  12445.  
  12446.  This explanation may be misleading because the error also occurs
  12447.  when a declared constant is out of range.
  12448.  
  12449.  The following program illustrates this problem:
  12450.  
  12451.  PROGRAM test
  12452.  CONST
  12453.    co : COMP = 9e20;       { this value is out of range   }
  12454.  BEGIN                     { The range should be          }
  12455.  END.                      {    9.2E-18 to 9.2E+18        }
  12456.  
  12457.  Microsoft has confirmed this to be a problem in QuickPascal Version
  12458.  1.00. We are researching this problem and will post new information as
  12459.  it becomes available.
  12460.  
  12461.  
  12462.  34. QuickPascal Does Not Support Multiple Debug Sessions
  12463.  
  12464.  Product Version(s): 1.00
  12465.  Operating System:   MS-DOS
  12466.  Flags: ENDUSER |
  12467.  Last Modified:  6-SEP-1989    ArticleIdent: Q47033
  12468.  
  12469.  Question:
  12470.  
  12471.  If I load two different programs into QuickPascal, set a breakpoint in
  12472.  the first program, and try to execute the second program, I get the
  12473.  following error and QuickPascal switches back to my first program:
  12474.  
  12475.     Cannot set breakpoint
  12476.  
  12477.  On-line help for this error indicates that a breakpoint was set on a
  12478.  line that does not contain executable code.
  12479.  
  12480.  The breakpoint within my first program is set correctly and I did not
  12481.  try to set a breakpoint within my second program. What causes this
  12482.  problem?
  12483.  
  12484.  Response:
  12485.  
  12486.  Microsoft QuickPascal Version 1.00 does not support multiple debug
  12487.  sessions. You must clear the breakpoints from your first program
  12488.  before you try to run or trace your second program. When you run a
  12489.  second program, all debug information for the first program is lost.
  12490.  
  12491.  
  12492.  35. QuickPascal Menu Colors Not Restored on VGA Adapters
  12493.  
  12494.  Product Version(s): 1.00
  12495.  Operating System:   MS-DOS
  12496.  Flags: ENDUSER |
  12497.  Last Modified:  6-SEP-1989    ArticleIdent: Q47034
  12498.  
  12499.  When using a VGA display adapter, running or debugging a graphics
  12500.  program while inside the QuickPascal (QP) environment causes the menu
  12501.  colors to be remapped if the video mode is changed and not restored
  12502.  before the control returns to the QuickPascal environment. This
  12503.  happens in either of the following situations:
  12504.  
  12505.  1. You trace into a program that changes the graphics mode. After the
  12506.     colors change, restart or break the program.
  12507.  
  12508.  2. You set the video mode and do not restore the default mode before
  12509.     the program ends.
  12510.  
  12511.  This is expected behavior on an VGA display. To prevent this from
  12512.  occurring, you must invoke QuickPascal with the /S switch.
  12513.  
  12514.  The /S option is used to save the color palettes on the VGA. By
  12515.  default, this switch is not active. /S must be used if you have a VGA
  12516.  and your graphics program is manipulating the VGA color palettes. This
  12517.  switch causes the color palettes to be saved to disk or memory.
  12518.  QuickPascal swaps the palettes back when returning to the QP
  12519.  environment from your program.
  12520.  
  12521.  If the menu colors are not correct after you complete these
  12522.  procedures, the colors may have been stored in the QP.INI file. In
  12523.  this case, erase the QP.INI file so that defaults will be used the
  12524.  next time you start QuickPascal.
  12525.  
  12526.  
  12527.  36. QuickPascal Evaluates All Compiler Directives for Syntax
  12528.  
  12529.  Product Version(s): 1.00
  12530.  Operating System:   MS-DOS
  12531.  Flags: ENDUSER |
  12532.  Last Modified:  6-SEP-1989    ArticleIdent: Q47116
  12533.  
  12534.  QuickPascal evaluates all directives, even if the directive is
  12535.  contained in a block that is not defined.
  12536.  
  12537.  On Page 250 of "Pascal by Example," the following text is presented:
  12538.  
  12539.     Conditional directives produce different code from the same source
  12540.     file if a conditional identifier is defined. The conditional
  12541.     directives are, in effect, a variation of the IF control statement.
  12542.     If a condition is true, code between the {$IFxxxCondition} and
  12543.     {$ENDIF} directives is compiled. If the condition is false, the
  12544.     compiler skips the code between the two directives. An optional
  12545.     {$ELSE} directive provides further control.
  12546.  
  12547.  The part about "If the condition is false..." is misleading. The
  12548.  compiler skips until it finds a "{$". The compiler is looking for
  12549.  {$ENDIF}. If you have any directives in that block, the compiler will
  12550.  check to make sure they are valid.
  12551.  
  12552.  The following code illustrates the problem:
  12553.  
  12554.  {$IFDEF VER40}
  12555.      {$k-}
  12556.  {$ENDIF}
  12557.  
  12558.  program foo;
  12559.  begin
  12560.      writeln('This is a test.');
  12561.  end.
  12562.  
  12563.  Even though VER40 is not defined, the compiler will complain that
  12564.  {$k-} is not a valid directive.
  12565.  
  12566.  
  12567.  37. _HRES16COLOR Video Mode Constant Spelled Incorrectly in Help
  12568.  
  12569.  Product Version(s): 1.00
  12570.  Operating System:   MS-DOS
  12571.  Flags: ENDUSER | docerr
  12572.  Last Modified:  6-SEP-1989    ArticleIdent: Q47251
  12573.  
  12574.  In Microsoft QuickPascal Version 1.00's on-line help, the videomode
  12575.  constant "_HRES16COLOR" is spelled incorrectly as "_HRES16COL". It is
  12576.  incorrect only in the Index under Video modes.
  12577.  
  12578.  The error is under review and will be corrected in a future release of
  12579.  QuickPascal.
  12580.  
  12581.  To see this incorrect information, invoke QuickPascal, bring up the
  12582.  Help.Index menu, choose V on the selection bar, and then choose Video
  12583.  modes.
  12584.  
  12585.  
  12586.  38. Quick Environments Do Not Notice If Floppy Drive Isn't Ready
  12587.  
  12588.  Product Version(s): 1.00
  12589.  Operating System:   MS-DOS
  12590.  Flags: ENDUSER | S_QuickC S_QuickASM
  12591.  Last Modified:  6-SEP-1989    ArticleIdent: Q47252
  12592.  
  12593.  If you enter one of the QuickC, QuickAssembler, or QuickPascal
  12594.  environments, do a File.Open, type in "A:\" to pull up the list of
  12595.  files available on Drive A, and the floppy drive is not ready, the
  12596.  environment simply waits. If you type "A:\*.*", the QuickPascal
  12597.  environment will still wait. The QuickC and QuickAssembler packages
  12598.  are better in that they produce an error message that says that an
  12599.  invalid file specification was entered. However, the Help menu does
  12600.  not mention that this problem can be caused by the drive not being
  12601.  ready.
  12602.  
  12603.  Microsoft is researching this problem and will post new information as
  12604.  it becomes available.
  12605.  
  12606.  
  12607.  39. Help for "Cannot Open Swap File" Is Incorrect in QuickPascal
  12608.  
  12609.  Product Version(s): 1.00
  12610.  Operating System:   MS-DOS
  12611.  Flags: ENDUSER | docerr
  12612.  Last Modified:  6-SEP-1989    ArticleIdent: Q47394
  12613.  
  12614.  When bringing up the Microsoft QuickPascal Version 1.00 environment,
  12615.  the help for the following error message incorrectly states that this
  12616.  error occurs when swap is OFF:
  12617.  
  12618.     Cannot open swap file
  12619.  
  12620.  The help for the error message should state that this error occurs
  12621.  when swap is turned ON and there is insufficient disk space or EMS
  12622.  memory for the swap file. In addition, this error message can also
  12623.  occur when the directory specified for the swap file does not exist.
  12624.  
  12625.  The following command line reproduces the error if the directory
  12626.  "C:\SWAP" does NOT exist:
  12627.  
  12628.     qp /swap:on=c:\swap\swap.dat
  12629.  
  12630.  
  12631.  40. Addr() Address Function and @ Operator Example
  12632.  
  12633.  Product Version(s): 1.00
  12634.  Operating System:   MS-DOS
  12635.  Flags: ENDUSER |
  12636.  Last Modified: 15-SEP-1989    ArticleIdent: Q47479
  12637.  
  12638.  The following is a description of the QuickPascal function Addr(), and
  12639.  the at-sign operator "@".
  12640.  
  12641.     Syntax:     FUNCTION Addr ( VAR id : <ident> ) : Pointer;
  12642.  
  12643.  The Addr() function returns the memory address of id, where id may be
  12644.  a variable, procedure, or function identifier. The return value of
  12645.  Addr() is a 32-bit pointer containing two 16-bit values representing
  12646.  the segment and offset of the location of id in memory.
  12647.  
  12648.  The at-sign "@" operator is equivalent to the Addr() function.
  12649.  
  12650.  The following are examples showing the use of the Addr function and
  12651.  the at-sign "@" operator:
  12652.  
  12653.  Example 1: Using the Addr() Function
  12654.  ------------------------------------
  12655.  
  12656.  PROGRAM xAddr;
  12657.  VAR
  12658.      p : pointer;
  12659.  BEGIN
  12660.      p := Addr (p);
  12661.      Writeln ('The address of p is at ', Seg(p^), ':', Ofs(p^));
  12662.  END.
  12663.  
  12664.  Example 2: Using the @ Operator
  12665.  -------------------------------
  12666.  
  12667.  PROGRAM At_Operator;
  12668.  VAR
  12669.      p : pointer;
  12670.  BEGIN
  12671.      p := @p;
  12672.      Writeln ('The address of p is at ', Seg(p^), ':', Ofs(p^));
  12673.  END.
  12674.  
  12675.  
  12676.  41. Select Text Fails on Toshiba T1000 with DOS 2.11 in ROM
  12677.  
  12678.  Product Version(s): 1.00
  12679.  Operating System:   MS-DOS
  12680.  Flags: ENDUSER | buglist1.00
  12681.  Last Modified:  6-SEP-1989    ArticleIdent: Q47483
  12682.  
  12683.  The Toshiba T1000 with DOS 2.11 in ROM does not select text with the
  12684.  SHIFT+arrow keys in the Microsoft QuickPascal environment.
  12685.  
  12686.  Microsoft has confirmed this to be a problem with QuickPascal Version
  12687.  1.00. We are researching the problem and will post new information as
  12688.  it becomes available.
  12689.  
  12690.  
  12691.  42. Get_area := Self.height; Incorrect in "Pascal by Example"
  12692.  
  12693.  Product Version(s): 1.00
  12694.  Operating System:   MS-DOS
  12695.  Flags: ENDUSER | docerr
  12696.  Last Modified: 11-SEP-1989    ArticleIdent: Q47485
  12697.  
  12698.  In Section 15.5, on Page 234 of Microsoft QuickPascal's "Pascal by
  12699.  Example," there is a typographical error in the example program
  12700.  OBJECTDE.PAS. The second line up from the bottom of the page is
  12701.  printed as follows:
  12702.  
  12703.     get_area := Self.height;
  12704.  
  12705.  The line should be as follows:
  12706.  
  12707.     get_area := Self.area;
  12708.  
  12709.  This program is also included in the on-line programming examples that
  12710.  can be called up from the QuickPascal environment. The on-line example
  12711.  contains the correct code.
  12712.  
  12713.  
  12714.  43. Illegal File Specification
  12715.  
  12716.  Product Version(s): 1.00
  12717.  Operating System:   MS-DOS
  12718.  Flags: ENDUSER | S_QuickC
  12719.  Last Modified: 15-SEP-1989    ArticleIdent: Q47611
  12720.  
  12721.  No checking is done on path specifications that are entered in the
  12722.  Options.Environment menu. Thus, if an invalid path is given for the
  12723.  EXE directory, QuickPascal generates the following error:
  12724.  
  12725.     Illegal file specification:
  12726.     <path and file name here>
  12727.  
  12728.  Neither QuickC nor QuickPascal checks to be sure that a path
  12729.  specification entered in the Options.Environment menu is valid. Thus,
  12730.  if you were to enter the path incorrectly, you would not find out
  12731.  until an attempt is made to use the path.
  12732.  
  12733.  This is not considered a problem in either QuickC or QuickPascal.
  12734.  
  12735.  
  12736.  44. Method Compiler Directive {$M+} Is Disabled by Default
  12737.  
  12738.  Product Version(s): 1.00
  12739.  Operating System:   MS-DOS
  12740.  Flags: ENDUSER | docerr
  12741.  Last Modified:  6-SEP-1989    ArticleIdent: Q47626
  12742.  
  12743.  In Section 15.3.1, Page 227 of Microsoft QuickPascal's "Pascal by
  12744.  Example," it states that "(The {$M+} directive is enabled by
  12745.  default.)" This is incorrect. The default for the Method compiler
  12746.  directive is disabled, i.e., {$M-}. You must explicitly enable Method
  12747.  checking with {$M+} if you want to use objects and object-oriented
  12748.  extensions. In Appendix B, Page 247, the proper default is listed.
  12749.  
  12750.  
  12751.  45. File.Open Requires an Extension After Specifying *.XXX
  12752.  
  12753.  Product Version(s): 1.00
  12754.  Operating System:   MS-DOS
  12755.  Flags: ENDUSER | S_QuickC buglist1.00
  12756.  Last Modified:  6-SEP-1989    ArticleIdent: Q47633
  12757.  
  12758.  When you invoke the File.Open menu and specify, for example, *.YYY, QP
  12759.  shows the .YYY files in the File List box. If you type in the filename
  12760.  such as XXX without the .YYY extension, you receive the following from
  12761.  QP:
  12762.  
  12763.     'XXX.YYY' does not exist
  12764.            Create?
  12765.  
  12766.  QP doesn't know that you are referring to XXX.YYY, so it assumes the
  12767.  file does not exist. You must include the extension. This also applies
  12768.  to QuickC.
  12769.  
  12770.  Microsoft is researching this problem and will post new information as
  12771.  it becomes available.
  12772.  
  12773.  
  12774.  46. Quick Pascal 1.00 Does Not Allow Truncation of Large Files
  12775.  
  12776.  Product Version(s): 1.00
  12777.  Operating System:   MS-DOS
  12778.  Flags: ENDUSER |
  12779.  Last Modified:  6-SEP-1989    ArticleIdent: Q47696
  12780.  
  12781.  When attempting to load a file that is too large to fit into the
  12782.  environment, Quick Pascal 1.00 does not give the option of truncating
  12783.  the file in order to load it.
  12784.  
  12785.  This option is under review and will be considered for inclusion in a
  12786.  future release of Quick Pascal.
  12787.  
  12788.  
  12789.  47. Error 50 and Error 127 in Program FirstGraphics
  12790.  
  12791.  Product Version(s): 1.00
  12792.  Operating System:   MS-DOS
  12793.  Flags: ENDUSER | docerr
  12794.  Last Modified:  6-SEP-1989    ArticleIdent: Q47742
  12795.  
  12796.  On Pages 173 and 174 of the Microsoft QuickPascal "Pascal by Example"
  12797.  manual, the example program FirstGraphics contains two errors.
  12798.  
  12799.  The following
  12800.  
  12801.     _MoveTo( vc.NumXPixels DIV 4, vc.NumYPixels * DIV 4);
  12802.  
  12803.  will produce
  12804.  
  12805.     Error 50: Error in expression
  12806.  
  12807.  at compile time. To correct this problem, insert a 3 between * and
  12808.  DIV.
  12809.  
  12810.  Also,
  12811.  
  12812.     _SetVideoMode(_DefaultMode);
  12813.  
  12814.  will produce
  12815.  
  12816.     Error 127: Invalid variable reference
  12817.  
  12818.  at compile time. Assign the function call to an integer such as a or i
  12819.  that has already been declared as an integer in the program, as
  12820.  follows:
  12821.  
  12822.     a := _SetVideoMode(_DefaultMode);
  12823.  
  12824.  Pascal functions, unlike C functions, require the returned value to be
  12825.  assigned to a variable.
  12826.  
  12827.  
  12828.  48. Mixed Pascal/Assembly Example (switch.asm) Does Not Work
  12829.  
  12830.  Product Version(s): 1.00
  12831.  Operating System:   MS-DOS
  12832.  Flags: ENDUSER | docerr hang assembly runtime
  12833.  Last Modified:  6-SEP-1989    ArticleIdent: Q47771
  12834.  
  12835.  The example program in "Pascal By Example," on Page 165, does not work
  12836.  as documented. Occasionally the computer locks up, nothing happens
  12837.  when the example is executed, or the following error is generated:
  12838.  
  12839.     Run-time Error 200: Division by Zero
  12840.  
  12841.  To correct the program, add the instructions {$F+} and {$F-} around
  12842.  the external declaration for switch().
  12843.  
  12844.  This error occurs because the program example neglects the fact that
  12845.  an assembly language procedure must be called with a far call. The
  12846.  {$F+} turns far calls on, {$F-} turns far calls off. Thus, the example
  12847.  program should read as follows:
  12848.  
  12849.  {$F+}
  12850.  {$L switch}
  12851.  PROCEDURE switch(VAR a, b: Word); EXTERNAL;
  12852.  {$F-}
  12853.  
  12854.  .
  12855.  .
  12856.  .
  12857.  
  12858.  switch(x, y)
  12859.  
  12860.  Also, the assembly language file given should have the following lines
  12861.  appended to its end:
  12862.  
  12863.  CODE ENDS
  12864.       END
  12865.  
  12866.  
  12867.  49. Index Incorrectly States That a "Single" Is 6-Bytes Long
  12868.  
  12869.  Product Version(s): 1.00
  12870.  Operating System:   MS-DOS
  12871.  Flags: ENDUSER | docerr
  12872.  Last Modified: 11-SEP-1989    ArticleIdent: Q47799
  12873.  
  12874.  The Index entries for the "Single" and "Real" types read as follows:
  12875.  
  12876.     Single       Stores 6-byte floating point number
  12877.     Real         Stores 6-byte floating point number
  12878.  
  12879.  The entry for Real is correct. However, the entry for Single should
  12880.  read as follows:
  12881.  
  12882.     Single       Stores 4-byte floating point number.
  12883.  
  12884.  This information is stated correctly in "Pascal By Example" on Page
  12885.  15.
  12886.  
  12887.  It is also documented correctly in the Online Help, following a
  12888.  different query path as shown below:
  12889.  
  12890.  1. Pull down the help menu.
  12891.  
  12892.  2. Choose "Contents."
  12893.  
  12894.  3. Choose "Data Types."
  12895.  
  12896.  4. Choose "Single."
  12897.  
  12898.     This screen correctly states that a Single occupies 4 bytes.
  12899.  
  12900.  
  12901.  50. Changing Directory/Drive in Shell Changes Them in Picker
  12902.  
  12903.  Product Version(s): 1.00
  12904.  Operating System:   MS-DOS
  12905.  Flags: ENDUSER | buglist1.00
  12906.  Last Modified: 11-SEP-1989    ArticleIdent: Q47819
  12907.  
  12908.  Question:
  12909.  
  12910.  I found that changing drives in a shell changes them in the picker. Is
  12911.  this correct behavior?
  12912.  
  12913.  To reproduce the problem, do the following:
  12914.  
  12915.  1. Start QuickPascal (QP) (a file must not have been opened during the
  12916.     session).
  12917.  
  12918.  2. Call File.Open and note your current drive and directory, then
  12919.     cancel.
  12920.  
  12921.  3. Execute File.DOS Shell.
  12922.  
  12923.  4. Change the drive or directory and exit the shell.
  12924.  
  12925.  5. Call File.Open.
  12926.  
  12927.  The current drive/directory now matches the drive/directory made
  12928.  current while in the shell. Changes made in the shell should not
  12929.  affect the current drive/directory of the environment. You should be
  12930.  able to change these only with the file picker dialog.
  12931.  
  12932.  Microsoft has confirmed this to be a problem with QuickPascal Version
  12933.  1.00. We are researching this problem and will post new information as
  12934.  it becomes available.
  12935.  
  12936.  
  12937.  
  12938.  51. QP Unit Swapped In for Trace Isn't Swapped Back Out
  12939.  
  12940.  Product Version(s): 1.00
  12941.  Operating System:   MS-DOS
  12942.  Flags: ENDUSER | buglist1.00
  12943.  Last Modified:  6-SEP-1989    ArticleIdent: Q47999
  12944.  
  12945.  If nine windows are opened in QuickPascal (QP) Version 1.00, and a
  12946.  trace into a program that uses a unit that isn't loaded in a window is
  12947.  made, one of the open files is swapped out so that QP can trace into
  12948.  the unit.
  12949.  
  12950.  The unit remains in the swapped window upon program completion. If the
  12951.  traced program is in the only unsaved window, it is the one swapped
  12952.  out. At program completion, the traced program is unavailable for
  12953.  further editing (even though it is saved to disk).
  12954.  
  12955.  Microsoft has confirmed this to be a problem with QuickPascal Version
  12956.  1.00. We are researching this problem and will post new information as
  12957.  it becomes available.
  12958.  
  12959.  
  12960.  52. Help for Run-Time Error 103 Is Inaccurate
  12961.  
  12962.  Product Version(s): 1.00
  12963.  Operating System:   MS-DOS
  12964.  Flags: ENDUSER | buglist1.00 docerr
  12965.  Last Modified:  6-SEP-1989    ArticleIdent: Q48002
  12966.  
  12967.  The help for run-time 103 states "An I/O operation was attempted on an
  12968.  unopened file." Attempting an I/O operation on an unopened file
  12969.  actually generates either run-time 104 or 105. Run-time 103 occurs if
  12970.  you try to close a file that was not opened.
  12971.  
  12972.  The following are the run-time errors returned when
  12973.  procedures/functions are used with unopened (or unassigned) files:
  12974.  
  12975.     Func/Proc   Error Returned
  12976.     ---------   --------------
  12977.  
  12978.     Erase             3
  12979.     Rename            3
  12980.     Reset           102
  12981.     Rewrite         102
  12982.     BlockRead       103
  12983.     BlockWrite      103
  12984.     Close           103
  12985.     FilePos         103
  12986.     FileSize        103
  12987.     Flush           103
  12988.     Seek            103
  12989.     Eof             104
  12990.     Eoln            104
  12991.     SeekEof         104
  12992.     SeekEoln        104
  12993.     Read            104
  12994.     Readln          104
  12995.     Write           105
  12996.     Writeln         105
  12997.  
  12998.  
  12999.  53. Getting Help on QuickPascal Errors
  13000.  
  13001.  Product Version(s): 1.00
  13002.  Operating System:   MS-DOS
  13003.  Flags: ENDUSER | documentation
  13004.  Last Modified: 21-APR-1990    ArticleIdent: Q48055
  13005.  
  13006.  To obtain help on QuickPascal error numbers when they are not produced
  13007.  by the environment, there are several special steps that must be
  13008.  taken. Note that these steps are not required by QuickC due to its
  13009.  support of the HELPFILES environment variable.
  13010.  
  13011.  Contexts and help text for all of the errors produced by QuickPascal
  13012.  are contained in the QPERR.HLP help file. This file is used only when
  13013.  help is requested from an error dialog box. For this help file to be
  13014.  accessed by the rest of the QuickPascal environment, the following
  13015.  copy should be made at the DOS prompt:
  13016.  
  13017.     COPY QP.HLP /b + QPERR.HLP /b
  13018.  
  13019.  Note: QPERR.HLP should not be erased because it is still the file that
  13020.  error dialog boxes use to locate help.
  13021.  
  13022.  The contexts of these error messages are in the form E.P####, where
  13023.  #### is the error number you are looking for, left-padded with zeros
  13024.  to four places. For example, the context for error number 32 would be
  13025.  E.P0032.
  13026.  
  13027.  Run-time error messages can be searched for by using the format
  13028.  E.R####.  For example E.R0202.  (note the R for run-time)
  13029.  
  13030.  To search for error number 32, type E.P0032 in an editor window,
  13031.  highlight the entire phrase, and then press F1 to search for the
  13032.  context.
  13033.  
  13034.  
  13035.  54. Address of Function in Debug Window Not Supported
  13036.  
  13037.  Product Version(s): 1.00
  13038.  Operating System:   MS-DOS
  13039.  Flags: ENDUSER | buglist1.00
  13040.  Last Modified: 15-SEP-1989    ArticleIdent: Q48225
  13041.  
  13042.  In the debug window, QuickPascal does not show the value of a function
  13043.  or procedure correctly. Instead of showing the actual address, it
  13044.  shows the value as 0000:0000.
  13045.  
  13046.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13047.  1.00. We are researching this problem and will post new information as
  13048.  it becomes available.
  13049.  
  13050.  Viewing the address of a function in the debug window currently is not
  13051.  supported. This feature will be considered for inclusion in a future
  13052.  release.
  13053.  
  13054.  To demonstrate the problem, trace into a program that has a function
  13055.  or procedure in it. Bring up the debug window and type the following:
  13056.  
  13057.     @foo
  13058.  
  13059.  Foo is the name of the function or procedure in question. The @
  13060.  operator should cause the address of foo to be displayed, but instead,
  13061.  the value 0000:0000 is displayed.
  13062.  
  13063.  
  13064.  55. Watch Window Should Be Tiled to Avoid Overlapping
  13065.  
  13066.  Product Version(s): 1.00
  13067.  Operating System:   MS-DOS
  13068.  Flags: ENDUSER | buglist1.00
  13069.  Last Modified:  6-SEP-1989    ArticleIdent: Q48237
  13070.  
  13071.  Adding a watch to QuickPascal (QP) Version 1.00 creates a completely
  13072.  overlapping debug window, which is impractical for the purpose of
  13073.  watching variables. Continued debugging overlaps ALL of the watch
  13074.  window, again defeating the purpose. It is necessary to resize each
  13075.  time. The best way to handle this is by tiling your existing windows.
  13076.  
  13077.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13078.  1.00. We are researching this problem and will post new information as
  13079.  it becomes available.
  13080.  
  13081.  
  13082.  56. File.Save to a Nonexistent Drive Gives Incorrect Error
  13083.  
  13084.  Product Version(s): 1.00
  13085.  Operating System:   MS-DOS
  13086.  Flags: ENDUSER | buglist1.00
  13087.  Last Modified: 27-SEP-1989    ArticleIdent: Q48239
  13088.  
  13089.  If you do a File.Save on a machine with one floppy drive by entering
  13090.  B:\XXX.PAS as the filename, QuickPascal (QP) gives the following error:
  13091.  
  13092.     Illegal file specification:
  13093.          'B:\XXX.PAS'
  13094.  
  13095.  B:\XXX.PAS is a valid filename. The error SHOULD say that the drive
  13096.  does not exist.
  13097.  
  13098.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13099.  1.00. We are researching this problem and will post new information as
  13100.  it becomes available.
  13101.  
  13102.  
  13103.  57. Environment Control of Search Path for Source File
  13104.  
  13105.  Product Version(s): 1.00
  13106.  Operating System:   MS-DOS
  13107.  Flags: ENDUSER |
  13108.  Last Modified: 11-SEP-1989    ArticleIdent: Q48277
  13109.  
  13110.  Question:
  13111.  
  13112.  Will adding a search path to the source section of environment control
  13113.  affect opening a source file once QuickPascal (QP) has started?
  13114.  
  13115.  Response:
  13116.  
  13117.  No; the source path section of the environment control has no effect
  13118.  on opening any files once QuickPascal has started. If you want to open
  13119.  a file in a directory other than the current working directory, you
  13120.  must select that directory from the "Dirs / Drives:" window under the
  13121.  open menu.
  13122.  
  13123.  However, if you were to add a path to the source section of the
  13124.  environment menu, and SAVE it, you could quit QuickPascal and then
  13125.  enter a file on the command line after QP and it will find the file
  13126.  and load QuickPascal with that file. To view this, try the following:
  13127.  
  13128.  1. Make a directory named "c:\test", and place a sample .PAS file
  13129.     there.
  13130.  
  13131.  2. Start QuickPascal and go to the environment menu under "options".
  13132.  
  13133.  3. Enter "c:\test" on the source line, select SAVE, and quit
  13134.     QuickPascal.
  13135.  
  13136.  4. On the command line, you can enter "qp file.pas" from any directory
  13137.     and QuickPascal will find your file.
  13138.  
  13139.  
  13140.  58. QP 1.00: Marking Text Blocks: Cannot Use Mouse to Mark End
  13141.  
  13142.  Product Version(s): 1.00
  13143.  Operating System:   MS-DOS
  13144.  Flags: ENDUSER |
  13145.  Last Modified: 11-SEP-1989    ArticleIdent: Q48278
  13146.  
  13147.  In the QuickPascal (QP) Version 1.00 environment, use the following
  13148.  procedure to mark a text block with the keyboard:
  13149.  
  13150.  1. Move the cursor to the desired beginning location (using the
  13151.     keyboard or mouse).
  13152.  
  13153.  2. Press ^K B, to mark the beginning of the text block.
  13154.  
  13155.  3. With the arrow keys, move the cursor to the desired end location.
  13156.  
  13157.  4. Press ^K K to mark the end of the text block.
  13158.  
  13159.  If the mouse is used to move the cursor to the end of the text block,
  13160.  ^K K will fail, and the text block will not be highlighted.
  13161.  
  13162.  
  13163.  59. Description of Compiler Option: Var-String Checking
  13164.  
  13165.  Product Version(s): 1.00
  13166.  Operating System:   MS-DOS
  13167.  Flags: ENDUSER | $v+ $v- {$v+} {$v-}
  13168.  Last Modified: 21-SEP-1989    ArticleIdent: Q48443
  13169.  
  13170.  The Var-String checking option controls whether or not strict type
  13171.  checking is performed on variable-length string parameters (in
  13172.  functions and procedures). When this directive is enabled, formal and
  13173.  actual parameters must be of IDENTICAL string types. When this
  13174.  directive is disabled, formal and actual string parameters can have
  13175.  different declared lengths (e.g. you can pass string[6] type data to
  13176.  functions that expect string[8] type data).
  13177.  
  13178.  The following program compiles only if Var-String checking is turned
  13179.  off. If Var-String checking is enabled, the compiler produces a type
  13180.  mismatch error.
  13181.  
  13182.  PROGRAM    vartest;
  13183.  PROCEDURE  print_str( var data_str : string);
  13184.     BEGIN
  13185.       writeln(data_str:10);
  13186.     END;
  13187.  
  13188.  VAR
  13189.     data_str1 : STRING[20];
  13190.     BEGIN
  13191.       data_str1:= 'abcdefghijklmnopqrst';
  13192.       print_str(data_str1);
  13193.       data_str1:= 'abc';
  13194.       print_str(data_str1);
  13195.     END.
  13196.  
  13197.  
  13198.  60. How to Manually Set Up QuickPascal on a Hard Disk
  13199.  
  13200.  Product Version(s): 1.00
  13201.  Operating System:   MS-DOS
  13202.  Flags: ENDUSER |
  13203.  Last Modified: 26-SEP-1989    ArticleIdent: Q48738
  13204.  
  13205.  The following information explains how to manually set up Microsoft
  13206.  QuickPascal Version 1.00 for a hard disk. It shows you how to set
  13207.  up in the same way as the SETUP.EXE program.
  13208.  
  13209.  This information demonstrates how to set up QuickPascal under the
  13210.  directory "QP" on Drive C. Please note that this is not the only
  13211.  configuration possible.
  13212.  
  13213.  1. Create the following directories:
  13214.  
  13215.        C:\QP
  13216.        C:\QP\SAMPLES
  13217.        C:\HLP
  13218.  
  13219.  2. Add the following to your AUTOEXEC.BAT file:
  13220.  
  13221.        SET PATH=C:\QP;C:\QC\HLP
  13222.  
  13223.     You may place this in a separate batch file if you prefer.
  13224.     Note: It is very important that you do not add spaces in or
  13225.     after the PATH variable. For example, "SET PATH= C:\QP;C:\QP\HLP"
  13226.     and "SET PATH=C:\QP;C:\QP\HLP " do not work correctly.
  13227.  
  13228.  3. Add the following to your CONFIG.SYS file:
  13229.  
  13230.        FILES=20
  13231.        BUFFERS=20
  13232.  
  13233.     You must reboot your machine for this to take effect.
  13234.  
  13235.  4. Copy the following files to C:\QP:
  13236.  
  13237.        File            5.25-Inch Disk          3.50-Inch Disk
  13238.        ----            --------------          --------------
  13239.  
  13240.        MOUSE.COM       Setup/Utilities         Setup/Program/Utilities
  13241.        MSHERC.COM      Setup/Utilities         Setup/Program/Utilities
  13242.        QPMKKEY.EXE     Setup/Utilities         Setup/Program/Utilities
  13243.        BRIEF.KEY       Setup/Utilities         Setup/Program/Utilities
  13244.        EMACS.KEY       Setup/Utilities         Setup/Program/Utilities
  13245.        ME.KEY          Setup/Utilities         Setup/Program/Utilities
  13246.        QP.KEY          Setup/Utilities         Setup/Program/Utilities
  13247.        EPSILON.KEY     Setup/Utilities         Setup/Program/Utilities
  13248.        QP.EXE          Program                 Setup/Program/Utilities
  13249.        QPL.COM         Program                 Setup/Program/Utilities
  13250.        QPL.ERR         Program                 Setup/Program/Utilities
  13251.        SYSTEM.QPU      Libraries               Libraries
  13252.        CRT.QPU         Libraries               Libraries
  13253.        DOS.QPU         Libraries               Libraries
  13254.        GRAPH.QPU       Libraries               Libraries
  13255.        MSGRUTIL.QPU    Libraries               Libraries
  13256.        MSGRAPH.QPU     Libraries               Libraries
  13257.        PRINTER.QPU     Libraries               Libraries
  13258.        COURB.FON       Libraries               Libraries
  13259.        HELVB.FON       Libraries               Libraries
  13260.        MODERN.FON      Libraries               Libraries
  13261.        ROMAN.FON       Libraries               Libraries
  13262.        SCRIPT.FON      Libraries               Libraries
  13263.        TMSRB.FON       Libraries               Libraries
  13264.        LEARN.EXE       MS Express              MS Express/Advisor
  13265.        LEARN.PIF       MS Express              MS Express/Advisor
  13266.        QPCBT.CTX       MS Express              MS Express/Advisor
  13267.        QPCBT.SCN       MS Express              MS Express/Advisor
  13268.        QPCBT.SOB       MS Express              MS Express/Advisor
  13269.        ATT6300.VID     MS Express              MS Express/Advisor
  13270.        CGASNOW.VID     MS Express              MS Express/Advisor
  13271.        HERC102.VID     MS Express              MS Express/Advisor
  13272.        ERCSSON.VID     MS Express              MS Express/Advisor
  13273.        HERC112.VID     MS Express              MS Express/Advisor
  13274.  
  13275.  5. Copy the following to C:\QP\HLP:
  13276.  
  13277.        File            5.25-Inch Disk          3.50-Inch Disk
  13278.        ----            --------------          --------------
  13279.  
  13280.        README.DOC      Setup                   Setup/Program/Utilities
  13281.        PACKING.LST     Setup                   Setup/Program/Utilities
  13282.        QP.HLP          MS Advisor              MS Express/Advisor
  13283.        QPENV.HLP       MS Advisor              MS Express/Advisor
  13284.        QPERR.HLP       MS Express              MS Express/Advisor
  13285.        QPGRAPH.HLP     MS Express              MS Express/Advisor
  13286.        NOTES.HLP       MS Express              MS Express/Advisor
  13287.  
  13288.  6. Copy all *.PAS files to C:\QP\SAMPLES.
  13289.  
  13290.  Microsoft QuickPascal Version 1.00 should now be set up on your hard
  13291.  disk.
  13292.  
  13293.  
  13294.  61. Error 19 Caused By Missing Space in Expression
  13295.  
  13296.  Product Version(s): 1.00
  13297.  Operating System:   MS-DOS
  13298.  Flags: ENDUSER | buglist1.00
  13299.  Last Modified: 26-SEP-1989    ArticleIdent: Q48843
  13300.  
  13301.  Under QuickPascal Version 1.00, 'error 19: ")" expected', occurs on
  13302.  any expression where a real number with no digits after the decimal
  13303.  point exists with a closing parenthesis directly to the right.
  13304.  Inserting a space or a 0 (zero) after the decimal eliminates the
  13305.  error.
  13306.  
  13307.  The following valid expression
  13308.  
  13309.     x := (1. + 1./9.);
  13310.  
  13311.  generates the following error and marks the decimal before the closing
  13312.  parentheses:
  13313.  
  13314.     error 19: ")" expected
  13315.  
  13316.  No error is generated if a space is inserted between the decimal and
  13317.  the closing parentheses, as follows
  13318.  
  13319.     x := (1. + 1./9. );
  13320.  
  13321.  or a zero is inserted after the decimal, as in the following:
  13322.  
  13323.     x := (1. + 1./9.0);
  13324.  
  13325.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13326.  1.00. We are researching this problem and will post new information as
  13327.  it becomes available.
  13328.  
  13329.  
  13330.  62. Problem in Options Environment Causes Vague Error
  13331.  
  13332.  Product Version(s): 1.00
  13333.  Operating System:   MS-DOS
  13334.  Flags: ENDUSER | buglist1.00
  13335.  Last Modified: 26-SEP-1989    ArticleIdent: Q48946
  13336.  
  13337.  If an incorrect path is entered in the Options.Environment window in
  13338.  the space for the EXE directory, an error message pop-up is returned
  13339.  when a compile is attempted. An incorrect path is a path to a
  13340.  non-existent directory or a directory path that exceeds the
  13341.  64-character length permitted by MS-DOS. The following is the message
  13342.  that is returned:
  13343.  
  13344.     +------------------------+
  13345.     |   Source:  xxxxx.PAS   |
  13346.     |   Cannot create file   |
  13347.     |    < OK >    <Help>    |
  13348.     +------------------------+
  13349.  
  13350.  This error message doesn't clarify the cause of the error. QuickPascal
  13351.  should return an error message that states "Invalid Executable Path"
  13352.  (or equivalent). However, since MS-DOS doesn't return enough precise
  13353.  error information, a clearer message is currently impossible.
  13354.  
  13355.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13356.  1.00. We are researching this problem and will post new information as
  13357.  it becomes available.
  13358.  
  13359.  To correct the problem, make sure that the environment path is valid,
  13360.  i.e., set to an existing directory, and/or is fewer than 64 characters
  13361.  in length.
  13362.  
  13363.  
  13364.  63. QP Reports Incorrect Number of Lines Compiled If Lines > 65535
  13365.  
  13366.  Product Version(s): 1.00
  13367.  Operating System:   MS-DOS
  13368.  Flags: ENDUSER | buglist1.00
  13369.  Last Modified: 26-SEP-1989    ArticleIdent: Q48986
  13370.  
  13371.  While compiling, QuickPascal displays a running total of the number of
  13372.  lines compiled in the currently compiling module, as well as the total
  13373.  number of lines in all modules compiled so far. This progress
  13374.  information is correct for programs up to 65,535 total lines. For
  13375.  larger programs, after compiling the 65,535th line, the counter wraps
  13376.  around and begins at 0 (zero) again.
  13377.  
  13378.  Therefore, when compilation is complete, QuickPascal displays the
  13379.  actual number of lines minus 65,536. So, if your program has 65,540
  13380.  lines, QPL displays 4 lines compiled instead of the correct number of
  13381.  lines. This problem occurs both in the environment and with the command
  13382.  line compiler QPL.
  13383.  
  13384.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13385.  1.00. We are researching this problem and will post new information as
  13386.  it becomes available.
  13387.  
  13388.  
  13389.  64. Modification of Type Comp with Negative Exponent
  13390.  
  13391.  Product Version(s): 1.00
  13392.  Operating System:   MS-DOS
  13393.  Flags: ENDUSER | buglist1.00
  13394.  Last Modified:  2-OCT-1989    ArticleIdent: Q48990
  13395.  
  13396.  When a variable of type comp is modified using the Debug.Modify value
  13397.  option in QuickPascal, unexpected results may occur. When the variable
  13398.  is modified using scientific notation to have a negative exponent,
  13399.  e.g. 1.5E-6, the resulting value that is stored in that variable is
  13400.  incorrect, e.g. 2.4309066601E+14.
  13401.  
  13402.  To reproduce the error, use the following code fragment and carry out
  13403.  the steps outlined below (any code that has a variable of type comp
  13404.  can be substituted):
  13405.  
  13406.  Code Fragment
  13407.  -------------
  13408.  
  13409.     program compmod (input, output)
  13410.  
  13411.     var comptest: comp;
  13412.  
  13413.     begin
  13414.     end.
  13415.  
  13416.  Use the following steps to reproduce the problem:
  13417.  
  13418.  1. Begin tracing through the program using the F8 key.
  13419.  
  13420.  2. Enter the Debug window and add a watch on the variable comptest.
  13421.  
  13422.  3. Enter the Debug window and select "modify value". Modify the comptest
  13423.     variable to be a value with a negative exponent (e.g. 6.6E-6). The
  13424.     value in the watch value demonstrates the error.
  13425.  
  13426.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13427.  1.00. We are researching this problem and will post new information as
  13428.  it becomes available.
  13429.  
  13430.  
  13431.  65. Make Menu Doesn't Show Product as .QPU When Source Is a Unit
  13432.  
  13433.  Product Version(s): 1.00
  13434.  Operating System:   MS-DOS
  13435.  Flags: ENDUSER | buglist1.00
  13436.  Last Modified:  2-OCT-1989    ArticleIdent: Q49009
  13437.  
  13438.  When compiling a stand-alone unit, the make menu should change to show
  13439.  that the product is <file>.QPU instead of <file>.EXE. This is not the
  13440.  case in QuickPascal Version 1.00. This could be confusing since a
  13441.  compilation finishes without error and the menu shows that <file>.EXE
  13442.  was produced when in actuality <file>.QPU was produced.
  13443.  
  13444.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13445.  1.00. We are researching this problem and will post new information as
  13446.  it becomes available.
  13447.  
  13448.  
  13449.  66. On-Line Help Incorrectly Describes Range Checking
  13450.  
  13451.  Product Version(s): 1.00
  13452.  Operating System:   MS-DOS
  13453.  Flags: ENDUSER | docerr
  13454.  Last Modified:  2-OCT-1989    ArticleIdent: Q49116
  13455.  
  13456.  Use the on-line help to look up compiler options. The $R (range
  13457.  checking) directive is incorrectly listed in the on-line help as being
  13458.  turned on ($R+) for default. The actual default is off ($R-).
  13459.  
  13460.  
  13461.  67. Characters Beyond Column 255 Become Reversed in Editor
  13462.  
  13463.  Product Version(s): 1.00
  13464.  Operating System:   MS-DOS
  13465.  Flags: ENDUSER | buglist1.00 QP
  13466.  Last Modified:  2-OCT-1989    ArticleIdent: Q49117
  13467.  
  13468.  When a long line is typed in the QuickPascal editor and the 255th
  13469.  character is reached, following characters are displayed in reverse
  13470.  order and a beep is sounded for each character. Characters beyond
  13471.  Column 270 scroll off the screen. The following is an example:
  13472.  
  13473.                               255            270
  13474.                                |              |
  13475.     hello there hello there helolleh ereht olle
  13476.  
  13477.  Although QuickPascal won't let you view more than 255 character lines,
  13478.  it maintains data after the 255th column. These characters, however,
  13479.  are useless because they are preserved in reverse order. In addition,
  13480.  lines longer than 128 in length are longer than the maximum allowable
  13481.  by the compiler.
  13482.  
  13483.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13484.  1.00. We are researching this problem and will post new information as
  13485.  it becomes available.
  13486.  
  13487.  
  13488.  68. Real Variables Can Be Modified to Less Than Minimum Value
  13489.  
  13490.  Product Version(s): 1.00
  13491.  Operating System:   MS-DOS
  13492.  Flags: ENDUSER | buglist1.00
  13493.  Last Modified:  2-OCT-1989    ArticleIdent: Q49118
  13494.  
  13495.  When using QuickPascal's debugging features to modify real values, it
  13496.  is possible to specify an incorrect value. The results vary for
  13497.  different types of reals.
  13498.  
  13499.  When most real variables are modified to below their allowable
  13500.  minimum, they are modified by the environment to become 0 (zero).
  13501.  However, for the types double and extended, the value severely loses
  13502.  accuracy between X.Xe-308 and X.Xe-325. These ranges vary slightly
  13503.  depending on the values of X.
  13504.  
  13505.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13506.  1.00. We are researching this problem and will post new information as
  13507.  it becomes available.
  13508.  
  13509.  
  13510.  69. File.DOS Shell While Running Program Stops Execution
  13511.  
  13512.  Product Version(s): 1.00
  13513.  Operating System:   MS-DOS
  13514.  Flags: ENDUSER | buglist1.00
  13515.  Last Modified: 10-OCT-1989    ArticleIdent: Q49317
  13516.  
  13517.  In QuickPascal Version 1.00, if you are using F8 to step through your
  13518.  program and choose DOS shell from the File menu, when you exit from
  13519.  that shell, the program you were running is restarted.
  13520.  
  13521.  To demonstrate this behavior, use the following procedure:
  13522.  
  13523.  1. Load the following sample program into the QuickPascal environment:
  13524.  
  13525.        program hello (output);
  13526.  
  13527.        begin
  13528.                writeln ('hello');
  13529.                writeln ('goodbye');
  13530.        end.
  13531.  
  13532.  2. Compile the program by invoking Build Main File from the MAKE menu.
  13533.  
  13534.  3. Press F8 to step to the begin line.
  13535.  
  13536.  4. Press F8 again to step to the writeln ('hello'); line.
  13537.  
  13538.  5. Invoke DOS Shell from the File menu. QuickPascal will shell to the DOS
  13539.     command prompt.
  13540.  
  13541.  6. Type "exit" (without the quotation marks) at the DOS command prompt
  13542.     to quit that shell and return to the QuickPascal environment.
  13543.  
  13544.  Now, if you press F8 again, you might expect to execute the
  13545.  writeln('goodbye'); line because that is exactly where you left off.
  13546.  However, QuickPascal starts executing from the beginning again.
  13547.  
  13548.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13549.  1.00. This feature is under review and will be considered for changes
  13550.  in a future release.
  13551.  
  13552.  
  13553.  70. Watching Out-of-Range Integers
  13554.  
  13555.  Product Version(s): 1.00
  13556.  Operating System:   MS-DOS
  13557.  Flags: ENDUSER | buglist1.00
  13558.  Last Modified: 10-OCT-1989    ArticleIdent: Q49320
  13559.  
  13560.  Problem:
  13561.  
  13562.  In the program below, the value of -32768 is assigned to an integer
  13563.  called X. I want to watch -X and see 32768 in the watch window. However,
  13564.  QuickPascal shows -32768 when I watch -X.
  13565.  
  13566.  Program test;
  13567.  
  13568.  var X : integer;
  13569.  
  13570.  begin
  13571.      X := -32768;
  13572.  end.
  13573.  
  13574.  Response:
  13575.  
  13576.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13577.  1.00. We are researching this problem and will post new information as
  13578.  it becomes available.
  13579.  
  13580.  QuickPascal handles this condition correctly up to the limit of an
  13581.  integer. For example, if you assign X the value of -32767 and then
  13582.  watch -X, QuickPascal displays 32767 in the watch window.
  13583.  
  13584.  This does not work for -32768 because you have exceeded the range of
  13585.  an integer. If you plan to store an integer larger than plus or minus
  13586.  32767, you must use the appropriate data type, longint.
  13587.  
  13588.  In the program below, X is now a longint. You can now watch -X and see
  13589.  32768 in the watch window.
  13590.  
  13591.  Program Example
  13592.  ---------------
  13593.  
  13594.  Program test;
  13595.  
  13596.  var X : longint;
  13597.  
  13598.  begin
  13599.      X := -32768;
  13600.  end.
  13601.  
  13602.  
  13603.  71. QuickPascal 1.00: A Program Can Use Up to 81 Units
  13604.  
  13605.  Product Version(s): 1.00
  13606.  Operating System:   MS-DOS
  13607.  Flags: ENDUSER |
  13608.  Last Modified: 10-OCT-1989    ArticleIdent: Q49499
  13609.  
  13610.  As documented in "Pascal by Example" on Page 88, a QuickPascal Version
  13611.  1.00 program can use up to 81 units.
  13612.  
  13613.  A "unit" is defined as "a related collection of declarations and
  13614.  procedures."
  13615.  
  13616.  For more information on units, refer to Pages 87-93, Chapter 7, the
  13617.  section titled "Units", in the Microsoft QuickPascal "Pascal by
  13618.  Example" text.
  13619.  
  13620.  
  13621.  72. How to Process Command-Line Arguments in QuickPascal
  13622.  
  13623.  Product Version(s): 1.00
  13624.  Operating System:   MS-DOS
  13625.  Flags: ENDUSER |
  13626.  Last Modified: 14-FEB-1990    ArticleIdent: Q58319
  13627.  
  13628.  Question:
  13629.  
  13630.  How do I process command-line arguments in QuickPascal?
  13631.  
  13632.  Response:
  13633.  
  13634.  Command-line arguments are accessed through two functions included in
  13635.  the SYSTEM unit: ParamCount and ParamStr. ParamCount returns the
  13636.  number of command-line arguments, while ParamStr can return a specific
  13637.  command-line argument in the form of a string. See the sample program
  13638.  below or see sample programs in the online help that show how to
  13639.  process command-line arguments.
  13640.  
  13641.  These online help sample programs are as follows:
  13642.  
  13643.      PARAMS.PAS
  13644.      SUMINT.PAS
  13645.      SUMREAL.PAS
  13646.      EXITHALT.PAS
  13647.  
  13648.  These files can be found under "Example Programs" on the Contents menu
  13649.  in the online help (that is, Help.Contents.Example
  13650.  Programs.-program-name-, where -program-name- is the name of the
  13651.  sample program).
  13652.  
  13653.  Code Sample
  13654.  -----------
  13655.  
  13656.  The following program also shows how to process command-line
  13657.  parameters:
  13658.  
  13659.  PROGRAM foo;
  13660.  
  13661.  VAR
  13662.      count,
  13663.      i       :  Word ;
  13664.  
  13665.  BEGIN
  13666.          { Display each command-line argument. }
  13667.  
  13668.          Writeln( 'Command-line arguments:' );
  13669.          Writeln;
  13670.  
  13671.          count := ParamCount;            { Number of parameters }
  13672.  
  13673.          FOR i :=0 TO count DO
  13674.                  Writeln( 'Parameter ', i, '   ', ParamStr( i ) );
  13675.  
  13676.  END.
  13677.  
  13678.  Compile the above program and then run it by typing the name of the
  13679.  .EXE file followed by various argument strings separated by spaces.
  13680.  
  13681.  
  13682.  73. Clicking on Help Contents Dots Might Not Work in QuickPascal
  13683.  
  13684.  Product Version(s): 1.00
  13685.  Operating System:   MS-DOS
  13686.  Flags: ENDUSER |
  13687.  Last Modified: 30-NOV-1989    ArticleIdent: Q49713
  13688.  
  13689.  When using the right mouse button to select help contents, clicking on
  13690.  the dots associated with a desired help topic might have no result.
  13691.  
  13692.  To accurately choose an item from the help contents window, click on
  13693.  the desired word or phrase next to the dot.
  13694.  
  13695.  
  13696.  74. Run-Time Error 105 Caused by Huge Array
  13697.  
  13698.  Product Version(s): 1.00
  13699.  Operating System:   MS-DOS
  13700.  Flags: ENDUSER |
  13701.  Last Modified: 30-NOV-1989    ArticleIdent: Q49738
  13702.  
  13703.  QuickPascal's run-time error 105, which normally means that the file
  13704.  specified was not open for output, is also caused by having an array
  13705.  indexed from 0 to 65535. The following code demonstrates this:
  13706.  
  13707.  Code Example
  13708.  ------------
  13709.  
  13710.  PROGRAM test;
  13711.  VAR
  13712.      i : LongInt;
  13713.      memflag : ARRAY[0..65535] of Integer;
  13714.  BEGIN
  13715.      FOR i := 0 to 65535 DO
  13716.      BEGIN
  13717.        writeln(i);
  13718.        memflag[i] := 0;
  13719.      END;
  13720.  END.
  13721.  
  13722.  The above code terminates with error 105. If the array is
  13723.  declared to be of type Byte, the program terminates later in the code.
  13724.  If the array is indexed any other way (e.g. [1..65535] or [0..65534]),
  13725.  the problem does not occur and either error 49 ("Structure too big") or
  13726.  error 146 ("Too many variables in the data segment") is displayed.
  13727.  
  13728.  
  13729.  75. Break When Expression Is True in Debug Breaks Incorrectly
  13730.  
  13731.  Product Version(s): 1.00
  13732.  Operating System:   MS-DOS
  13733.  Flags: ENDUSER | buglist1.00
  13734.  Last Modified: 30-NOV-1989    ArticleIdent: Q50131
  13735.  
  13736.  If you set a breakpoint (Break When Expression Is True) in one file
  13737.  and then run another program that has the same variable, the second
  13738.  program breaks when the expression is true from the first program.
  13739.  
  13740.  The following demonstrates this problem.
  13741.  
  13742.  1. Start with the following programs in two separate tiled windows:
  13743.  
  13744.       PROGRAM   foo1;               PROGRAM   foo2;
  13745.  
  13746.       VAR  i : INTEGER;             VAR  i : INTEGER;
  13747.  
  13748.       BEGIN                         BEGIN
  13749.  
  13750.          FOR i := 1 TO 4 DO            FOR i := 2 TO 10 DO
  13751.             WRITELN ('i = ',i);           WRITELN ('i = ',i);
  13752.  
  13753.       END.                          END.
  13754.  
  13755.  2. From foo1 window, go to (Debug.Set Breakpoint.Break When Expression
  13756.     Is true) and add "i = 3" (without the quotation marks) in the
  13757.     Expression: box.
  13758.  
  13759.  3. Press the F5 key to run the foo1. The program will run and print "i
  13760.     = 1" and "i = 2" in the output window, then break.
  13761.  
  13762.  4. Switch to foo2 window and press the "F5" key to run foo2. The
  13763.     program will run and print "i = 2", then break. This should not
  13764.     happen. Instead, it should print "i = 2" through "i = 10".
  13765.  
  13766.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13767.  1.00. We are researching this problem and will post new information
  13768.  here as it becomes available.
  13769.  
  13770.  
  13771.  76. Help Screen for Error 13 Has Incomplete Information
  13772.  
  13773.  Product Version(s): 1.00
  13774.  Operating System:   MS-DOS
  13775.  Flags: ENDUSER | buglist1.00 docerr
  13776.  Last Modified: 30-NOV-1989    ArticleIdent: Q50132
  13777.  
  13778.  The help screen for "Error 13: String constant exceeds line" says that
  13779.  the string does not have a closing quotation mark and that string
  13780.  constants must be contained in the same line.
  13781.  
  13782.  If a string is not contained in the same line, it still may have a
  13783.  closing quotation mark, it's just not on the same line as the opening
  13784.  quotation mark. A better explanation would be the following:
  13785.  
  13786.     A closing quote for the string was not found on the same line as
  13787.     the opening quote. A string must be contained on a single line.
  13788.  
  13789.  Microsoft has confirmed this to be a problem with QuickPascal Version
  13790.  1.00. We are researching this problem and will post new information
  13791.  here as it becomes available.
  13792.  
  13793.  
  13794.  77. QP1.00:<Find All> Does Not Exist When Searching in Help Window
  13795.  
  13796.  Product Version(s): 1.00
  13797.  Operating System:   MS-DOS
  13798.  Flags: ENDUSER |
  13799.  Last Modified: 21-MAR-1990    ArticleIdent: Q50473
  13800.  
  13801.  In QuickPascal Version 1.00, when performing a Search.Find in a help
  13802.  window, the <Find All> option is unavailable. This option is available
  13803.  when searching in a regular file window.
  13804.  
  13805.  This option is under review and is being considered for inclusion a
  13806.  future release of QuickPascal (QP).
  13807.  
  13808.  
  13809.  78. QuickPascal 1.00 PACKING.LST (3.5-Inch Version)
  13810.  
  13811.  Product Version(s): 1.00
  13812.  Operating System:   MS-DOS
  13813.  Flags: ENDUSER |
  13814.  Last Modified: 30-NOV-1989    ArticleIdent: Q51250
  13815.  
  13816.  The following information is from the packing list for the 3.5-inch
  13817.  version of Microsoft QuickPascal (R) Compiler, Version 1.00:
  13818.  
  13819.  Disk 1: Program/Setup/Utilities
  13820.  
  13821.  Files                  Description
  13822.  -----                  -----------
  13823.  
  13824.  QP.EXE                 Microsoft QuickPascal program development
  13825.                         environment.
  13826.  QPL.COM                QuickPascal command-line compiler.
  13827.  QPL.ERR                QuickPascal command-line compiler error
  13828.                         messages.
  13829.  PACKING.LST            Packing list (this file).
  13830.  SETUP.EXE              SETUP program -- installs QuickPascal.
  13831.  README.DOC             Directs you to README in Help.
  13832.  FIXSHIFT.COM           Fixes BIOS bug for certain Compaq (R) and other
  13833.                         keyboards.
  13834.  MOUSE.COM              Microsoft Mouse driver.
  13835.  MSHERC.COM             TSR -- supports Hercules (R) card graphics.
  13836.  QPMKKEY.EXE            Creates customized keyboard command files.
  13837.  
  13838.  SAMPLES\BIGHEAP.PAS    New versions of GetMem and FreeMem that can
  13839.                         allocate heap space in blocks larger than 65,520
  13840.                         bytes.
  13841.  
  13842.  SAMPLES\BIGMEM.PAS     BIGMEM.PAS uses the sample BigHeap unit.
  13843.  SAMPLES\MOUSE.PAS      Real mode mouse control routines; derived from
  13844.                         "Microsoft OS/2 Programmer's Reference," Chapter
  13845.                         3.
  13846.  SAMPLES\SORTDEMO.PAS   Graphically demonstrates six common sorting
  13847.                         algorithms
  13848.  SAMPLES\OBJECTS.PAS    Object-oriented demo.
  13849.  SAMPLES\CRLF.PAS       Normalizes all line endings of a text file to
  13850.                         CRLF.
  13851.  SAMPLES\GRDMEO.PAS     Demonstrates the QuickPascal graphics library.
  13852.                         It uses two additional units: menu and turtle.
  13853.  SAMPLES\MENU.PAS       Used by Grdemo.
  13854.  SAMPLES\TURTLE         Used by Grdemo (for Turtle graphics).
  13855.  BRIEF.KEY              Keyboard MAP files.
  13856.  EMACS.KEY                " "
  13857.  EPSILON.KEY              " "
  13858.  QP.KEY                   " "
  13859.  ME.KEY                   " "
  13860.  
  13861.  Disk 2: Microsoft QuickPascal Advisor/Microsoft QuickPascal Express
  13862.  
  13863.  Files                  Description
  13864.  -----                  -----------
  13865.  
  13866.  QP.HLP                 QuickPascal help files.
  13867.  QPENV.HLP                " "
  13868.  QPERR.HLP                " "
  13869.  QPGRAPH.HLP              " "
  13870.  NOTES.HLP                " "
  13871.  LEARN.EXE              Computer-Based Training file.
  13872.  QPCBT.CTX                " "
  13873.  QPCBT.SCN                " "
  13874.  QPCBT.SOB                " "
  13875.  LEARN.PIF              Computer-Based Training Windows PIF file.
  13876.  ATT6300.VID            Computer-Based Training additional display
  13877.                         drivers.
  13878.  CGASNOW.VID              " "
  13879.  ERICSSON.VID             " "
  13880.  HERC102.VID              " "
  13881.  HERC112.VID              " "
  13882.  
  13883.  Disk 3: Libraries
  13884.  
  13885.  Files                  Description
  13886.  -----                  -----------
  13887.  
  13888.  SYSTEM.QPU             System Unit.
  13889.  CRT.QPU                CRT Interface Unit.
  13890.  DOS.QPU                DOS Interface Unit.
  13891.  MSGRAPH.QPU            Graphics Interface Unit.
  13892.  MSGRUTIL.QPU           Graphics Support Unit.
  13893.  GRAPH.QPU              Graphics Support Unit.
  13894.  PRINTER.QPU            Printer Interface Unit.
  13895.  COURB.FON              Font files.
  13896.  ROMAN.FON                " "
  13897.  SCRIPT.FON               " "
  13898.  TMSRB.FON                " "
  13899.  HELVB.FON                " "
  13900.  MODERN.FON               " "
  13901.  
  13902.  
  13903.  79. Bad Expression in Debug Window Yields Incorrect Error Message
  13904.  
  13905.  Product Version(s): 1.00
  13906.  Operating System:   MS-DOS
  13907.  Flags: ENDUSER | docerr
  13908.  Last Modified:  4-JAN-1990    ArticleIdent: Q51473
  13909.  
  13910.  If you enter a numeric value followed by a character in the debug
  13911.  window, you will get the error "Invalid end of line," which is
  13912.  incorrect. The error should read "Invalid expression."
  13913.  
  13914.  
  13915.  80. Error 73 Caused by Passing Incorrect Parameters
  13916.  
  13917.  Product Version(s): 1.00
  13918.  Operating System:   MS-DOS
  13919.  Flags: ENDUSER | docerr
  13920.  Last Modified:  4-JAN-1990    ArticleIdent: Q51776
  13921.  
  13922.  QuickPascal's ERROR 73, which is defined as "Error in Statement," may
  13923.  be caused by passing different parameters than that which a function
  13924.  or procedure expects.
  13925.  
  13926.  As expected, the compiler highlights the call to the procedure or
  13927.  function and brings up the error message window. But if you select
  13928.  <Help> when given the ERROR 73 message, the QuickPascal environment
  13929.  gives "An undefined error occurred in the statement" as more
  13930.  information.
  13931.  
  13932.  The following code demonstrates this behavior:
  13933.  
  13934.  program errtest;
  13935.  
  13936.  procedure test;
  13937.  var i: integer;
  13938.  begin
  13939.       i := 3;
  13940.  end;
  13941.  
  13942.  begin
  13943.       test(3);
  13944.  end.
  13945.  
  13946.  The compiler highlights the call to test and brings up ERROR 73 on a
  13947.  pop-up window.
  13948.  
  13949.  
  13950.  81. OK to Redefine Predefined Functions and Procedures
  13951.  
  13952.  Product Version(s): 1.00
  13953.  Operating System:   MS-DOS
  13954.  Flags: ENDUSER | S_PasCal
  13955.  Last Modified:  4-JAN-1990    ArticleIdent: Q51777
  13956.  
  13957.  If you define a function or procedure in your QuickPascal program
  13958.  which happens to have the same name as a run-time library routine, you
  13959.  will receive no error messages, and QuickPascal will accept your
  13960.  definition of the function instead of the run-time routine's
  13961.  definition.
  13962.  
  13963.  The following code demonstrates this behavior:
  13964.  
  13965.  program dupefunc;
  13966.  
  13967.  function sin (x: Real):Real;
  13968.  begin
  13969.     sin := 30.0;
  13970.  end;
  13971.  
  13972.  var x, y : Real;
  13973.  begin
  13974.     x := 7.0;
  13975.     y := sin(x);
  13976.     writeln('Sin of 7.0 returns: ', y);
  13977.  end.
  13978.  
  13979.  The program writes the following line to the screen upon execution:
  13980.  
  13981.  Sin of 7.0 returns: 30
  13982.  
  13983.  This is expected behavior for QuickPascal and also occurs in Pascal
  13984.  Version 4.00.
  13985.  
  13986.  
  13987.  82. How to Pass Functions and Procedures As Parameters
  13988.  
  13989.  Product Version(s): 1.00
  13990.  Operating System:   MS-DOS
  13991.  Flags: ENDUSER |
  13992.  Last Modified:  2-JAN-1990    ArticleIdent: Q51832
  13993.  
  13994.  It is possible to pass functions or procedures as parameters to other
  13995.  functions or procedures. To do this, you must declare a TYPE of that
  13996.  procedure or function and you must declare the procedure or function
  13997.  with long calls and returns. The following code demonstrates this:
  13998.  
  13999.  Code Example
  14000.  ------------
  14001.  
  14002.  program passing(input, output);
  14003.  type
  14004.          Func = function(x : integer) : integer;
  14005.          Proc = procedure(x : integer);
  14006.  
  14007.  var
  14008.          x : integer;
  14009.  
  14010.  {$F+}
  14011.  
  14012.  function square(x : integer) : integer;
  14013.  begin
  14014.          square := x * x;
  14015.  end;
  14016.  
  14017.  procedure printline(x : integer);
  14018.  begin
  14019.          write('The square of ',x,' is ');
  14020.  end;
  14021.  
  14022.  {$F-}
  14023.  
  14024.  procedure trial(myfunc : Func ; myproc : Proc ; x : integer);
  14025.  var
  14026.          z : integer;
  14027.  begin
  14028.          myproc(x);
  14029.          z := myfunc(x);
  14030.          writeln(z);
  14031.  end;
  14032.  
  14033.  begin
  14034.          trial(square, printline, 5);
  14035.  end.
  14036.  
  14037.  Note the two types defined in the program: one called Func and the
  14038.  other called Proc. The Func type can be any function that takes an
  14039.  integer and returns an integer; the Proc type can be any procedure
  14040.  that takes an integer. If, for example, you have another procedure
  14041.  that takes a single integer, you can pass it with the same Proc type.
  14042.  
  14043.  Also note the {$F+} and {$F-} compiler directives. These compiler
  14044.  directives tell the compiler to generate long calls and returns.
  14045.  
  14046.  
  14047.  83. QuickPascal Cannot Trace Program with Pointers of Type OBJECT
  14048.  
  14049.  Product Version(s): 1.00
  14050.  Operating System:   MS-DOS
  14051.  Flags: ENDUSER | buglist1.00
  14052.  Last Modified:  6-MAR-1990    ArticleIdent: Q57291
  14053.  
  14054.  Tracing into a program with pointers of type OBJECT in QuickPascal
  14055.  Version 1.00 causes the system to hang at the line that follows the
  14056.  assignment of the pointer.
  14057.  
  14058.  Trace into the following program in the QuickPascal environment using
  14059.  F8. The system hangs at the line after the assignment of the pointer.
  14060.  The program runs correctly if you use F5 to run the program from
  14061.  within the environment or to run it from the DOS prompt outside the
  14062.  environment; the program hangs the machine only when tracing using F8.
  14063.  
  14064.  Code Sample
  14065.  --------------
  14066.  
  14067.       PROGRAM ObjectPointer;
  14068.       {$M+}
  14069.  
  14070.       TYPE
  14071.            obj = OBJECT
  14072.                  str : STRING
  14073.            END;
  14074.  
  14075.       VAR
  14076.            ptr : ^obj;
  14077.  
  14078.       BEGIN
  14079.  
  14080.            new (ptr);
  14081.            ptr^.str := 'Hello';
  14082.            writeln ('ptr^.str = ', ptr^.str);  { Will hang here.}
  14083.  
  14084.       END.
  14085.  
  14086.  Microsoft has confirmed this to be a problem with QuickPascal Version
  14087.  1.00. We are researching this problem and will post new information
  14088.  here as it becomes available.
  14089.  
  14090.  
  14091.  
  14092.  84. QuickPascal May Not Install in 3.x Box of OS/2 with HPFS
  14093.  
  14094.  Product Version(s): 1.00
  14095.  Operating System:   MS-DOS
  14096.  Flags: ENDUSER |
  14097.  Last Modified: 16-JAN-1990    ArticleIdent: Q57312
  14098.  
  14099.  QuickPascal may not install properly on a fixed disk if you are in the
  14100.  3.x box of OS/2 and your hard drive has the High Performance File
  14101.  System (HPFS) installed.
  14102.  
  14103.  The following are descriptions of problems that occur when running
  14104.  Setup:
  14105.  
  14106.  Case 1
  14107.  ------
  14108.  
  14109.  If you specify the destination drive to be one on which HPFS is
  14110.  installed, and if the current default drive is Drive A, QuickPascal
  14111.  will always try to use Drive B as the destination drive, unless the
  14112.  machine has no Drive B. In this case, QuickPascal will attempt to use
  14113.  Drive A as the destination drive, even though you are using A as the
  14114.  source drive.
  14115.  
  14116.  Case 2
  14117.  ------
  14118.  
  14119.  If the current default drive is Drive C and Drive C has HPFS
  14120.  installed, then QuickPascal will install all files in the root
  14121.  directory of Drive C (C:\), even if you specify C:\QP as the
  14122.  destination directory.
  14123.  
  14124.  To work around setup problems, use a manual installation procedure for
  14125.  QuickPascal.
  14126.  
  14127.  The following is the manual setup procedure:
  14128.  
  14129.  1. Copy all files from the distribution disks to a subdirectory on the
  14130.     hard drive.
  14131.  
  14132.  2. Invoke QuickPascal from the 3x box.
  14133.  
  14134.  3. Correctly set the environment paths from the Options in the
  14135.     QuickPascal menu.
  14136.  
  14137.  
  14138.  85. FEXPAND() May Return the Wrong Path in QuickPascal
  14139.  
  14140.  Product Version(s): 1.00
  14141.  Operating System:   MS-DOS
  14142.  Flags: ENDUSER | buglist1.00
  14143.  Last Modified: 16-JAN-1990    ArticleIdent: Q57519
  14144.  
  14145.  The QuickPascal Version 1.00 run-time library function FEXPAND() does
  14146.  not return the root directory as the directory name if a single
  14147.  backslash '\' is passed as a string. Instead, the function returns the
  14148.  current working directory.
  14149.  
  14150.  Microsoft has confirmed this to be a problem with Microsoft
  14151.  QuickPascal Version 1.00. We are researching this problem and will
  14152.  post new information here as it becomes available.
  14153.  
  14154.  Code Example
  14155.  ------------
  14156.  
  14157.  PROGRAM findfile;
  14158.  
  14159.  USES  Dos;
  14160.  
  14161.  VAR
  14162.      full_path   : pathstr;
  14163.      dir         : DirStr;
  14164.      fname       : NameStr;
  14165.      exten       : ExtStr;
  14166.  
  14167.  BEGIN
  14168.  
  14169.      full_path := FExpand( '\' );
  14170.      FSplit( full_path, dir, fname, exten );
  14171.      Writeln( 'File found first in:' );
  14172.      Writeln( 'Drive/directory : ', dir );
  14173.      Writeln( 'File name       : ', fname );
  14174.      Writeln( 'Extension       : ', exten );
  14175.  
  14176.  END.
  14177.  
  14178.  The current workaround for this problem is to pass in '\.\' instead of
  14179.  '\'. This procedure will return the root directory.
  14180.  
  14181.  
  14182.  
  14183.  86. Syntax Charts for Pascal Program Structure -- Declarations
  14184.  
  14185.  Product Version(s): 1.00
  14186.  Operating System:   MS-DOS
  14187.  Flags: ENDUSER | s_pascal
  14188.  Last Modified: 21-JAN-1990    ArticleIdent: Q57556
  14189.  
  14190.  A block in QuickPascal Version 1.00 is part of a procedure or function
  14191.  declaration, or a program or unit. A block is made up of declarations
  14192.  and statements, as shown below:
  14193.  
  14194.                    +------------------+       +----------------+
  14195.       block ------>| declaration part |------>| statement part |
  14196.                    +------------------+       +----------------+
  14197.  
  14198.  The declaration part is made up of labels, constants, types,
  14199.  variables, and procedure/function declarations.  All of these
  14200.  declarations are LOCAL to the block.
  14201.  
  14202.  Example
  14203.  -------
  14204.  
  14205.  declaration part -----+--------------------------------------+-->
  14206.                     ^  |                                   ^  |
  14207.                     |  +--->[ LABEL declaration part ]-----+  |
  14208.                     |  |                                   |  |
  14209.                     |  +--->[ CONSTANT declaration part ]--+  |
  14210.                     |  |                                   |  |
  14211.                     |  +--->[ TYPE declaration part ]------+  |
  14212.                     |  |                                   |  |
  14213.                     |  +--->[ VARIABLE declaration part ]--+  |
  14214.                     |  |                                   |  |
  14215.                     |  +--->[ PROC/FUNC declaration part ]-+  |
  14216.                     |                                         |
  14217.                     +-----------------------------------------+
  14218.  
  14219.  Labels declared in the LABEL declaration part mark statements in the
  14220.  corresponding statement part. Each label marks only one statement.
  14221.  
  14222.  Example
  14223.  -------
  14224.  
  14225.  label
  14226.  declaration part ---->{ LABEL }----->[ label ]--+--->{ ; }
  14227.                                   ^              |
  14228.                                   |              |
  14229.                                   +----{ , }<----+
  14230.  
  14231.  Digits or identifiers may be used for labels. Digits must be in the
  14232.  range of 0-9999.
  14233.  
  14234.  Example
  14235.  -------
  14236.  
  14237.  constant
  14238.  declaration part --->{ CONST }----+--->[ const. decl. ]-----+--->
  14239.                                 ^  |                       ^ |
  14240.                                 |  |                       | |
  14241.                                 |  +->[ typed const. decl]-+ |
  14242.                                 |                            |
  14243.                                 +----------------------------+
  14244.  type
  14245.  declaration part ---->{ TYPE }---->[ type decl. ]---+--->
  14246.                                 ^                    |
  14247.                                 |                    |
  14248.                                 +--------------------+
  14249.  
  14250.  variable
  14251.  declaration part ---->{ VAR }----->[ var decl. ]--+--->
  14252.                                 ^                  |
  14253.                                 |                  |
  14254.                                 +------------------+
  14255.  
  14256.  procedure/function
  14257.  declaration part --------+--->[ procedure decl. ]-----+--->
  14258.                        ^  |                         ^  |
  14259.                        |  |                         |  |
  14260.                        |  +---->[ function decl ]---+  |
  14261.                        |                               |
  14262.                        +-------------------------------+
  14263.  
  14264.  Code Example
  14265.  ------------
  14266.  
  14267.  PROGRAM TEST(output);
  14268.  
  14269.  LABEL     x1;
  14270.  
  14271.  CONST     NUM_GOMERS = 1000;
  14272.  
  14273.  TYPE      ARRAY_TYPE = array [1..10] of char;
  14274.  
  14275.  VAR       char_array : ARRAY_TYPE;
  14276.                     i : integer;
  14277.  
  14278.  FUNCTION Foo( spud : char ):integer;
  14279.  
  14280.       VAR    x   : integer;
  14281.  
  14282.  BEGIN
  14283.  
  14284.       x := 5;
  14285.       writeln('This should print.');
  14286.       Foo := x;
  14287.  
  14288.  END;
  14289.  
  14290.  BEGIN
  14291.       i := 0;
  14292.  
  14293.       goto x1;
  14294.  
  14295.       if (i < 2) then
  14296.         begin
  14297.            writeln('this should not print.');
  14298.            x1:  i := foo( char_array[1] );
  14299.         end;
  14300.  END.
  14301.  
  14302.  
  14303.  87. Documentation Error in HORIZON.PAS
  14304.  
  14305.  Product Version(s): 1.00
  14306.  Operating System:   MS-DOS
  14307.  Flags: ENDUSER | docerr
  14308.  Last Modified: 23-JAN-1990    ArticleIdent: Q57860
  14309.  
  14310.  The sample program HORIZON.PAS on Page 189 of the "Microsoft
  14311.  QuickPascal - Pascal By Example" and the online help example program
  14312.  in "Pascal By Example" does not cycle through the 256 colors. The
  14313.  following lines are incorrect:
  14314.  
  14315.     rainbow[col + 192] := Red OR NOT gray;
  14316.     rainbow[col + 192 + 256] := Red OR NOT gray;
  14317.  
  14318.  To correct the problem, change "OR" to "AND," as follows:
  14319.  
  14320.     rainbow[col + 192] := Red AND NOT gray;
  14321.     rainbow[col + 192 + 256] := Red AND NOT gray;
  14322.  
  14323.  The correction allows the program to cycle through the 256 colors.
  14324.  
  14325.  
  14326.  88. _RemapAllPalette May Fail on VGA
  14327.  
  14328.  Product Version(s): 1.00
  14329.  Operating System:   MS-DOS
  14330.  Flags: ENDUSER | buglist1.00
  14331.  Last Modified:  5-FEB-1990    ArticleIdent: Q57892
  14332.  
  14333.  The QuickPascal run-time graphics function, _RemapAllPalette, may fail
  14334.  on a VGA if a color that is out-of-range is given as its argument.
  14335.  
  14336.  For a value to be a legal color on a VGA, it must be of the binary
  14337.  form 0000000000XXXXXX00XXXXXX00XXXXXX. If _RemapAllPalette is given a
  14338.  color or an array of colors as an argument, and if any of the colors
  14339.  in the array are illegal, the function will terminate execution and
  14340.  return. This is not quite consistent with the way it behaves on EGAs.
  14341.  
  14342.  This problem is evident in the HORIZON.PAS program located on Page 189
  14343.  of "Microsoft QuickPascal - Pascal by Example," and also available
  14344.  from the online help by selecting the following from the HELP menu:
  14345.  
  14346.     Contents.Pascal by Example Programs.HORIZON.PAS
  14347.  
  14348.  A workaround can be achieved by masking each of the values in the
  14349.  array with the hex value $003F3F3F. This forces each color back into
  14350.  the "legal" range.
  14351.  
  14352.  Microsoft has confirmed this to be a problem with the _RemapAllPalette
  14353.  function in QuickPascal Version 1.00. We are researching this problem
  14354.  and will post new information here as it becomes available.
  14355.  
  14356.  
  14357.  89. Different Results When Running Program from DOS Prompt
  14358.  
  14359.  Product Version(s): 1.00
  14360.  Operating System:   MS-DOS
  14361.  Flags: ENDUSER |
  14362.  Last Modified:  5-MAR-1990    ArticleIdent: Q58109
  14363.  
  14364.  Different results may be obtained when running a program from within
  14365.  the QuickPascal environment and when running the same executable from
  14366.  the DOS prompt.
  14367.  
  14368.  The QuickPascal environment may appear to automatically initializes
  14369.  all global variables and arrays to 0 (although this behavior is not
  14370.  guaranteed); in the case of an array of type BOOLEAN, all entries are
  14371.  initialized to FALSE. However, this behavior does not occur after
  14372.  exiting the environment and running the same executable from the DOS
  14373.  prompt. When running a program from the DOS prompt, any uninitialized
  14374.  variables will consistently be undefined.
  14375.  
  14376.  Also note that this automatic initialization only applies to global
  14377.  variables. Any variable or array declared locally within a procedure
  14378.  or function must be initialized, whether running the program from
  14379.  within the environment or from the DOS prompt. Otherwise, its value
  14380.  (or the value of its elements, in the case of an array) will be
  14381.  undefined.
  14382.  
  14383.  This is expected behavior. The general rule to follow when writing
  14384.  good code is to initialize ALL variables and arrays before use to
  14385.  avoid inconsistent results. Otherwise, their contents may be
  14386.  undefined, and the output of your program will be unpredictable.
  14387.  
  14388.  The following code demonstrates this situation:
  14389.  
  14390.  Code Example
  14391.  ------------
  14392.  
  14393.  PROGRAM bogus_code;
  14394.  
  14395.  VAR
  14396.          x : integer;
  14397.          P : array [1..10] of integer;   { Array declared globally }
  14398.  
  14399.  PROCEDURE call;
  14400.  
  14401.          VAR
  14402.  
  14403.          A : array [1..10] of integer;   { Array declared locally }
  14404.  
  14405.  BEGIN
  14406.  
  14407.   { Uncomment this section to initialize array A }
  14408.  
  14409.     {x := 1;
  14410.      while x <= 10 do
  14411.          BEGIN
  14412.           A[x] := 0;
  14413.           x := x+1;
  14414.          END;}
  14415.  
  14416.      x := 1;
  14417.  
  14418.      while x <= 10 do
  14419.          BEGIN
  14420.           write( A[x], ' ' );  { Print contents of array A }
  14421.           x := x + 1;
  14422.          END;
  14423.  
  14424.      writeln;
  14425.  
  14426.  END; { call }
  14427.  
  14428.  BEGIN   { main }
  14429.  
  14430.          call;
  14431.  
  14432.   { Uncomment this section to initialize array P }
  14433.  
  14434.     {x := 1;
  14435.      while x <= 10 do
  14436.          BEGIN
  14437.           P[x] := 0;
  14438.           x := x+1;
  14439.          END;}
  14440.  
  14441.      x := 1;
  14442.  
  14443.      while x <= 10 do
  14444.          BEGIN
  14445.           write( P[x], ' ' );  { Print contents of array P }
  14446.           x := x + 1;
  14447.          END;
  14448.  
  14449.      writeln;
  14450.  
  14451.  END.
  14452.  
  14453.  Compile the above program and run it from within the QuickPascal
  14454.  environment using F5. It will print random numbers from array A, while
  14455.  array P will output all 0's (zeros), even though it has not been
  14456.  explicitly initialized. Then exit the environment and run the program
  14457.  from the DOS prompt. Both arrays will then output random numbers. To
  14458.  achieve consistent results from both within the QuickPascal
  14459.  environment and from the DOS prompt, uncomment the two initialization
  14460.  routines above.
  14461.  
  14462.  Also note that if the Options.Compiler.Debug_Information switch is
  14463.  disabled in the QuickPascal environment, variables and arrays will not
  14464.  be initialized, either from within the environment or from the DOS
  14465.  prompt.
  14466.  
  14467.  
  14468.  90. Path Incorrectly Stated in "Up and Running"
  14469.  
  14470.  Product Version(s): 1.00
  14471.  Operating System:   MS-DOS
  14472.  Flags: ENDUSER | docerr
  14473.  Last Modified: 26-FEB-1990    ArticleIdent: Q58652
  14474.  
  14475.  On Page 7, 11, and 15 of the "Microsoft QuickPascal -- Up and Running"
  14476.  manual, the default paths for the file types are incorrectly stated. The
  14477.  correct default paths for the file types are shown below:
  14478.  
  14479.     Path                      File Type
  14480.     ----                      ---------
  14481.  
  14482.     C:\QP                     Executable (.EXE)
  14483.     C:\QP                     Unit (.QPU)
  14484.     C:\QP\HLP                 Help (.HLP)
  14485.  
  14486.  
  14487.  91. Using the Undocumented SWAP Option When Invoking QuickPascal
  14488.  
  14489.  Product Version(s): 1.00
  14490.  Operating System:   MS-DOS
  14491.  Flags: ENDUSER | docerr
  14492.  Last Modified: 26-FEB-1990    ArticleIdent: Q58782
  14493.  
  14494.  When compiling a very large program with multiple large modules in
  14495.  QuickPascal, a dialog box with the following message may appear:
  14496.  
  14497.     Error 1:  Out of memory
  14498.  
  14499.  Clicking on the <help> switch of the dialog box reveals the following
  14500.  explanation:
  14501.  
  14502.     There was not enough memory for compiling. Either the program was
  14503.     too big or available memory was insufficient.
  14504.  
  14505.     - Split a large program into smaller parts. Put functions and
  14506.       procedures into a unit. Allocate variables dynamically rather
  14507.       than statically.
  14508.  
  14509.     - Close unneeded windows before compiling.
  14510.  
  14511.     - Reinvoke QP, swapping to disk or to expanded memory.
  14512.  
  14513.          To swap to disk:               QP /SWAP:DISK
  14514.          To swap to expanded memory:    QP /SWAP:EMS
  14515.  
  14516.  The SWAP option is not documented. The out-of-memory problem may be
  14517.  caused by using a large number of units, especially if you are using
  14518.  MSGRAPH.QPU or GRAPH.QPU. QuickPascal tries to load ALL of the units
  14519.  on the USES line into memory before deciding which parts of these
  14520.  units it needs to use. If you have large, memory-intensive units, this
  14521.  uses up memory very fast and you may get the "out-of-memory" error
  14522.  message even though the resulting executable may be very small.
  14523.  
  14524.  However, using SWAP may not be the automatic solution for the
  14525.  out-of-memory problem. SWAP does NOT cause these units to be loaded
  14526.  into the swap area. When SWAP has been invoked using one of the above
  14527.  commands, QuickPascal creates a 1 MB swap file on disk (or in expanded
  14528.  memory) to use for swapping in and out some of the QuickPascal
  14529.  environment elements. (To use SWAP, you must have at least 1 MB of
  14530.  free disk space, or you must be using an expanded memory module.)
  14531.  
  14532.  Therefore, reinvoking QuickPascal with the SWAP option still may not
  14533.  cure the "out-of-memory" error message.
  14534.  
  14535.  At load time, the initial swap area is set aside, and part of the user
  14536.  interface (environment) code is loaded into it. The amount of free
  14537.  memory does not change after that; that is, HEAP size remains a
  14538.  constant. A predetermined amount of code is swapped in and out of the
  14539.  swap area in single chunks as needed.
  14540.  
  14541.  This swapping area is not used at all by QuickPascal for any of the
  14542.  units or the program being compiled, but it should help when making
  14543.  room for a very large program that does not use any of the graphics
  14544.  units.
  14545.  
  14546.  
  14547.  92. QP Help: Error: Out of Memory
  14548.  
  14549.  Product Version(s): 1.00
  14550.  Operating System:   MS-DOS
  14551.  Flags: ENDUSER | s_error
  14552.  Last Modified: 15-APR-1990    ArticleIdent: Q60513
  14553.  
  14554.  The following information is from the QuickPascal Version 1.00
  14555.  QPERR.HLP help file:
  14556.  
  14557.     Error 1: Out of memory
  14558.  
  14559.  There was not enough memory for compiling. Either the program was too
  14560.  big or available memory was insufficient.
  14561.  
  14562.  - Split a large program into smaller parts. Put functions and
  14563.    procedures into a unit. Allocate variables dynamically rather than
  14564.    statically.
  14565.  
  14566.  - Close unneeded windows before compiling.
  14567.  
  14568.  - Reinvoke QP, swapping to disk or to expanded memory.
  14569.  
  14570.       To swap to disk:               QP /SWAP:DISK
  14571.       To swap to expanded memory:    QP /SWAP:EMS
  14572.  
  14573.  
  14574.  93. QP Help: Error: Line Too Long
  14575.  
  14576.  Product Version(s): 1.00
  14577.  Operating System:   MS-DOS
  14578.  Flags: ENDUSER | s_error
  14579.  Last Modified: 15-APR-1990    ArticleIdent: Q60514
  14580.  
  14581.  The following information is from the QuickPascal Version 1.00
  14582.  QPERR.HLP help file:
  14583.  
  14584.     Error 10: Line too long
  14585.  
  14586.  The line at the cursor exceeds QuickPascal's maximum line length of
  14587.  128 characters.
  14588.  
  14589.  Possible methods for shortening the line include:
  14590.  
  14591.     - Breaking a complex expression into smaller parts
  14592.     - Reducing the length of variable and constant names
  14593.     - Deleting any trailing blanks or tabs on the line
  14594.     - Creating long strings with the plus (+) operator
  14595.  
  14596.  
  14597.  94. QP Help: Error: Field or Method Already Defined
  14598.  
  14599.  Product Version(s): 1.00
  14600.  Operating System:   MS-DOS
  14601.  Flags: ENDUSER | s_error
  14602.  Last Modified: 15-APR-1990    ArticleIdent: Q60515
  14603.  
  14604.  The following information is from the QuickPascal Version 1.00
  14605.  QPERR.HLP help file:
  14606.  
  14607.     Error 102: Field or method already defined
  14608.  
  14609.  This name has already been used to define a field or method.
  14610.  
  14611.  Give the field or method a different name, or rename the previously
  14612.  defined field or method that uses the same name.
  14613.  
  14614.  
  14615.  95. QP Help: Error: Invalid QPU File
  14616.  
  14617.  Product Version(s): 1.00
  14618.  Operating System:   MS-DOS
  14619.  Flags: ENDUSER | s_error
  14620.  Last Modified: 15-APR-1990    ArticleIdent: Q60516
  14621.  
  14622.  The following information is from the QuickPascal Version 1.00
  14623.  QPERR.HLP help file:
  14624.  
  14625.     Error 103: Invalid QPU file
  14626.  
  14627.  The USES statement refers to a file that is not a valid .QPU file.
  14628.  Either the file does not exist, or it exists but is not a compiled
  14629.  QuickPascal unit.
  14630.  
  14631.  Check to make sure the file exists and is spelled correctly. If the
  14632.  problem persists, delete the .QPU file and recompile the unit from its
  14633.  original source code.
  14634.  
  14635.  
  14636.  96. QP Help: Error: Duplicate Unit Name
  14637.  
  14638.  Product Version(s): 1.00
  14639.  Operating System:   MS-DOS
  14640.  Flags: ENDUSER | s_error
  14641.  Last Modified: 15-APR-1990    ArticleIdent: Q60517
  14642.  
  14643.  The following information is from the QuickPascal Version 1.00
  14644.  QPERR.HLP help file:
  14645.  
  14646.     Error 104: Duplicate unit name
  14647.  
  14648.  The same unit has been specified more than once in the USES statement.
  14649.  
  14650.  Remove the duplicate references.
  14651.  
  14652.  
  14653.  97. QP Help: Error: Circular Unit Reference
  14654.  
  14655.  Product Version(s): 1.00
  14656.  Operating System:   MS-DOS
  14657.  Flags: ENDUSER | s_error
  14658.  Last Modified: 15-APR-1990    ArticleIdent: Q60518
  14659.  
  14660.  The following information is from the QuickPascal Version 1.00
  14661.  QPERR.HLP help file:
  14662.  
  14663.     Error 105: Circular unit reference
  14664.  
  14665.  A circular reference was made in the interface section of a unit.
  14666.  
  14667.  Circular references are allowed only in the implementation sections of
  14668.  units.
  14669.  
  14670.  
  14671.  98. QP Help: Error: Error in Real Constant
  14672.  
  14673.  Product Version(s): 1.00
  14674.  Operating System:   MS-DOS
  14675.  Flags: ENDUSER | s_error
  14676.  Last Modified: 15-APR-1990    ArticleIdent: Q60519
  14677.  
  14678.  The following information is from the QuickPascal Version 1.00
  14679.  QPERR.HLP help file:
  14680.  
  14681.     Error 106: Error in real constant
  14682.  
  14683.  This constant does not conform to the syntax for a real number. Change
  14684.  the constant to the correct syntax.
  14685.  
  14686.  
  14687.  99. QP Help: Error: Coprocessor Required
  14688.  
  14689.  Product Version(s): 1.00
  14690.  Operating System:   MS-DOS
  14691.  Flags: ENDUSER | s_error
  14692.  Last Modified: 15-APR-1990    ArticleIdent: Q60520
  14693.  
  14694.  The following information is from the QuickPascal Version 1.00
  14695.  QPERR.HLP help file:
  14696.  
  14697.     Error 107: Coprocessor required
  14698.  
  14699.  QuickPascal requires a math coprocessor to perform this operation.
  14700.  Unless your computer uses math chips from the Intel 80x87 family, you
  14701.  cannot specify the {$N+} compiler directive or the use of a
  14702.  coprocessor in the Compiler dialog box under the Options menu.
  14703.  
  14704.  
  14705.  100. QP Help: Error: Too Many Nested Conditional Directives
  14706.  
  14707.  Product Version(s): 1.00
  14708.  Operating System:   MS-DOS
  14709.  Flags: ENDUSER | s_error
  14710.  Last Modified: 15-APR-1990    ArticleIdent: Q60521
  14711.  
  14712.  The following information is from the QuickPascal Version 1.00
  14713.  QPERR.HLP help file:
  14714.  
  14715.     Error 108: Too many nested conditional directives
  14716.  
  14717.  A series of conditional statements is nested too deeply.
  14718.  
  14719.  Break the construct into smaller pieces that do not require such deep
  14720.  nesting.
  14721.  
  14722.  
  14723.  101. QP Help: Error: Misplaced Directive
  14724.  
  14725.  Product Version(s): 1.00
  14726.  Operating System:   MS-DOS
  14727.  Flags: ENDUSER | s_error
  14728.  Last Modified: 15-APR-1990    ArticleIdent: Q60522
  14729.  
  14730.  The following information is from the QuickPascal Version 1.00
  14731.  QPERR.HLP help file:
  14732.  
  14733.     Error 109: Misplaced directive
  14734.  
  14735.  This directive is out of sequence or located in the wrong part of the
  14736.  program. Move or delete the directive. For example, an $ENDIF
  14737.  directive must appear after an $IFxx directive.
  14738.  
  14739.  
  14740.  102. QP Help: Error: $ENDIF Directive Missing
  14741.  
  14742.  Product Version(s): 1.00
  14743.  Operating System:   MS-DOS
  14744.  Flags: ENDUSER | s_error
  14745.  Last Modified: 15-APR-1990    ArticleIdent: Q60523
  14746.  
  14747.  The following information is from the QuickPascal Version 1.00
  14748.  QPERR.HLP help file:
  14749.  
  14750.     Error 110: $ENDIF directive missing
  14751.  
  14752.  The $IFxx compiler directive requires an $ENDIF directive to terminate
  14753.  the $IFxx block.
  14754.  
  14755.  Insert the $ENDIF directive at the appropriate location.
  14756.  
  14757.  
  14758.  103. QP Help: Error: Too Many Conditional Symbols
  14759.  
  14760.  Product Version(s): 1.00
  14761.  Operating System:   MS-DOS
  14762.  Flags: ENDUSER | s_error
  14763.  Last Modified: 15-APR-1990    ArticleIdent: Q60524
  14764.  
  14765.  The following information is from the QuickPascal Version 1.00
  14766.  QPERR.HLP help file:
  14767.  
  14768.     Error 111: Too many conditional symbols
  14769.  
  14770.  The number of defined symbols exceeded the maximum in QuickPascal.
  14771.  
  14772.  Use {$UNDEF} to undefine some symbols or to reduce the number of
  14773.  conditional symbols. Use a UNIT or included file, if necessary.
  14774.  
  14775.  
  14776.  104. QP Help: Error: Error in Integer Constant
  14777.  
  14778.  Product Version(s): 1.00
  14779.  Operating System:   MS-DOS
  14780.  Flags: ENDUSER | s_error
  14781.  Last Modified: 15-APR-1990    ArticleIdent: Q60525
  14782.  
  14783.  The following information is from the QuickPascal Version 1.00
  14784.  QPERR.HLP help file:
  14785.  
  14786.     Error 11: Error in integer constant
  14787.  
  14788.  The integer constant at the cursor was not in the range -2147483647 to
  14789.  2147483648.
  14790.  
  14791.  Check that the number is an integer within range.
  14792.  
  14793.  This error occurs when specifying the lowest value in the LongInt
  14794.  range, -2147483648. Use First( LongInt ) to represent this value.
  14795.  
  14796.  
  14797.  105. QP Help: Error: Header Does Not Match Previous Declaration
  14798.  
  14799.  Product Version(s): 1.00
  14800.  Operating System:   MS-DOS
  14801.  Flags: ENDUSER | s_error
  14802.  Last Modified: 15-APR-1990    ArticleIdent: Q60526
  14803.  
  14804.  The following information is from the QuickPascal Version 1.00
  14805.  QPERR.HLP help file:
  14806.  
  14807.     Error 112: Header does not match previous declaration
  14808.  
  14809.  This procedure or function header does not match its original
  14810.  declaration.
  14811.  
  14812.  A procedure or function's first declaration takes precedence over a
  14813.  subsequent header. The headers must match exactly. Change the
  14814.  incorrect header to match the correct one. Cutting and pasting ensures
  14815.  a perfect match.
  14816.  
  14817.  
  14818.  106. QP Help: Error: Invalid Qualification
  14819.  
  14820.  Product Version(s): 1.00
  14821.  Operating System:   MS-DOS
  14822.  Flags: ENDUSER | s_error
  14823.  Last Modified: 15-APR-1990    ArticleIdent: Q60527
  14824.  
  14825.  The following information is from the QuickPascal Version 1.00
  14826.  QPERR.HLP help file:
  14827.  
  14828.     Error 113: Invalid qualification
  14829.  
  14830.  An error occurred in the identifier name used as a qualifier, or the
  14831.  name given to the qualifier is not available within the current scope.
  14832.  
  14833.  Check the spelling of the qualifying name. Make sure that any needed
  14834.  units are specified in the USES statement.
  14835.  
  14836.  
  14837.  107. QP Help: Error: Too Many Parameters
  14838.  
  14839.  Product Version(s): 1.00
  14840.  Operating System:   MS-DOS
  14841.  Flags: ENDUSER | s_error
  14842.  Last Modified: 15-APR-1990    ArticleIdent: Q60528
  14843.  
  14844.  The following information is from the QuickPascal Version 1.00
  14845.  QPERR.HLP help file:
  14846.  
  14847.     Error 114: Too many parameters
  14848.  
  14849.  The size in bytes of passed parameters exceeded 64K.
  14850.  
  14851.  
  14852.  108. QP Help: Error: Class Must Be Defined at Global Level
  14853.  
  14854.  Product Version(s): 1.00
  14855.  Operating System:   MS-DOS
  14856.  Flags: ENDUSER | s_error
  14857.  Last Modified: 15-APR-1990    ArticleIdent: Q60529
  14858.  
  14859.  The following information is from the QuickPascal Version 1.00
  14860.  QPERR.HLP help file:
  14861.  
  14862.     Error 115: Class must be defined at global level
  14863.  
  14864.  A class has been defined locally.
  14865.  
  14866.  Classes must be defined at the beginning of the program (or at the
  14867.  beginning of either the INTERFACE or IMPLEMENTATION sections of a
  14868.  unit) in order to make them global definitions.
  14869.  
  14870.  Move the class definition up with the global level declarations.
  14871.  
  14872.  
  14873.  109. QP Help: Error: Class Must Be Defined in Type Definition
  14874.  
  14875.  Product Version(s): 1.00
  14876.  Operating System:   MS-DOS
  14877.  Flags: ENDUSER | s_error
  14878.  Last Modified: 15-APR-1990    ArticleIdent: Q60530
  14879.  
  14880.  The following information is from the QuickPascal Version 1.00
  14881.  QPERR.HLP help file:
  14882.  
  14883.     Error 116: Class must be defined in type definition
  14884.  
  14885.  Define a class within a TYPE declaration.
  14886.  
  14887.  
  14888.  110. QP Help: Error: Invalid Procedure or Function Reference
  14889.  
  14890.  Product Version(s): 1.00
  14891.  Operating System:   MS-DOS
  14892.  Flags: ENDUSER | s_error
  14893.  Last Modified: 15-APR-1990    ArticleIdent: Q60531
  14894.  
  14895.  The following information is from the QuickPascal Version 1.00
  14896.  QPERR.HLP help file:
  14897.  
  14898.     Error 117: Invalid procedure or function reference
  14899.  
  14900.  An attempt was made to assign a near procedure to a procedure
  14901.  variable.
  14902.  
  14903.  Procedure variables must refer to far procedures.
  14904.  
  14905.  To correct the problem:
  14906.  
  14907.  - Turn on the Far Calls directive under the Compiler option in the
  14908.     Options menu.
  14909.  
  14910.  - Place the procedure declaration between the {$F+} and {$F-}
  14911.    directives.
  14912.  
  14913.  
  14914.  111. QP Help: Error: Procedure or Function Variable Expected
  14915.  
  14916.  Product Version(s): 1.00
  14917.  Operating System:   MS-DOS
  14918.  Flags: ENDUSER | s_error
  14919.  Last Modified: 15-APR-1990    ArticleIdent: Q60532
  14920.  
  14921.  The following information is from the QuickPascal Version 1.00
  14922.  QPERR.HLP help file:
  14923.  
  14924.     Error 118: Procedure or function variable expected
  14925.  
  14926.  The variable must be a procedural-type variable.
  14927.  
  14928.  Check to see that you followed the correct syntax for declaring and
  14929.  typing variables within a parameter list. Remember that returned
  14930.  variables require the VAR keyword.
  14931.  
  14932.  
  14933.  112. QP Help: Error: Object Type Expected
  14934.  
  14935.  Product Version(s): 1.00
  14936.  Operating System:   MS-DOS
  14937.  Flags: ENDUSER | s_error
  14938.  Last Modified: 15-APR-1990    ArticleIdent: Q60567
  14939.  
  14940.  The following information is from the QuickPascal Version 1.00
  14941.  QPERR.HLP help file:
  14942.  
  14943.     Error 119: Object type expected
  14944.  
  14945.  An object type was expected.
  14946.  
  14947.  
  14948.  113. QP Help: Error: Object Must Be Defined at Global Level
  14949.  
  14950.  Product Version(s): 1.00
  14951.  Operating System:   MS-DOS
  14952.  Flags: ENDUSER | s_error
  14953.  Last Modified: 15-APR-1990    ArticleIdent: Q60568
  14954.  
  14955.  The following information is from the QuickPascal Version 1.00
  14956.  QPERR.HLP help file:
  14957.  
  14958.     Error 120: Object must be defined at global level
  14959.  
  14960.  An object has been defined at a level other than a global level.
  14961.  
  14962.  Move the definition up to the same level as global constants and
  14963.  variables.
  14964.  
  14965.  
  14966.  114. QP Help: Error: OBJECT Must Be Defined in Type Definition
  14967.  
  14968.  Product Version(s): 1.00
  14969.  Operating System:   MS-DOS
  14970.  Flags: ENDUSER | s_error
  14971.  Last Modified: 15-APR-1990    ArticleIdent: Q60569
  14972.  
  14973.  The following information is from the QuickPascal Version 1.00
  14974.  QPERR.HLP help file:
  14975.  
  14976.     Error 121: OBJECT must be defined in type definition
  14977.  
  14978.  An occurrence of "OBJECT" has been found outside of a type
  14979.  declaration. The keyword "OBJECT" is reserved for declaring class
  14980.  types.
  14981.  
  14982.     MyClass = (OBJECT)
  14983.         the_data: Integer;
  14984.         Procedure MyClass.MyMethod;
  14985.     END;
  14986.  
  14987.  
  14988.  115. QP Help: Error: Error in Character Constant
  14989.  
  14990.  Product Version(s): 1.00
  14991.  Operating System:   MS-DOS
  14992.  Flags: ENDUSER | s_error
  14993.  Last Modified: 15-APR-1990    ArticleIdent: Q60570
  14994.  
  14995.  The following information is from the QuickPascal Version 1.00
  14996.  QPERR.HLP help file:
  14997.  
  14998.     Error 12: Error in character constant
  14999.  
  15000.  The character constant at the cursor contains an error.
  15001.  
  15002.  Check that the value assigned to the constant is a character data type
  15003.  (not an integer, real, string, or other data type).
  15004.  
  15005.  
  15006.  116. QP Help: Error: Invalid Class Type
  15007.  
  15008.  Product Version(s): 1.00
  15009.  Operating System:   MS-DOS
  15010.  Flags: ENDUSER | s_error
  15011.  Last Modified: 15-APR-1990    ArticleIdent: Q60571
  15012.  
  15013.  The following information is from the QuickPascal Version 1.00
  15014.  QPERR.HLP help file:
  15015.  
  15016.     Error 122: Invalid class type
  15017.  
  15018.  The name of a defined object was invalid.
  15019.  
  15020.  The name of an object cannot be the same as a parent name. For
  15021.  example, the following will cause this error:
  15022.  
  15023.     TYPE
  15024.         my_name = OBJECT( my_name );
  15025.  
  15026.  
  15027.  117. QP Help: Error: Class Table Overflow
  15028.  
  15029.  Product Version(s): 1.00
  15030.  Operating System:   MS-DOS
  15031.  Flags: ENDUSER | s_error
  15032.  Last Modified: 15-APR-1990    ArticleIdent: Q60572
  15033.  
  15034.  The following information is from the QuickPascal Version 1.00
  15035.  QPERR.HLP help file:
  15036.  
  15037.     Error 123: Class table overflow
  15038.  
  15039.  The number of classes that can be stored in the class table has been
  15040.  exceeded.
  15041.  
  15042.  Reduce the number of classes to continue.
  15043.  
  15044.  You may be able to decrease the number of classes by using instances
  15045.  of existing classes.
  15046.  
  15047.  
  15048.  118. QP Help: Error: Syntax Error
  15049.  
  15050.  Product Version(s): 1.00
  15051.  Operating System:   MS-DOS
  15052.  Flags: ENDUSER | s_error
  15053.  Last Modified: 15-APR-1990    ArticleIdent: Q60573
  15054.  
  15055.  The following information is from the QuickPascal Version 1.00
  15056.  QPERR.HLP help file:
  15057.  
  15058.     Error 124: Syntax error
  15059.  
  15060.  The statement is not formed correctly.
  15061.  
  15062.  
  15063.  119. QP Help: Error: This Method Has No Parent
  15064.  
  15065.  Product Version(s): 1.00
  15066.  Operating System:   MS-DOS
  15067.  Flags: ENDUSER | s_error
  15068.  Last Modified: 15-APR-1990    ArticleIdent: Q60574
  15069.  
  15070.  The following information is from the QuickPascal Version 1.00
  15071.  QPERR.HLP help file:
  15072.  
  15073.     Error 125: This method has no parent
  15074.  
  15075.  INHERITED has been applied to a method that has no parent. Either
  15076.  create a parent class with a method to inherit, or do not use the
  15077.  INHERITED keyword.
  15078.  
  15079.  
  15080.  120. QP Help: Error: Type of Expression Must Be POINTER
  15081.  
  15082.  Product Version(s): 1.00
  15083.  Operating System:   MS-DOS
  15084.  Flags: ENDUSER | s_error
  15085.  Last Modified: 15-APR-1990    ArticleIdent: Q60575
  15086.  
  15087.  The following information is from the QuickPascal Version 1.00
  15088.  QPERR.HLP help file:
  15089.  
  15090.     Error 126: Type of expression must be POINTER
  15091.  
  15092.  The expression in the statement must be of a POINTER type.
  15093.  
  15094.  
  15095.  121. QP Help: Error: Invalid Variable Reference
  15096.  
  15097.  Product Version(s): 1.00
  15098.  Operating System:   MS-DOS
  15099.  Flags: ENDUSER | s_error
  15100.  Last Modified: 15-APR-1990    ArticleIdent: Q60576
  15101.  
  15102.  The following information is from the QuickPascal Version 1.00
  15103.  QPERR.HLP help file:
  15104.  
  15105.     Error 127: Invalid variable reference
  15106.  
  15107.  A constant, expression, or function has been applied to a procedure
  15108.  expecting a VAR parameter. Substitute a variable to continue.
  15109.  
  15110.  
  15111.  122. QP Help: Error: Symbol Table Overflow
  15112.  
  15113.  Product Version(s): 1.00
  15114.  Operating System:   MS-DOS
  15115.  Flags: ENDUSER | s_error
  15116.  Last Modified: 15-APR-1990    ArticleIdent: Q60577
  15117.  
  15118.  The following information is from the QuickPascal Version 1.00
  15119.  QPERR.HLP help file:
  15120.  
  15121.     Error 128: Symbol table overflow
  15122.  
  15123.  QuickPascal can only support up to 64K of declared symbols in a unit
  15124.  or program.
  15125.  
  15126.  Avoid symbol table overflow by moving some declarations into another
  15127.  unit.
  15128.  
  15129.  
  15130.  123. QP Help: Error: Too Many Imported Units
  15131.  
  15132.  Product Version(s): 1.00
  15133.  Operating System:   MS-DOS
  15134.  Flags: ENDUSER | s_error
  15135.  Last Modified: 15-APR-1990    ArticleIdent: Q60578
  15136.  
  15137.  The following information is from the QuickPascal Version 1.00
  15138.  QPERR.HLP help file:
  15139.  
  15140.     Error 129: Too many imported units
  15141.  
  15142.  QuickPascal allows up to 81 units to be included in a program. Combine
  15143.  procedures and functions into existing units to reduce the number of
  15144.  total units.
  15145.  
  15146.  
  15147.  124. QP Help: Error: Code Cannot Exceed 64K Bytes
  15148.  
  15149.  Product Version(s): 1.00
  15150.  Operating System:   MS-DOS
  15151.  Flags: ENDUSER | s_error
  15152.  Last Modified: 15-APR-1990    ArticleIdent: Q60579
  15153.  
  15154.  The following information is from the QuickPascal Version 1.00
  15155.  QPERR.HLP help file:
  15156.  
  15157.     Error 130: Code cannot exceed 64K bytes
  15158.  
  15159.  The total size of the code cannot exceed 64K bytes. Split the program
  15160.  into several units to continue.
  15161.  
  15162.  
  15163.  125. QP Help: Error: Invalid Real Operation
  15164.  
  15165.  Product Version(s): 1.00
  15166.  Operating System:   MS-DOS
  15167.  Flags: ENDUSER | s_error
  15168.  Last Modified: 15-APR-1990    ArticleIdent: Q60580
  15169.  
  15170.  The following information is from the QuickPascal Version 1.00
  15171.  QPERR.HLP help file:
  15172.  
  15173.     Error 131: Invalid real operation
  15174.  
  15175.  An operation on two real types in this statement resulted in an
  15176.  invalid floating-point operation. Either an overflow occurred or an
  15177.  attempt was made to divide by zero.
  15178.  
  15179.  
  15180.  126. QP Help: Error: String Constant Exceeds Line
  15181.  
  15182.  Product Version(s): 1.00
  15183.  Operating System:   MS-DOS
  15184.  Flags: ENDUSER | s_error
  15185.  Last Modified: 15-APR-1990    ArticleIdent: Q60581
  15186.  
  15187.  The following information is from the QuickPascal Version 1.00
  15188.  QPERR.HLP help file:
  15189.  
  15190.     Error 13: String constant exceeds line
  15191.  
  15192.  The string is missing a closing quote. A string must be contained on a
  15193.  single line.
  15194.  
  15195.  
  15196.  127. QP Help: Error: Real Overflow
  15197.  
  15198.  Product Version(s): 1.00
  15199.  Operating System:   MS-DOS
  15200.  Flags: ENDUSER | s_error
  15201.  Last Modified: 15-APR-1990    ArticleIdent: Q60582
  15202.  
  15203.  The following information is from the QuickPascal Version 1.00
  15204.  QPERR.HLP help file:
  15205.  
  15206.     Error 132: Real overflow
  15207.  
  15208.  A floating-point operation produced an overflow. Do not exceed the
  15209.  maximum allowed value of a real type.
  15210.  
  15211.  
  15212.  128. QP Help: Error: Real Underflow
  15213.  
  15214.  Product Version(s): 1.00
  15215.  Operating System:   MS-DOS
  15216.  Flags: ENDUSER | s_error
  15217.  Last Modified: 15-APR-1990    ArticleIdent: Q60583
  15218.  
  15219.  The following information is from the QuickPascal Version 1.00
  15220.  QPERR.HLP help file:
  15221.  
  15222.     Error 133: Real underflow
  15223.  
  15224.  A floating-point operation produced an underflow. This error only
  15225.  occurs if you are using the 8087 numeric coprocessor with a control
  15226.  word that unmasks underflow exceptions.
  15227.  
  15228.  
  15229.  129. QP Help: Error: Undefined External
  15230.  
  15231.  Product Version(s): 1.00
  15232.  Operating System:   MS-DOS
  15233.  Flags: ENDUSER | s_error
  15234.  Last Modified: 15-APR-1990    ArticleIdent: Q60584
  15235.  
  15236.  The following information is from the QuickPascal Version 1.00
  15237.  QPERR.HLP help file:
  15238.  
  15239.     Error 134: Undefined external
  15240.  
  15241.  A subprogram has been declared external, but it was not defined by
  15242.  any of the .OBJ files linked in with the program.
  15243.  
  15244.  
  15245.  130. QP Help: Error: Too Many Object File Names
  15246.  
  15247.  Product Version(s): 1.00
  15248.  Operating System:   MS-DOS
  15249.  Flags: ENDUSER | s_error filenames
  15250.  Last Modified: 15-APR-1990    ArticleIdent: Q60585
  15251.  
  15252.  The following information is from the QuickPascal Version 1.00
  15253.  QPERR.HLP help file:
  15254.  
  15255.     Error 135: Too many object file names
  15256.  
  15257.  Too many .OBJ files have been linked in. Reduce the number of object
  15258.  files to link with the program.
  15259.  
  15260.  
  15261.  131. QP Help: Error: Invalid Object File
  15262.  
  15263.  Product Version(s): 1.00
  15264.  Operating System:   MS-DOS
  15265.  Flags: ENDUSER | s_error
  15266.  Last Modified: 15-APR-1990    ArticleIdent: Q60586
  15267.  
  15268.  The following information is from the QuickPascal Version 1.00
  15269.  QPERR.HLP help file:
  15270.  
  15271.     Error 136: Invalid object file
  15272.  
  15273.  The object file that was to be linked contains invalid information.
  15274.  Verify that the file actually is an .OBJ file.
  15275.  
  15276.  
  15277.  132. QP Help: Error: Object File Too Large
  15278.  
  15279.  Product Version(s): 1.00
  15280.  Operating System:   MS-DOS
  15281.  Flags: ENDUSER | s_error
  15282.  Last Modified: 19-APR-1990    ArticleIdent: Q60652
  15283.  
  15284.  The following information is from the QuickPascal Version 1.00
  15285.  QPERR.HLP help file:
  15286.  
  15287.     Error 137: Object file too large
  15288.  
  15289.  The object file that was to be linked is too large. .OBJ files cannot
  15290.  exceed 64K in length.
  15291.  
  15292.  
  15293.  133. QP Help: Error: Invalid Segment Definition
  15294.  
  15295.  Product Version(s): 1.00
  15296.  Operating System:   MS-DOS
  15297.  Flags: ENDUSER | s_error
  15298.  Last Modified: 19-APR-1990    ArticleIdent: Q60653
  15299.  
  15300.  The following information is from the QuickPascal Version 1.00
  15301.  QPERR.HLP help file:
  15302.  
  15303.     Error 138: Invalid segment definition
  15304.  
  15305.  An .OBJ file being read in by the {$L} directive contained one of the
  15306.  following:
  15307.  
  15308.  - The AT combine type
  15309.  
  15310.  - Two code segments, one named CODE and one named CSEG
  15311.  
  15312.  - A data or code segment exactly 64K in size
  15313.  
  15314.  
  15315.  134. QP Help: Error: Invalid Segment Name
  15316.  
  15317.  Product Version(s): 1.00
  15318.  Operating System:   MS-DOS
  15319.  Flags: ENDUSER | s_error
  15320.  Last Modified: 19-APR-1990    ArticleIdent: Q60654
  15321.  
  15322.  The following information is from the QuickPascal Version 1.00
  15323.  QPERR.HLP help file:
  15324.  
  15325.     Error 139: Invalid segment name
  15326.  
  15327.  A segment had an invalid name.
  15328.  
  15329.  A data segment may be named DSEG or DATA. A code segment may be named
  15330.  CSEG or CODE. There can be only one code and one data segment.
  15331.  
  15332.  
  15333.  135. QP Help: Error: Code Segment Too Large
  15334.  
  15335.  Product Version(s): 1.00
  15336.  Operating System:   MS-DOS
  15337.  Flags: ENDUSER | s_error
  15338.  Last Modified: 19-APR-1990    ArticleIdent: Q60655
  15339.  
  15340.  The following information is from the QuickPascal Version 1.00
  15341.  QPERR.HLP help file:
  15342.  
  15343.     Error 140: Code segment too large
  15344.  
  15345.  The code segment is too large. Code segments may not exceed 64K in
  15346.  length. Reduce the size of the segment by splitting the program into
  15347.  several units.
  15348.  
  15349.  
  15350.  136. QP Help: Error: Invalid PUBLIC Definition
  15351.  
  15352.  Product Version(s): 1.00
  15353.  Operating System:   MS-DOS
  15354.  Flags: ENDUSER | s_error
  15355.  Last Modified: 19-APR-1990    ArticleIdent: Q60656
  15356.  
  15357.  The following information is from the QuickPascal Version 1.00
  15358.  QPERR.HLP help file:
  15359.  
  15360.     Error 141: Invalid PUBLIC definition
  15361.  
  15362.  Error 141 occurs when loading .OBJ files with {$L <name>}.
  15363.  
  15364.  A symbol declared as PUBLIC in the .OBJ file is already in the symbol
  15365.  table from a different definition. A name collision has occurred.
  15366.  
  15367.  Change one of the names.
  15368.  
  15369.  
  15370.  137. QP Help: Error: Unexpected End of File
  15371.  
  15372.  Product Version(s): 1.00
  15373.  Operating System:   MS-DOS
  15374.  Flags: ENDUSER | s_error
  15375.  Last Modified: 19-APR-1990    ArticleIdent: Q60657
  15376.  
  15377.  The following information is from the QuickPascal Version 1.00
  15378.  QPERR.HLP help file:
  15379.  
  15380.     Error 14: Unexpected end of file
  15381.  
  15382.  QuickPascal encountered an end-of-file where one was not expected
  15383.  (possibly in the middle of your program code).
  15384.  
  15385.  Check that you remembered the END statement in your source code.
  15386.  Alternately, remove any unintentional nonprinting characters at the
  15387.  cursor with the DEL key, or retype the entire line.
  15388.  
  15389.  
  15390.  138. QP Help: Error: Invalid EXTRN Definition
  15391.  
  15392.  Product Version(s): 1.00
  15393.  Operating System:   MS-DOS
  15394.  Flags: ENDUSER | s_error
  15395.  Last Modified: 19-APR-1990    ArticleIdent: Q60658
  15396.  
  15397.  The following information is from the QuickPascal Version 1.00
  15398.  QPERR.HLP help file:
  15399.  
  15400.     Error 142: Invalid EXTRN definition
  15401.  
  15402.  Error 142 occurs when loading .OBJ files with {$L <name>}.
  15403.  
  15404.  The .OBJ file contains an EXTRN directive that refers to something
  15405.  other than a procedure, function, data item, or typed constant. An
  15406.  EXTRN may not refer to a type, simple constant, absolute variable, or
  15407.  inline procedure or function.
  15408.  
  15409.  
  15410.  139. QP Help: Error: Too Many EXTRNs
  15411.  
  15412.  Product Version(s): 1.00
  15413.  Operating System:   MS-DOS
  15414.  Flags: ENDUSER | s_error
  15415.  Last Modified: 19-APR-1990    ArticleIdent: Q60659
  15416.  
  15417.  The following information is from the QuickPascal Version 1.00
  15418.  QPERR.HLP help file:
  15419.  
  15420.     Error 143: Too many EXTRNs
  15421.  
  15422.  Error 143 occurs when loading .OBJ files with {$L <name>}.
  15423.  
  15424.  An .OBJ file exceeded the QuickPascal limit of 512 EXTRN definitions
  15425.  per .OBJ file.
  15426.  
  15427.  
  15428.  140. QP Help: Error: Invalid Fixup
  15429.  
  15430.  Product Version(s): 1.00
  15431.  Operating System:   MS-DOS
  15432.  Flags: ENDUSER | s_error
  15433.  Last Modified: 19-APR-1990    ArticleIdent: Q60660
  15434.  
  15435.  The following information is from the QuickPascal Version 1.00
  15436.  QPERR.HLP help file:
  15437.  
  15438.     Error 144: Invalid fixup
  15439.  
  15440.  Error 144 occurs when loading .OBJ files with {$L <name>}.
  15441.  
  15442.  An .OBJ file may not contain fixup records on byte values or fixups in
  15443.  the data segment. Such fixups are likely to occur if data is
  15444.  initialized to point to code. An .OBJ file may not contain initialized
  15445.  data.
  15446.  
  15447.  
  15448.  141. QP Help: Error: Too Many Opened Files
  15449.  
  15450.  Product Version(s): 1.00
  15451.  Operating System:   MS-DOS
  15452.  Flags: ENDUSER | s_error
  15453.  Last Modified: 19-APR-1990    ArticleIdent: Q60661
  15454.  
  15455.  The following information is from the QuickPascal Version 1.00
  15456.  QPERR.HLP help file:
  15457.  
  15458.     Error 145: Too many opened files
  15459.  
  15460.  Compilation has exceeded the number of available DOS file handles.
  15461.  
  15462.  File handles are taken up by used units and by files included with the
  15463.  {$I} directive. Reduce the number of files in a single compilation, or
  15464.  increase the number of available handles by putting the following in
  15465.  CONFIG.SYS:
  15466.  
  15467.     FILES=20
  15468.  
  15469.  TSR (terminate-and-stay-resident) programs may use up file handles.
  15470.  Remove resident software, then recompile.
  15471.  
  15472.  
  15473.  142. QP Help: Error: Too Many Variables
  15474.  
  15475.  Product Version(s): 1.00
  15476.  Operating System:   MS-DOS
  15477.  Flags: ENDUSER | s_error
  15478.  Last Modified: 19-APR-1990    ArticleIdent: Q60662
  15479.  
  15480.  The following information is from the QuickPascal Version 1.00
  15481.  QPERR.HLP help file:
  15482.  
  15483.     Error 146: Too many variables
  15484.  
  15485.  Storage size of all variables exceeded the capacity of the data
  15486.  segment.
  15487.  
  15488.  Variables and typed constants are stored in the data segment along
  15489.  with program data. The data segment may not exceed 64K.
  15490.  
  15491.  Use dynamic allocation (New or GetMem) to place data on the heap.
  15492.  
  15493.  
  15494.  143. QP Help: Error: Directive Must Be At Top of Program
  15495.  
  15496.  Product Version(s): 1.00
  15497.  Operating System:   MS-DOS
  15498.  Flags: ENDUSER | s_error
  15499.  Last Modified: 19-APR-1990    ArticleIdent: Q60663
  15500.  
  15501.  The following information is from the QuickPascal Version 1.00
  15502.  QPERR.HLP help file:
  15503.  
  15504.     Error 147: Directive must be at top of program
  15505.  
  15506.  A global compiler directive was located after the beginning of the
  15507.  declaration of a program or unit.
  15508.  
  15509.  Global compiler directives must precede the implementation section in
  15510.  a unit. In a program, they must precede the first declaration,
  15511.  appearing before any CONST, TYPE, VAR, PROCEDURE, or FUNCTION. Global
  15512.  compiler directives are usually located immediately after any USES
  15513.  statements.
  15514.  
  15515.  
  15516.  144. QP Help: Error: Invalid Directive
  15517.  
  15518.  Product Version(s): 1.00
  15519.  Operating System:   MS-DOS
  15520.  Flags: ENDUSER | s_error
  15521.  Last Modified: 19-APR-1990    ArticleIdent: Q60664
  15522.  
  15523.  The following information is from the QuickPascal Version 1.00
  15524.  QPERR.HLP help file:
  15525.  
  15526.     Error 15: Invalid directive
  15527.  
  15528.  The directive at the cursor is not a valid QuickPascal compiler
  15529.  directive.
  15530.  
  15531.  Verify that the directive uses the correct syntax (see the Directives
  15532.  entry in the Contents help screen).
  15533.  
  15534.  
  15535.  145. QP Help: Error: Invalid Assignment
  15536.  
  15537.  Product Version(s): 1.00
  15538.  Operating System:   MS-DOS
  15539.  Flags: ENDUSER | s_error
  15540.  Last Modified: 19-APR-1990    ArticleIdent: Q60665
  15541.  
  15542.  The following information is from the QuickPascal Version 1.00
  15543.  QPERR.HLP help file:
  15544.  
  15545.     Error 148: Invalid assignment
  15546.  
  15547.  An assignment was made to an invalid type.
  15548.  
  15549.  Variables of type FILE and Text cannot be assigned to directly.
  15550.  
  15551.  
  15552.  146. QP Help: Error: Set Type Out of Range
  15553.  
  15554.  Product Version(s): 1.00
  15555.  Operating System:   MS-DOS
  15556.  Flags: ENDUSER | s_error
  15557.  Last Modified: 19-APR-1990    ArticleIdent: Q60666
  15558.  
  15559.  The following information is from the QuickPascal Version 1.00
  15560.  QPERR.HLP help file:
  15561.  
  15562.     Error 149: Set type out of range
  15563.  
  15564.  The base type of a set exceeded the limit of a set.
  15565.  
  15566.  A set may have only 256 elements. Its base type must be a subrange
  15567.  within 0..255, or an enumerated type with no more than 256 values.
  15568.  Base types of ShortInt, Integer, LongInt, or Word are not permitted.
  15569.  
  15570.  
  15571.  147. QP Help: Error: Index Out of Range
  15572.  
  15573.  Product Version(s): 1.00
  15574.  Operating System:   MS-DOS
  15575.  Flags: ENDUSER | s_error
  15576.  Last Modified: 19-APR-1990    ArticleIdent: Q60667
  15577.  
  15578.  The following information is from the QuickPascal Version 1.00
  15579.  QPERR.HLP help file:
  15580.  
  15581.     Error 150: Index out of range
  15582.  
  15583.  The index of an array variable declaration specified an invalid number
  15584.  of elements.
  15585.  
  15586.  The range of the index type of an array determines the number of
  15587.  elements in the array. Using a LongInt subrange as an array index will
  15588.  cause this error. Each array must fit within a single 64K segment. An
  15589.  array declared with this index range would exceed the maximum size for
  15590.  an array, no matter what type of element.
  15591.  
  15592.  
  15593.  148. QP Help: Error: Object Variable Expected in Member Function
  15594.  
  15595.  Product Version(s): 1.00
  15596.  Operating System:   MS-DOS
  15597.  Flags: ENDUSER | s_error
  15598.  Last Modified: 19-APR-1990    ArticleIdent: Q60668
  15599.  
  15600.  The following information is from the QuickPascal Version 1.00
  15601.  QPERR.HLP help file:
  15602.  
  15603.     Error 151: Object variable expected in Member function
  15604.  
  15605.  The variable passed as the first argument to the Member function was
  15606.  not an object.
  15607.  
  15608.  
  15609.  149. QP Help: Error: Object Type Expected in Member Function
  15610.  
  15611.  Product Version(s): 1.00
  15612.  Operating System:   MS-DOS
  15613.  Flags: ENDUSER | s_error
  15614.  Last Modified: 19-APR-1990    ArticleIdent: Q60669
  15615.  
  15616.  The following information is from the QuickPascal Version 1.00
  15617.  QPERR.HLP help file:
  15618.  
  15619.     Error 152: Object type expected in Member function
  15620.  
  15621.  The type passed as the second argument to the Member function was not
  15622.  a class.
  15623.  
  15624.  
  15625.  150. QP Help: Error: Expression Too Complicated
  15626.  
  15627.  Product Version(s): 1.00
  15628.  Operating System:   MS-DOS
  15629.  Flags: ENDUSER | s_error
  15630.  Last Modified: 19-APR-1990    ArticleIdent: Q60670
  15631.  
  15632.  The following information is from the QuickPascal Version 1.00
  15633.  QPERR.HLP help file:
  15634.  
  15635.     Error 153: Expression too complicated
  15636.  
  15637.  An expression contains too many terms.
  15638.  
  15639.  Break up the complex expression into simpler expressions.
  15640.  
  15641.  
  15642.  151. QP Help: Error: Line Information Table Overflow
  15643.  
  15644.  Product Version(s): 1.00
  15645.  Operating System:   MS-DOS
  15646.  Flags: ENDUSER | s_error
  15647.  Last Modified: 19-APR-1990    ArticleIdent: Q60671
  15648.  
  15649.  The following information is from the QuickPascal Version 1.00
  15650.  QPERR.HLP help file:
  15651.  
  15652.     Error 155: Line information table overflow
  15653.  
  15654.  The storage capacity for debug information was exceeded.
  15655.  
  15656.  The QuickPascal debugger can keep track of up to 16K source lines.
  15657.  
  15658.  Turn off the debugger with the {$D-} directive, or compile some source
  15659.  files without debugger information.
  15660.  
  15661.  
  15662.  152. QP Help: Error: Fixup Table Overflow
  15663.  
  15664.  Product Version(s): 1.00
  15665.  Operating System:   MS-DOS
  15666.  Flags: ENDUSER | s_error
  15667.  Last Modified: 19-APR-1990    ArticleIdent: Q60787
  15668.  
  15669.  The following information is from the QuickPascal Version 1.00
  15670.  QPERR.HLP help file:
  15671.  
  15672.     Error 156: Fixup table overflow
  15673.  
  15674.  A program may only have 16K fixups.
  15675.  
  15676.  
  15677.  153. QP Help: Error: Source Table Overflow
  15678.  
  15679.  Product Version(s): 1.00
  15680.  Operating System:   MS-DOS
  15681.  Flags: ENDUSER | s_error
  15682.  Last Modified: 19-APR-1990    ArticleIdent: Q60788
  15683.  
  15684.  The following information is from the QuickPascal Version 1.00
  15685.  QPERR.HLP help file:
  15686.  
  15687.     Error 157: Source table overflow
  15688.  
  15689.  The storage capacity for source file names was exceeded.
  15690.  
  15691.  QuickPascal allows a maximum of 2K of memory to keep track of the
  15692.  names of source files used in a program.
  15693.  
  15694.  Combine some files, or rename files with shorter names.
  15695.  
  15696.  
  15697.  154. QP Help: Error: Unit Expected
  15698.  
  15699.  Product Version(s): 1.00
  15700.  Operating System:   MS-DOS
  15701.  Flags: ENDUSER | s_error
  15702.  Last Modified: 19-APR-1990    ArticleIdent: Q60789
  15703.  
  15704.  The following information is from the QuickPascal Version 1.00
  15705.  QPERR.HLP help file:
  15706.  
  15707.     Error 158: Unit expected
  15708.  
  15709.  A USES clause in a program called for a file that did not contain a
  15710.  UNIT heading.
  15711.  
  15712.  A used file must begin with a heading:
  15713.  
  15714.     UNIT <identifier>;
  15715.  
  15716.  
  15717.  155. QP Help: Error: End of File Expected
  15718.  
  15719.  Product Version(s): 1.00
  15720.  Operating System:   MS-DOS
  15721.  Flags: ENDUSER | s_error
  15722.  Last Modified: 19-APR-1990    ArticleIdent: Q60790
  15723.  
  15724.  The following information is from the QuickPascal Version 1.00
  15725.  QPERR.HLP help file:
  15726.  
  15727.     Error 16: End of file expected
  15728.  
  15729.  QuickPascal expects an end-of-file at the cursor location.
  15730.  
  15731.  Move or delete everything after the END statement.
  15732.  
  15733.  
  15734.  156. QP Help: Error: Unsatisfied Forward Name Reference
  15735.  
  15736.  Product Version(s): 1.00
  15737.  Operating System:   MS-DOS
  15738.  Flags: ENDUSER | s_error
  15739.  Last Modified: 19-APR-1990    ArticleIdent: Q60791
  15740.  
  15741.  The following information is from the QuickPascal Version 1.00
  15742.  QPERR.HLP help file:
  15743.  
  15744.     Error 159: Unsatisfied forward name reference
  15745.  
  15746.  A type declaration was used but never defined.
  15747.  
  15748.  
  15749.  157. QP Help: Error: Invalid Fixup in Iterated Data
  15750.  
  15751.  Product Version(s): 1.00
  15752.  Operating System:   MS-DOS
  15753.  Flags: ENDUSER | s_error
  15754.  Last Modified: 19-APR-1990    ArticleIdent: Q60792
  15755.  
  15756.  The following information is from the QuickPascal Version 1.00
  15757.  QPERR.HLP help file:
  15758.  
  15759.     Error 160: Invalid fixup in iterated data
  15760.  
  15761.  A fixup cannot occur in an iterated data record.
  15762.  
  15763.  Check the assembly files for a relocatable reference inside a DUP
  15764.  record.
  15765.  
  15766.  
  15767.  158. QP Help: Error: Include Files Not Allowed Here
  15768.  
  15769.  Product Version(s): 1.00
  15770.  Operating System:   MS-DOS
  15771.  Flags: ENDUSER | s_error
  15772.  Last Modified: 19-APR-1990    ArticleIdent: Q60793
  15773.  
  15774.  The following information is from the QuickPascal Version 1.00
  15775.  QPERR.HLP help file:
  15776.  
  15777.     Error 161: Include files not allowed here
  15778.  
  15779.  A file was included inside of a statement.
  15780.  
  15781.  Files cannot be included within a statement.
  15782.  
  15783.  
  15784.  159. QP Help: Error: Stack Overflow
  15785.  
  15786.  Product Version(s): 1.00
  15787.  Operating System:   MS-DOS
  15788.  Flags: ENDUSER | s_error
  15789.  Last Modified: 19-APR-1990    ArticleIdent: Q60794
  15790.  
  15791.  The following information is from the QuickPascal Version 1.00
  15792.  QPERR.HLP help file:
  15793.  
  15794.     Error 162: Stack overflow
  15795.  
  15796.  A stack overflow occurred during the link process.
  15797.  
  15798.  
  15799.  160. QP Help: Run-Time Error: File Does Not Exist
  15800.  
  15801.  Product Version(s): 1.00
  15802.  Operating System:   MS-DOS
  15803.  Flags: ENDUSER | s_error
  15804.  Last Modified: 19-APR-1990    ArticleIdent: Q60795
  15805.  
  15806.  The following information is from the QuickPascal Version 1.00
  15807.  QPERR.HLP help file:
  15808.  
  15809.     Run-Time Error 2: File does not exist
  15810.  
  15811.  No file exists by the name assigned to the file variable.
  15812.  
  15813.  When a file variable that has been assigned the name of a nonexistent
  15814.  file is passed to the Append, Erase, Rename, or Reset procedures, this
  15815.  error occurs.
  15816.  
  15817.  
  15818.  161. QP Help: Run-Time Error: Path Does Not Exist
  15819.  
  15820.  Product Version(s): 1.00
  15821.  Operating System:   MS-DOS
  15822.  Flags: ENDUSER | s_error
  15823.  Last Modified: 19-APR-1990    ArticleIdent: Q60796
  15824.  
  15825.  The following information is from the QuickPascal Version 1.00
  15826.  QPERR.HLP help file:
  15827.  
  15828.     Run-Time Error 3: Path does not exist
  15829.  
  15830.  The specified path name does not exist.
  15831.  
  15832.  When a file variable that has been assigned an invalid file name or a
  15833.  name of a nonexistent subdirectory is passed to the Append, Erase,
  15834.  Rename, Reset, or Rewrite procedures, this error occurs. It also
  15835.  occurs when the path passed to ChDir, MkDir, or RmDir is not valid or
  15836.  does not exist.
  15837.  
  15838.  
  15839.  162. QP Help: Run-Time Error: Out of File Handles
  15840.  
  15841.  Product Version(s): 1.00
  15842.  Operating System:   MS-DOS
  15843.  Flags: ENDUSER | s_error
  15844.  Last Modified: 19-APR-1990    ArticleIdent: Q60797
  15845.  
  15846.  The following information is from the QuickPascal Version 1.00
  15847.  QPERR.HLP help file:
  15848.  
  15849.     Run-Time Error 4: Out of file handles
  15850.  
  15851.  The program ran out of DOS file handles when it tried to open a file.
  15852.  This probably occurred during a call to the Append, Reset, or Rewrite
  15853.  procedures.
  15854.  
  15855.  Increase the setting in CONFIG.SYS to FILES=20, or reduce the number
  15856.  of files open at any one time. QuickPascal may use some file handles;
  15857.  try to run the program outside the QuickPascal environment.
  15858.  
  15859.  TSR (terminate-and-stay-resident) programs may use up file handles.
  15860.  Remove resident software, then run the program.
  15861.  
  15862.  
  15863.  163. QP Help: Run-Time Error: Invalid File Access
  15864.  
  15865.  Product Version(s): 1.00
  15866.  Operating System:   MS-DOS
  15867.  Flags: ENDUSER | s_error
  15868.  Last Modified: 19-APR-1990    ArticleIdent: Q60798
  15869.  
  15870.  The following information is from the QuickPascal Version 1.00
  15871.  QPERR.HLP help file:
  15872.  
  15873.     Run-Time Error 5: Invalid file access
  15874.  
  15875.  The procedures Append, ChDir, Erase, MkDir, Rename, Reset, Rewrite, or
  15876.  RmDir generate this error upon attempting to:
  15877.  
  15878.    - Read from a write-only file
  15879.    - Write to a read-only file or a directory name
  15880.    - Write to or create a file or directory on a full disk
  15881.    - Create a directory by an existing name
  15882.    - Rename a file to an existing name
  15883.    - Rename a directory
  15884.    - Remove a read-only file, a nonexistent file, the root directory,
  15885.      or a non-empty or nonexistent directory
  15886.  
  15887.  
  15888.  164. QP Help: Run-Time Error: Invalid File Handle
  15889.  
  15890.  Product Version(s): 1.00
  15891.  Operating System:   MS-DOS
  15892.  Flags: ENDUSER | s_error
  15893.  Last Modified: 19-APR-1990    ArticleIdent: Q60799
  15894.  
  15895.  The following information is from the QuickPascal Version 1.00
  15896.  QPERR.HLP help file:
  15897.  
  15898.     Run-Time Error 6: Invalid file handle
  15899.  
  15900.  A file handle that was somehow invalid was passed to DOS.
  15901.  
  15902.  This may mean that an area of memory was overwritten.
  15903.  
  15904.  
  15905.  165. QP Help: Run-Time Error: Invalid Access Code
  15906.  
  15907.  Product Version(s): 1.00
  15908.  Operating System:   MS-DOS
  15909.  Flags: ENDUSER | s_error
  15910.  Last Modified: 19-APR-1990    ArticleIdent: Q60800
  15911.  
  15912.  The following information is from the QuickPascal Version 1.00
  15913.  QPERR.HLP help file:
  15914.  
  15915.     Run-Time Error 12: Invalid access code
  15916.  
  15917.  The Append or Reset procedures found an invalid access code in
  15918.  FileMode.
  15919.  
  15920.  
  15921.  166. QP Help: Error: Identifier Expected
  15922.  
  15923.  Product Version(s): 1.00
  15924.  Operating System:   MS-DOS
  15925.  Flags: ENDUSER | s_error
  15926.  Last Modified: 19-APR-1990    ArticleIdent: Q60801
  15927.  
  15928.  The following information is from the QuickPascal Version 1.00
  15929.  QPERR.HLP help file:
  15930.  
  15931.     Error 17: Identifier expected
  15932.  
  15933.  The syntax of the current line requires an identifier of some kind.
  15934.  
  15935.  An identifer is a name of a constant, type, variable, procedure, or
  15936.  function.
  15937.  
  15938.  Add an appropriate identifier to the line.
  15939.  
  15940.  
  15941.  167. QP Help: Run-Time Error: Invalid Drive Value
  15942.  
  15943.  Product Version(s): 1.00
  15944.  Operating System:   MS-DOS
  15945.  Flags: ENDUSER | s_error
  15946.  Last Modified: 19-APR-1990    ArticleIdent: Q60802
  15947.  
  15948.  The following information is from the QuickPascal Version 1.00
  15949.  QPERR.HLP help file:
  15950.  
  15951.     Run-Time Error 15: Invalid drive value
  15952.  
  15953.  A procedure was passed an invalid value for a drive.
  15954.  
  15955.  The ChDir and GetDir procedures give this error if passed an invalid
  15956.  drive specification.
  15957.  
  15958.  
  15959.  168. QP Help: Run-Time Error: Current Directory May Not Be Deleted
  15960.  
  15961.  Product Version(s): 1.00
  15962.  Operating System:   MS-DOS
  15963.  Flags: ENDUSER | s_error
  15964.  Last Modified: 19-APR-1990    ArticleIdent: Q60803
  15965.  
  15966.  The following information is from the QuickPascal Version 1.00
  15967.  QPERR.HLP help file:
  15968.  
  15969.     Run-Time Error 16: Current directory may not be deleted
  15970.  
  15971.  The RmDir procedure was passed a path that represents the current
  15972.  directory.
  15973.  
  15974.  
  15975.  169. QP Help: Run-Time Error: Rename Must Occur on Same Drive
  15976.  
  15977.  Product Version(s): 1.00
  15978.  Operating System:   MS-DOS
  15979.  Flags: ENDUSER | s_error
  15980.  Last Modified: 19-APR-1990    ArticleIdent: Q60804
  15981.  
  15982.  The following information is from the QuickPascal Version 1.00
  15983.  QPERR.HLP help file:
  15984.  
  15985.     Run-Time Error 17: Rename must occur on same drive
  15986.  
  15987.  The Rename procedure was passed file names with different drive
  15988.  specifications.
  15989.  
  15990.  
  15991.  170. QP Help: Run-Time Error: Error in Reading Disk
  15992.  
  15993.  Product Version(s): 1.00
  15994.  Operating System:   MS-DOS
  15995.  Flags: ENDUSER | s_error
  15996.  Last Modified: 19-APR-1990    ArticleIdent: Q60805
  15997.  
  15998.  The following information is from the QuickPascal Version 1.00
  15999.  QPERR.HLP help file:
  16000.  
  16001.     Run-Time Error 100: Error in reading disk
  16002.  
  16003.  The current position was at the end-of-file when an attempt was made
  16004.  to read from a file.
  16005.  
  16006.  
  16007.  171. QP Help: Run-Time Error: Error in Writing to Disk
  16008.  
  16009.  Product Version(s): 1.00
  16010.  Operating System:   MS-DOS
  16011.  Flags: ENDUSER | s_error
  16012.  Last Modified: 19-APR-1990    ArticleIdent: Q60806
  16013.  
  16014.  The following information is from the QuickPascal Version 1.00
  16015.  QPERR.HLP help file:
  16016.  
  16017.     Run-Time Error 101: Error in writing to disk
  16018.  
  16019.  The disk was full when an attempt was made to write to a file.
  16020.  
  16021.  
  16022.  172. QP Help: Run-Time Error: File Not Yet Assigned
  16023.  
  16024.  Product Version(s): 1.00
  16025.  Operating System:   MS-DOS
  16026.  Flags: ENDUSER | s_error
  16027.  Last Modified: 19-APR-1990    ArticleIdent: Q60809
  16028.  
  16029.  The following information is from the QuickPascal Version 1.00
  16030.  QPERR.HLP help file:
  16031.  
  16032.     Run-Time Error 102: File not yet assigned
  16033.  
  16034.  The Append, Erase, Rename, Reset, or Rewrite procedures were passed a
  16035.  file variable that had not been assigned to a filename by the Assign
  16036.  procedure.
  16037.  
  16038.  
  16039.  173. QP Help: Run-Time Error: File Not Open
  16040.  
  16041.  Product Version(s): 1.00
  16042.  Operating System:   MS-DOS
  16043.  Flags: ENDUSER | s_error
  16044.  Last Modified: 19-APR-1990    ArticleIdent: Q60810
  16045.  
  16046.  The following information is from the QuickPascal Version 1.00
  16047.  QPERR.HLP help file:
  16048.  
  16049.     Run-Time Error 103: File not open
  16050.  
  16051.  An I/O operation was attempted on an unopened file.
  16052.  
  16053.  
  16054.  174. QP Help: Run-Time Error: File Not Opened for Input
  16055.  
  16056.  Product Version(s): 1.00
  16057.  Operating System:   MS-DOS
  16058.  Flags: ENDUSER | s_error
  16059.  Last Modified: 19-APR-1990    ArticleIdent: Q60811
  16060.  
  16061.  The following information is from the QuickPascal Version 1.00
  16062.  QPERR.HLP help file:
  16063.  
  16064.     Run-Time Error 104: File not opened for input
  16065.  
  16066.  An attempt was made to read from a file that was not opened or was
  16067.  opened for output only.
  16068.  
  16069.  
  16070.  175. QP Help: Run-Time Error: File Not Opened for Output
  16071.  
  16072.  Product Version(s): 1.00
  16073.  Operating System:   MS-DOS
  16074.  Flags: ENDUSER | s_error
  16075.  Last Modified: 19-APR-1990    ArticleIdent: Q60812
  16076.  
  16077.  The following information is from the QuickPascal Version 1.00
  16078.  QPERR.HLP help file:
  16079.  
  16080.     Run-Time Error 105: File not opened for output
  16081.  
  16082.  An attempt was made to write to a file that was not opened or was
  16083.  opened for input only.
  16084.  
  16085.  
  16086.  176. QP Help: Run-Time Error: Invalid Numeric Input
  16087.  
  16088.  Product Version(s): 1.00
  16089.  Operating System:   MS-DOS
  16090.  Flags: ENDUSER | s_error
  16091.  Last Modified: 19-APR-1990    ArticleIdent: Q60813
  16092.  
  16093.  The following information is from the QuickPascal Version 1.00
  16094.  QPERR.HLP help file:
  16095.  
  16096.     Run-Time Error 106: Invalid numeric input
  16097.  
  16098.  The numeric format of an input value read by the Read or Readln
  16099.  procedures was invalid.
  16100.  
  16101.  
  16102.  177. QP Help: Error: ";" Expected
  16103.  
  16104.  Product Version(s): 1.00
  16105.  Operating System:   MS-DOS
  16106.  Flags: ENDUSER | s_error
  16107.  Last Modified: 19-APR-1990    ArticleIdent: Q60814
  16108.  
  16109.  The following information is from the QuickPascal Version 1.00
  16110.  QPERR.HLP help file:
  16111.  
  16112.     Error 18: ";" expected
  16113.  
  16114.  QuickPascal expected a semicolon at or before the current cursor
  16115.  location.
  16116.  
  16117.  Insert a semicolon at or before the current cursor location, or at
  16118.  the end of the previous line.
  16119.  
  16120.  
  16121.  178. QP Help: Run-Time Error: Write-Protected Disk
  16122.  
  16123.  Product Version(s): 1.00
  16124.  Operating System:   MS-DOS
  16125.  Flags: ENDUSER | s_error
  16126.  Last Modified: 19-APR-1990    ArticleIdent: Q60815
  16127.  
  16128.  The following information is from the QuickPascal Version 1.00
  16129.  QPERR.HLP help file:
  16130.  
  16131.     Run-Time Error 150: Write-protected disk
  16132.  
  16133.  An attempt was made to write to a write-protected disk.
  16134.  
  16135.  
  16136.  179. QP Help: Run-Time Error: Unknown Unit
  16137.  
  16138.  Product Version(s): 1.00
  16139.  Operating System:   MS-DOS
  16140.  Flags: ENDUSER | s_error
  16141.  Last Modified: 19-APR-1990    ArticleIdent: Q60816
  16142.  
  16143.  The following information is from the QuickPascal Version 1.00
  16144.  QPERR.HLP help file:
  16145.  
  16146.     Run-Time Error 151: Unknown unit
  16147.  
  16148.  An I/O operation was directed to a drive or device that does not
  16149.  exist.
  16150.  
  16151.  
  16152.  180. QP Help: Run-Time Error: Drive or Device Not Ready
  16153.  
  16154.  Product Version(s): 1.00
  16155.  Operating System:   MS-DOS
  16156.  Flags: ENDUSER | s_error
  16157.  Last Modified: 19-APR-1990    ArticleIdent: Q60817
  16158.  
  16159.  The following information is from the QuickPascal Version 1.00
  16160.  QPERR.HLP help file:
  16161.  
  16162.     Run-Time Error 152: Drive or device not ready
  16163.  
  16164.  An I/O operation was directed to a drive that did not contain a floppy
  16165.  or whose door was not closed, or to a device that is unable to service
  16166.  the request.
  16167.  
  16168.  
  16169.  181. QP Help: Run-Time Error: Invalid Command
  16170.  
  16171.  Product Version(s): 1.00
  16172.  Operating System:   MS-DOS
  16173.  Flags: ENDUSER | s_error
  16174.  Last Modified: 19-APR-1990    ArticleIdent: Q60818
  16175.  
  16176.  The following information is from the QuickPascal Version 1.00
  16177.  QPERR.HLP help file:
  16178.  
  16179.     Run-Time Error 153: Invalid command
  16180.  
  16181.  The operating system did not recognize a command that was passed to
  16182.  it.
  16183.  
  16184.  
  16185.  182. QP Help: Run-Time Error: Data Error (CRC)
  16186.  
  16187.  Product Version(s): 1.00
  16188.  Operating System:   MS-DOS
  16189.  Flags: ENDUSER | s_error
  16190.  Last Modified: 19-APR-1990    ArticleIdent: Q60819
  16191.  
  16192.  The following information is from the QuickPascal Version 1.00
  16193.  QPERR.HLP help file:
  16194.  
  16195.     Run-Time Error 154: Data error (CRC)
  16196.  
  16197.  A disk sector contained a CRC error.
  16198.  
  16199.  
  16200.  183. QP Help: Run-Time Error: Length of Request Structure Invalid
  16201.  
  16202.  Product Version(s): 1.00
  16203.  Operating System:   MS-DOS
  16204.  Flags: ENDUSER | s_error
  16205.  Last Modified: 19-APR-1990    ArticleIdent: Q60820
  16206.  
  16207.  The following information is from the QuickPascal Version 1.00
  16208.  QPERR.HLP help file:
  16209.  
  16210.     Run-Time Error 155: Length of request structure invalid
  16211.  
  16212.  An invalid length was used in a disk operation.
  16213.  
  16214.  
  16215.  184. QP Help: Run-Time Error: Seek Error
  16216.  
  16217.  Product Version(s): 1.00
  16218.  Operating System:   MS-DOS
  16219.  Flags: ENDUSER | s_error
  16220.  Last Modified: 19-APR-1990    ArticleIdent: Q60821
  16221.  
  16222.  The following information is from the QuickPascal Version 1.00
  16223.  QPERR.HLP help file:
  16224.  
  16225.     Run-Time Error 156: Seek error
  16226.  
  16227.  A DOS error occurred during a seek operation.
  16228.  
  16229.  
  16230.  185. QP Help: Run-Time Error: Non-MS-DOS Disk
  16231.  
  16232.  Product Version(s): 1.00
  16233.  Operating System:   MS-DOS
  16234.  Flags: ENDUSER | s_error
  16235.  Last Modified: 19-APR-1990    ArticleIdent: Q60822
  16236.  
  16237.  The following information is from the QuickPascal Version 1.00
  16238.  QPERR.HLP help file:
  16239.  
  16240.     Run-Time Error 157: Non-MS-DOS disk
  16241.  
  16242.  An I/O operation was directed to a disk that is not formatted or is
  16243.  formatted for a different system.
  16244.  
  16245.  
  16246.  186. QP Help: Run-Time Error: Sector Not Found
  16247.  
  16248.  Product Version(s): 1.00
  16249.  Operating System:   MS-DOS
  16250.  Flags: ENDUSER | s_error
  16251.  Last Modified: 19-APR-1990    ArticleIdent: Q60823
  16252.  
  16253.  The following information is from the QuickPascal Version 1.00
  16254.  QPERR.HLP help file:
  16255.  
  16256.     Run-Time Error 158: Sector not found
  16257.  
  16258.  A nonexistent sector was requested in a disk operation.
  16259.  
  16260.  
  16261.  187. QP Help: Run-Time Error: Printer Out of Paper
  16262.  
  16263.  Product Version(s): 1.00
  16264.  Operating System:   MS-DOS
  16265.  Flags: ENDUSER | s_error
  16266.  Last Modified: 19-APR-1990    ArticleIdent: Q60824
  16267.  
  16268.  The following information is from the QuickPascal Version 1.00
  16269.  QPERR.HLP help file:
  16270.  
  16271.     Run-Time Error 159: Printer out of paper
  16272.  
  16273.  An operation was directed to a printer that has no paper.
  16274.  
  16275.  
  16276.  188. QP Help: Error: ")" Expected
  16277.  
  16278.  Product Version(s): 1.00
  16279.  Operating System:   MS-DOS
  16280.  Flags: ENDUSER | s_error
  16281.  Last Modified: 19-APR-1990    ArticleIdent: Q60825
  16282.  
  16283.  The following information is from the QuickPascal Version 1.00
  16284.  QPERR.HLP help file:
  16285.  
  16286.     Error 19: ")" expected
  16287.  
  16288.  QuickPascal found an opening parenthesis but cannot find a matching
  16289.  closing parenthesis.
  16290.  
  16291.  Check for balanced parentheses in lists, enumerated types, arrays,
  16292.  record initializations, and in expressions that use parentheses.
  16293.  Insert a ")" where you want the list or expression to end.
  16294.  
  16295.  
  16296.  189. QP Help: Run-Time Error: Write Fault
  16297.  
  16298.  Product Version(s): 1.00
  16299.  Operating System:   MS-DOS
  16300.  Flags: ENDUSER | s_error
  16301.  Last Modified: 19-APR-1990    ArticleIdent: Q60826
  16302.  
  16303.  The following information is from the QuickPascal Version 1.00
  16304.  QPERR.HLP help file:
  16305.  
  16306.     Run-Time Error 160: Write fault
  16307.  
  16308.  A hardware error occurred.
  16309.  
  16310.  
  16311.  190. QP Help: Run-Time Error: Read Fault
  16312.  
  16313.  Product Version(s): 1.00
  16314.  Operating System:   MS-DOS
  16315.  Flags: ENDUSER | s_error
  16316.  Last Modified: 19-APR-1990    ArticleIdent: Q60827
  16317.  
  16318.  The following information is from the QuickPascal Version 1.00
  16319.  QPERR.HLP help file:
  16320.  
  16321.     Run-Time Error 161: Read fault
  16322.  
  16323.  A hardware error occurred.
  16324.  
  16325.  
  16326.  191. QP Help: Run-Time Error: General Failure
  16327.  
  16328.  Product Version(s): 1.00
  16329.  Operating System:   MS-DOS
  16330.  Flags: ENDUSER | s_error
  16331.  Last Modified: 19-APR-1990    ArticleIdent: Q60828
  16332.  
  16333.  The following information is from the QuickPascal Version 1.00
  16334.  QPERR.HLP help file:
  16335.  
  16336.     Run-Time Error 162: General failure
  16337.  
  16338.  A hardware or other system error occurred.
  16339.  
  16340.  
  16341.  192. QP Help: Run-Time Error: Object Not Allocated
  16342.  
  16343.  Product Version(s): 1.00
  16344.  Operating System:   MS-DOS
  16345.  Flags: ENDUSER | s_error
  16346.  Last Modified: 19-APR-1990    ArticleIdent: Q60889
  16347.  
  16348.  The following information is from the QuickPascal Version 1.00
  16349.  QPERR.HLP help file:
  16350.  
  16351.     Run-Time Error 180: Object not allocated
  16352.  
  16353.  An object was passed to the Dispose procedure without previously
  16354.  being allocated by the New procedure.
  16355.  
  16356.  This error can also occur if the object structure has been corrupted
  16357.  or overwritten.
  16358.  
  16359.  
  16360.  193. QP Help: Run-Time Error: Invalid Object Reference
  16361.  
  16362.  Product Version(s): 1.00
  16363.  Operating System:   MS-DOS
  16364.  Flags: ENDUSER | s_error
  16365.  Last Modified: 19-APR-1990    ArticleIdent: Q60890
  16366.  
  16367.  The following information is from the QuickPascal Version 1.00
  16368.  QPERR.HLP help file:
  16369.  
  16370.     Run-Time Error 181: Invalid object reference
  16371.  
  16372.  A method was sent to an object that was not allocated previously by
  16373.  the New procedure.
  16374.  
  16375.  This error can also occur if the object structure has been corrupted
  16376.  or overwritten.
  16377.  
  16378.  
  16379.  194. QP Help: Run-Time Error: Division by Zero
  16380.  
  16381.  Product Version(s): 1.00
  16382.  Operating System:   MS-DOS
  16383.  Flags: ENDUSER | s_error
  16384.  Last Modified: 19-APR-1990    ArticleIdent: Q60891
  16385.  
  16386.  The following information is from the QuickPascal Version 1.00
  16387.  QPERR.HLP help file:
  16388.  
  16389.     Run-Time Error 200: Division by zero
  16390.  
  16391.  An attempt was made to divide by zero.
  16392.  
  16393.  
  16394.  195. QP Help: Run-Time Error: Range Check Error
  16395.  
  16396.  Product Version(s): 1.00
  16397.  Operating System:   MS-DOS
  16398.  Flags: ENDUSER | s_error
  16399.  Last Modified: 19-APR-1990    ArticleIdent: Q60892
  16400.  
  16401.  The following information is from the QuickPascal Version 1.00
  16402.  QPERR.HLP help file:
  16403.  
  16404.     Run-Time Error 201: Range check error
  16405.  
  16406.  An out-of-range value was assigned to a variable, used as an array
  16407.  index, or passed to a procedure or function.
  16408.  
  16409.  This error is possible only when range checking is turned on by the
  16410.  {$R+} directive.
  16411.  
  16412.  
  16413.  196. QP Help: Run-Time Error: Stack Overflow Error
  16414.  
  16415.  Product Version(s): 1.00
  16416.  Operating System:   MS-DOS
  16417.  Flags: ENDUSER | s_error
  16418.  Last Modified: 19-APR-1990    ArticleIdent: Q60893
  16419.  
  16420.  The following information is from the QuickPascal Version 1.00
  16421.  QPERR.HLP help file:
  16422.  
  16423.     Run-Time Error 202: Stack overflow error
  16424.  
  16425.  The stack contained insufficient space for the local variables for a
  16426.  procedure or function.
  16427.  
  16428.  This error is possible only when stack checking is on. Stack checking
  16429.  is turned on by the {$S+} directive.
  16430.  
  16431.  
  16432.  197. QP Help: Run-Time Error: Heap Overflow Error
  16433.  
  16434.  Product Version(s): 1.00
  16435.  Operating System:   MS-DOS
  16436.  Flags: ENDUSER | s_error
  16437.  Last Modified: 19-APR-1990    ArticleIdent: Q60894
  16438.  
  16439.  The following information is from the QuickPascal Version 1.00
  16440.  QPERR.HLP help file:
  16441.  
  16442.     Run-Time Error 203: Heap overflow error
  16443.  
  16444.  The heap contained insufficient space for allocation of the specified
  16445.  amount of memory by the GetMem or New procedures.
  16446.  
  16447.  
  16448.  198. QP Help: Run-Time Error: Invalid Pointer Operation
  16449.  
  16450.  Product Version(s): 1.00
  16451.  Operating System:   MS-DOS
  16452.  Flags: ENDUSER | s_error
  16453.  Last Modified: 19-APR-1990    ArticleIdent: Q60895
  16454.  
  16455.  The following information is from the QuickPascal Version 1.00
  16456.  QPERR.HLP help file:
  16457.  
  16458.     Run-Time Error 204: Invalid pointer operation
  16459.  
  16460.  A pointer set to NIL or to a non-heap location was passed to the
  16461.  Dispose or FreeMem procedures.
  16462.  
  16463.  
  16464.  199. QP Help: Error: Cannot Open File
  16465.  
  16466.  Product Version(s): 1.00
  16467.  Operating System:   MS-DOS
  16468.  Flags: ENDUSER | s_error
  16469.  Last Modified: 19-APR-1990    ArticleIdent: Q60896
  16470.  
  16471.  The following information is from the QuickPascal Version 1.00
  16472.  QPERR.HLP help file:
  16473.  
  16474.     Error 2: Cannot open file
  16475.  
  16476.  QuickPascal could not open the specified file.
  16477.  
  16478.  If the file is a unit, make sure the unit has been compiled into a
  16479.  .QPU file.
  16480.  
  16481.  If the file is an include file or an .OBJ file, make sure the
  16482.  Environment path under the Options menu is correct.
  16483.  
  16484.  
  16485.  200. QP Help: Error: "." Expected
  16486.  
  16487.  Product Version(s): 1.00
  16488.  Operating System:   MS-DOS
  16489.  Flags: ENDUSER | s_error
  16490.  Last Modified: 19-APR-1990    ArticleIdent: Q60897
  16491.  
  16492.  The following information is from the QuickPascal Version 1.00
  16493.  QPERR.HLP help file:
  16494.  
  16495.     Error 20: "." expected
  16496.  
  16497.  QuickPascal expected a period after the last END statement in the
  16498.  program.
  16499.  
  16500.  Insert the period or check the line for correct syntax. Your program
  16501.  may be missing a BEGIN statement.
  16502.  
  16503.  
  16504.  201. QP Help: Run-Time Error: Floating Point Overflow
  16505.  
  16506.  Product Version(s): 1.00
  16507.  Operating System:   MS-DOS
  16508.  Flags: ENDUSER | s_error
  16509.  Last Modified: 19-APR-1990    ArticleIdent: Q60898
  16510.  
  16511.  The following information is from the QuickPascal Version 1.00
  16512.  QPERR.HLP help file:
  16513.  
  16514.     Run-Time Error 205: Floating point overflow
  16515.  
  16516.  A floating-point operation resulted in an overflow.
  16517.  
  16518.  
  16519.  202. QP Help: Run-Time Error: Floating Point Underflow
  16520.  
  16521.  Product Version(s): 1.00
  16522.  Operating System:   MS-DOS
  16523.  Flags: ENDUSER | s_error
  16524.  Last Modified: 19-APR-1990    ArticleIdent: Q60899
  16525.  
  16526.  The following information is from the QuickPascal Version 1.00
  16527.  QPERR.HLP help file:
  16528.  
  16529.     Run-Time Error 206: Floating point underflow
  16530.  
  16531.  A floating-point operation resulted in an underflow.
  16532.  
  16533.  
  16534.  203. QP Help: Run-Time Error: Invalid Floating Point Operation
  16535.  
  16536.  Product Version(s): 1.00
  16537.  Operating System:   MS-DOS
  16538.  Flags: ENDUSER | s_error
  16539.  Last Modified: 19-APR-1990    ArticleIdent: Q60900
  16540.  
  16541.  The following information is from the QuickPascal Version 1.00
  16542.  QPERR.HLP help file:
  16543.  
  16544.     Run-Time Error 207: Invalid floating point operation
  16545.  
  16546.  This error occurred because of one of the following:
  16547.  
  16548.  - A stack overflow occurred, with either alternate math or
  16549.    coprocessor.
  16550.  
  16551.  - A non-positive value was passed to the Ln function.
  16552.  
  16553.  - A negative value was passed to the Sqrt function.
  16554.  
  16555.  - The value passed to the Round or Trunc functions was not in the
  16556.  range of a LongInt (-2147483648..2147483647).
  16557.  
  16558.  
  16559.  204. QP Help: Error: BEGIN Expected
  16560.  
  16561.  Product Version(s): 1.00
  16562.  Operating System:   MS-DOS
  16563.  Flags: ENDUSER | s_error
  16564.  Last Modified: 19-APR-1990    ArticleIdent: Q60901
  16565.  
  16566.  The following information is from the QuickPascal Version 1.00
  16567.  QPERR.HLP help file:
  16568.  
  16569.     Error 21: BEGIN expected
  16570.  
  16571.  QuickPascal found the start of a statement block without the BEGIN
  16572.  keyword.
  16573.  
  16574.  If BEGIN is present but in a different location, check for any missing
  16575.  keywords such as VAR or DO.
  16576.  
  16577.  
  16578.  205. QP Help: Error: END Expected
  16579.  
  16580.  Product Version(s): 1.00
  16581.  Operating System:   MS-DOS
  16582.  Flags: ENDUSER | s_error
  16583.  Last Modified: 19-APR-1990    ArticleIdent: Q60902
  16584.  
  16585.  The following information is from the QuickPascal Version 1.00
  16586.  QPERR.HLP help file:
  16587.  
  16588.     Error 22: END expected
  16589.  
  16590.  QuickPascal found the end of a statement block without the END
  16591.  keyword.
  16592.  
  16593.  If an END keyword is present, check for balanced BEGIN and END
  16594.  statements. Also check for END statements in constructs that expect
  16595.  END statements but do not use BEGIN statements (such as CASE
  16596.  statements).
  16597.  
  16598.  
  16599.  206. QP Help: Error: Label Must Be in the Range 0..9999
  16600.  
  16601.  Product Version(s): 1.00
  16602.  Operating System:   MS-DOS
  16603.  Flags: ENDUSER | s_error
  16604.  Last Modified: 19-APR-1990    ArticleIdent: Q60903
  16605.  
  16606.  The following information is from the QuickPascal Version 1.00
  16607.  QPERR.HLP help file:
  16608.  
  16609.     Error 23: Label must be in the range 0..9999
  16610.  
  16611.  QuickPascal encountered a label that lies outside the accepted range
  16612.  of label numbers.
  16613.  
  16614.  Change the label to a number between 0 and 9999 or to a unique name.
  16615.  If the label is referred to frequently, use the Replace command with
  16616.  the Verify option.
  16617.  
  16618.  
  16619.  207. QP Help: Error: Identifier or Label Already Defined
  16620.  
  16621.  Product Version(s): 1.00
  16622.  Operating System:   MS-DOS
  16623.  Flags: ENDUSER | s_error
  16624.  Last Modified: 19-APR-1990    ArticleIdent: Q60904
  16625.  
  16626.  The following information is from the QuickPascal Version 1.00
  16627.  QPERR.HLP help file:
  16628.  
  16629.     Error 25: Identifier or label already defined
  16630.  
  16631.  This name is already defined as having a different value or meaning.
  16632.  
  16633.  Identifiers within the same scope must be unique. One name can refer
  16634.  only to one data type, one procedure, one function, etc. A label can
  16635.  be defined only once. A label may not be defined twice in the same
  16636.  program.
  16637.  
  16638.  Give this identifier a new name, or rename the previous one that uses
  16639.  this same name. Change the current label or the previous label with
  16640.  the same name or number.
  16641.  
  16642.  
  16643.  208. QP Help: Error: Error in Type Definition
  16644.  
  16645.  Product Version(s): 1.00
  16646.  Operating System:   MS-DOS
  16647.  Flags: ENDUSER | s_error
  16648.  Last Modified: 19-APR-1990    ArticleIdent: Q60905
  16649.  
  16650.  The following information is from the QuickPascal Version 1.00
  16651.  QPERR.HLP help file:
  16652.  
  16653.     Error 26: Error in type definition
  16654.  
  16655.  QuickPascal found an error in the definition of this type.
  16656.  
  16657.  Check the syntax for what you want to define, and also check any
  16658.  limitations of that particular data type.
  16659.  
  16660.  
  16661.  209. QP Help: Error: This Type Not Allowed Here
  16662.  
  16663.  Product Version(s): 1.00
  16664.  Operating System:   MS-DOS
  16665.  Flags: ENDUSER | s_error
  16666.  Last Modified: 19-APR-1990    ArticleIdent: Q60906
  16667.  
  16668.  The following information is from the QuickPascal Version 1.00
  16669.  QPERR.HLP help file:
  16670.  
  16671.     Error 27: This type not allowed here
  16672.  
  16673.  The data type of the identifier or value containing the cursor is not
  16674.  a valid data type at this location.
  16675.  
  16676.  Check the syntax of the code and verify the correct data type. Change
  16677.  the identifier or value to the correct type.
  16678.  
  16679.  
  16680.  210. QP Help: Error: OF Expected
  16681.  
  16682.  Product Version(s): 1.00
  16683.  Operating System:   MS-DOS
  16684.  Flags: ENDUSER | s_error
  16685.  Last Modified: 19-APR-1990    ArticleIdent: Q60907
  16686.  
  16687.  The following information is from the QuickPascal Version 1.00
  16688.  QPERR.HLP help file:
  16689.  
  16690.     Error 28: OF expected
  16691.  
  16692.  This statement requires an additional OF keyword for completion.
  16693.  
  16694.  Check the syntax of the associated statement. For example, CASE
  16695.  statements and ARRAY declarations both require the OF keyword as part
  16696.  of their complete syntax.
  16697.  
  16698.  
  16699.  211. QP Help: Error: Implementation Restriction
  16700.  
  16701.  Product Version(s): 1.00
  16702.  Operating System:   MS-DOS
  16703.  Flags: ENDUSER | s_error
  16704.  Last Modified: 19-APR-1990    ArticleIdent: Q60908
  16705.  
  16706.  The following information is from the QuickPascal Version 1.00
  16707.  QPERR.HLP help file:
  16708.  
  16709.     Error 29: Implementation restriction
  16710.  
  16711.  You exceeded QuickPascal's capacity for this construct.
  16712.  
  16713.  Break the construct into smaller pieces.
  16714.  
  16715.  
  16716.  212. QP Help: Error: File Too Big
  16717.  
  16718.  Product Version(s): 1.00
  16719.  Operating System:   MS-DOS
  16720.  Flags: ENDUSER | s_error
  16721.  Last Modified: 25-APR-1990    ArticleIdent: Q61002
  16722.  
  16723.  The following information is from the QuickPascal Version 1.00
  16724.  QPERR.HLP help file:
  16725.  
  16726.     Error 3: File too big
  16727.  
  16728.  The file exceeds the maximum size.
  16729.  
  16730.  Try putting some procedures and functions into a custom unit and
  16731.  compiling again. If the program uses include files, convert them to
  16732.  units wherever possible.
  16733.  
  16734.  
  16735.  213. QP Help: Error: "]" Expected
  16736.  
  16737.  Product Version(s): 1.00
  16738.  Operating System:   MS-DOS
  16739.  Flags: ENDUSER | s_error
  16740.  Last Modified: 25-APR-1990    ArticleIdent: Q61003
  16741.  
  16742.  The following information is from the QuickPascal Version 1.00
  16743.  QPERR.HLP help file:
  16744.  
  16745.     Error 31: "]" expected
  16746.  
  16747.  QuickPascal found an array or set with unbalanced brackets.
  16748.  
  16749.  Balance the brackets by adding the closing square bracket.
  16750.  
  16751.  
  16752.  214. QP Help: Error: Unknown Identifier
  16753.  
  16754.  Product Version(s): 1.00
  16755.  Operating System:   MS-DOS
  16756.  Flags: ENDUSER | s_error
  16757.  Last Modified: 25-APR-1990    ArticleIdent: Q61004
  16758.  
  16759.  The following information is from the QuickPascal Version 1.00
  16760.  QPERR.HLP help file:
  16761.  
  16762.     Error 32: Unknown identifier
  16763.  
  16764.  The name at the cursor has not been declared.
  16765.  
  16766.  You must declare all names before they can be used. If the name is
  16767.  defined in a unit, check that the unit appears in the USES statement.
  16768.  
  16769.  
  16770.  215. QP Help: Error: Error in Simple Type Definition
  16771.  
  16772.  Product Version(s): 1.00
  16773.  Operating System:   MS-DOS
  16774.  Flags: ENDUSER | s_error
  16775.  Last Modified: 25-APR-1990    ArticleIdent: Q61005
  16776.  
  16777.  The following information is from the QuickPascal Version 1.00
  16778.  QPERR.HLP help file:
  16779.  
  16780.     Error 33: Error in simple type definition
  16781.  
  16782.  An error was made in defining a simple type.
  16783.  
  16784.  Check the syntax of your declaration.
  16785.  
  16786.  
  16787.  216. QP Help: Error: Type Identifier Expected
  16788.  
  16789.  Product Version(s): 1.00
  16790.  Operating System:   MS-DOS
  16791.  Flags: ENDUSER | s_error
  16792.  Last Modified: 25-APR-1990    ArticleIdent: Q61006
  16793.  
  16794.  The following information is from the QuickPascal Version 1.00
  16795.  QPERR.HLP help file:
  16796.  
  16797.     Error 34: Type identifier expected
  16798.  
  16799.  QuickPascal expects a data type at the cursor location.
  16800.  
  16801.  Add the appropriate data type (for example, Integer, Char, or Double)
  16802.  as required by the statement. For instance, array declarations require
  16803.  the data type of the array elements, and function declarations require
  16804.  both the data types of the returned value and the types of parameters
  16805.  passed to the function.
  16806.  
  16807.  
  16808.  217. QP Help: Error: "=" Expected
  16809.  
  16810.  Product Version(s): 1.00
  16811.  Operating System:   MS-DOS
  16812.  Flags: ENDUSER | s_error
  16813.  Last Modified: 25-APR-1990    ArticleIdent: Q61007
  16814.  
  16815.  The following information is from the QuickPascal Version 1.00
  16816.  QPERR.HLP help file:
  16817.  
  16818.     Error 35: "=" expected
  16819.  
  16820.  The statement requires an equal sign at the cursor.
  16821.  
  16822.  Check the syntax for the statement. This error often occurs in CONST
  16823.  initializations or TYPE declarations. Use := for value assignments and
  16824.  = for testing equality or initializing a constant.
  16825.  
  16826.  
  16827.  218. QP Help: Error: Constant Expected
  16828.  
  16829.  Product Version(s): 1.00
  16830.  Operating System:   MS-DOS
  16831.  Flags: ENDUSER | s_error
  16832.  Last Modified: 25-APR-1990    ArticleIdent: Q61008
  16833.  
  16834.  The following information is from the QuickPascal Version 1.00
  16835.  QPERR.HLP help file:
  16836.  
  16837.     Error 36: Constant expected
  16838.  
  16839.  QuickPascal requires a constant or constant expression at the cursor.
  16840.  
  16841.  You cannot use a variable or an expression that uses variables at this
  16842.  location.
  16843.  
  16844.  Insert a new constant or the appropriate existing constant at the
  16845.  cursor.
  16846.  
  16847.  
  16848.  219. QP Help: Error: Integer or Real Constant Expected
  16849.  
  16850.  Product Version(s): 1.00
  16851.  Operating System:   MS-DOS
  16852.  Flags: ENDUSER | s_error
  16853.  Last Modified: 25-APR-1990    ArticleIdent: Q61009
  16854.  
  16855.  The following information is from the QuickPascal Version 1.00
  16856.  QPERR.HLP help file:
  16857.  
  16858.     Error 37: Integer or real constant expected
  16859.  
  16860.  QuickPascal requires a numeric constant at the cursor.
  16861.  
  16862.  You cannot use a variable or an expression that uses variables at
  16863.  this location.
  16864.  
  16865.  Insert a new numeric constant or the appropriate existing numeric
  16866.  constant at the cursor.
  16867.  
  16868.  
  16869.  220. QP Help: Error: Range Expected
  16870.  
  16871.  Product Version(s): 1.00
  16872.  Operating System:   MS-DOS
  16873.  Flags: ENDUSER | s_error
  16874.  Last Modified: 25-APR-1990    ArticleIdent: Q61010
  16875.  
  16876.  The following information is from the QuickPascal Version 1.00
  16877.  QPERR.HLP help file:
  16878.  
  16879.     Error 38: Range expected
  16880.  
  16881.  The syntax used in this statement requires that you specify a range of
  16882.  values.
  16883.  
  16884.  Specify a range of values with two periods between the lower and upper
  16885.  range limits. For example, 1..5 specifies the values 1, 2, 3, 4, and
  16886.  5. Examples of keywords that use ranges include CASE and ARRAY.
  16887.  
  16888.  
  16889.  221. QP Help: Error: Subrange Bounds Must Be Scalar
  16890.  
  16891.  Product Version(s): 1.00
  16892.  Operating System:   MS-DOS
  16893.  Flags: ENDUSER | s_error
  16894.  Last Modified: 25-APR-1990    ArticleIdent: Q61011
  16895.  
  16896.  The following information is from the QuickPascal Version 1.00
  16897.  QPERR.HLP help file:
  16898.  
  16899.     Error 39: Subrange bounds must be scalar
  16900.  
  16901.  The limiting values of a subrange must be scalar.
  16902.  
  16903.  "Scalar" refers to values that are either integers or or enumerated
  16904.  data types, such as A..Z. The boundary values cannot be real.
  16905.  
  16906.  Replace the subrange bounds with the appropriate scalar values.
  16907.  
  16908.  
  16909.  222. QP Help: Error: Incompatible Subrange Types
  16910.  
  16911.  Product Version(s): 1.00
  16912.  Operating System:   MS-DOS
  16913.  Flags: ENDUSER | s_error
  16914.  Last Modified: 25-APR-1990    ArticleIdent: Q61012
  16915.  
  16916.  The following information is from the QuickPascal Version 1.00
  16917.  QPERR.HLP help file:
  16918.  
  16919.     Error 40: Incompatible subrange types
  16920.  
  16921.  The statement contains two different subrange types.
  16922.  
  16923.  A subrange type is composed of a specified range of any standard or
  16924.  user-defined ordinal types. Subranges consist of elements of the same
  16925.  type. The lower and upper bounds of a subrange must be of the same
  16926.  data type.
  16927.  
  16928.  Change one of the boundary values so that both values share the same
  16929.  data type.
  16930.  
  16931.  
  16932.  223. QP Help: Error: Too Many Nested Files
  16933.  
  16934.  Product Version(s): 1.00
  16935.  Operating System:   MS-DOS
  16936.  Flags: ENDUSER | s_error
  16937.  Last Modified: 25-APR-1990    ArticleIdent: Q61013
  16938.  
  16939.  The following information is from the QuickPascal Version 1.00
  16940.  QPERR.HLP help file:
  16941.  
  16942.     Error 4: Too many nested files
  16943.  
  16944.  The program nests include files too deeply. If the files included must
  16945.  include other files, keep the nesting to a maximum depth of eight
  16946.  files.
  16947.  
  16948.  Convert some of the include files to units.
  16949.  
  16950.  
  16951.  224. QP Help: Error: Low Bound Exceeds High Bound
  16952.  
  16953.  Product Version(s): 1.00
  16954.  Operating System:   MS-DOS
  16955.  Flags: ENDUSER | s_error
  16956.  Last Modified: 25-APR-1990    ArticleIdent: Q61014
  16957.  
  16958.  The following information is from the QuickPascal Version 1.00
  16959.  QPERR.HLP help file:
  16960.  
  16961.     Error 41: Low bound exceeds high bound
  16962.  
  16963.  The low bound range in a declared array exceeds the high bound range.
  16964.  For example:
  16965.  
  16966.     ARRAY[1..10] OF Integer;    {correct}
  16967.     TYPE
  16968.         my_rg = 1..10;
  16969.  
  16970.     ARRAY[10..1] OF Integer;    {incorrect}
  16971.     TYPE
  16972.         my_rg = 10..1;
  16973.  
  16974.  
  16975.  225. QP Help: Error: ":" Expected
  16976.  
  16977.  Product Version(s): 1.00
  16978.  Operating System:   MS-DOS
  16979.  Flags: ENDUSER | s_error
  16980.  Last Modified: 25-APR-1990    ArticleIdent: Q61015
  16981.  
  16982.  The following information is from the QuickPascal Version 1.00
  16983.  QPERR.HLP help file:
  16984.  
  16985.     Error 42: ":" expected
  16986.  
  16987.  A colon (:) was expected but did not occur in the statement. The ":"
  16988.  symbol is used to
  16989.  
  16990.  - Declare a variable
  16991.  
  16992.  - Designate a label within a program
  16993.  
  16994.  - Identify a constant in a CASE statement
  16995.  
  16996.  - Indicate a value will be returned by a function
  16997.  
  16998.  
  16999.  226. QP Help: Error: Unsatisfied Forward Reference
  17000.  
  17001.  Product Version(s): 1.00
  17002.  Operating System:   MS-DOS
  17003.  Flags: ENDUSER | s_error
  17004.  Last Modified: 25-APR-1990    ArticleIdent: Q61016
  17005.  
  17006.  The following information is from the QuickPascal Version 1.00
  17007.  QPERR.HLP help file:
  17008.  
  17009.     Error 43: Unsatisfied forward reference
  17010.  
  17011.  The formal parameter list and block has not been declared for a
  17012.  FORWARD procedure.
  17013.  
  17014.  
  17015.  227. QP Help: Error: Integer Constant Expected
  17016.  
  17017.  Product Version(s): 1.00
  17018.  Operating System:   MS-DOS
  17019.  Flags: ENDUSER | s_error
  17020.  Last Modified: 25-APR-1990    ArticleIdent: Q61017
  17021.  
  17022.  The following information is from the QuickPascal Version 1.00
  17023.  QPERR.HLP help file:
  17024.  
  17025.     Error 44: Integer constant expected
  17026.  
  17027.  An integer constant was expected in the statement. Replace the
  17028.  variable identifier with an integer constant.
  17029.  
  17030.  
  17031.  228. QP Help: Error: Invalid String Length
  17032.  
  17033.  Product Version(s): 1.00
  17034.  Operating System:   MS-DOS
  17035.  Flags: ENDUSER | s_error
  17036.  Last Modified: 25-APR-1990    ArticleIdent: Q61018
  17037.  
  17038.  The following information is from the QuickPascal Version 1.00
  17039.  QPERR.HLP help file:
  17040.  
  17041.     Error 45: Invalid string length
  17042.  
  17043.  The length of a string must be an integer between 1 and 255.
  17044.  
  17045.  
  17046.  229. QP Help: Error: Tag Field Type Must Be Scalar or Subrange
  17047.  
  17048.  Product Version(s): 1.00
  17049.  Operating System:   MS-DOS
  17050.  Flags: ENDUSER | s_error
  17051.  Last Modified: 24-APR-1990    ArticleIdent: Q61019
  17052.  
  17053.  The following information is from the QuickPascal Version 1.00
  17054.  QPERR.HLP help file:
  17055.  
  17056.     Error 46: Tag field type must be scalar or subrange
  17057.  
  17058.  The tag field in the variant record must be either a scalar or
  17059.  subrange type.
  17060.  
  17061.  Tag fields are separate fields of a record that indicate the variant
  17062.  used in the record variable.
  17063.  
  17064.  
  17065.  230. QP Help: Error: "(" Expected
  17066.  
  17067.  Product Version(s): 1.00
  17068.  Operating System:   MS-DOS
  17069.  Flags: ENDUSER | s_error
  17070.  Last Modified: 25-APR-1990    ArticleIdent: Q61020
  17071.  
  17072.  The following information is from the QuickPascal Version 1.00
  17073.  QPERR.HLP help file:
  17074.  
  17075.     Error 47: "(" expected
  17076.  
  17077.  A left parenthesis "(" must be paired with a right parenthesis ")".
  17078.  Check statements with nested parentheses to verify that the number of
  17079.  right and left parentheses match.
  17080.  
  17081.  
  17082.  231. QP Help: Error: Too Many Literals
  17083.  
  17084.  Product Version(s): 1.00
  17085.  Operating System:   MS-DOS
  17086.  Flags: ENDUSER | s_error
  17087.  Last Modified: 24-APR-1990    ArticleIdent: Q61021
  17088.  
  17089.  The following information is from the QuickPascal Version 1.00
  17090.  QPERR.HLP help file:
  17091.  
  17092.     Error 48: Too many literals
  17093.  
  17094.  The program has too many literal constants to fit into memory. Reduce
  17095.  the number of constants by passing parameters to procedures and
  17096.  functions.
  17097.  
  17098.  
  17099.  232. QP Help: Error: Error in Expression
  17100.  
  17101.  Product Version(s): 1.00
  17102.  Operating System:   MS-DOS
  17103.  Flags: ENDUSER | s_error
  17104.  Last Modified: 25-MAY-1990    ArticleIdent: Q61114
  17105.  
  17106.  The following information is from the QuickPascal Version 1.00
  17107.  QPERR.HLP help file:
  17108.  
  17109.     Error 50: Error in expression
  17110.  
  17111.  An undefined syntax error occurred in the expression.
  17112.  
  17113.  
  17114.  233. QP Help: Error: Cannot Read File
  17115.  
  17116.  Product Version(s): 1.00
  17117.  Operating System:   MS-DOS
  17118.  Flags: ENDUSER | s_error
  17119.  Last Modified: 25-MAY-1990    ArticleIdent: Q61115
  17120.  
  17121.  The following information is from the QuickPascal Version 1.00
  17122.  QPERR.HLP help file:
  17123.  
  17124.     Error 5: Cannot read file
  17125.  
  17126.  QuickPascal cannot read from the specified file.
  17127.  
  17128.  Check that the disk drive functions properly and that the disk
  17129.  contains no errors or bad sectors.
  17130.  
  17131.  
  17132.  234. QP Help: Error: Conflicting Operands
  17133.  
  17134.  Product Version(s): 1.00
  17135.  Operating System:   MS-DOS
  17136.  Flags: ENDUSER | s_error
  17137.  Last Modified: 25-MAY-1990    ArticleIdent: Q61116
  17138.  
  17139.  The following information is from the QuickPascal Version 1.00
  17140.  QPERR.HLP help file:
  17141.  
  17142.     Error 51: Conflicting operands
  17143.  
  17144.  The operands in the expression are of an incompatible type. For
  17145.  example,
  17146.  
  17147.     'A' DIV 5
  17148.  
  17149.  
  17150.  235. QP Help: Error: Right Operand Is Not a Set
  17151.  
  17152.  Product Version(s): 1.00
  17153.  Operating System:   MS-DOS
  17154.  Flags: ENDUSER | s_error
  17155.  Last Modified: 25-MAY-1990    ArticleIdent: Q61117
  17156.  
  17157.  The following information is from the QuickPascal Version 1.00
  17158.  QPERR.HLP help file:
  17159.  
  17160.     Error 52: Right operand is not a set
  17161.  
  17162.  The operand to the right of a set operator is not a set. Set
  17163.  operations can only be performed on sets.
  17164.  
  17165.  
  17166.  236. QP Help: Error: Invalid Identifier
  17167.  
  17168.  Product Version(s): 1.00
  17169.  Operating System:   MS-DOS
  17170.  Flags: ENDUSER | s_error
  17171.  Last Modified: 25-MAY-1990    ArticleIdent: Q61118
  17172.  
  17173.  The following information is from the QuickPascal Version 1.00
  17174.  QPERR.HLP help file:
  17175.  
  17176.     Error 53: Invalid identifier
  17177.  
  17178.  An identifier was used in an illegal context.
  17179.  
  17180.  
  17181.  237. QP Help: Error: Invalid Type Cast
  17182.  
  17183.  Product Version(s): 1.00
  17184.  Operating System:   MS-DOS
  17185.  Flags: ENDUSER | s_error
  17186.  Last Modified: 25-MAY-1990    ArticleIdent: Q61119
  17187.  
  17188.  The following information is from the QuickPascal Version 1.00
  17189.  QPERR.HLP help file:
  17190.  
  17191.     Error 54: Invalid type cast
  17192.  
  17193.  An attempt has been made to cast to an incompatible type. Check to
  17194.  see if the type is compatible.
  17195.  
  17196.  
  17197.  238. QP Help: Error: Cannot Create File
  17198.  
  17199.  Product Version(s): 1.00
  17200.  Operating System:   MS-DOS
  17201.  Flags: ENDUSER | s_error
  17202.  Last Modified: 25-MAY-1990    ArticleIdent: Q61120
  17203.  
  17204.  The following information is from the QuickPascal Version 1.00
  17205.  QPERR.HLP help file:
  17206.  
  17207.     Error 55: Cannot create file
  17208.  
  17209.  An I/O error has prevented the file from being created.
  17210.  
  17211.  Check for defective disk media.
  17212.  
  17213.  
  17214.  239. QP Help: Error: Cannot Write File
  17215.  
  17216.  Product Version(s): 1.00
  17217.  Operating System:   MS-DOS
  17218.  Flags: ENDUSER | s_error
  17219.  Last Modified: 25-MAY-1990    ArticleIdent: Q61121
  17220.  
  17221.  The following information is from the QuickPascal Version 1.00
  17222.  QPERR.HLP help file:
  17223.  
  17224.     Error 56: Cannot write file
  17225.  
  17226.  An I/O error has prevented the file from being written.
  17227.  
  17228.  Check for defective disk media.
  17229.  
  17230.  
  17231.  240. QP Help: Error: Variable Type Must Be Pointer
  17232.  
  17233.  Product Version(s): 1.00
  17234.  Operating System:   MS-DOS
  17235.  Flags: ENDUSER | s_error
  17236.  Last Modified: 25-MAY-1990    ArticleIdent: Q61122
  17237.  
  17238.  The following information is from the QuickPascal Version 1.00
  17239.  QPERR.HLP help file:
  17240.  
  17241.     Error 57: Variable type must be pointer
  17242.  
  17243.  The variable in this statement must be of a pointer type.
  17244.  
  17245.  You may be trying to dereference something that is not a pointer.
  17246.  
  17247.  
  17248.  241. QP Help: Error: Variable Type Must Be Record
  17249.  
  17250.  Product Version(s): 1.00
  17251.  Operating System:   MS-DOS
  17252.  Flags: ENDUSER | s_error
  17253.  Last Modified: 25-MAY-1990    ArticleIdent: Q61123
  17254.  
  17255.  The following information is from the QuickPascal Version 1.00
  17256.  QPERR.HLP help file:
  17257.  
  17258.     Error 58: Variable type must be record
  17259.  
  17260.  The variable in the statement must be of a record type.
  17261.  
  17262.  
  17263.  242. QP Help: Error: Variable Type Must Be Array or String
  17264.  
  17265.  Product Version(s): 1.00
  17266.  Operating System:   MS-DOS
  17267.  Flags: ENDUSER | s_error
  17268.  Last Modified: 25-MAY-1990    ArticleIdent: Q61124
  17269.  
  17270.  The following information is from the QuickPascal Version 1.00
  17271.  QPERR.HLP help file:
  17272.  
  17273.     Error 59: Variable type must be array or string
  17274.  
  17275.  The variable in the statement must be declared as an array or a
  17276.  string.
  17277.  
  17278.  
  17279.  243. QP Help: Error: No Such Field in This Record or Object
  17280.  
  17281.  Product Version(s): 1.00
  17282.  Operating System:   MS-DOS
  17283.  Flags: ENDUSER | s_error
  17284.  Last Modified: 25-MAY-1990    ArticleIdent: Q61125
  17285.  
  17286.  The following information is from the QuickPascal Version 1.00
  17287.  QPERR.HLP help file:
  17288.  
  17289.     Error 60: No such field in this record or object
  17290.  
  17291.  A field does not exist in this record or object type with the
  17292.  specified identifier.
  17293.  
  17294.  Check the declaration to verify that the field exists.
  17295.  
  17296.  
  17297.  244. QP Help: Error: Cannot Close File
  17298.  
  17299.  Product Version(s): 1.00
  17300.  Operating System:   MS-DOS
  17301.  Flags: ENDUSER | s_error
  17302.  Last Modified: 25-MAY-1990    ArticleIdent: Q61126
  17303.  
  17304.  The following information is from the QuickPascal Version 1.00
  17305.  QPERR.HLP help file:
  17306.  
  17307.     Error 6: Cannot close file
  17308.  
  17309.  QuickPascal cannot close the specified file.
  17310.  
  17311.  Check that the disk drive functions properly and that the disk
  17312.  contains no errors or bad sectors.
  17313.  
  17314.  
  17315.  245. QP Help: Error: Index Type Is Not Compatible with Declaration
  17316.  
  17317.  Product Version(s): 1.00
  17318.  Operating System:   MS-DOS
  17319.  Flags: ENDUSER | s_error
  17320.  Last Modified: 25-MAY-1990    ArticleIdent: Q61127
  17321.  
  17322.  The following information is from the QuickPascal Version 1.00
  17323.  QPERR.HLP help file:
  17324.  
  17325.     Error 61: Index type is not compatible with the
  17326.             declaration
  17327.  
  17328.  The specified index type, or subscript, of the array in this
  17329.  statement is not consistent with the original array declaration. For
  17330.  example, given the declarations:
  17331.  
  17332.     VAR
  17333.         TheGrade   : Array[ 1..25 ] OF Char;
  17334.         the_letter : Char;
  17335.  
  17336.  the error occurs on the following line:
  17337.  
  17338.     the_letter := TheGrade[ 'A' ];
  17339.  
  17340.  
  17341.  246. QP Help: Error: Routine Too Big
  17342.  
  17343.  Product Version(s): 1.00
  17344.  Operating System:   MS-DOS
  17345.  Flags: ENDUSER | s_error
  17346.  Last Modified: 25-MAY-1990    ArticleIdent: Q61128
  17347.  
  17348.  The following information is from the QuickPascal Version 1.00
  17349.  QPERR.HLP help file:
  17350.  
  17351.     Error 62: Routine too big
  17352.  
  17353.  The procedure or function is too large to fit into memory.
  17354.  
  17355.  Divide the routine into smaller components.
  17356.  
  17357.  
  17358.  247. QP Help: Error: UNTIL Expected
  17359.  
  17360.  Product Version(s): 1.00
  17361.  Operating System:   MS-DOS
  17362.  Flags: ENDUSER | s_error
  17363.  Last Modified: 25-MAY-1990    ArticleIdent: Q61129
  17364.  
  17365.  The following information is from the QuickPascal Version 1.00
  17366.  QPERR.HLP help file:
  17367.  
  17368.     Error 63: UNTIL expected
  17369.  
  17370.  UNTIL was expected in the statement but not found.
  17371.  
  17372.  A REPEAT statement must include an UNTIL keyword, as in
  17373.  
  17374.     REPEAT
  17375.         TestCase;
  17376.     UNTIL the_var = 1;
  17377.  
  17378.  
  17379.  248. QP Help: Error: Boolean Expression Expected
  17380.  
  17381.  Product Version(s): 1.00
  17382.  Operating System:   MS-DOS
  17383.  Flags: ENDUSER | s_error
  17384.  Last Modified: 25-MAY-1990    ArticleIdent: Q61130
  17385.  
  17386.  The following information is from the QuickPascal Version 1.00
  17387.  QPERR.HLP help file:
  17388.  
  17389.     Error 64: Boolean expression expected
  17390.  
  17391.  The expression being evaluated in a conditional statement must
  17392.  produce a result of type Boolean.
  17393.  
  17394.  
  17395.  249. QP Help: Error: DO Expected
  17396.  
  17397.  Product Version(s): 1.00
  17398.  Operating System:   MS-DOS
  17399.  Flags: ENDUSER | s_error
  17400.  Last Modified: 25-MAY-1990    ArticleIdent: Q61131
  17401.  
  17402.  The following information is from the QuickPascal Version 1.00
  17403.  QPERR.HLP help file:
  17404.  
  17405.     Error 65: DO expected
  17406.  
  17407.  DO was expected in the statement but not found.
  17408.  
  17409.  A WHILE statement or a WITH statement must include a DO keyword, as
  17410.  in
  17411.  
  17412.     WHILE (Eof( myfile ) = False) DO
  17413.         Readln( myfile );
  17414.  or
  17415.  
  17416.     WITH the_record DO
  17417.         the_size := 10;
  17418.  
  17419.  
  17420.  250. QP Help: Error: THEN Expected
  17421.  
  17422.  Product Version(s): 1.00
  17423.  Operating System:   MS-DOS
  17424.  Flags: ENDUSER | s_error
  17425.  Last Modified: 25-MAY-1990    ArticleIdent: Q61132
  17426.  
  17427.  The following information is from the QuickPascal Version 1.00
  17428.  QPERR.HLP help file:
  17429.  
  17430.     Error 66: THEN expected
  17431.  
  17432.  THEN was expected in the statement but not found.
  17433.  
  17434.  An IF statement must include a THEN keyword, as in
  17435.  
  17436.     IF (the_color = red) THEN
  17437.         DisplayStopSign;
  17438.  
  17439.  
  17440.  251. QP Help: Error: Invalid Label
  17441.  
  17442.  Product Version(s): 1.00
  17443.  Operating System:   MS-DOS
  17444.  Flags: ENDUSER | s_error
  17445.  Last Modified: 25-MAY-1990    ArticleIdent: Q61133
  17446.  
  17447.  The following information is from the QuickPascal Version 1.00
  17448.  QPERR.HLP help file:
  17449.  
  17450.     Error 67: Invalid label
  17451.  
  17452.  The label is incorrectly defined.
  17453.  
  17454.  A label is a digit sequence whose value ranges from 0 to 9999.
  17455.  Leading zeros are not significant.
  17456.  
  17457.  
  17458.  252. QP Help: Error: Unknown Label
  17459.  
  17460.  Product Version(s): 1.00
  17461.  Operating System:   MS-DOS
  17462.  Flags: ENDUSER | s_error
  17463.  Last Modified: 25-MAY-1990    ArticleIdent: Q61134
  17464.  
  17465.  The following information is from the QuickPascal Version 1.00
  17466.  QPERR.HLP help file:
  17467.  
  17468.     Error 68: Unknown label
  17469.  
  17470.  The label referred to by the GOTO statement could not be located.
  17471.  
  17472.  A label must occur within the scope of the current block.
  17473.  
  17474.  
  17475.  253. QP Help: Error: Label Not Within Current Block
  17476.  
  17477.  Product Version(s): 1.00
  17478.  Operating System:   MS-DOS
  17479.  Flags: ENDUSER | s_error
  17480.  Last Modified: 25-MAY-1990    ArticleIdent: Q61135
  17481.  
  17482.  The following information is from the QuickPascal Version 1.00
  17483.  QPERR.HLP help file:
  17484.  
  17485.     Error 69: Label not within current block
  17486.  
  17487.  A GOTO statement cannot refer to a label outside the current block.
  17488.  Either place the label within the scope of the block, or use a
  17489.  procedure or function.
  17490.  
  17491.  
  17492.  254. QP Help: Error: Label Already Defined
  17493.  
  17494.  Product Version(s): 1.00
  17495.  Operating System:   MS-DOS
  17496.  Flags: ENDUSER | s_error
  17497.  Last Modified: 25-MAY-1990    ArticleIdent: Q61136
  17498.  
  17499.  The following information is from the QuickPascal Version 1.00
  17500.  QPERR.HLP help file:
  17501.  
  17502.     Error 70: Label already defined
  17503.  
  17504.  A label with the same name has already been defined.
  17505.  
  17506.  Rename the label with a unique name.
  17507.  
  17508.  
  17509.  255. QP Help: Error: Cannot Seek File
  17510.  
  17511.  Product Version(s): 1.00
  17512.  Operating System:   MS-DOS
  17513.  Flags: ENDUSER | s_error
  17514.  Last Modified: 25-MAY-1990    ArticleIdent: Q61137
  17515.  
  17516.  The following information is from the QuickPascal Version 1.00
  17517.  QPERR.HLP help file:
  17518.  
  17519.     Error 7: Cannot seek file
  17520.  
  17521.  The compiler could not seek the specified file.
  17522.  
  17523.  This is typically a hardware problem. Check that the disk drive is
  17524.  functioning properly.
  17525.  
  17526.  
  17527.  256. QP Help: Error: Label Expected
  17528.  
  17529.  Product Version(s): 1.00
  17530.  Operating System:   MS-DOS
  17531.  Flags: ENDUSER | s_error
  17532.  Last Modified: 25-MAY-1990    ArticleIdent: Q61138
  17533.  
  17534.  The following information is from the QuickPascal Version 1.00
  17535.  QPERR.HLP help file:
  17536.  
  17537.     Error 71: Label expected
  17538.  
  17539.  The GOTO statement must include a label. For example,
  17540.  
  17541.     GOTO 1000;
  17542.  
  17543.  
  17544.  257. QP Help: Error: Undefined Label in Preceding Statement Part
  17545.  
  17546.  Product Version(s): 1.00
  17547.  Operating System:   MS-DOS
  17548.  Flags: ENDUSER | s_error
  17549.  Last Modified: 25-MAY-1990    ArticleIdent: Q61139
  17550.  
  17551.  The following information is from the QuickPascal Version 1.00
  17552.  QPERR.HLP help file:
  17553.  
  17554.     Error 72: Undefined label in preceding statement part
  17555.  
  17556.  The label referenced by the GOTO statement has not been defined. A
  17557.  label must occur within the scope of the current block.
  17558.  
  17559.  
  17560.  258. QP Help: Error: Error in Statement
  17561.  
  17562.  Product Version(s): 1.00
  17563.  Operating System:   MS-DOS
  17564.  Flags: ENDUSER | s_error
  17565.  Last Modified: 25-MAY-1990    ArticleIdent: Q61140
  17566.  
  17567.  The following information is from the QuickPascal Version 1.00
  17568.  QPERR.HLP help file:
  17569.  
  17570.     Error 73: Error in statement
  17571.  
  17572.  An undefined error has occurred in the statement.
  17573.  
  17574.  
  17575.  259. QP Help: Error: ":=" Expected
  17576.  
  17577.  Product Version(s): 1.00
  17578.  Operating System:   MS-DOS
  17579.  Flags: ENDUSER | s_error
  17580.  Last Modified: 25-MAY-1990    ArticleIdent: Q61141
  17581.  
  17582.  The following information is from the QuickPascal Version 1.00
  17583.  QPERR.HLP help file:
  17584.  
  17585.     Error 74: ":=" expected
  17586.  
  17587.  A ":=" was expected but did not occur in the statement.
  17588.  
  17589.  The assignment operator (:=) assigns a value to a variable or
  17590.  function. Do not confuse ":=" with the equivalence operator (=).
  17591.  
  17592.  
  17593.  260. QP Help: Error: Type Mismatch
  17594.  
  17595.  Product Version(s): 1.00
  17596.  Operating System:   MS-DOS
  17597.  Flags: ENDUSER | s_error
  17598.  Last Modified: 25-MAY-1990    ArticleIdent: Q61142
  17599.  
  17600.  The following information is from the QuickPascal Version 1.00
  17601.  QPERR.HLP help file:
  17602.  
  17603.     Error 75: Type mismatch
  17604.  
  17605.  A type-incompatibility situation occurred, for one of the following
  17606.  reasons:
  17607.  
  17608.  - The variable and the expression in an assignment statement were not
  17609.    compatible types.
  17610.  
  17611.  - An actual parameter passed to a procedure or function was not
  17612.    type-compatible with a formal parameter.
  17613.  
  17614.  - An expression contained incompatible types of operands.
  17615.  
  17616.  - An expression used as an array index was not type-compatible for
  17617.    indexing an array.
  17618.  
  17619.  
  17620.  261. QP Help: Error: Variable Identifier Expected
  17621.  
  17622.  Product Version(s): 1.00
  17623.  Operating System:   MS-DOS
  17624.  Flags: ENDUSER | s_error
  17625.  Last Modified: 25-MAY-1990    ArticleIdent: Q61143
  17626.  
  17627.  The following information is from the QuickPascal Version 1.00
  17628.  QPERR.HLP help file:
  17629.  
  17630.     Error 76: Variable identifier expected
  17631.  
  17632.  A variable was expected in the statement.
  17633.  
  17634.  Replace the constant with a variable identifier.
  17635.  
  17636.  
  17637.  262. QP Help: Error: Invalid FOR Control Variable
  17638.  
  17639.  Product Version(s): 1.00
  17640.  Operating System:   MS-DOS
  17641.  Flags: ENDUSER | s_error
  17642.  Last Modified: 25-MAY-1990    ArticleIdent: Q61144
  17643.  
  17644.  The following information is from the QuickPascal Version 1.00
  17645.  QPERR.HLP help file:
  17646.  
  17647.     Error 77: Invalid FOR control variable
  17648.  
  17649.  The control variable in a FOR statement must be of an ordinal type.
  17650.  
  17651.  
  17652.  263. QP Help: Error: Scalar Type Expected
  17653.  
  17654.  Product Version(s): 1.00
  17655.  Operating System:   MS-DOS
  17656.  Flags: ENDUSER | s_error
  17657.  Last Modified: 25-MAY-1990    ArticleIdent: Q61145
  17658.  
  17659.  The following information is from the QuickPascal Version 1.00
  17660.  QPERR.HLP help file:
  17661.  
  17662.     Error 78: Scalar type expected
  17663.  
  17664.  A scalar type was expected in the statement.
  17665.  
  17666.  A scalar type has a finite number of elements. Scalar types include
  17667.  Boolean, Char, enumerated types, integer types, and subranges.
  17668.  
  17669.  
  17670.  264. QP Help: Error: TO or DOWNTO Expected
  17671.  
  17672.  Product Version(s): 1.00
  17673.  Operating System:   MS-DOS
  17674.  Flags: ENDUSER | s_error
  17675.  Last Modified: 25-MAY-1990    ArticleIdent: Q61146
  17676.  
  17677.  The following information is from the QuickPascal Version 1.00
  17678.  QPERR.HLP help file:
  17679.  
  17680.     Error 79: TO or DOWNTO expected
  17681.  
  17682.  The keywords TO or DOWNTO are required in a FOR statement. For
  17683.  example,
  17684.  
  17685.     FOR loop := 1 TO 10
  17686.  or
  17687.     FOR loop := 100 DOWNTO 10
  17688.  
  17689.  
  17690.  265. QP Help: Error: Disk Full
  17691.  
  17692.  Product Version(s): 1.00
  17693.  Operating System:   MS-DOS
  17694.  Flags: ENDUSER | s_error
  17695.  Last Modified: 25-MAY-1990    ArticleIdent: Q61147
  17696.  
  17697.  The following information is from the QuickPascal Version 1.00
  17698.  QPERR.HLP help file:
  17699.  
  17700.     Error 80: Disk full
  17701.  
  17702.  The disk is too full to continue the operation. Exit to DOS and
  17703.  delete unwanted files to free additional space.
  17704.  
  17705.  
  17706.  266. QP Help: Error: Invalid End of Line
  17707.  
  17708.  Product Version(s): 1.00
  17709.  Operating System:   MS-DOS
  17710.  Flags: ENDUSER | s_error
  17711.  Last Modified: 25-MAY-1990    ArticleIdent: Q61148
  17712.  
  17713.  The following information is from the QuickPascal Version 1.00
  17714.  QPERR.HLP help file:
  17715.  
  17716.     Error 8: Invalid end of line
  17717.  
  17718.  QuickPascal encountered a carriage return without a line feed or a
  17719.  line feed without a preceding carriage return.
  17720.  
  17721.  Re-enter the end-of-line character to correct the line terminator.
  17722.  
  17723.  
  17724.  267. QP Help: Error: Constant Value Out of Range
  17725.  
  17726.  Product Version(s): 1.00
  17727.  Operating System:   MS-DOS
  17728.  Flags: ENDUSER | s_error
  17729.  Last Modified: 25-MAY-1990    ArticleIdent: Q61149
  17730.  
  17731.  The following information is from the QuickPascal Version 1.00
  17732.  QPERR.HLP help file:
  17733.  
  17734.     Error 81: Constant value out of range
  17735.  
  17736.  A value exceeded the acceptable range for the data type of the
  17737.  constant.
  17738.  
  17739.  QuickPascal infers the acceptable range of a constant based on the
  17740.  type of value entered.
  17741.  
  17742.  Reassign the constant a value within the range of the current data
  17743.  type, or change the data type.
  17744.  
  17745.  
  17746.  268. QP Help: Error: "," Expected
  17747.  
  17748.  Product Version(s): 1.00
  17749.  Operating System:   MS-DOS
  17750.  Flags: ENDUSER | s_error
  17751.  Last Modified: 25-MAY-1990    ArticleIdent: Q61150
  17752.  
  17753.  The following information is from the QuickPascal Version 1.00
  17754.  QPERR.HLP help file:
  17755.  
  17756.     Error 82: "," expected
  17757.  
  17758.  QuickPascal expects a comma between items in a list, such as multiple
  17759.  parameters passed to a procedure or function.
  17760.  
  17761.  Insert a comma at the current cursor location.
  17762.  
  17763.  
  17764.  269. QP Help: Error: Division by Zero
  17765.  
  17766.  Product Version(s): 1.00
  17767.  Operating System:   MS-DOS
  17768.  Flags: ENDUSER | s_error
  17769.  Last Modified: 25-MAY-1990    ArticleIdent: Q61151
  17770.  
  17771.  The following information is from the QuickPascal Version 1.00
  17772.  QPERR.HLP help file:
  17773.  
  17774.     Error 83: Division by zero
  17775.  
  17776.  The divisor in the expression evaluated to zero, resulting in a
  17777.  division by zero.
  17778.  
  17779.  Alter the value of the divisor.
  17780.  
  17781.  
  17782.  270. QP Help: Error: Too Many Local Routines
  17783.  
  17784.  Product Version(s): 1.00
  17785.  Operating System:   MS-DOS
  17786.  Flags: ENDUSER | s_error
  17787.  Last Modified: 25-MAY-1990    ArticleIdent: Q61152
  17788.  
  17789.  The following information is from the QuickPascal Version 1.00
  17790.  QPERR.HLP help file:
  17791.  
  17792.     Error 84: Too many local routines
  17793.  
  17794.  The maximum number of procedures and functions that QuickPascal can
  17795.  handle locally has been exceeded.
  17796.  
  17797.  Move some of the procedures or functions to a global level, or create
  17798.  a unit for some of the routines.
  17799.  
  17800.  
  17801.  271. QP Help: Error: Integer Expression Expected
  17802.  
  17803.  Product Version(s): 1.00
  17804.  Operating System:   MS-DOS
  17805.  Flags: ENDUSER | s_error
  17806.  Last Modified: 25-MAY-1990    ArticleIdent: Q61153
  17807.  
  17808.  The following information is from the QuickPascal Version 1.00
  17809.  QPERR.HLP help file:
  17810.  
  17811.     Error 85: Integer expression expected
  17812.  
  17813.  The expression was not an integer type.
  17814.  
  17815.  Change the result of the expression to an integer type. If you need
  17816.  to convert a real number to an integer, use the Trunc function.
  17817.  
  17818.  
  17819.  272. QP Help: Error: Pointer Type Cannot Be Referenced
  17820.  
  17821.  Product Version(s): 1.00
  17822.  Operating System:   MS-DOS
  17823.  Flags: ENDUSER | s_error
  17824.  Last Modified: 25-MAY-1990    ArticleIdent: Q61154
  17825.  
  17826.  The following information is from the QuickPascal Version 1.00
  17827.  QPERR.HLP help file:
  17828.  
  17829.     Error 86: Pointer type cannot be referenced
  17830.  
  17831.  The pointer type cannot be referenced.
  17832.  
  17833.  Cast or assign the pointer to a typed pointer.
  17834.  
  17835.  
  17836.  273. QP Help: Error: Typed Pointer Expected
  17837.  
  17838.  Product Version(s): 1.00
  17839.  Operating System:   MS-DOS
  17840.  Flags: ENDUSER | s_error
  17841.  Last Modified: 25-MAY-1990    ArticleIdent: Q61155
  17842.  
  17843.  The following information is from the QuickPascal Version 1.00
  17844.  QPERR.HLP help file:
  17845.  
  17846.     Error 87: Typed pointer expected
  17847.  
  17848.  The statement expects a typed pointer.
  17849.  
  17850.  Replace the untyped pointer variable at the cursor with a typed
  17851.  pointer variable.
  17852.  
  17853.  
  17854.  274. QP Help: Error: File Type Expected
  17855.  
  17856.  Product Version(s): 1.00
  17857.  Operating System:   MS-DOS
  17858.  Flags: ENDUSER | s_error
  17859.  Last Modified: 25-MAY-1990    ArticleIdent: Q61156
  17860.  
  17861.  The following information is from the QuickPascal Version 1.00
  17862.  QPERR.HLP help file:
  17863.  
  17864.     Error 88: File type expected
  17865.  
  17866.  A typed, untyped, or text file was expected.
  17867.  
  17868.  
  17869.  275. QP Help: Error: Cannot Write Expressions of This Type
  17870.  
  17871.  Product Version(s): 1.00
  17872.  Operating System:   MS-DOS
  17873.  Flags: ENDUSER | s_error
  17874.  Last Modified: 25-MAY-1990    ArticleIdent: Q61157
  17875.  
  17876.  The following information is from the QuickPascal Version 1.00
  17877.  QPERR.HLP help file:
  17878.  
  17879.     Error 89: Cannot write expressions of this type
  17880.  
  17881.  The Write and Writeln statements can print only numeric, string, and
  17882.  Boolean data. A command to print a complex or user-defined data type
  17883.  such as a record, set, pointer, or enumeration has been entered; this
  17884.  cannot be done.
  17885.  
  17886.  Convert the value to a string and then print the string.
  17887.  
  17888.  
  17889.  276. QP Help: Error: Ordinal Expression Expected
  17890.  
  17891.  Product Version(s): 1.00
  17892.  Operating System:   MS-DOS
  17893.  Flags: ENDUSER | s_error
  17894.  Last Modified: 25-MAY-1990    ArticleIdent: Q61158
  17895.  
  17896.  The following information is from the QuickPascal Version 1.00
  17897.  QPERR.HLP help file:
  17898.  
  17899.     Error 90: Ordinal expression expected
  17900.  
  17901.  A procedure or function expected an ordinal type.
  17902.  
  17903.  A variable passed to this procedure or function must be of an ordinal
  17904.  type. An expression passed to it must evaluate to an ordinal value.
  17905.  
  17906.  
  17907.  277. QP Help: Error: Illegal Character
  17908.  
  17909.  Product Version(s): 1.00
  17910.  Operating System:   MS-DOS
  17911.  Flags: ENDUSER | s_error
  17912.  Last Modified: 25-MAY-1990    ArticleIdent: Q61159
  17913.  
  17914.  The following information is from the QuickPascal Version 1.00
  17915.  QPERR.HLP help file:
  17916.  
  17917.     Error 9: Illegal character
  17918.  
  17919.  QuickPascal encountered an invalid character.
  17920.  
  17921.  Some illegal characters do not appear on the screen. QuickPascal
  17922.  placed the cursor where it found the invalid character. Use the DEL
  17923.  key to remove that character (and retype it if necessary). If the
  17924.  problem persists, retype the entire line.
  17925.  
  17926.  Valid QuickPascal source code characters are a..z, A..Z, 0..9, $ @ _
  17927.  ; : , . + - * / = ^ ' # < > [ ] ( ) { } and " " (blank space). Other
  17928.  characters are valid only in comments.
  17929.  
  17930.  
  17931.  278. QP Help: Error: Invalid File Type
  17932.  
  17933.  Product Version(s): 1.00
  17934.  Operating System:   MS-DOS
  17935.  Flags: ENDUSER | s_error
  17936.  Last Modified: 25-MAY-1990    ArticleIdent: Q61160
  17937.  
  17938.  The following information is from the QuickPascal Version 1.00
  17939.  QPERR.HLP help file:
  17940.  
  17941.     Error 91: Invalid file type
  17942.  
  17943.  The file operation does not accept a file of this type.
  17944.  
  17945.  Check the syntax for the file operation and make sure the operation
  17946.  accepts the file type you specified. This problem often occurs if you
  17947.  try to use a Text file operation on a binary file or vice versa.
  17948.  
  17949.  
  17950.  279. QP Help: Error: Variable Parameter Expected
  17951.  
  17952.  Product Version(s): 1.00
  17953.  Operating System:   MS-DOS
  17954.  Flags: ENDUSER | s_error
  17955.  Last Modified: 25-MAY-1990    ArticleIdent: Q61161
  17956.  
  17957.  The following information is from the QuickPascal Version 1.00
  17958.  QPERR.HLP help file:
  17959.  
  17960.     Error 92: Variable parameter expected
  17961.  
  17962.  A constant or expression has been specified where Pascal requires a
  17963.  variable.
  17964.  
  17965.  Replace the parameter with a variable reference.
  17966.  
  17967.  
  17968.  280. QP Help: Error: Cannot Read Expressions of This Type
  17969.  
  17970.  Product Version(s): 1.00
  17971.  Operating System:   MS-DOS
  17972.  Flags: ENDUSER | s_error
  17973.  Last Modified: 25-MAY-1990    ArticleIdent: Q61162
  17974.  
  17975.  The following information is from the QuickPascal Version 1.00
  17976.  QPERR.HLP help file:
  17977.  
  17978.     Error 93: Cannot read expressions of this type
  17979.  
  17980.  The Read and Readln statements accept only numeric, string, and
  17981.  Boolean data. If you wish to read in a user-defined type, such as a
  17982.  set or pointer, read the value as a number and then convert it to the
  17983.  appropriate value.
  17984.  
  17985.  
  17986.  281. QP Help: Error: Integer or Real Expression Expected
  17987.  
  17988.  Product Version(s): 1.00
  17989.  Operating System:   MS-DOS
  17990.  Flags: ENDUSER | s_error
  17991.  Last Modified: 25-MAY-1990    ArticleIdent: Q61163
  17992.  
  17993.  The following information is from the QuickPascal Version 1.00
  17994.  QPERR.HLP help file:
  17995.  
  17996.     Error 94: Integer or real expression expected
  17997.  
  17998.  QuickPascal expects an expression that evaluates to an integer or
  17999.  real value. Modify the expression as needed so that it results in
  18000.  either an integer or real number.
  18001.  
  18002.  
  18003.  282. QP Help: Error: Integer or Real Variable Expected
  18004.  
  18005.  Product Version(s): 1.00
  18006.  Operating System:   MS-DOS
  18007.  Flags: ENDUSER | s_error
  18008.  Last Modified: 25-MAY-1990    ArticleIdent: Q61164
  18009.  
  18010.  The following information is from the QuickPascal Version 1.00
  18011.  QPERR.HLP help file:
  18012.  
  18013.     Error 95: Integer or real variable expected
  18014.  
  18015.  QuickPascal expects a numeric variable of an integer or real type at
  18016.  the cursor location.
  18017.  
  18018.  
  18019.  283. QP Help: Error: INLINE Error
  18020.  
  18021.  Product Version(s): 1.00
  18022.  Operating System:   MS-DOS
  18023.  Flags: ENDUSER | s_error
  18024.  Last Modified: 25-MAY-1990    ArticleIdent: Q61165
  18025.  
  18026.  The following information is from the QuickPascal Version 1.00
  18027.  QPERR.HLP help file:
  18028.  
  18029.     Error 97: INLINE error
  18030.  
  18031.  There is an error in the INLINE statement syntax. Check the
  18032.  machine-language and INLINE syntax carefully.
  18033.  
  18034.  
  18035.  284. QP Help: Error: Label Definition Not Allowed in INTERFACE
  18036.  
  18037.  Product Version(s): 1.00
  18038.  Operating System:   MS-DOS
  18039.  Flags: ENDUSER | s_error
  18040.  Last Modified: 25-MAY-1990    ArticleIdent: Q61166
  18041.  
  18042.  The following information is from the QuickPascal Version 1.00
  18043.  QPERR.HLP help file:
  18044.  
  18045.     Error 98: Label definition not allowed in INTERFACE part
  18046.  
  18047.  Labels cannot be defined in the INTERFACE portion of a unit. Define
  18048.  any labels in the IMPLEMENTATION section of the unit.
  18049.  
  18050.  
  18051.  285. QP Help: Error: INTERFACE Expected
  18052.  
  18053.  Product Version(s): 1.00
  18054.  Operating System:   MS-DOS
  18055.  Flags: ENDUSER | s_error
  18056.  Last Modified: 25-MAY-1990    ArticleIdent: Q61167
  18057.  
  18058.  The following information is from the QuickPascal Version 1.00
  18059.  QPERR.HLP help file:
  18060.  
  18061.     Error 99: INTERFACE expected
  18062.  
  18063.  QuickPascal expects an INTERFACE statement immediately following the
  18064.  unit declaration. Any variables, constants, procedures, etc., that
  18065.  you want a calling program to have access to must appear within the
  18066.  INTERFACE portion of the unit. Place any declarations that you do not
  18067.  want the calling program to access in the IMPLEMENTATION section of
  18068.  the unit.
  18069.  
  18070.  
  18071.  286. QP Help: Error: IMPLEMENTATION Expected
  18072.  
  18073.  Product Version(s): 1.00
  18074.  Operating System:   MS-DOS
  18075.  Flags: ENDUSER | s_error
  18076.  Last Modified: 25-MAY-1990    ArticleIdent: Q61168
  18077.  
  18078.  The following information is from the QuickPascal Version 1.00
  18079.  QPERR.HLP help file:
  18080.  
  18081.     Error 100: IMPLEMENTATION expected
  18082.  
  18083.  Place an IMPLEMENTATION statement prior to any executable code. If
  18084.  there are declarations that you do not want the calling program to
  18085.  have access to, place them in the IMPLEMENTATION section of a unit.
  18086.  Such declarations typically include variables, constants, etc., that
  18087.  need to be available to all of the unit's procedure and function
  18088.  definitions.
  18089.  
  18090.  
  18091.  287. QP Help: Error: Invalid Unit File
  18092.  
  18093.  Product Version(s): 1.00
  18094.  Operating System:   MS-DOS
  18095.  Flags: ENDUSER | s_error
  18096.  Last Modified: 25-MAY-1990    ArticleIdent: Q61169
  18097.  
  18098.  The following information is from the QuickPascal Version 1.00
  18099.  QPERR.HLP help file:
  18100.  
  18101.     Error 101: Invalid unit file
  18102.  
  18103.  The USES statement refers to a file that is not a valid unit.
  18104.  
  18105.  Check the spelling of the name you referenced. Make sure the program
  18106.  or file is compatible with QuickPascal.
  18107.  
  18108.  
  18109.  288. _GFillInterior Does Not Always Fill Ellipse
  18110.  
  18111.  Product Version(s): 1.00
  18112.  Operating System:   MS-DOS
  18113.  Flags: ENDUSER | s_quickc
  18114.  Last Modified: 25-MAY-1990    ArticleIdent: Q61311
  18115.  
  18116.  The following code demonstrates that the _GFillInterior flag will not
  18117.  fill the ellipse if the center of that ellipse is off the screen:
  18118.  
  18119.  PROGRAM Show;
  18120.  
  18121.  USES MSGraph, Crt;
  18122.  
  18123.  VAR
  18124.     DummyInt:Integer;
  18125.     DummyChar:Char;
  18126.  
  18127.  BEGIN
  18128.     DummyInt := _SetVideoMode(_EResColor);
  18129.     (** This one fills ok **)
  18130.     _Ellipse(_GFillInterior,220,75,420,275);
  18131.  
  18132.     (** This one does not **)
  18133.     _Ellipse(_GFillInterior,220,280,420,480);
  18134.  
  18135.     DummyChar := ReadKey;
  18136.     DummyInt := _SetVideoMode(_DefaultMode);
  18137.  END.
  18138.  
  18139.  _GFILLINTERIOR works differently depending on whether it is used with
  18140.  one class of function (_rectangle and _polygon) or the other (_ellipse
  18141.  and _pie). In the first case (for example, _rectangle and _polygon), a
  18142.  polygon scanfill is done that fills based on the shape of the object,
  18143.  regardless of where it is on the screen, or any other objects (or
  18144.  lines) within the object. This is usually the best approach, since it
  18145.  fills the way you would normally expect.
  18146.  
  18147.  The second case (for example, _ellipse) is handled differently. In
  18148.  this case, it is equivalent to doing a _floodfill() call, using the
  18149.  current color as the border, with the starting position at the
  18150.  "center" of the ellipse. _pie is equally arbitrary, although it uses a
  18151.  point about 3/4 of the way along a line bisecting the arc. The key in
  18152.  either case is that the starting-point is arbitrary and fixed. If that
  18153.  point is outside the viewport or is already drawn in the
  18154.  border/drawing color, the floodfill doesn't do anything.
  18155.  
  18156.  Also, because it is a floodfill, not a scanfill, objects or lines
  18157.  inside the ellipse/pie can cause it to not be filled entirely, whereas
  18158.  scanfill always fills completely. This is by design.
  18159.  
  18160.  One reason for adding _polygon to C Version 6.00 is to add the ability
  18161.  to draw virtually any shape (for example: you can simulate ellipses
  18162.  and pies) and still do a scanfill.
  18163.  
  18164.  
  18165.  289. QuickPascal May Not Correctly Reset Colors When Exiting
  18166.  
  18167.  Product Version(s): 1.00
  18168.  Operating System:   MS-DOS
  18169.  Flags: ENDUSER |
  18170.  Last Modified: 11-SEP-1990    ArticleIdent: Q65500
  18171.  
  18172.  Under certain circumstances, Microsoft QuickPascal (QP) version 1.00
  18173.  does not correctly reset all colors when exiting back to DOS.
  18174.  QuickPascal seems to change the color palette when it was previously
  18175.  set by DOS. The problem has been reproduced only on machines that use
  18176.  Compaq VGA cards.
  18177.  
  18178.  By design, QuickPascal does not make any assumptions about your
  18179.  intentions when modifying colors. If you are within the environment
  18180.  and modified any colors, QP will not reset these colors when you exit.
  18181.  The following procedure demonstrates this behavior:
  18182.  
  18183.  1. Compile the following program under QuickPascal version 1.00 and
  18184.     then exit to DOS.
  18185.  
  18186.        program colortst;
  18187.        uses crt;
  18188.        var
  18189.           i : integer;
  18190.        begin
  18191.           for i:=1 to 15 do begin
  18192.              textcolor(i);
  18193.              writeln('this is color ',i);
  18194.           end;
  18195.        end.
  18196.  
  18197.  2. At the DOS prompt, type "MODE CO80".
  18198.  
  18199.  3. Run "colortst". This will display 15 lines of text in different
  18200.     colors.
  18201.  
  18202.  4. Enter QuickPascal and then exit.
  18203.  
  18204.  Color #6 of the program will change from light brown to light yellow.
  18205.  
  18206.  As a workaround, the following batch file can be used to set the
  18207.  colors back to the default:
  18208.  
  18209.     mode co80
  18210.     qp %1 %2 %3 %4 %5
  18211.     mode co80
  18212.  
  18213.  
  18214.  290. Use RESET(fh,recordsize) When Working with Non-Typed Files
  18215.  
  18216.  Product Version(s): 1.00
  18217.  Operating System:   MS-DOS
  18218.  Flags: ENDUSER | buglist1.00 SR# S900910-39
  18219.  Last Modified: 26-DEC-1990    ArticleIdent: Q65570
  18220.  
  18221.  Microsoft QuickPascal contains a variable type of "FILE" that declares
  18222.  a file handle for an un-typed file. This is useful in conjunction with
  18223.  the BlockRead and BlockWrite statements in that it allows you to open
  18224.  any file and then READ or WRITE any type of data to the file. (This is
  18225.  equivalent to OPENing a file for BINARY and using the GET and PUT file
  18226.  I/O statements in BASIC.)
  18227.  
  18228.  To prevent unexpected errors of "Runtime error - 100" (which is
  18229.  attempting to read past the end of file), the RESET statement's
  18230.  optional second parameter must be used. This second parameter
  18231.  specifies the logical record length for the file. If not specified,
  18232.  the record size defaults to 128 bytes.
  18233.  
  18234.  This information applies to Microsoft QuickPascal version 1.00 for
  18235.  MS-DOS.
  18236.  
  18237.  Since the default for the record size parameter of the RESET statement
  18238.  is 128-bytes in length, failing to use this parameter when working
  18239.  with non-type files will usually result in "Runtime error - 100,"
  18240.  attempt to read past end of file. This is because all files are not a
  18241.  multiple of 128-bytes in length.
  18242.  
  18243.  The following sample program demonstrates how not using the record
  18244.  size parameter of the RESET statement can lead to "Runtime error -
  18245.  100."
  18246.  
  18247.  To run the programs below, you must create a file called TEST.DAT.
  18248.  Contents of TEST.DAT should be as follows:
  18249.  
  18250.     ABCDEFGHIJKLMNOPQRSTUVWXYZ
  18251.  
  18252.  Sample Program 1
  18253.  ----------------
  18254.  
  18255.  PROGRAM ResetTest;
  18256.  VAR fh: FILE;
  18257.       s: STRING[26];
  18258.  BEGIN
  18259.    ASSIGN(fh, 'test.dat');
  18260.    RESET(fh);              { Opens file with record size of 128-bytes.}
  18261.    BlockRead(fh, s, 1);    { Attempts to READ one 128-byte record but}
  18262.    WRITELN(s);             { fails because the file is only 26 bytes.}
  18263.    CLOSE(fh);
  18264.  END.
  18265.  
  18266.  When the above program is executed, the BlockRead statement will
  18267.  generate "Runtime error - 100" because the default record size is
  18268.  128-bytes and the file is only 26-bytes in length. Changing the RESET
  18269.  statement to include a record size parameter from 1 to 26 will allow
  18270.  the program to execute successfully. The following program will
  18271.  execute without error:
  18272.  
  18273.  Sample Program 2
  18274.  ----------------
  18275.  
  18276.  PROGRAM ResetTest;
  18277.  VAR fh: FILE;
  18278.       s: STRING[26];
  18279.  BEGIN
  18280.    ASSIGN(fh, 'test.dat');
  18281.    RESET(fh, 26);          { Opens file with record size of 26-bytes.}
  18282.    BlockRead(fh, s, 1);    { Reads one 26-bytes record.              }
  18283.    WRITELN(s);
  18284.    CLOSE(fh);
  18285.  END.
  18286.  
  18287.  
  18288.  291. Excellent "QuickPascal Programming" Book from MS Press
  18289.  
  18290.  Product Version(s): 1.00
  18291.  Operating System:   MS-DOS
  18292.  Flags: ENDUSER | s_pascal manual
  18293.  Last Modified: 24-OCT-1990    ArticleIdent: Q65878
  18294.  
  18295.  The following excellent book is available to support customers of
  18296.  Microsoft QuickPascal version 1.00:
  18297.  
  18298.     "Microsoft QuickPascal Programming", by Kris Jamsa, published
  18299.     by Microsoft Press, copyright 1990.
  18300.  
  18301.  This book teaches both the Pascal language and the Microsoft
  18302.  QuickPascal environment, and is an excellent guide for beginning,
  18303.  intermediate, and advanced Pascal programmers. This book is a great
  18304.  supplement to the existing documentation and online help shipped with
  18305.  Microsoft QuickPascal 1.00.
  18306.  
  18307.  
  18308.  292. Comparison of Pascal 4.00 and QuickPascal: Which Should I Buy?
  18309.  
  18310.  Product Version(s): 1.00
  18311.  Operating System:   MS-DOS
  18312.  Flags: ENDUSER | SR# S900927-116 S_Pascal
  18313.  Last Modified:  8-OCT-1990    ArticleIdent: Q66011
  18314.  
  18315.  This article compares Microsoft Pascal version 4.00 with Microsoft
  18316.  QuickPascal version 1.00. This information may be very important when
  18317.  deciding which product to buy or use.
  18318.  
  18319.  The only advantages to using Microsoft Pascal 4.00 are the ability to
  18320.  create OS/2 programs and to perform interlanguage calling. Otherwise,
  18321.  the Pascal 4.00 package is substantially more difficult to use than
  18322.  QuickPascal 1.00.
  18323.  
  18324.  QuickPascal offers a powerful and easy-to-use programming environment.
  18325.  
  18326.  This information applies to Microsoft QuickPascal version 1.00 for
  18327.  MS-DOS and to Microsoft Pascal Compiler version 4.00 for MS-DOS and MS
  18328.  OS/2.
  18329.  
  18330.  COMPARISON OF PASCAL 4.00 COMPILER WITH QUICKPASCAL 1.00
  18331.  --------------------------------------------------------
  18332.  
  18333.  Which Operating Systems Are Supported
  18334.  -------------------------------------
  18335.  
  18336.  QuickPascal 1.00 can only run under DOS or in the DOS compatibility
  18337.  box of Windows or OS/2. Programs compiled with QuickPascal can only
  18338.  run under DOS.
  18339.  
  18340.  Pascal 4.00 can create programs for either DOS or OS/2. Pascal 4.00
  18341.  also comes with libraries that enable you to create programs for
  18342.  Microsoft Windows versions 2.x for MS-DOS, but NOT for Windows version
  18343.  3.00.
  18344.  
  18345.  Programming Environment of QuickPascal Versus Pascal
  18346.  ----------------------------------------------------
  18347.  
  18348.  QuickPascal comes with an integrated programming environment, QP.EXE.
  18349.  Like the other Microsoft "Quick" products, QP.EXE has a
  18350.  character-oriented window interface. This means that you write
  18351.  programs in a window or series of windows. (Internally, the windows in
  18352.  QP.EXE are not stored as bit-mapped graphical windows, but are instead
  18353.  created in text mode with graphics characters and text.) QP.EXE has
  18354.  overlapping windows. Common editor functions can be accessed from
  18355.  pull-down menus accessible by the ALT key or by a mouse click. QP.EXE
  18356.  has the following menus:
  18357.  
  18358.     Menu Name   Purpose
  18359.     ---------   -------
  18360.  
  18361.     File        Managing multiple files
  18362.     Debug       Debugging programs
  18363.     Search      Search and replace
  18364.     Make        Program building and program management
  18365.     Options     Customizing the editor and programming environment
  18366.     View        Managing programming windows and the output screen
  18367.     Help        Access to online help
  18368.  
  18369.  The QuickPascal QP.EXE environment has a complete online help system
  18370.  and context-sensitive help similar to the other Microsoft Quick
  18371.  products. QP.EXE has full mouse support.
  18372.  
  18373.  Pascal 4.00 does not come with a programming environment, but instead
  18374.  comes with the Microsoft Editor (M.EXE or MEP.EXE). The Microsoft
  18375.  Editor is a programmer's editor with most of the standard editing
  18376.  functions, such as cutting and pasting text, searching and replacing,
  18377.  and managing multiple files. The Pascal compiler can be launched from
  18378.  within the Microsoft Editor. This editor can be customized by writing
  18379.  extensions in C and compiling them. The Microsoft Editor is difficult
  18380.  to learn and use, but it is a powerful editor with many useful
  18381.  features. The Pascal 4.00 compiler will compile any programs that are
  18382.  ASCII text files, thus programmers can use any editor of their choice,
  18383.  as long as they save the Pascal source code as text.
  18384.  
  18385.  Interlanguage Calling
  18386.  ---------------------
  18387.  
  18388.  Programs compiled in QuickPascal can only call programs created in
  18389.  assembly language.
  18390.  
  18391.  Programs compiled in Pascal 4.00 can call programs created with the
  18392.  Microsoft family of languages, including C, FORTRAN, BASIC, COBOL, or
  18393.  assembly language. (Note that only certain versions of C, FORTRAN,
  18394.  BASIC, and COBOL can link with Pascal 4.00.)
  18395.  
  18396.  Compatibility / Portability
  18397.  ---------------------------
  18398.  
  18399.  QuickPascal 1.00 is highly source-code compatible with Borland's Turbo
  18400.  Pascal 5.00. Porting code to and from Turbo Pascal 5.00 is a fairly
  18401.  straightforward process.
  18402.  
  18403.  Pascal 4.00 is very minimally source-code compatible with Borland's
  18404.  Turbo Pascal products. Porting code to or from Turbo Pascal requires
  18405.  extensive source code changes.
  18406.  
  18407.  
  18408.  293. No Color on Magnavox VGA Using QP or QC GRAPHICS.LIB
  18409.  
  18410.  Product Version(s): 1.00
  18411.  Operating System:   MS-DOS
  18412.  Flags: ENDUSER | SR# S901005-21 S_C S_QuickC
  18413.  Last Modified: 26-DEC-1990    ArticleIdent: Q66423
  18414.  
  18415.  Customers have reported that the GRDEMO program shipped with both
  18416.  QuickPascal version 1.00 and QuickC version 2.00 does not run in color
  18417.  on a Magnavox VGA Adapter. The resolution is correct but the colors
  18418.  are shades of gray.
  18419.  
  18420.  The problem was reported with Magnavox VGA BIOS version 1.05.
  18421.  Customers have reported that this problem is resolved in Magnavox VGA
  18422.  BIOS version 1.11.
  18423.  
  18424.  This information applies to QuickPascal version 1.00, to QuickC
  18425.  versions 2.00, 2.01, 2.50, and 2.51, and to Microsoft C Compiler
  18426.  version 6.00 for MS-DOS.
  18427.  
  18428.  The problem lies in GRAPHICS.LIB, which is essentially the same for
  18429.  all the above mentioned products. Some calls to this library will
  18430.  incorrectly reset the color palette. This is a minor hardware
  18431.  incompatibility with the Magnavox VGA Adapter and there is currently
  18432.  no workaround.
  18433.  
  18434.  For a related article concerning the C product line, query the
  18435.  Microsoft Knowledge Base using the following words:
  18436.  
  18437.       Magnavox and setvideomode
  18438.  
  18439.  
  18440.  294. QuickPascal Uses Radians, Not Degrees, for Sin and Cos
  18441.  
  18442.  Product Version(s): 1.00
  18443.  Operating System:   MS-DOS
  18444.  Flags: ENDUSER | SR# S901231-66
  18445.  Last Modified: 14-FEB-1991    ArticleIdent: Q69163
  18446.  
  18447.  You must pass angle measurements in radians (not degrees) to Microsoft
  18448.  QuickPascal's Sin and Cos functions.
  18449.  
  18450.  Microsoft QuickPascal version 1.00 uses radians for its trigonometric
  18451.  functions (Sin and Cos); therefore, the value from QuickPascal will be
  18452.  different from a calculator's value for sine and cosine, unless your
  18453.  calculator is using radians.
  18454.  
  18455.  To convert degrees to radians, multiply the degrees by pi/180, where
  18456.  pi equals approximately 3.14159265359.
  18457.  
  18458.  Note: Pi is an intrinsic function than returns the value of pi in
  18459.  QuickPascal. See the online Help in QP.EXE for more information (by
  18460.  placing the cursor on the word "pi" in QP.EXE and pressing the F1
  18461.  function key).
  18462.  
  18463.  The following sample QuickPascal program shows how to convert degrees
  18464.  to radians:
  18465.  
  18466.  program convert(input,output);
  18467.   var
  18468.        x:integer; y:real;
  18469.    begin
  18470.        x:=45;
  18471.    writeln('sin of 45 radians =', sin(x));
  18472.    writeln('sin of 45 degrees =', sin(x*pi/180));
  18473.    end.
  18474.  
  18475.  
  18476.  
  18477.  
  18478.  
  18479.  
  18480.  Microsoft Programmer's Work Bench [Development Environment]
  18481.  =============================================================================
  18482.  
  18483.  
  18484.  1. Using the Features of PWB to Build a Program with Overlays
  18485.  
  18486.  Product Version(s): 1.00   | 1.00
  18487.  Operating System:   MS-DOS | OS/2
  18488.  Flags: ENDUSER |
  18489.  Last Modified: 18-APR-1990    ArticleIdent: Q60050
  18490.  
  18491.  A MAKE file built with PWB can be modified (within reason) with the
  18492.  user supplied information section. This section, coded as
  18493.  
  18494.     # << User_supplied_information >>
  18495.  
  18496.  can contain other instructions that PWB (actually NMAKE or NMK) is
  18497.  supposed to carry out during the MAKE cycle. All instructions that
  18498.  follow this "fence" are not changed by PWB.
  18499.  
  18500.  The following instructions detail two implementations of that "fence"
  18501.  to allow PWB to build a program that uses overlays.
  18502.  
  18503.  While the following steps appear tedious, they are simple in practice.
  18504.  
  18505.  Once the changes are made, the only time you need to edit the MAKE
  18506.  file directly is to change your overlay structure, or to add or delete
  18507.  modules. When adding or deleting modules, you must both edit the
  18508.  program list with Make.Edit Program List and modify the commands in
  18509.  the user section. If you are only modifying the overlay structure, you
  18510.  change just the user section.
  18511.  
  18512.  The overlay structure in the example is as follows:
  18513.  
  18514.     HELLO.OBJ  (root)
  18515.         |
  18516.         +----A.OBJ (first  overlay)
  18517.         |
  18518.         +----B.OBJ (second overlay)
  18519.  
  18520.  All of the .OBJs are built from .C files with the same base name.
  18521.  
  18522.  1. Use PWB to build the program list in the normal way. This step is
  18523.     the same for any new program list.
  18524.  
  18525.     a. Start PWB.
  18526.  
  18527.     b. Choose Make.Set Program List and specify a new name -- HELLO.MAK
  18528.        in this example.
  18529.  
  18530.     c. Add HELLO.C, A.C, and B.C to the list. (If you have additional
  18531.        .C or .OBJ files, you would add them as well.) When all the
  18532.        files are listed, select Set Dependencies.
  18533.  
  18534.     d. Choose Options.Build Options and click on the Set Initial
  18535.        Build Options button and select DOS EXE.
  18536.  
  18537.     e. From Options.Compile Options, select the proper memory model.
  18538.  
  18539.     f. From Options.Link Options.Set Debug Options, turn off
  18540.        Incremental Link.
  18541.  
  18542.     g. From the Options.Browse Options dialog box, turn Generate Browse
  18543.        Information on.
  18544.  
  18545.     h. Choose Make.Rebuild All to make sure that the program builds
  18546.        properly without overlays. If it doesn't, review your work in
  18547.        previous steps.
  18548.  
  18549.  2. Now that you have a working program list, add the non-PWB
  18550.     information to the end.
  18551.  
  18552.     a. Choose Make.Clear Program List so that you can edit the MAKE
  18553.        file. Attempting to edit the current program list results in the
  18554.        message "No-edit file may not be modified."
  18555.  
  18556.     b. Choose File.Open to open the MAKE file so you can modify it.
  18557.  
  18558.     c. Go to the end of the file and start a blank line.
  18559.  
  18560.        Starting in column 1, add the following line:
  18561.  
  18562.           # << User_supplied_information >>
  18563.  
  18564.        Be sure to enter the line exactly as shown -- spacing is
  18565.        significant. This line is a "fence". Everything below the fence
  18566.        is yours and is not modified by PWB. Conversely, you should not
  18567.        modify anything above the fence because that section belongs to PWB.
  18568.  
  18569.     d. Below the fence starting in column one, add the pseudo-target:
  18570.  
  18571.           OVERLAID : $(OBJS)
  18572.  
  18573.        Be sure it starts column 1. Do not put a blank line after this line.
  18574.  
  18575.     e. Copy the command section from the $(PROJ).EXE description block
  18576.        to immediately follow the pseudo-target. The command section begins
  18577.        on the line following the line that reads
  18578.  
  18579.           $(PROJ).exe : $(OBJS)
  18580.  
  18581.        and ends at the next blank line. Do not copy the $(PROJ).EXE
  18582.        line, and do not leave a blank after the target. After you have
  18583.        copied the commands, your file should appear as follows:
  18584.  
  18585.           ... PWB section here, unmodified ...
  18586.  
  18587.           # << User_supplied_information >>
  18588.  
  18589.           OVERLAID : $(OBJS)
  18590.           !IF $(DEBUG)                    # copy of commands...
  18591.                   $(LRF) @<<$(PROJ).lrf
  18592.           $(RT_OBJS: = +^
  18593.           ) $(OBJS: = +^
  18594.           )
  18595.           $@
  18596.           ...
  18597.  
  18598.     f. Use the following procedure to modify the commands to link an
  18599.        overlaid EXE instead of a normal EXE.
  18600.  
  18601.        Note: There are two subsections in this section: a debug section
  18602.        that starts at the first "!IF $(DEBUG)" and ends at "!ELSE", and
  18603.        a release section that starts after the "!ELSE" and ends at the
  18604.        first "!ENDIF".
  18605.  
  18606.        You need to make the following modifications to both
  18607.        subsections.
  18608.  
  18609.        i. Delete the line that reads as follows:
  18610.  
  18611.              ) $(OBJS: = +^
  18612.  
  18613.           After the right parenthesis on the line that moved up, put
  18614.           your list of .OBJ files with parentheses to indicate which
  18615.           ones go in which overlays. If you need to use more than one
  18616.           line for all of your objects, be sure to put a plus sign (+)
  18617.           at the end of each line except the last.
  18618.  
  18619.       ii. Replace "$@" on the next line with "$(PROJ).EXE".
  18620.  
  18621.           In our example,
  18622.  
  18623.                  $(LRF) @<<$(PROJ).lrf
  18624.              $(RT_OBJS: = +^
  18625.              ) $(OBJS: = +^     # delete this line
  18626.              )                  # append OBJ list here ...
  18627.              $@                 # replace this line with $(PROJ).EXE
  18628.  
  18629.           becomes:
  18630.  
  18631.                  $(LRF) @<<$(PROJ).lrf
  18632.              $(RT_OBJS: = +^
  18633.              ) hello.obj +
  18634.              (a.obj) +
  18635.              (b.obj)
  18636.              $(PROJ).exe
  18637.  
  18638.           Remember to make the changes in both branches of the !IF
  18639.           $(DEBUG).
  18640.  
  18641.     g. The last step is to modify the browser database build commands.
  18642.        These are the two lines at the very end of the file that begin
  18643.        with "$(NMAKEBSC...". PWB adds and deletes these lines in the
  18644.        PWB section as you turn browser information on and off.
  18645.  
  18646.        Since PWB won't delete and add these lines in the user section,
  18647.        enclose them in !IF $(BROWSE)...!ENDIF so they'll be executed
  18648.        only when you ask for browse information. You also need to
  18649.        delete the "$(NMFLAGS)" macro from the second line to prevent
  18650.        infinite NMAKE recursion.
  18651.  
  18652.        The following lines
  18653.  
  18654.           $(NMAKEBSC1) MAKEFLAGS=
  18655.           $(NMAKEBSC2) $(NMFLAGS) -f $(PROJFILE) $(PROJ).bsc
  18656.  
  18657.        become:
  18658.  
  18659.           !IF $(BROWSE)
  18660.               $(NMAKEBSC1) MAKEFLAGS=
  18661.               $(NMAKEBSC2) -f $(PROJFILE) $(PROJ).bsc
  18662.           !ENDIF
  18663.  
  18664.        If you need special NMAKE options for building the browser
  18665.        database, just add them where you removed $(NMFLAGS).
  18666.  
  18667.  3. Reactivate the MAKE file by selecting Make.Set Program List.
  18668.  
  18669.  4. With these changes, if you select Make.Rebuild All, you will still
  18670.     get a non-overlaid program because PWB normally builds the first
  18671.     target in the MAKE file. To build the overlaid program, modify the
  18672.     command line passed to NMAKE so that NMAKE builds your overlay
  18673.     target rather than the regular EXE. Select Options.NMAKE Options
  18674.     and specify "OVERLAID" as the target by putting it in the NMAKE
  18675.     options box, or use Make.Build Target.
  18676.  
  18677.  5. With "OVERLAID" in Options.NMAKE Options you can build your program
  18678.     by either selecting Make.Rebuild All or Make.Build *.EXE, as usual.
  18679.     If you want to build a non-overlaid program, delete "OVERLAID" from
  18680.     the NMAKE options box.
  18681.  
  18682.     Note that if you use debug options with overlays you will get a
  18683.     linker warning L4047. This warning, and the dialog box that says
  18684.     that CRT0DAT.ASM can't be found, are normal when building overlaid
  18685.     programs for debugging and can be ignored. You can debug the overlaid
  18686.     program normally, with full debugging information available.
  18687.  
  18688.     This MAKE file behaves almost identically to a regular PWB MAKE
  18689.     file. The only differences are that NMAKE options are NOT  passed
  18690.     to the browser build unless you add them to the browser build line,
  18691.     and that you must edit the user supplied section if you add or
  18692.     delete modules from the project.
  18693.  
  18694.  
  18695.  2.
  18696.  
  18697.  Product Version(s): 1.00   | 1.00
  18698.  Operating System:   MS-DOS | OS/2
  18699.  Flags: ENDUSER | buglist1.00 fixlist1.10 s_c
  18700.  Last Modified:  5-FEB-1991    ArticleIdent: Q60392
  18701.  
  18702.  TOOLS.PRE is a sample Programmer's WorkBench (PWB) initialization file
  18703.  that is installed (and modified) when C 6.00 is installed by running
  18704.  the Setup program. On pages 19 and 20 of "Microsoft C: Installing and
  18705.  Using the Professional Development System," it states that the
  18706.  contents of TOOLS.PRE can be merged with an existing TOOLS.INI file,
  18707.  if one exists, or it can be renamed to TOOLS.INI, if there isn't one.
  18708.  To work correctly, you must make sure that the contents of this file
  18709.  are preceded by a PWB tag (for example, [PWB]) because the supplied
  18710.  TOOLS.PRE lacks this tag.
  18711.  
  18712.  When merging the PWB 1.00 TOOLS.PRE file into an existing TOOLS.INI
  18713.  file, a [PWB] tag should be added just above the area where the file
  18714.  is merged. For example:
  18715.  
  18716.  [PWB]
  18717.    .
  18718.    .
  18719.    .
  18720.    (TOOLS.PRE contents)
  18721.    .
  18722.    .
  18723.    .
  18724.  
  18725.  [NEXT-TAG]
  18726.  
  18727.  If TOOLS.PRE is being renamed to TOOLS.INI, the tag should be added as
  18728.  the first line in the file. In either case, failure to add the tag
  18729.  will result in PWB ignoring the initialization information.
  18730.  
  18731.  Microsoft has confirmed this to be a problem in PWB version 1.00. This
  18732.  problem was corrected in PWB version 1.10.
  18733.  
  18734.  
  18735.  3. How to Abort Compilation When Using PWB
  18736.  
  18737.  Product Version(s): 1.00   | 1.00
  18738.  Operating System:   MS-DOS | OS/2
  18739.  Flags: ENDUSER | s_c
  18740.  Last Modified: 17-JUL-1990    ArticleIdent: Q60500
  18741.  
  18742.  Question:
  18743.  
  18744.  How do I abort a compile that is in progress when using the
  18745.  Programmer's WorkBench (PWB) environment?
  18746.  
  18747.  Response:
  18748.  
  18749.  Under MS-DOS (or the OS/2 3.x compatibility box), use CTRL+C to abort.
  18750.  
  18751.  Under OS/2, use "Arg Meta Compile" to abort a compilation taking place
  18752.  in the background.
  18753.  
  18754.  The default keystrokes for Arg Meta Compile are ALT+A F9 CTRL+F3.
  18755.  
  18756.  You can also create a macro and assign it to a key to abort the
  18757.  compile process. Below is a sample macro that you could place in your
  18758.  TOOLS.INI file under the [pwb] tag.
  18759.  
  18760.     [pwb]
  18761.     Abort:=Arg Meta Compile
  18762.     Abort:Ctrl+F5
  18763.  
  18764.  Note: In either OS/2 or MS-DOS, the ESC key and CTRL+BREAK do not
  18765.  abort a compilation.
  18766.  
  18767.  
  18768.  4. PWB Makefiles Are Read-Only When Set as Active Program List
  18769.  
  18770.  Product Version(s): 1.00   | 1.00
  18771.  Operating System:   MS-DOS | OS/2
  18772.  Flags: ENDUSER |
  18773.  Last Modified: 25-MAY-1990    ArticleIdent: Q60749
  18774.  
  18775.  When you choose the Make.Set Program List option within the
  18776.  Programmer's WorkBench (PWB) environment to set a program list for the
  18777.  current project, the makefile associated with the current program list
  18778.  is marked as read-only and is not editable.
  18779.  
  18780.  Code Example
  18781.  ------------
  18782.  
  18783.  // FOO.C
  18784.  
  18785.  #include <stdio.h>
  18786.  void main ( void )
  18787.  {
  18788.     printf ( "Foobar\n" ) ;
  18789.  }
  18790.  
  18791.  1. Using the above sample program, choose the Make.Set Program List
  18792.     menu options and call the program list FOO.MAK.
  18793.  
  18794.  2. Save the list.
  18795.  
  18796.  3. Choose the File.Open menu, and enter FOO.MAK as the file you want
  18797.     to open.
  18798.  
  18799.  4. Place your cursor anywhere in the file and press ENTER. You will be
  18800.     greeted with the following a pop-up message:
  18801.  
  18802.        No-edit file may not be modified.
  18803.  
  18804.  If you want to edit the makefile, choose the Make.Clear Program List
  18805.  options, and you can edit the makefile as you want.
  18806.  
  18807.  
  18808.  5. Why Zero-Length .SBR Files Are Left on the Disk by the PWB
  18809.  
  18810.  Product Version(s): 1.00   | 1.00
  18811.  Operating System:   MS-DOS | OS/2
  18812.  Flags: ENDUSER |
  18813.  Last Modified: 16-JAN-1991    ArticleIdent: Q61056
  18814.  
  18815.  When using the Source Browser functionality within the Programmer's
  18816.  WorkBench, you can expect to have zero-length .SBR files on your disk.
  18817.  This is by design of the PWBRMAKE utility.
  18818.  
  18819.  PWBRMAKE.EXE is a utility that converts the .SBR files created by the
  18820.  compiler for each program module into a single database file that can
  18821.  be read by the Programmer's WorkBench (PWB) Source Browser. The
  18822.  resulting Source Browser database file has the extension .BSC.
  18823.  
  18824.  When a Source Browser database (a .BSC file) is built from .SBR files,
  18825.  the .SBR files are truncated to zero length to save disk space since
  18826.  they can be quite large. .SBR files are truncated to zero length,
  18827.  rather than being deleted, because PWBRMAKE performs incremental
  18828.  updates to the database and, therefore, needs the time and date stamp
  18829.  from the files.
  18830.  
  18831.  When you rebuild part of your project, new .SBR files are built for
  18832.  those modules. Each .SBR file that has not been re-created during a
  18833.  build is included as a zero-length file. This tells PWBRMAKE that the
  18834.  file has no new contribution to make to the database, so no update of
  18835.  that part of the database is required.
  18836.  
  18837.  
  18838.  6. Do Not Start Programmer's WorkBench by Typing PWBED
  18839.  
  18840.  Product Version(s): 1.00
  18841.  Operating System:   MS-DOS
  18842.  Flags: ENDUSER |
  18843.  Last Modified: 11-JUL-1990    ArticleIdent: Q61307
  18844.  
  18845.  You cannot start the Programmer's WorkBench by typing PWBED. This is
  18846.  incorrect. Type PWB to start the Programmer's WorkBench environment.
  18847.  
  18848.  In the REAL MODE directory specified during setup, there will be two
  18849.  executables for the PWB, PWB.COM and PWBED.EXE. PWB.COM actually
  18850.  spawns PWBED.EXE. If you use PWBED to start the PWB, it will consume
  18851.  approximately 500K of memory. By executing a DOS SHELL from within the
  18852.  PWB and running CHKDSK, you will notice there is very little memory
  18853.  left.
  18854.  
  18855.  When you invoke the PWB the correct way (by typing PWB), then shell-
  18856.  out and do a CHKDSK, you will see that the PWB has only consumed
  18857.  approximately 8K of available memory.
  18858.  
  18859.  The PWB appears to work correctly if you invoke it with PWBED.
  18860.  However, since it is using so much memory, you will receive memory
  18861.  problems, such as "out of memory," "cannot compile," or "cannot
  18862.  build." These are caused because there is not enough memory to spawn
  18863.  either NMAKE, the compiler, or the linker.
  18864.  
  18865.  
  18866.  7. Steps Needed to Make Source Browser Usable
  18867.  
  18868.  Product Version(s): 1.00    | 1.00
  18869.  Operating System:   MS-DOS  | OS/2
  18870.  Flags: ENDUSER |
  18871.  Last Modified: 11-JUL-1990    ArticleIdent: Q61309
  18872.  
  18873.  Before using the Browse menu options, you must first define and build
  18874.  the database the Source Browser will use. If this database is not
  18875.  already built, all options on the Browse menu will be grayed out and
  18876.  unusable.
  18877.  
  18878.  The following steps must be taken to define a database that is usable
  18879.  by the Source Browser menu options:
  18880.  
  18881.  1. Generate a program list using the Set Program List command in the
  18882.     Make menu. The PWB creates one internally if you do not specify one
  18883.     and the program only uses one source file. If a program is larger
  18884.     than one source file and a program list is not set, it is
  18885.     impossible to generate a Source Browser database.
  18886.  
  18887.  2. Choose Browse Options from the Options menu. You must select the
  18888.     Generate Browse Information field in the dialog box to create the
  18889.     Source Browser database.
  18890.  
  18891.  3. Build your program using the Make Menu option. You MUST have a
  18892.     successful build (compile AND link) of the program for a Source
  18893.     Browser database to be generated.
  18894.  
  18895.  The Browse Menu options should now be available for use.
  18896.  
  18897.  If, after taking the steps outlined above, the Browse Menu options
  18898.  are still unavailable for use, query on the following keywords:
  18899.  
  18900.     Browse and Options and Unavailable and Strange and Circumstances
  18901.  For printed documentation explaining the setup and use of the Source
  18902.  Browser, see Pages 50-52 of "Installing and Using the Professional
  18903.  Development System." You can also find information about the Source
  18904.  Browser in the online help under Programmer's WorkBench, Using the PWB
  18905.  Source Browser.
  18906.  
  18907.  
  18908.  8. SYS2070 Issued When Executing PWB.EXE for the First Time
  18909.  
  18910.  Product Version(s): 1.00
  18911.  Operating System:   OS/2
  18912.  Flags: ENDUSER |
  18913.  Last Modified: 13-JUN-1990    ArticleIdent: Q61572
  18914.  
  18915.  When running the Programmer's WorkBench (PWB) for the first time, the
  18916.  following OS/2 system error may be issued:
  18917.  
  18918.     Session Title:
  18919.     PWBED.EXE
  18920.  
  18921.     SYS2070: The system could not demand load the
  18922.     application's segment. MSHELP HELPSHRINK is in error.
  18923.     For additional detailed information also see message SYS0127
  18924.  
  18925.  This system error is caused by the PWB's use of a version of
  18926.  MSHELP.DLL that is not as current as the one that was shipped with C
  18927.  version 6.00. For the PWB to function correctly, the correct version
  18928.  of MSHELP.DLL must be in the LIBPATH.
  18929.  
  18930.  The README.DOC on the C version 6.00 Setup/Compiler 1 Disk warns of
  18931.  this potential problem, and suggests that QuickHelp (QH) be terminated
  18932.  as a background keyboard monitor before Setup is run.
  18933.  
  18934.  This problem is usually caused as a result of the Setup program not
  18935.  being able to copy its version of MSHELP.DLL over the old version of
  18936.  MSHELP.DLL. If another process (most likely a detached session of
  18937.  QH.EXE) was accessing this file during the execution of Setup, the
  18938.  Setup program will issue a message similar to the following:
  18939.  
  18940.     ERROR: Could not create file C:\OS2\DLL\mshelp.dll
  18941.     ERROR: File copy failed: A:\the PWB\mshelp.dll to C:\OS2\dll\mshelp.dll
  18942.  
  18943.  To solve this problem, take the following steps:
  18944.  
  18945.  1. Disable QH as a keyboard monitor:
  18946.  
  18947.     a. Press ALT+Q (to invoke QH).
  18948.  
  18949.     b. Press O (for the Options menu).
  18950.  
  18951.     c. Press T (to Terminate the monitor).
  18952.  
  18953.  2. Copy the up-to-date version of MSHELP.DLL from the distribution
  18954.     disk:
  18955.  
  18956.     a. Insert the Setup/Compiler 1 Disk into Drive A.
  18957.  
  18958.     b. Change the default Drive A.
  18959.  
  18960.     c. Run Setup with the /copy option by typing the following:
  18961.  
  18962.           setup /copy
  18963.  
  18964.     d. Press ENTER
  18965.  
  18966.     e. Press ENTER again (unless the setup files are in a drive other
  18967.        than A).
  18968.  
  18969.     f. At the prompt asking for the name of the file to copy, type
  18970.        MSHELP.DLL and press ENTER.
  18971.  
  18972.     g. At the prompt asking for the name of the directory to which to
  18973.        copy this file, type the directory in which the old MSHELP.DLL
  18974.        is located (most likely C:\OS2\DLL).
  18975.  
  18976.     h. Setup should then ask for the Programmer's WorkBench/Utilities
  18977.        for OS/2 Disk to be inserted into the setup drive.
  18978.  
  18979.     i. When Setup is finished copying the file, press ENTER at the
  18980.        next prompt.
  18981.  
  18982.  The PWB should now start up correctly.
  18983.  
  18984.  
  18985.  9. U1355 Bad Command or File Name
  18986.  
  18987.  Product Version(s): 1.00   | 1.00
  18988.  Operating System:   MS-DOS | OS/2
  18989.  Flags: ENDUSER | docerr filename
  18990.  Last Modified: 27-SEP-1990    ArticleIdent: Q61607
  18991.  
  18992.  The following undocumented error may occur when attempting to run an
  18993.  executable file such as CL.EXE, LINK.EXE, NMAKE.EXE, etc., from inside
  18994.  the Programmer's WorkBench (PWB).
  18995.  
  18996.     U1355 Bad Command or File Name
  18997.  
  18998.  The error occurs because the directory containing the .EXE file is not
  18999.  specified in the search path or an incorrect LINK.EXE is being
  19000.  executed.
  19001.  
  19002.  This problem can be corrected by adding the missing directory name(s)
  19003.  to the path in the AUTOEXEC.BAT or STARTUP.CMD and rebooting, or
  19004.  executing NEW-VARS.BAT or NEW-VARS.CMD. If an incorrect linker is the
  19005.  problem, the search path can be rearranged to find the new version of
  19006.  the linker first, or the old linkers can be deleted or renamed.
  19007.  Finally, it may be necessary to delete the CURRENT.STS and PROG.STS
  19008.  files before the PWB will work correctly. This error is not documented
  19009.  in the PWB online help.
  19010.  
  19011.  
  19012.  10. Saving Compiler Results File in the PWB
  19013.  
  19014.  Product Version(s): 1.00   | 1.00
  19015.  Operating System:   MS-DOS | OS/2
  19016.  Flags: ENDUSER |
  19017.  Last Modified: 25-MAY-1990    ArticleIdent: Q61636
  19018.  
  19019.  The Programmer's WorkBench (PWB) deletes the compiler results file
  19020.  upon exiting the PWB. In DOS or OS/2, the file can be saved if the
  19021.  compiler results window is made current and the File.Save As menu
  19022.  option is selected.
  19023.  
  19024.  The compiler results file will appear similar to the following:
  19025.  
  19026.     +++ PWB  [E:\] Rebuild
  19027.             NMAKE  /z /a /f E:\pwb.mak
  19028.          cl /c /W4 /Fm /Ot /FoGLOBL.obj GLOBL.C
  19029.     Microsoft (R) C Optimizing Compiler Version 6.00
  19030.     Copyright (c) Microsoft Corp 1984-1990. All rights reserved.
  19031.  
  19032.     GLOBL.C
  19033.          echo @GLOBL.lrf > NUL
  19034.          link @GLOBL.lrf
  19035.  
  19036.     Microsoft (R) Segmented-Executable Linker  Version 5.10
  19037.     Copyright (C) Microsoft Corp 1984-1990.  All rights
  19038.     reserved.
  19039.  
  19040.     Object Modules [.OBJ]: GLOBL.obj,GLOBL.exe,NUL, /NOD:SLIBCE
  19041.     SLIBCEP , /NOI /BATCH /EXE /FAR /PACKC;
  19042.  
  19043.  
  19044.  11. Programmer's WorkBench Edit Switch Is Unimplemented
  19045.  
  19046.  Product Version(s): 1.00   | 1.00
  19047.  Operating System:   MS-DOS | OS/2
  19048.  Flags: ENDUSER | docerr
  19049.  Last Modified: 14-MAY-1990    ArticleIdent: Q61642
  19050.  
  19051.  The edit switch for the Programmer's WorkBench (PWB), documented on
  19052.  Page 79 of the version 6.00 "Microsoft C Reference" manual, is
  19053.  unimplemented in PWB version 1.00. The switch is designed to set the
  19054.  active file as read-only so that it cannot be edited.
  19055.  
  19056.  If you add an option in your TOOLS.INI file under the PWB tag to read
  19057.  either
  19058.  
  19059.     Edit:yes
  19060.     Edit:no
  19061.  
  19062.  PWB will return an error message saying "Edit is not an editor
  19063.  switch."
  19064.  
  19065.  As a workaround, invoke PWB with the /r option to open up the current
  19066.  file as read-only.
  19067.  
  19068.  
  19069.  12. Certain Key Sequences Cause R6003 or SYS1943 in PWB 1.00
  19070.  
  19071.  Product Version(s): 1.00   | 1.00
  19072.  Operating System:   MS-DOS | OS/2
  19073.  Flags: ENDUSER | buglist1.00 fixlist1.10
  19074.  Last Modified:  4-FEB-1991    ArticleIdent: Q61660
  19075.  
  19076.  In the Programmer's Workbench (PWB) version 1.00, it has been observed
  19077.  that certain unusual editing sequences can cause the following errors:
  19078.  
  19079.  In DOS:
  19080.  
  19081.     Run-time error R6003 - integer divide by 0
  19082.  
  19083.  In OS/2:
  19084.  
  19085.     SYS1943 protection violation, trap number 13
  19086.  
  19087.  The following sequences reproduce the errors:
  19088.  
  19089.     Procedure                             Keystrokes
  19090.     ---------                             ----------
  19091.  
  19092.  1. Bring up several files.               ALT+F O x3
  19093.     Select the Options menu.              ALT+O
  19094.     Select Linker options.                L
  19095.     Select Set Debug Options.             ALT+G
  19096.     Pull up help on the options.          F1
  19097.     Arg-refresh through several files.    ALT+A SHIFT+F7 x3
  19098.     Escape back to the Editor screen.     ESC x3
  19099.  
  19100.  2. Select the Options menu.              ALT+O
  19101.     Select Editor Settings.               S (or K)
  19102.     Go down thirteen lines.               DOWN ARROW key x13
  19103.     Backspace.                            BACKSPACE
  19104.     Undo.                                 ALT+BACKSPACE
  19105.  
  19106.  Note: Step 2 reproduces only the R6003 error in DOS, not the SYS1943
  19107.  error.
  19108.  
  19109.  
  19110.  13. PWB 1.00 Requires Decimal Value for Stack Size in LINK Options
  19111.  
  19112.  Product Version(s): 1.00    | 1.00
  19113.  Operating System:   MS-DOS  | OS/2
  19114.  Flags: ENDUSER | buglist1.00 fixlist1.10
  19115.  Last Modified:  5-FEB-1991    ArticleIdent: Q61871
  19116.  
  19117.  In the Programmer's WorkBench (PWB) version 1.00, there is a problem
  19118.  with changing a program's stack size in some situations. When
  19119.  specifying the stack size in the Link Options dialog box (from the
  19120.  Options menu), you must enter the value in the form of a decimal
  19121.  integer. Although the Help menu tells you this field accepts positive
  19122.  integers in octal and hexadecimal form, PWB 1.00 will not accept them.
  19123.  
  19124.  When an octal or hexadecimal value is entered in the stack-size field,
  19125.  any digits specified as A-F are discarded and replaced by 0 (zero). If
  19126.  digits precede a letter, the digits are retained and the letters are
  19127.  discarded.
  19128.  
  19129.  Microsoft has confirmed this to be a problem in PWB version 1.00. This
  19130.  problem was corrected in PWB version 1.10.
  19131.  
  19132.  
  19133.  14. SYS0002 Produced If MSHELP.DLL Not Installed
  19134.  
  19135.  Product Version(s): 1.00
  19136.  Operating System:   OS/2
  19137.  Flags: ENDUSER | pwbhelp
  19138.  Last Modified: 23-JAN-1991    ArticleIdent: Q61955
  19139.  
  19140.  Under OS/2, if MSHELP.DLL is not installed correctly or is not on the
  19141.  LIBPATH, the following error may appear in a window when starting the
  19142.  Programmer's WorkBench (PWB):
  19143.  
  19144.                      Cannot Autoload Extension
  19145.                      e:\c600\binp\pwbhelp.pxt
  19146.  MSHELP:  SYS0002:  The system cannot find the file specified
  19147.  
  19148.                          < OK >   < Help >
  19149.  
  19150.  Make sure that the latest version of MSHELP.DLL (the one that was
  19151.  included with the Microsoft C Compiler version 6.00) is installed in a
  19152.  directory contained in your LIBPATH.
  19153.  
  19154.  If this file was not copied off the disks during setup, you can
  19155.  execute the following command with your Setup disk in Drive A:
  19156.  
  19157.     a:setup /copy
  19158.  
  19159.  Specify the file MSHELP.DLL at the prompt, then specify the
  19160.  destination directory.
  19161.  
  19162.  The default for SETUP.EXE is to put OS/2 DLLs in the C:\OS2\DLL
  19163.  directory. If you choose to install the DLLs in some other directory,
  19164.  you must edit the LIBPATH in your CONFIG.SYS file and restart the
  19165.  system.
  19166.  
  19167.  
  19168.  15. Enabling of Source Browser Menu Related to .BSC and .MAK Files
  19169.  
  19170.  Product Version(s): 1.00   | 1.00
  19171.  Operating System:   MS-DOS | OS/2
  19172.  Flags: ENDUSER |
  19173.  Last Modified: 29-MAY-1990    ArticleIdent: Q61968
  19174.  
  19175.  The Source Browser feature of the Programmer's WorkBench (PWB) is
  19176.  enabled or disabled depending upon the existence of a database file
  19177.  (.BSC file) AND a program list (.MAK file). The existence of a .BSC
  19178.  database file alone does not guarantee that the Browse menu will be
  19179.  enabled for all modules in a project, even if the .BSC file was built
  19180.  from .SBR files for every module. The setting of a program list is
  19181.  also required.
  19182.  
  19183.  Thus, if a .BSC file is built outside of the PWB with PWBRMAKE, then
  19184.  upon entering the PWB, the Browser will be enabled for only one module
  19185.  at most (see below). The easiest method to enable the Browse menu for
  19186.  ALL modules is to select "Set program list" on the Make menu, then
  19187.  type in the base name of the .BSC file (with the .MAK or no extension)
  19188.  when it prompts you for the filename. If the .MAK file you enter does
  19189.  not exist, then the dialog box appears for adding files to the program
  19190.  list, whereas you can just select "Save List" without actually adding
  19191.  any files. At this point, the Browser menu will be enabled for all
  19192.  files you bring up into the PWB editor.
  19193.  
  19194.  The existence of a Source Browser database file means that the Browse
  19195.  menu will be enabled for a source file with a matching base name of
  19196.  the .BSC file.
  19197.  
  19198.  For example, assume a project consists of several modules, with the
  19199.  main source module called PROJECT.C. In addition, assume a Browser
  19200.  database file called PROJECT.BSC is built from the .SBR Browser
  19201.  information files produced by the compiler for every module in this
  19202.  project. If the file PROJECT.C is brought up in the PWB, the Browse
  19203.  menu will be enabled because the base name (PROJECT) is the same as
  19204.  the base name of the database file PROJECT.BSC.
  19205.  
  19206.  On the other hand, if any of the other source files in the project are
  19207.  opened in the PWB, the Browse menu will be disabled because the base
  19208.  names do not match the base name of the database file. Also, if
  19209.  PROJECT.C is made the current file (which enables the Browse menu) and
  19210.  an option is selected on the browse Menu, such as "Goto Reference"
  19211.  (which causes a jump to a different module), the Browse menu will
  19212.  become disabled. The only way to re-enable the Browse menu in this
  19213.  case is to make PROJECT.C the current file again.
  19214.  
  19215.  The way to enable the Browse menu for all modules is to set a program
  19216.  list to a file with the .MAK extension and the same base name as the
  19217.  .BSC file. Thus, in the example above, setting the program list to
  19218.  PROJECT.MAK will enable the Browse menu for all modules. In fact, this
  19219.  connection between the .BSC file and the .MAK file enables the Browse
  19220.  menu for the modules in the current project, and for ANY file opened
  19221.  under the PWB.
  19222.  
  19223.  The result is that if you bring up a file in the editor that is
  19224.  completely unrelated to the current project (and may not even have a
  19225.  related .BSC file), you can still use the Browse menu options.
  19226.  However, in this situation, the information available from the Browser
  19227.  still only pertains to the original project.
  19228.  
  19229.  In summary, the .MAK file and .BSC file relationship is based solely
  19230.  on the file existence, NOT the file contents. The program list does
  19231.  NOT need to contain the names of the modules in the current project
  19232.  (or even be an actual makefile) for the Browser to function.
  19233.  
  19234.  
  19235.  16. Modifying TOOLS.INI May Have No Effect on PWB Environment
  19236.  
  19237.  Product Version(s): 1.00   | 1.00
  19238.  Operating System:   MS-DOS | OS/2
  19239.  Flags: ENDUSER |
  19240.  Last Modified: 17-JUL-1990    ArticleIdent: Q62170
  19241.  
  19242.  Changing settings in the TOOLS.INI file to modify the behavior of the
  19243.  Programmer's WorkBench (PWB) may not work under certain circumstances.
  19244.  For instance, if you decide to change the PWB to 50-line mode by
  19245.  setting "height:50" in the TOOLS.INI file, it will not work if the PWB
  19246.  was previously used in the 25- or 43-line mode.
  19247.  
  19248.  This is because some environment information is also recorded in the
  19249.  CURRENT.STS file, which is read in after the TOOLS.INI file --
  19250.  overriding the TOOLS.INI settings.
  19251.  
  19252.  The following are three workarounds for this problem:
  19253.  
  19254.  1. Use the /DS switch when invoking the PWB. This will ignore the
  19255.     CURRENT.STS file. However, this option also causes the current file
  19256.     history (of files being edited) to be ignored.
  19257.  
  19258.  2. Delete the CURRENT.STS file. This also causes the current list of
  19259.     programs being edited to be ignored.
  19260.  
  19261.  3. The better option is to select Editor Settings from the Options
  19262.     menu. When the list of editor switch settings appears, it can be
  19263.     changed and saved to the TOOLS.INI file by pressing SHIFT+F2. This
  19264.     will save the settings and cause the selection to take effect.
  19265.  
  19266.  
  19267.  17. Reversing Mouse Buttons in the PWB Cannot Be Done
  19268.  
  19269.  Product Version(s): 1.00   | 1.00
  19270.  Operating System:   MS-DOS | OS/2
  19271.  Flags: ENDUSER |
  19272.  Last Modified: 25-JUL-1990    ArticleIdent: Q62330
  19273.  
  19274.  Currently under the Programmer's WorkBench (PWB) released with version
  19275.  6.00 of the Microsoft C Optimizing Compiler, it is not possible to
  19276.  reverse the functionality of the mouse buttons.
  19277.  
  19278.  It is possible to change the functionality of the mouse buttons under
  19279.  OS/2 and DOS, but this will be overridden by the PWB environment.
  19280.  
  19281.  
  19282.  18. Attempting to Expand a Help Dialog Box Hangs DOS
  19283.  
  19284.  Product Version(s): 1.00   | 1.00
  19285.  Operating System:   MS-DOS | OS/2
  19286.  Flags: ENDUSER | buglist1.00
  19287.  Last Modified: 25-JUL-1990    ArticleIdent: Q62331
  19288.  
  19289.  When one of the pull-down menus in the Programmer's WorkBench (PWB)
  19290.  version 1.00 is selected (File, Edit, View, etc.) and then F1 is
  19291.  chosen for help on that menu, a small help screen appears. If CTRL+F10
  19292.  is chosen in an attempt to expand the window to full screen, the
  19293.  machine will hang under DOS. If the machine doesn't hang, it may
  19294.  require another invocation of CTRL+F10 to cause the problem.
  19295.  
  19296.  Under OS/2, the machine may not hang, but the PWB's functionality will
  19297.  be disrupted and attempts to free oneself may cause a GP fault. It may
  19298.  be possible to exit the PWB, but at the very least, the CURRENT.STS
  19299.  file will be corrupted so that future entrances to PWB will result in
  19300.  very odd window configurations.
  19301.  
  19302.  Microsoft has confirmed this to be a problem with the PWB version
  19303.  1.00. We are researching this problem and will post new information
  19304.  here as it becomes available.
  19305.  
  19306.  
  19307.  19. PWB Doesn't Update Mark Location If Mark Moves Up or Left
  19308.  
  19309.  Product Version(s): 1.00 | 1.00
  19310.  Operating System:   OS/2 | 1.00
  19311.  Flags: ENDUSER | buglist1.00
  19312.  Last Modified: 13-JUN-1990    ArticleIdent: Q62388
  19313.  
  19314.  If you set a mark in a file, and that location then moves upward or
  19315.  toward the left in the file, PWB does not reset the mark location;
  19316.  however, it does correctly update marks that move downward or to the
  19317.  right in the file.
  19318.  
  19319.  Consider the following file:
  19320.  
  19321.  /* Test.dat */
  19322.  test1
  19323.  
  19324.  test2
  19325.  
  19326.  test3
  19327.  
  19328.  Place the cursor on the "2" in test2. Choose the Search.Define Mark
  19329.  menu option. Name the mark "mark1" and press ENTER. Now, move the
  19330.  cursor to another location in the file. Choose the Search.Go To Mark
  19331.  option from the menus. Go to "mark1". Note that the cursor is back on
  19332.  the "2" in test2.
  19333.  
  19334.  Next, add another blank line between test1 and test2. Again, move your
  19335.  cursor and go to mark1. Note that the cursor is back on the "2" in
  19336.  test2.
  19337.  
  19338.  Now, delete both the lines between test1 and test2. Select the
  19339.  Search.Go To Mark option from the menus. Note that the cursor is on
  19340.  the same location as it was before you deleted these lines. The same
  19341.  behavior will happen if you delete any of the characters before the
  19342.  "2" in the test2 line.
  19343.  
  19344.  Microsoft has confirmed this to be a problem in the Programmer's
  19345.  WorkBench (PWB) version 1.00. We are researching this problem and will
  19346.  post new information here as it becomes available.
  19347.  
  19348.  
  19349.  20. PWB 1.00 "Set Dependencies" Fails with Spaces in #include Line
  19350.  
  19351.  Product Version(s): 1.00   | 1.00
  19352.  Operating System:   MS-DOS | OS/2
  19353.  Flags: ENDUSER | buglist1.00 fixlist1.10 s_c
  19354.  Last Modified:  5-FEB-1991    ArticleIdent: Q62578
  19355.  
  19356.  The Programmer's WorkBench (PWB) version 1.00 (shipped with C version
  19357.  6.00) includes a "Set Dependencies" option in the "Set Program List"
  19358.  window. This option automatically sets up build dependencies for all
  19359.  include files used in the current project. This option will fail with
  19360.  a message that the include file does not exist if there are embedded
  19361.  spaces between the left angle bracket (<) and the include-file name in
  19362.  an include directive line.
  19363.  
  19364.  The Set Dependencies option will work correctly if the space(s) are
  19365.  removed or if a new build option is added to the TOOLS.INI file.
  19366.  
  19367.  Although embedded spaces are legal in C programming syntax, the
  19368.  Programmer's WorkBench fails to parse the include line correctly if
  19369.  spaces exist before the filename. The following line of code shows the
  19370.  situation where the "Set Dependencies" error will occur:
  19371.  
  19372.     #include < stdio.h >
  19373.  
  19374.  The space before the "s" in stdio.h prevents PWB from finding the
  19375.  STDIO.H include file. (The trailing space after stdio.h does not
  19376.  affect the behavior of "Set Dependencies".)
  19377.  
  19378.  The full text of the error message window for the line above is as
  19379.  follows:
  19380.  
  19381.          stdio.h does not exist
  19382.     Cannot build its dependency tree.
  19383.     Abort dependency lists generation?
  19384.          <Yes>    <No>    <Help>
  19385.  
  19386.  Selecting <Help> displays a help screen that describes the problem as
  19387.  being either a mistyped filename or a nonexistent file, but the actual
  19388.  file DOES exist. Removing the embedded space will correct the problem.
  19389.  
  19390.  You can also add two new "build" lines to the TOOLS.INI file to make
  19391.  the PWB recognize include directives that contain spaces. These lines
  19392.  should be included under the section with the [PWB] tag, and should
  19393.  have the following syntax:
  19394.  
  19395.     build: include .c                                              \
  19396.         "^[ \t]*#[ \t]*include[ \t]*\"[ \t]*\\([^\"]+[ \t]*\\)\""  \
  19397.         case
  19398.     build: include .c                                              \
  19399.        "^[ \t]*#[ \t]*include[ \t]*<[ \t]*\\([^>]+\\)[ \t]*>"      \
  19400.         case system
  19401.  
  19402.  (Note: These build switch statements are broken down into multiple
  19403.  lines with the line continuation character (\) because of space
  19404.  limitations; you may enter each of them into the TOOLS.INI file on a
  19405.  single line, rather than multiple lines.)
  19406.  
  19407.  There is one drawback to this workaround; you will still get the error
  19408.  message shown above because the "old" build switch is applied before
  19409.  the new one. To have the new build switch take effect, you need to
  19410.  select "No" when prompted to abort the dependency list generation.
  19411.  Once you have selected "No" for each file with spaces in the include
  19412.  directive, the dependencies will then be generated correctly.
  19413.  
  19414.  Microsoft has confirmed this to be a problem in the Programmer's
  19415.  WorkBench version 1.00. This problem was corrected in the Programmer's
  19416.  WorkBench version 1.10.
  19417.  
  19418.  
  19419.  21. PWB 1.10 Dialog Boxes May Blink After Dialog Help Is Obtained
  19420.  
  19421.  Product Version(s): 1.10
  19422.  Operating System:   MS-DOS
  19423.  Flags: ENDUSER | buglist1.10 flicker
  19424.  Last Modified: 19-FEB-1991    ArticleIdent: Q69347
  19425.  
  19426.  When working with the Programmer's WorkBench (PWB) version 1.10 under
  19427.  DOS, there are several instances where a dialog box may start flashing
  19428.  incorrectly. This situation occurs when you obtain help on a PWB
  19429.  informational pop-up dialog box and then return from the Help dialog
  19430.  screen. At this point you may find that the original dialog box is
  19431.  rapidly blinking.
  19432.  
  19433.  This problem may occur when trying to get help on a topic for which
  19434.  there is no help, trying to use an unassigned key, or when PWB informs
  19435.  you that you changed a file but didn't save it before you tried to
  19436.  exit. In each of these cases, PWB gives you a pop-up dialog box
  19437.  informing you of the situation. If you get help on this informational
  19438.  dialog box and then press ESC or click Cancel, the original dialog box
  19439.  will start blinking.
  19440.  
  19441.  This is not normal behavior, however, PWB is still fully functional
  19442.  and you may proceed by selecting an appropriate choice from the
  19443.  flashing dialog box.
  19444.  
  19445.  Microsoft has confirmed this to be a problem in the Programmer's
  19446.  WorkBench version 1.10. We are researching this problem and will post
  19447.  new information here as it becomes available.
  19448.  
  19449.  
  19450.  22. R6000 Stack Overflow After Deleting Current Makefile
  19451.  
  19452.  Product Version(s): 1.00   | 1.00
  19453.  Operating System:   MS-DOS | OS/2
  19454.  Flags: ENDUSER |
  19455.  Last Modified: 25-JUL-1990    ArticleIdent: Q62668
  19456.  
  19457.  If you are viewing your makefile in a window in PWB 1.00, then delete
  19458.  the makefile from a shell; attempting to make the window containing
  19459.  the makefile active will cause a run-time error R6000, stack overflow.
  19460.  
  19461.  To duplicate this problem, bring up a sample program and set the
  19462.  program list to that file's makefile. Next, open up another window
  19463.  and open the makefile in that window. Now, either from the Run.Run
  19464.  <DOS-OS/2> Command menu or the File.<DOS-OS/2> Shell, delete that
  19465.  makefile.
  19466.  
  19467.  After returning back to the PWB, make the window containing the
  19468.  makefile the active program list either by pressing the F6 key to
  19469.  toggle windows or by clicking the left mouse button in that window.
  19470.  
  19471.  You will be faced with a popup message saying "File has been deleted
  19472.  from disk. Delete from memory?" Answering "yes" brings up the popup
  19473.  six to eight more times. Then, PWB will abort to the system prompt
  19474.  with an R6000 (stack overflow) error message and another message, "File
  19475.  has been deleted from disk."
  19476.  
  19477.  Microsoft has confirmed this to be a problem in PWB version 1.00. We
  19478.  are researching this problem and will post new information here as it
  19479.  becomes available.
  19480.  
  19481.  
  19482.  23. PWB 1.00 Extensions Only Return True Under DOS
  19483.  
  19484.  Product Version(s): 1.00
  19485.  Operating System:   MS-DOS
  19486.  Flags: ENDUSER | buglist1.00
  19487.  Last Modified: 15-AUG-1990    ArticleIdent: Q63052
  19488.  
  19489.  Extensions written for use by the Programmer's WorkBench (PWB) version
  19490.  1.00 under the DOS operating system are recognized as returning true
  19491.  regardless of their actual return values.
  19492.  
  19493.  The use of return values as a way of providing conditional jumps
  19494.  inside PWB macros is a common practice that is affected by the above
  19495.  limitation for PWB extensions. The following sample extension and
  19496.  macro demonstrate the above problem. Once installed, both the foo()
  19497.  and foo2() functions will be seen as returning true to PWB.
  19498.  
  19499.  Sample Code
  19500.  -----------
  19501.  
  19502.  // foo.c
  19503.  
  19504.  #include <string.h>
  19505.  #include <stdlib.h>
  19506.  #include <ext.h>
  19507.  
  19508.  PWBFUNC foo( unsigned argData, ARG far *pArg, flagType fMeta );
  19509.  PWBFUNC foo2( unsigned argData, ARG far *pArg, flagType fMeta);
  19510.  
  19511.  // Switches.
  19512.  struct swiDesc swiTable[] =
  19513.  {
  19514.     { NULL, NULL, 0 }
  19515.  };
  19516.  
  19517.  // Commands.
  19518.  struct cmdDesc cmdTable[] =
  19519.  {
  19520.     { "foo", foo, 0, NOARG },
  19521.     { "foo2",foo2,0, NOARG },
  19522.     { NULL, NULL, 0, 0 }
  19523.  };
  19524.  
  19525.  void EXTERNAL WhenLoaded()
  19526.  {
  19527.      SetKey( "foo",         "alt+f" );
  19528.      SetKey( "foo2",       "ctrl+f" );
  19529.      return;
  19530.  }
  19531.  
  19532.  PWBFUNC foo( unsigned argData, ARG far *pArg, flagType fMeta )
  19533.  {
  19534.   return(FALSE);  /* FALSE is defined as 0 in ext.h */
  19535.  }
  19536.  
  19537.  PWBFUNC foo2( unsigned argData, ARG far *pArg, flagType fMeta)
  19538.  {
  19539.   return(TRUE);   /* TRUE is defined as 1 in ext.h  */
  19540.  }
  19541.  
  19542.  // End of foo.c
  19543.  
  19544.  ; macros in tools.ini to test foo and foo2
  19545.  
  19546.  load foo
  19547.  
  19548.  test:=foo ->loc1 arg "true" message => :>loc1 arg "false" message
  19549.  test2:=foo2 ->loc2 arg "true" message => :>loc2 arg "false" message
  19550.  
  19551.  test:alt+t
  19552.  test2:ctrl+2
  19553.  
  19554.  Microsoft has confirmed this to be a problem with PWB version 1.00. We
  19555.  are researching this problem and will post new information here as it
  19556.  becomes available.
  19557.  
  19558.  
  19559.  24. PWB Text Highlight with Mouse Acts Strange After Search
  19560.  
  19561.  Product Version(s): 1.00   | 1.00
  19562.  Operating System:   MS-DOS | OS/2
  19563.  Flags: ENDUSER |
  19564.  Last Modified: 15-AUG-1990    ArticleIdent: Q63059
  19565.  
  19566.  The click-and-drag method of selecting text with the mouse in the
  19567.  Programmer's Workbench (PWB) sometimes works incorrectly when used
  19568.  after a search function.
  19569.  
  19570.  To reproduce this problem, do the following:
  19571.  
  19572.  1. Select a word in the text using the mouse (double-click on a single
  19573.     word).
  19574.  
  19575.  2. Execute the search function (select the Search menu, choose Find,
  19576.     then OK).
  19577.  
  19578.  3. Now try to highlight the text a few lines below the word you used
  19579.     to search on (using the click-and-drag method).
  19580.  
  19581.  The text will be highlighted starting at the original word that was
  19582.  searched for, rather than at the starting mouse position.
  19583.  
  19584.  To work around this problem, click the left button anywhere in the
  19585.  text window, then perform the text highlight.
  19586.  
  19587.  Microsoft has confirmed this to be a problem with the Programmer's
  19588.  Workbench version 1.00. We are researching this problem and will post
  19589.  new information here as it becomes available.
  19590.  
  19591.  
  19592.  25. PWB Does Not Return from DOS Shell with ";" in TMP
  19593.  
  19594.  Product Version(s): 1.00
  19595.  Operating System:   MS-DOS
  19596.  Flags: ENDUSER |
  19597.  Last Modified: 25-JUL-1990    ArticleIdent: Q62702
  19598.  
  19599.  If there is a semicolon ";" in your TMP environment variable, you may
  19600.  not be able to return to the Programmer's Workbench by typing "exit"
  19601.  after selecting "DOS Shell" from the File menu in PWB.
  19602.  
  19603.  Since the TMP environment variable is used to specify a single
  19604.  directory rather than a path, the semicolon character should not be
  19605.  used.
  19606.  
  19607.  To re-create this situation, type the following at the command line:
  19608.  
  19609.     set TMP=C:\TMP;
  19610.  
  19611.  Then select DOS Shell from within PWB. Typing "exit" on the DOS
  19612.  command line will not bring you back into PWB.
  19613.  
  19614.  To correct the problem, remove the semicolon from the end of the TMP
  19615.  environment variable.
  19616.  
  19617.  
  19618.  26. PWB BACKUP.BAK Does Not Create Backup of Source File Correctly
  19619.  
  19620.  Product Version(s): 1.00   | 1.00
  19621.  Operating System:   MS-DOS | OS/2
  19622.  Flags: ENDUSER| buglist1.00
  19623.  Last Modified: 24-JUL-1990    ArticleIdent: Q63234
  19624.  
  19625.  Version 1.00 of the Programmer's Workbench does not create a backup of
  19626.  your source file correctly if the PROJECT.MAK has the same base name
  19627.  as the SOURCE.C file. When you build or rebuild the project, the file
  19628.  saved as your backup is a copy of the CURRENT.STS file.
  19629.  
  19630.  A workaround to this problem is to name your PROJECT.MAK with a
  19631.  different base name than your SOURCE.C file. This will still save a
  19632.  copy of your CURRENT.STS file with the base name of the PROJECT.MAK.
  19633.  However, it will correctly save a backup of the SOURCE.C as
  19634.  SOURCE.BAK.
  19635.  
  19636.  Microsoft has confirmed this to be a problem in version 1.00 of the
  19637.  Programmer's Workbench and will post new information here as it
  19638.  becomes available.
  19639.  
  19640.  
  19641.  
  19642.  27. PWB menukey Switch Resets to ALT When Shelling Out to DOS
  19643.  
  19644.  Product Version(s): 1.00
  19645.  Operating System:   MS-DOS
  19646.  Flags: ENDUSER | buglist1.00
  19647.  Last Modified: 10-JUL-1990    ArticleIdent: Q63267
  19648.  
  19649.  If the "menukey" switch in the DOS version of the Programmer's
  19650.  Workbench (PWB) version 1.00 is set to anything other than ALT (which
  19651.  is the default), it will be redefined to the ALT key after shelling
  19652.  out to DOS. This means the menukey switch will lose its assignment
  19653.  anytime you choose Compile, Run Program, Debug Program, or DOS Shell.
  19654.  
  19655.  The menukey switch determines which keystroke activates the PWB main
  19656.  menu bar. The ALT key is normally used for this, but menukey can be
  19657.  redefined to any keystroke. For example, menukey is automatically
  19658.  defined to F9 if you select Brief Editor emulation when installing the
  19659.  Programmer's WorkBench.
  19660.  
  19661.  Whenever you invoke any function (such as Build) that goes out to DOS
  19662.  for execution and then returns, the menukey switch is reset to ALT, so
  19663.  that both ALT AND the user-defined keystroke invoke the menu.
  19664.  
  19665.  To work around this problem, you can use the Restart command to invoke
  19666.  a macro that redefines the menukey to the desired value each time you
  19667.  return from a DOS SHELL command, which will then keep ALT from
  19668.  activating the menu. For example, to make it so that F9 is always
  19669.  reset as the only menukey, put the following line in the PWB tagged
  19670.  section of the TOOLS.INI file:
  19671.  
  19672.     restart:= arg "menukey:F9" assign
  19673.  
  19674.  Since the Restart command, if it exists in TOOLS.INI, is invoked
  19675.  automatically when returning from a SHELL command, this guarantees
  19676.  that the key assignment will always remain consistent.
  19677.  
  19678.  Microsoft has confirmed that the automatic reactivation of ALT as the
  19679.  menukey is a problem with the Programmer's WorkBench version 1.00. We
  19680.  are researching this problem and will post new information here as it
  19681.  becomes available.
  19682.  
  19683.  
  19684.  28. PWB: Print Does Not Put CR/LF at EOL If Text Selected
  19685.  
  19686.  Product Version(s): 1.00   | 1.00
  19687.  Operating System:   MS-DOS | OS/2
  19688.  Flags: ENDUSER | buglist1.00
  19689.  Last Modified: 25-JUL-1990    ArticleIdent: Q63318
  19690.  
  19691.  Using the Programmer's Workbench version 1.00, when a region of text
  19692.  is selected and the Print function is invoked, the resulting output
  19693.  contains linefeed characters (0x0A) at the end of each line, rather
  19694.  than a carriage return/linefeed (<CR><LF>) combination (0x0D and
  19695.  0x0A).
  19696.  
  19697.  Some printer drivers do not recognize this as a valid end-of-line
  19698.  (EOL) character and do not print correctly.
  19699.  
  19700.  To reproduce this problem, open a file that contains the <CR><LF>
  19701.  combination at the end of each line. Highlight a region of text in the
  19702.  file and from the File menu choose Print. Tab to the second field and
  19703.  type in the following:
  19704.  
  19705.     copy %s test.txt
  19706.  
  19707.  This will copy the region of selected to the file TEST.TXT. Using a
  19708.  standard hex file viewer, you can see that the end of a line is
  19709.  denoted by a single 0A. If you look at the original file using the hex
  19710.  viewer, it will contain 0A 0D at the end of each line.
  19711.  
  19712.  The Programmer's Workbench will recognize this type of file (with a
  19713.  single 0A at each end of line) and display it correctly if you try to
  19714.  open it within the Workbench, but many printer drivers do not
  19715.  understand this type of file.
  19716.  The workaround for this problem is to write a program that translates
  19717.  each 0x0A found in the output file to the bytes 0x0D and 0x0A, or use
  19718.  a printer driver that understands this type of file. In fact, most
  19719.  printers have an escape sequence or dip switch to make it recognize
  19720.  this type of file.
  19721.  
  19722.  Microsoft has confirmed this to be a problem with the Programmer's
  19723.  Workbench version 1.00. We are researching this problem and will
  19724.  post new information here as it becomes available.
  19725.  
  19726.  
  19727.  29. Unknown Function psrch with Brief Emulation in PWB
  19728.  
  19729.  Product Version(s): 1.00   | 1.00
  19730.  Operating System:   MS-DOS | OS/2
  19731.  Flags: ENDUSER |
  19732.  Last Modified: 25-JUL-1990    ArticleIdent: Q63319
  19733.  
  19734.  When using the Brief emulation feature of the Programmer's WorkBench
  19735.  version 1.00, reinitialization of the TOOLS.INI file will cause a
  19736.  number of unknown functions to appear when you try to use them. In
  19737.  short, most of the unknown functions that may be reported are related
  19738.  to search features such as the psearch switch. The error message
  19739.  associated with this search feature is commonly "Unknown function
  19740.  psrch."
  19741.  
  19742.  This error occurs only after you use the Initialize function.
  19743.  
  19744.  The Initialize function discards current macro definitions and rereads
  19745.  the appropriate section of TOOLS.INI. This is not exactly the same as
  19746.  restarting PWB; the Autostart macro is not executed after Initialize.
  19747.  The BRIEF emulation depends on the Autostart macro to define the
  19748.  search functions.
  19749.  
  19750.  To recover the definition of the missing macros, execute the toggle_re
  19751.  BRIEF emulation macro (CTRL+F6). To avoid having to remember to
  19752.  execute this macro, you can add this to the main section of TOOLS.INI:
  19753.  
  19754.     reinit:=Initialize Autostart
  19755.     reinit:Shift+F8
  19756.  
  19757.  Or you can define the macros as follows:
  19758.  
  19759.     psrch:=arg arg "String to Search for" prompt ->can
  19760.                                             psearch => :>can cancel
  19761.     msrch:=arg arg "String to Search for" prompt ->can
  19762.                                             msearch => :>can cancel
  19763.     qrepl:=arg arg qreplace
  19764.     srchname:="REoff"
  19765.  
  19766.  
  19767.  30. Problems Viewing README.DOC Inside PWB Online Help and QH
  19768.  
  19769.  Product Version(s): 1.00
  19770.  Operating System:   MS-DOS
  19771.  Flags: ENDUSER  |
  19772.  Last Modified: 15-AUG-1990    ArticleIdent: Q63661
  19773.  
  19774.  Problems can occur when attempting to access the README.DOC from
  19775.  within the DOS versions of Programmer's WorkBench (PWB) or QH via the
  19776.  online help.
  19777.  
  19778.  When attempting to view the README.DOC file using the online help
  19779.  inside the DOS version of PWB, the messages "Error displaying help"
  19780.  and then "Cannot process cross reference" may be displayed in
  19781.  successive dialog boxes.
  19782.  
  19783.  When attempting to view the README.DOC file from within QH, the
  19784.  message "The database README.DOC is not open, or the topic is not
  19785.  found" may be displayed.
  19786.  
  19787.  Again, these problems are found only in the DOS version of PWB and QH.
  19788.  Access of the README.DOC in this manner does not produce errors under
  19789.  the OS/2 versions of PWB or QH.
  19790.  
  19791.  The following are two possible workarounds for the problem in PWB:
  19792.  
  19793.  1. The README.DOC can be loaded into the help system by typing the
  19794.     following
  19795.  
  19796.        arg "$PATH:readme.doc!" arg pwbhelp
  19797.  
  19798.     with default keys:
  19799.  
  19800.        Alt+A $PATH:readme.doc! F1
  19801.  
  19802.     Note that this method may fail if there is another file named
  19803.     README.DOC in the path before the C 6.00 README.DOC. If this is the
  19804.     case, the other README.DOC will be loaded instead of the C 6.00
  19805.     README.DOC. This method can also fail if there is not enough memory
  19806.     to load the file into the help system.
  19807.  
  19808.  2. If the previous method fails, the C 6.00 README.DOC can be loaded
  19809.     into PWB as a normal text file via the File.Open menu option. The
  19810.     README.DOC can be found in the C 6.00 bound executable directory
  19811.     (for example, C:\C600\BINB).
  19812.  
  19813.  The following are three possible workarounds for the problem in QH:
  19814.  
  19815.  1. Inside QH, select View.Search, type "$PATH:readme.doc!" and press
  19816.     ENTER. Again, this will bring up the first README.DOC on the path.
  19817.  
  19818.  2. You can also select File.Open and load the the file by giving the
  19819.     full path and filename of the C 6.00 README.DOC. QH allows you to
  19820.     open any text file under 64K in size.
  19821.  
  19822.  3. To enable direct access of the README.DOC from within QH via the
  19823.     README.DOC button, it is necessary to point the QH environment
  19824.     variable to the directory where the README.DOC is located. For
  19825.     example:
  19826.  
  19827.        set qh=c:\c600\binb\readme.doc
  19828.  
  19829.     The QH environment variable is not documented in the C 6.00 printed
  19830.     or online documentation.
  19831.  
  19832.  Microsoft is researching this problem and will post new information
  19833.  here as it becomes available.
  19834.  
  19835.  
  19836.  31. CTRL+NUM/ May be Read as CTRL+/ in DOS with NUM LOCK On
  19837.  
  19838.  Product Version(s): 1.00 1.10 | 1.00 1.10
  19839.  Operating System:   MS-DOS    | OS/2
  19840.  Flags: ENDUSER | buglist1.10
  19841.  Last Modified: 15-NOV-1990    ArticleIdent: Q66740
  19842.  
  19843.  In versions 1.00 and 1.10 of Programmer's WorkBench (PWB), the
  19844.  CTRL+NUM/ (CTRL+/ on the numeric keypad) and ALT+NUM/ (ALT+/ on the
  19845.  numeric keypad) combinations may be interpreted as CTRL+/ and ALT+/
  19846.  (on the main keyboard). This problem happens only in DOS or the OS/2
  19847.  DOS 3.x box, and only on certain computers. This behavior will cause
  19848.  any macro or function assigned to CTRL+NUM/ or ALT+NUM/ to not execute
  19849.  when NUM LOCK is on.
  19850.  
  19851.  To reproduce this problem, assign a function or macro to CTRL+NUM/.
  19852.  Then execute the TELL function (CTRL+T by default) and press CTRL+NUM/.
  19853.  The TELL function prompts for a keystroke, then displays the name of
  19854.  the keystroke and the function assigned to it. With NUM LOCK on, TELL
  19855.  will return the following:
  19856.  
  19857.     unassigned:Ctrl+/.
  19858.  
  19859.  With NUM LOCK off, TELL will return the following:
  19860.  
  19861.     <function name>:Ctrl+num/.
  19862.  
  19863.  This behavior is identical for the ALT+NUM/ key name, but works
  19864.  properly for all other key names on the numeric keypad.
  19865.  
  19866.  If NUM LOCK is off, or if the protected-mode version of PWB is run,
  19867.  this behavior does not occur.
  19868.  
  19869.  This behavior has been observed on the following machines:
  19870.  
  19871.     Northgate 386-33
  19872.     PS/2 Model 70
  19873.     PS/2 Model 80-311
  19874.  
  19875.  Microsoft has confirmed this to be a problem in PWB version 1.00 and
  19876.  1.10. We are researching this problem and will post new information
  19877.  here as it becomes available.
  19878.  
  19879.  
  19880.  32. PWB Command-Line Option /DP Is Documented But Not Implemented
  19881.  
  19882.  Product Version(s): 1.00   | 1.00
  19883.  Operating System:   MS-DOS | OS/2
  19884.  Flags: ENDUSER | docerr
  19885.  Last Modified: 27-JUL-1990    ArticleIdent: Q63951
  19886.  
  19887.  The /DP switch for the Programmer's WorkBench (PWB), documented on
  19888.  Page 49 of the version 6.00 "Microsoft C Reference," is not
  19889.  implemented in version 1.00 of the PWB. This switch is designed to
  19890.  ignore the most recent program list upon starting the PWB.
  19891.  
  19892.  The /DP switch is mentioned only in the "Microsoft C Reference" and
  19893.  not in the online help.
  19894.  
  19895.  Upon invocation, the Programmer's WorkBench version 1.00 does not
  19896.  automatically set the program list to the last program list used.
  19897.  Therefore, the /DP command-line switch was not implemented because it
  19898.  would have no purpose.
  19899.  
  19900.  With the PWB version 1.00, there is no way to have the last program
  19901.  list set automatically at startup.
  19902.  
  19903.  
  19904.  33. With the "deflang" Switch PWB Prompts for Setting Program List
  19905.  
  19906.  Product Version(s): 1.00   | 1.00
  19907.  Operating System:   MS-DOS | OS/2
  19908.  Flags: ENDUSER | docerr
  19909.  Last Modified:  3-AUG-1990    ArticleIdent: Q64353
  19910.  
  19911.  As documented on Page 79 of the "Microsoft C Reference" shipped with C
  19912.  version 6.00 and in the online help, the "deflang" switch in the
  19913.  Programmer's WorkBench (PWB) sets the default filename extension for
  19914.  list boxes in PWB dialog boxes. Another (undocumented) feature of this
  19915.  switch is to enable you to be prompted to "Set Program List?" when
  19916.  loading a source file with a .MAK file associated with it in the
  19917.  current directory.
  19918.  
  19919.  By default, "deflang" is not set. You can set the deflang switch in
  19920.  the [PWB] tagged section of the TOOLS.INI file, for example:
  19921.  
  19922.     deflang:C
  19923.  
  19924.  This changes the default filename extension in the PWB's dialog boxes
  19925.  (such as Open in the File menu) from "*.*" to "*.c", so that only
  19926.  files with the .c extension show up by default. Other languages can be
  19927.  specified as well, as shown below:
  19928.  
  19929.     Switch Setting     Extension
  19930.     --------------     ---------
  19931.  
  19932.     no value            .*
  19933.     C                   .c
  19934.     Asm                 .asm
  19935.     BASIC               .bas
  19936.     FORTRAN             .for
  19937.     Pascal              .pas
  19938.     COBOL               .cbl
  19939.     LISP                .lsp
  19940.  
  19941.  Note that the online documentation specifies "Assembler" as the switch
  19942.  to use for .ASM files, but this is incorrect. "Asm" is the correct
  19943.  switch to use to make Assembler the default language.
  19944.  
  19945.  The deflang switch also enables you to be prompted as to whether or
  19946.  not the program list should be set automatically. If you load a file
  19947.  that has the extension specified by the "deflang" switch and you also
  19948.  have a .MAK file with the same base filename in the same directory,
  19949.  the PWB will prompt you about loading the program list.
  19950.  
  19951.  For example, assume that deflang is set to C and FOO.MAK and FOO.C are
  19952.  in the same directory. If you type PWB FOO.C at the command-prompt,
  19953.  the PWB will pause when loading and prompt with "Set Program List?
  19954.  FOO.MAK". At this point you can specify <yes> or <no>.
  19955.  
  19956.  When already in the PWB, if you select Open from the File menu, and
  19957.  select FOO.C as the file to open, the PWB will also prompt you at this
  19958.  point regarding whether or not you want FOO.MAK loaded as the program
  19959.  list, but only if NO program list is currently set.
  19960.  
  19961.  
  19962.  34. Can't Resize a Window with a Macro in PWB
  19963.  
  19964.  Product Version(s): 1.00   | 1.00
  19965.  Operating System:   MS-DOS | OS/2
  19966.  Flags: ENDUSER |
  19967.  Last Modified: 30-AUG-1990    ArticleIdent: Q64433
  19968.  
  19969.  A window cannot be resized using the "resize" function in a macro.
  19970.  After Programmer's WorkBench (PWB) performs the resize function, it
  19971.  waits for the you to respond with the UP ARROW or DOWN ARROW key.
  19972.  Functions that are placed in the macro after the resize function are
  19973.  ignored. If "record on" is selected and you try to record the resizing
  19974.  of a window, the macro will stop recording until the ENTER key on the
  19975.  numeric keypad is pressed.
  19976.  
  19977.  The following is an example:
  19978.  
  19979.     resizeit:= cancel arg arg nextmsg window resize up up up NumEnter
  19980.  
  19981.  The above example stops at the resize function and waits for you to
  19982.  resize the window. The remaining functions are ignored.
  19983.  
  19984.  To make a window a specified size, move the cursor to a location on
  19985.  the screen and then open the window with the "window" function.
  19986.  
  19987.  The following is an example of a macro that opens the "<compile>"
  19988.  window with a specified size:
  19989.  
  19990.  compile_size:= up up up up up up up up up up
  19991.  resize_it:=cancel meta down compile_size arg window window arg \
  19992.             "<compile>" setfile window
  19993.  resize_it:ALT+U
  19994.  
  19995.  Note: The size of the compile window can be adjusted by changing the
  19996.  number of ups on the compile_size line.
  19997.  
  19998.  
  19999.  35. PWB Hangs When Run with Some Communication Programs Under OS/2
  20000.  
  20001.  Product Version(s): 1.00
  20002.  Operating System:   OS/2
  20003.  Flags: ENDUSER |
  20004.  Last Modified: 30-AUG-1990    ArticleIdent: Q64435
  20005.  
  20006.  When running Programmer's WorkBench (PWB) under OS/2 while
  20007.  simultaneously running communication programs, PWB will appear to
  20008.  hang. To correct the problem, terminate any communication programs and
  20009.  PWB will resume as normal.
  20010.  
  20011.  
  20012.  36. "Cannot Open File current.$" May Mean Incorrect INIT Variable
  20013.  
  20014.  Product Version(s): 1.00   | 1.00
  20015.  Operating System:   MS-DOS | OS/2
  20016.  Flags: ENDUSER |
  20017.  Last Modified: 17-DEC-1990    ArticleIdent: Q64566
  20018.  
  20019.  When using the Programmer's Workbench (PWB), the following message may
  20020.  appear as a pop-up dialog box when selecting Compile or DOS Shell (or
  20021.  OS/2 Shell for OS/2):
  20022.  
  20023.     +----- Cannot open file! -----+
  20024.     |   D:\TEST\SRC\X\current.$   |
  20025.     |  No such file or directory  |
  20026.     |-----------------------------|
  20027.     |      < OK >   < Help >      |
  20028.     +-----------------------------+
  20029.  
  20030.  One cause for this error is an incorrect setting of the INIT
  20031.  environment variable. To remedy the situation, exit PWB and make sure
  20032.  that the INIT environment variable is set to a valid directory name
  20033.  (for example, a directory that exists).
  20034.  
  20035.  To reproduce this message, set your INIT environment variable to an
  20036.  invalid directory, for instance (if a directory named X does not exist
  20037.  on your drive):
  20038.  
  20039.     SET INIT=X
  20040.  
  20041.  Then start PWB and try to compile a program. The message will appear
  20042.  in the middle of the screen.
  20043.  
  20044.  One possible reason why your INIT environment variable may be set
  20045.  incorrectly, even if your AUTOEXEC.BAT sets it correctly, is that you
  20046.  might have run out of environment space in the setting of the
  20047.  variable. You can refer to the "MS-DOS Encyclopedia," Article 2, for
  20048.  more information about increasing your environment space.
  20049.  
  20050.  
  20051.  37. How to Use the PWB with the Windows 3.00 SDK
  20052.  
  20053.  Product Version(s): 1.00   | 1.00
  20054.  Operating System:   MS-DOS | OS/2
  20055.  Flags: ENDUSER |
  20056.  Last Modified: 15-AUG-1990    ArticleIdent: Q64788
  20057.  
  20058.  Detailed step-by-step instructions on how to set up the Programmer's
  20059.  WorkBench (PWB) for use with the Windows version 3.00 Software
  20060.  Development Kit (SDK) can be found in a file provided with the SDK
  20061.  called PWBINFO.WRI.
  20062.  
  20063.  The file explains how to set PWB switches so that Windows applications
  20064.  can be built from within PWB. The file also explains how to access the
  20065.  SDK's online help.
  20066.  
  20067.  This file can be viewed and printed with the WRITE program, which is
  20068.  packaged with the Windows 3.00 package.
  20069.  
  20070.  
  20071.  38. Tips for Using the Microsoft Advisor Online Help
  20072.  
  20073.  Product Version(s): 1.00 1.10 | 1.00 1.10
  20074.  Operating System:   MS-DOS    | OS/2
  20075.  Flags: ENDUSER | s_quickc s_c s_qh
  20076.  Last Modified: 23-JAN-1991    ArticleIdent: Q64829
  20077.  
  20078.  The following are some tips for more effectively using the online
  20079.  documentation included with the Microsoft C Compiler version 6.00
  20080.  Programmer's Workbench (PWB) as well as the Microsoft Advisor
  20081.  command-line help system:
  20082.  
  20083.  1. Finding help on a topic for which the exact name is not known.
  20084.  
  20085.     If the exact spelling of a topic is not known, the help for that
  20086.     topic can't be accessed directly (for instance, by using the F1 key
  20087.     in PWB), but it can usually be found indirectly.
  20088.  
  20089.     By using the table of contents and selecting links that pertain to
  20090.     the subject in question, the topic can usually be found. To get to
  20091.     the table of contents from within QuickHelp, select the Categories
  20092.     menu, then "C 6.00".  From within PWB, choose the Help menu, then
  20093.     select Contents.
  20094.  
  20095.     If you know the general spelling of the topic, an alphabetical
  20096.     index is available by choosing Index from the main contents screen.
  20097.  
  20098.  2. "Paging" through the online documentation.
  20099.  
  20100.     The online documentation can be "paged through" like you would page
  20101.     through a manual.
  20102.  
  20103.     In PWB, CTRL+F1 takes you from one topic to the next sequential
  20104.     topic in the help file. In QuickHelp, Choose Next or Back from the
  20105.     View menu to move in either direction.
  20106.  
  20107.  3. Scanning a list of available topics (as in a printed index).
  20108.  
  20109.     There are alphabetical indices for every major component of the
  20110.     product. Just choose Index from the main contents screen and select
  20111.     the appropriate topic.
  20112.  
  20113.  4. Techniques for using the online help.
  20114.  
  20115.     For more information on how to use the help system, as well as on
  20116.     the general organization and structure of the help system, choose
  20117.     Using Help from the main contents screen.
  20118.  
  20119.     For additional help, see Chapter 4, "Using the On-Line Reference,"
  20120.     of the "Microsoft C Installing and Using the Professional
  20121.     Development System" manual that comes with C version 6.00.
  20122.  
  20123.  5. Printing out the online help files.
  20124.  
  20125.     By using the HELPMAKE utility, the help files can be decoded to
  20126.     readable text files, which can then be printed. For more
  20127.     information about the HELPMAKE utility, see Chapter 7 of the
  20128.     "Microsoft C Advanced Programming Techniques" manual that comes
  20129.     with C version 6.00.
  20130.  
  20131.  
  20132.  39. Predefined Identifiers in Microsoft C 6.00
  20133.  
  20134.  Product Version(s): 6.00   | 6.00
  20135.  Operating System:   MS-DOS | OS/2
  20136.  Flags: ENDUSER | s_quickhelp s_c s_utils
  20137.  Last Modified: 24-OCT-1990    ArticleIdent: Q65472
  20138.  
  20139.  The following information is contained in the online help for the
  20140.  Microsoft C Compiler version 6.00.
  20141.  
  20142.  This information below can be accessed by using the following steps:
  20143.  
  20144.  1. Obtain help on the text "cl" using either the F1 key from the
  20145.     Programmer's WorkBench, or by using "qh cl" from the DOS or OS/2
  20146.     command lines.
  20147.  
  20148.  2. Select Preprocessor Options, then Predefined Identifiers.
  20149.  The compiler automatically defines identifiers useful in writing
  20150.  portable programs. You can use these identifiers to compile code
  20151.  sections conditionally. These identifiers are always defined unless
  20152.  otherwise stated.
  20153.  
  20154.     Identifier       Target Identified
  20155.     ----------       -----------------
  20156.  
  20157.     MSDOS            MS-DOS operating system
  20158.     M_I86            Member of the I86 processor family
  20159.     M_I86mM          Memory model type
  20160.                      <m> = T    Tiny
  20161.                            S    Small (default)
  20162.                            C    Compact model
  20163.                            M    Medium model
  20164.                            L    Large model
  20165.                            H    Huge model
  20166.     M_I8086          8088 or 8086 processor; default or with /G0
  20167.                         option
  20168.     M_I286           80286 processor; defined with /G1 or /G2 option
  20169.     _MSC_VER         Identifies the version of Microsoft C
  20170.     NO_EXT_KEYS      Disables Microsoft-specific language extensions
  20171.                         and extended keywords; defined only with /Za
  20172.                         option
  20173.     _CHAR_UNSIGNED   Changes default char type to unsigned; defined
  20174.                         only with /J option
  20175.  
  20176.  The _MSC_VER identifier has a value of 600 for the Microsoft C Compiler
  20177.  version 6.00. This identifier is not defined in Microsoft C versions
  20178.  5.10 and earlier.
  20179.  
  20180.  
  20181.  40. How to Add Other Language Compilers to PWB's Build Options
  20182.  
  20183.  Product Version(s): 1.00 1.10 | 1.00 1.10
  20184.  Operating System:   MS-DOS    | OS/2
  20185.  Flags: ENDUSER | s_pascal b_basiccom s_c h_masm h_fortran b_cobol
  20186.  Last Modified: 24-OCT-1990    ArticleIdent: Q65568
  20187.  
  20188.  The Programmer's WorkBench (PWB) is an environment capable of
  20189.  utilizing different compilers for mixed-language programming. When
  20190.  installed during BASIC version 7.10 setup, PWB version 1.10 shows
  20191.  build options for the BASIC language only. However, it is possible to
  20192.  include other language compilers to utilize the full features of the
  20193.  PWB utility.
  20194.  
  20195.  The following information applies to the Programmer's WorkBench
  20196.  version 1.10 utility supplied with Microsoft BASIC Professional
  20197.  Development System (PDS) version 7.10 for MS-DOS and MS OS/2.
  20198.  
  20199.  Note that the 1.00 version of PWB is shipped with Microsoft C
  20200.  Professional Development System (PDS) version 6.00. The steps below
  20201.  should also apply to PWB version 1.00.
  20202.  
  20203.  The Programmer's WorkBench (PWB.EXE) is an advanced development
  20204.  environment capable of integrating several language compilers,
  20205.  NMAKE.EXE, LINK.EXE, and the CodeView debugger. It offers the ability
  20206.  to accomplish tasks, such as program development under protected mode
  20207.  and mixed-language programming. This ability is not available in the
  20208.  QuickBASIC extended development environment (QBX.EXE).
  20209.  
  20210.  Two special files, PWBC.PX$ (for protected mode OS/2) and PWBC.MX$
  20211.  (for DOS mode), reside on the BASIC PDS 7.10 disks and support the
  20212.  option of using the C compiler in PWB. Since SETUP.EXE (in BASIC PDS
  20213.  7.10) does not copy PWBC.PX$ and PWBC.MX$ during installation, these
  20214.  files must be unpacked and transferred to your machine, for example to
  20215.  the \BINP subdirectory located in the \BC7 directory. (Note: The
  20216.  UNPACK.EXE utility is found on disk 1 of the BASIC PDS package.) After
  20217.  unpacking, the files will have the names PWBC.PXT and PWBC.MXT.
  20218.  
  20219.  Next, the following command lines must be added to the TOOLS.INI file
  20220.  to make the C compiler available to PWB:
  20221.  
  20222.     [pwb - .BAS .BI]
  20223.        LOAD: LogicalDrive:\[Path]\PWBC.PXT
  20224.  
  20225.  For further information about installing PWBC.PXT and PWBC.MXT, see
  20226.  Page 54 of the "Microsoft BASIC 7.1: Getting Started" manual.
  20227.  
  20228.  If you want to program in languages other than BASIC or C [such as
  20229.  Microsoft Macro Assembler (MASM), Microsoft Pascal, Microsoft FORTRAN,
  20230.  or Microsoft COBOL 3.00/3.00a], the following steps will insert the
  20231.  initial build options to include other languages to PWB's build
  20232.  options menu. In the example below, options to include the MASM.EXE
  20233.  assembler are specified. If some other language's compiler is desired,
  20234.  substitute appropriate changes for that compiler, where noted in the
  20235.  specified areas:
  20236.  
  20237.   1. In PWB, go to the Options menu and select Build Options.
  20238.  
  20239.   2. Choose Save Current Build Options.
  20240.  
  20241.   3. Enter a meaningful message, such as "Options to Include MASM" in
  20242.      the window's edit field (if some other language is desired, change
  20243.      MASM to the appropriate name). Select the OK button from the "Save
  20244.      Current Build Options" and "Build Options" windows.
  20245.  
  20246.   4. Open the "TOOLS.INI" file in the PWB utility and go down to the
  20247.      bottom of the file. Somewhere near the bottom should be the tag
  20248.      "[PWB-Build Options: Options to Include MASM]" (or the language
  20249.      that was specified).
  20250.  
  20251.   5. In this section, add the following NMAKE instructions:
  20252.  
  20253.         build: inference .asm.obj masm_asm_obj
  20254.         build: command masm_asm_obj "masm $<;"
  20255.  
  20256.      Note: For languages other than MASM, distinguish a variable name
  20257.      in the inference rule to be used in the commands line (such as
  20258.      masm_asm_obj has been used above) and then specify the appropriate
  20259.      compiler in the commands line within the quotation marks. The
  20260.      special filename macro specified in the quotation marks, "$<",
  20261.      applies the command to any object that has an out-of-date
  20262.      executable file.
  20263.  
  20264.   6. Press SHIFT+F8 to reinitialize the file and then close it.
  20265.  
  20266.   7. Go to the File menu and select New (it is a good idea to close any
  20267.      files that are currently open before this step).
  20268.  
  20269.   8. Go to the Options menu and select Build Options.
  20270.  
  20271.   9. Choose Initial Build Options.
  20272.  
  20273.  10. Select the "Options to Include MASM" option (it should be near the
  20274.      bottom of the list).
  20275.  
  20276.  After completing these instructions, the PWB utility will now be ready
  20277.  to compile assembler along with BASIC source code, provided that paths
  20278.  to the necessary compilers are furnished.
  20279.  
  20280.  
  20281.  41. PWB Err Msg: Out of Local Memory. Unable to Recover.
  20282.  
  20283.  Product Version(s): 1.00
  20284.  Operating System:   MS-DOS
  20285.  Flags: ENDUSER |
  20286.  Last Modified: 17-OCT-1990    ArticleIdent: Q65913
  20287.  
  20288.  When setting a program list inside of the Programmer's WorkBench
  20289.  (PWB), the following message may occur:
  20290.  
  20291.     Out of Local Memory.  Unable to Recover.
  20292.  
  20293.  The error is printed on the screen and the PWB exits to DOS. This
  20294.  error may occur when the program list contains too many names. To
  20295.  resolve the problem, combine object modules into libraries whenever
  20296.  possible. Remove the .OBJ files from the program list and replace them
  20297.  with the new libraries. This will reduce the number of object modules
  20298.  that need to be defined in the program list.
  20299.  
  20300.  Another method that sometimes helps to alleviate the error is to open
  20301.  the File menu and close as many unneeded files as possible. This
  20302.  should be done before setting the program list.
  20303.  
  20304.  
  20305.  42. Situation Where PWB Online Help Text Disappears
  20306.  
  20307.  Product Version(s): 1.00 1.10 | 1.00 1.10
  20308.  Operating System:   MS-DOS    | OS/2
  20309.  Flags: ENDUSER | SR# S901010-118 B_BasicCom S_C B_cobol
  20310.  Last Modified: 24-OCT-1990    ArticleIdent: Q66229
  20311.  
  20312.  When requesting help in Microsoft Programmer's WorkBench (PWB)
  20313.  versions 1.00 and 1.10, the following sequence of events will cause
  20314.  the Help screen text to disappear, leaving only the hyperlinks.
  20315.  
  20316.  This information applies to Programmer's WorkBench version 1.00 (which
  20317.  comes with Microsoft C Professional Development System version 6.00
  20318.  for MS-DOS and MS OS/2), and to Programmer's WorkBench version 1.10
  20319.  (which comes with Microsoft COBOL Professional Development System
  20320.  version 4.00 and with Microsoft BASIC Professional Development System
  20321.  (PDS) version 7.10 for MS-DOS and MS OS/2).
  20322.  
  20323.  Microsoft has confirmed this to be a problem in PWB. We are
  20324.  researching this problem and will post new information here as it
  20325.  becomes available.
  20326.  Follow these steps to reproduce the problem:
  20327.  
  20328.  1. From the DOS or OS/2 prompt, enter PWB. From the File menu, select
  20329.     New. Type PLINES and request help by pressing F1 or single-clicking
  20330.     the right mouse button.
  20331.  
  20332.  2. In the Help dialog, double-click the left mouse button with the
  20333.     cursor on the hyperlink "Using PWB Functions."
  20334.  
  20335.  3. Double-click the left mouse button with the cursor on the hyperlink
  20336.     "PWB Functions by Category."
  20337.  
  20338.  4. Double-click the left mouse button with the cursor on the hyperlink
  20339.     "Moving Through Files."
  20340.  
  20341.  5. The vertical scroll bar will show that you are at the bottom of the
  20342.     dialog. Press PGUP and you will notice that the hyperlinks to Up,
  20343.     Index, Contents, and Back have disappeared. Double-click the left
  20344.     mouse button with the cursor on any of these empty hyperlinks; the
  20345.     text on the screen will disappear, with empty hyperlinks appearing
  20346.     on the screen.
  20347.  
  20348.  
  20349.  43. How to Insert Spaces Before a Block of Text in PWB
  20350.  
  20351.  Product Version(s): 1.00   | 1.00
  20352.  Operating System:   MS-DOS | OS/2
  20353.  Flags: ENDUSER | S_EDITOR
  20354.  Last Modified: 24-OCT-1990    ArticleIdent: Q66231
  20355.  
  20356.  It is sometimes desirable to indent or move over a block of text in
  20357.  the Programmer's WorkBench (PWB) or the M Editor. The following steps
  20358.  can be used to insert spaces before a block of text to indent it:
  20359.  
  20360.  1. Get into boxarg mode. You can select this mode from the Edit menu
  20361.     under the Programmer's Workbench, or select the boxstream function
  20362.     under the Microsoft Editor.
  20363.  
  20364.  2. Highlight the area you want to contain the spaces. This may be
  20365.     anywhere in the file.
  20366.  
  20367.  3. Select the linsert function. By default, this is CTRL+N.
  20368.  
  20369.  The highlighted area should now be moved over and replaced by spaces.
  20370.  
  20371.  You don't have to be in boxarg mode for this to work; linsert always
  20372.  treats its argument as a boxarg regardless of the current mode.
  20373.  However, the highlight on the screen won't match the area that is
  20374.  going to be inserted unless you use boxarg mode.
  20375.  
  20376.  Also, ldelete can be used to unindent a block of text. However, you
  20377.  must be in boxarg or streamarg mode for it to work correctly. In
  20378.  linearg mode, it will delete entire lines.
  20379.  
  20380.  
  20381.  44. PWB's Use of Expanded Memory
  20382.  
  20383.  Product Version(s): 1.00 1.10
  20384.  Operating System:   MS-DOS
  20385.  Flags: ENDUSER |
  20386.  Last Modified: 23-OCT-1990    ArticleIdent: Q66308
  20387.  
  20388.  The DOS version of the Programmer's WorkBench (PWB) will utilize
  20389.  expanded memory to swap its own segment overlays if it detects that
  20390.  expanded memory is available in the system. When PWB needs a new
  20391.  overlay, the existing overlay in memory is first copied into expanded
  20392.  memory. If there is not enough room in expanded memory to copy the
  20393.  overlay, the least recently used overlay is discarded to make room for
  20394.  it. This scheme allows most overlays to be read from expanded memory
  20395.  instead of from disk.
  20396.  
  20397.  Note that this is the only method by which PWB will take advantage of
  20398.  available expanded memory, and that PWB versions 1.00 and 1.10 have no
  20399.  internal provisions to make use of extended memory in any way.
  20400.  
  20401.  
  20402.  45. PWB May Exit to DOS If TMP Not Set Correctly
  20403.  
  20404.  Product Version(s): 1.00 1.10
  20405.  Operating System:   MS-DOS
  20406.  Flags: ENDUSER | buglist1.00 buglist1.10
  20407.  Last Modified: 24-OCT-1990    ArticleIdent: Q66309
  20408.  
  20409.  If the tmp environment variable is set only to a drive (with no path
  20410.  specified), the PWB may "crash" out to DOS when a compile is
  20411.  attempted. The screen will still show the PWB, but there will be a
  20412.  prompt displayed.
  20413.  
  20414.  This problem may be reproduced using the following procedure:
  20415.  
  20416.  1. Set up the environment to run the PWB.
  20417.  
  20418.  2. Set the tmp environment variable to the current drive, without
  20419.     specifying a path. For example:
  20420.  
  20421.        SET TMP=C:
  20422.  
  20423.  3. Execute the PWB and create or load a simple source file.
  20424.  
  20425.  4. Attempt to compile the source file. (Note: If the COMPILE option is
  20426.     not available on the make menu, make sure the file has a name with a
  20427.     .c extension.)
  20428.  
  20429.  Microsoft has confirmed this to be a problem with the Programmer's
  20430.  WorkBench versions 1.00 and 1.10. We are researching this problem and
  20431.  will post new information here as it becomes available.
  20432.  
  20433.  
  20434.  46. MASM Build Switches for PWB 1.10
  20435.  
  20436.  Product Version(s): 1.10    | 1.10
  20437.  Operating System:   MS-DOS  | OS/2
  20438.  Flags: ENDUSER |
  20439.  Last Modified:  5-DEC-1990    ArticleIdent: Q66339
  20440.  
  20441.  When setting a program list containing .ASM files in Programmer's
  20442.  WorkBench (PWB) version 1.10, the following error message occurs:
  20443.  
  20444.     Program List: file 'filename' will be ignored
  20445.     File type unused by current build options
  20446.  
  20447.  The .ASM files are not recognized because PWB 1.10 does not contain
  20448.  build switches specific to any language. Build switches are now loaded
  20449.  from language extension files (.MXT for DOS and .PXT for OS/2). If you
  20450.  have an assembly language extension file, you will not see this error
  20451.  message. Language extensions are not necessary and are only a
  20452.  convenience for controlling the build process; only the build switches
  20453.  are really needed.
  20454.  
  20455.  The following build switches can be added to a tagged section in your
  20456.  TOOLS.INI file. To use these build options, first choose your language
  20457.  options from the Options Build Options menu, then initialize this
  20458.  section by typing {arg} tag_name {reinitialize} (type the following to
  20459.  invoke the sample build switch below:
  20460.  
  20461.     ALT+A asm_rules SHIFT+F8
  20462.  
  20463.  These switches can also be added to a custom set of build options
  20464.  saved by Save Current Build Options. They may then be initialized by
  20465.  choosing Build Options from the Options menu, and then selecting Set
  20466.  Initial Build Options to choose the new custom language options.
  20467.  
  20468.  Sample Build Switches
  20469.  ---------------------
  20470.  
  20471.  [pwb-asm_rules]
  20472.  ;
  20473.  ;   MASM build rules
  20474.  ;
  20475.  build:macro ASM "MASM"
  20476.  build:macro AFLAGS_G "/Mx /T"
  20477.  build:macro AFLAGS_D "/Zi"
  20478.  build:macro AFLAGS_R ""
  20479.  build:inference .asm.obj as_asm_obj
  20480.  build:release command as_asm_obj  \
  20481.              "$(ASM) $(AFLAGS_G) $(AFLAGS_R) $<, $@;"
  20482.  build:debug command as_asm_obj  \
  20483.              "$(ASM) $(AFLAGS_G) $(AFLAGS_D) $<, $@;"
  20484.  build:include .asm "^[ \t]*include[ \t]+\\([^ \t]+\\)"
  20485.  build:include .inc "^[ \t]*include[ \t]+\\([^ \t]+\\)"
  20486.  
  20487.  These assembly flags can then be modified from PWB by using the
  20488.  following macros. The macros must be assigned to keystrokes to be
  20489.  activated. This can be done using the <ASSIGN> pseudo file. They can
  20490.  then be used to redefine the flags to pass to MASM.
  20491.  
  20492.  ;
  20493.  ;   MASM option-setting macros
  20494.  ;
  20495.  setAFG:= arg "Global MASM Options?"  prompt -> cancel lasttext home \
  20496.          "build:macro AFLAGS_G \"" endline "\"" assign
  20497.  
  20498.  setAFD:= arg "Debug MASM Options?"   prompt -> cancel lasttext home \
  20499.          "build:macro AFLAGS_D \"" endline "\"" assign
  20500.  
  20501.  setAFR:= arg "Release MASM Options?" prompt -> cancel lasttext home \
  20502.          "build:macro AFLAGS_R \"" endline "\"" assign
  20503.  
  20504.  
  20505.  47. Unexpected Behavior with the /Gt Switch and the PWB
  20506.  
  20507.  Product Version(s): 1.00   | 1.00
  20508.  Operating System:   MS-DOS | OS/2
  20509.  Flags: ENDUSER | S_C
  20510.  Last Modified: 15-JAN-1991    ArticleIdent: Q66828
  20511.  
  20512.  Adding the /Gt compiler switch with an argument to the Additional
  20513.  Options section of the C Compiler Options on the Programmer's
  20514.  WorkBench (PWB) Options menu can cause the value of the argument to be
  20515.  changed or dropped.
  20516.  
  20517.  Microsoft has confirmed this to be a problem in the Programmer's
  20518.  WorkBench version 1.00. We are researching this problem and will post
  20519.  new information here as it becomes available.
  20520.  
  20521.  When you add the /Gt switch with an argument (for example, /Gt30) and
  20522.  click OK, then immediately go back into the Compiler Options dialog
  20523.  box; you will see that the /Gt30 switch you just set is now /Gt3.
  20524.  
  20525.  If you set a /Gt switch and specify a value, it will compile with that
  20526.  correct value because it was written to the file on disk that is used
  20527.  to build the program.
  20528.  
  20529.  If you go back in and look at the compiler options and see that the
  20530.  value is incorrect and Cancel the options dialog, you will still
  20531.  compile with your initial correct /Gt value.
  20532.  
  20533.  You will compile with the incorrect /Gt value only if you make another
  20534.  change in that dialog and select OK. This is because you changed the
  20535.  options, so PWB rewrites the options to the file on disk. In the case
  20536.  of /Gt, that option is written incorrectly and from that point on, you
  20537.  will compile with the incorrect /Gt value.
  20538.  
  20539.  Not all values of /Gt are incorrect. The most common incorrect values
  20540.  end in zero. The following are examples where the problem occurs:
  20541.  
  20542.     /Gt40 will turn into /Gt4
  20543.     /Gt0  will turn into /Gt
  20544.     /Gt20 will turn into /Gt
  20545.  
  20546.  Some other values that get changed are the following:
  20547.  
  20548.     /Gt113 will turn into /Gt3
  20549.     /Gt305 will turn into /Gt35
  20550.     /Gt14  will turn into /Gt4
  20551.     /Gt22  will turn into /Gt
  20552.  
  20553.  As a possible work around, do not set /Gt in the PWB, and set the
  20554.  environment variable CL to the desired threshold, as in the following
  20555.  example:
  20556.  
  20557.     set cl=/Gt40
  20558.  
  20559.  This value will be read by the compiler when it is called from the
  20560.  PWB.
  20561.  
  20562.  Also, you can set the /Gt switch on the Additional Options line in
  20563.  either Set Debug Options or Set Release Options, rather than the
  20564.  global Additional Options.
  20565.  
  20566.  
  20567.  48. REsearch() Function Prototype Not Found in EXT.H Header File
  20568.  
  20569.  Product Version(s): 1.00 1.10 | 1.00 1.10
  20570.  Operating System:   MS-DOS    | OS/2
  20571.  Flags: ENDUSER | buglist1.00 buglist1.10
  20572.  Last Modified:  4-DEC-1990    ArticleIdent: Q67274
  20573.  
  20574.  The Programmer's WorkBench (PWB) function REsearch(), although
  20575.  included in EXTSUP.LIB, is not prototyped in the EXT.H header file. To
  20576.  call REsearch(), use the following prototype:
  20577.  
  20578.  int REsearch( PFILE pFile, flagType fForward, flagType fAll,
  20579.                flagType fCase, flagType fWrap, char _far *pattern,
  20580.                fl *pflStart );
  20581.  
  20582.  For more information, see online help.
  20583.  
  20584.  Microsoft has confirmed this to be a problem in PWB versions 1.00 and
  20585.  1.10. We are researching this problem and will post new information
  20586.  here as it becomes available.
  20587.  
  20588.  
  20589.  49. PWB Help Crashes When Using "Moving Through a File"
  20590.  
  20591.  Product Version(s): 1.10   | 1.10
  20592.  Operating System:   MS-DOS | OS/2
  20593.  Flags: ENDUSER | buglist1.10
  20594.  Last Modified: 14-DEC-1990    ArticleIdent: Q67361
  20595.  
  20596.  When using the online help through the Programmer's WorkBench (PWB),
  20597.  the help system will crash if you do the following:
  20598.  
  20599.  1. After entering help, choose Contents.
  20600.  
  20601.  2. Select the Microsoft Advisor from the list of contents.
  20602.  
  20603.  3. Select the Programmer's WorkBench button followed by the "Moving
  20604.     Through a File" selection.
  20605.  
  20606.  At this point a header will appear on the screen and the elevator for
  20607.  the window will appear as though it is at the bottom of a page.
  20608.  
  20609.  The page can be scrolled up and the contents viewed, especially if
  20610.  highlighted, but the menu items at the top will be blacked out
  20611.  (although they are present). From this point, no further help can be
  20612.  accessed.
  20613.  
  20614.  If you exit help and then reenter, nothing will come up.
  20615.  Re-initializing does not reinstate the help system. Only shelling out,
  20616.  exiting, and reentering will allow you to access the help system.
  20617.  
  20618.  Microsoft has confirmed this to be a problem in the Programmer's
  20619.  WorkBench version 1.10. We are researching this problem and will post
  20620.  new information here as it becomes available.
  20621.  
  20622.  
  20623.  50. PWB Hangs with Novell NetWare
  20624.  
  20625.  Product Version(s): 1.00 1.11
  20626.  Operating System:   MS-DOS
  20627.  Flags: ENDUSER | s_quickc s_codeview s_c
  20628.  Last Modified: 14-DEC-1990    ArticleIdent: Q67483
  20629.  
  20630.  On certain installations of a Novell network, the network will cause
  20631.  the Programmer's WorkBench (PWB) to hang. This problem may also occur
  20632.  in CodeView or QuickC. The hang usually occurs when an attempt is made
  20633.  to use the mouse.
  20634.  
  20635.  If you have a peripheral (such as a mouse) that uses Interrupt Request
  20636.  Level (IRQ) 3, and your system is part of a network using Novell
  20637.  NetWare version 2.15 or earlier, your system may hang when you load
  20638.  QuickC, PWB, or CodeView. As a temporary solution, set your peripheral
  20639.  to use another interrupt. For more information, contact your Novell
  20640.  NetWare dealer.
  20641.  
  20642.  If taking these steps does not solve the problem, please contact
  20643.  Microsoft Product Support Services.
  20644.  
  20645.  
  20646.  51. PWB Menu Hyperlink in PWB.HLP is Inconsistent in Version 1.10
  20647.  
  20648.  Product Version(s): 1.10   | 1.10
  20649.  Operating System:   MS-DOS | OS/2
  20650.  Flags: ENDUSER |
  20651.  Last Modified: 23-JAN-1991    ArticleIdent: Q67614
  20652.  
  20653.  When selecting help on the Programmer's WorkBench (PWB) version 1.10
  20654.  from the Categories menu in QuickHelp version 1.70, the help screen
  20655.  for Microsoft Advisor Help System is presented instead. This behavior
  20656.  may be duplicated by following the procedure outlined below:
  20657.  
  20658.  1. Start QuickHelp without an argument to get help on any topic. This
  20659.     will bring up the main help screen.
  20660.  
  20661.  2. Select the Programmer's WorkBench choice under the Categories menu.
  20662.  
  20663.  Instead of bringing up the help screen for Programmer's WorkBench, you
  20664.  will see the screen for the Microsoft Advisor Help System.
  20665.  
  20666.  If the PWB.HLP help file is decoded using helpmake as follows
  20667.  
  20668.     helpmake /D /T /Opwb.doc pwb.hlp
  20669.  
  20670.  we can see that the reason for this is that the .context directive for
  20671.  Programmer's WorkBench appears in the wrong section in the decoded
  20672.  help file. The following line
  20673.  
  20674.     .context Programmer's Workbench
  20675.  
  20676.  appears above the section for "Microsoft Advisor Contents." To correct
  20677.  the problem, move the .context directive for Programmer's WorkBench to
  20678.  the proper section, which is the "Programmer's WorkBench Contents."
  20679.  
  20680.  The helpfile must then be recompressed, as follows:
  20681.  
  20682.     helpmake /E7 /T /Opwb.hlp pwb.doc
  20683.  
  20684.  The choice of /E7 is shown here for demonstration purposes only, and
  20685.  is strictly arbitrary in this case. If maximum compression is desired,
  20686.  the numerical argument to the /E switch may be left off, or /E15 may
  20687.  be specified. Maximum compression will restore the database as close
  20688.  to its original size and state as possible.
  20689.  
  20690.  
  20691.  52. "missing ':' in ->" Caused by Control Character
  20692.  
  20693.  Product Version(s): 1.00 1.10 | 1.00 1.10
  20694.  Operating System:   MS-DOS    | OS/2
  20695.  Flags: ENDUSER |
  20696.  Last Modified: 14-DEC-1990    ArticleIdent: Q67736
  20697.  
  20698.  When invoking the Programmer's WorkBench (PWB), if there is a control
  20699.  character at the end of the TOOLS.INI file, [usually a CTRL+Z (ASCII
  20700.  26) end-of-file marker] and you only have a [pwb] tagged section, an
  20701.  error message will appear stating "missing ':' in ->". Note that the
  20702.  "->" is the graphic right-arrow symbol.
  20703.  
  20704.  This is not a problem in the PWB. A control character is a legal macro
  20705.  name. The message indicates that a macro definition or key assignment
  20706.  is expected after the character. To keep this message from appearing,
  20707.  place the tag
  20708.  
  20709.     [end]
  20710.  
  20711.  before the control character at the end of your TOOLS.INI file. With
  20712.  this tag at the end of the file, you always suppress the message, even
  20713.  if you edit TOOLS.INI with an editor that inserts CTRL+Z's at the end
  20714.  of the file. This is because the -> symbol must be within the [pwb]
  20715.  tagged section for this error message to be displayed, and the [end]
  20716.  tag forces the -> into its own tagged section.
  20717.  
  20718.  Simply deleting the control character will work until you edit the
  20719.  file with an editor that replaces the CTRL+Z, then this message
  20720.  reappears. This may also when using the COPY command to concatenate
  20721.  files.
  20722.  
  20723.  
  20724.  53. Inconsistent Error Attempting to Load Nonexistent Extension
  20725.  
  20726.  Product Version(s): 1.00 1.10
  20727.  Operating System:   OS/2
  20728.  Flags: ENDUSER |
  20729.  Last Modified: 28-DEC-1990    ArticleIdent: Q67777
  20730.  
  20731.  When attempting to load a Programmer's WorkBench extension through a
  20732.  macro definition in the TOOLS.INI file, if the extension file does not
  20733.  exist, or is not in the current path, the following error message is
  20734.  displayed in a dialog box:
  20735.  
  20736.     pwbhelp:  SYS0123:  A file name or volume label contains an
  20737.                         incorrect character
  20738.  
  20739.  This error message should indicate that the extension file could not
  20740.  be found; however, the message is generated by the OS/2 operating
  20741.  system's DLL loading code, and therefore, cannot be changed by PWB.
  20742.  
  20743.  The following error message is generated in the DOS version of PWB,
  20744.  which displays this message in a dialog box:
  20745.  
  20746.     No such file or directory
  20747.  
  20748.  To correct the problem, make sure that the directory in which the
  20749.  extension resides is in the current path.
  20750.  
  20751.  
  20752.  54. PWB May Record Incorrect Paths for Dependencies in Makefile
  20753.  
  20754.  Product Version(s): 1.00 1.10  | 1.00 1.10
  20755.  Operating System:   MS-DOS     | OS/2
  20756.  Flags: ENDUSER | buglist1.00 buglist1.10
  20757.  Last Modified:  6-FEB-1991    ArticleIdent: Q67780
  20758.  
  20759.  Creating a program list with dependencies in directories other than
  20760.  the project (makefile) directory may result in the Programmer's
  20761.  WorkBench (PWB) recording the wrong paths to these dependencies.
  20762.  
  20763.  The following steps illustrate the problem:
  20764.  
  20765.  1. Create subdirectories named TEST and TESTA under the same
  20766.     directory, with sample files FOO.C in TEST and GOO.C in TESTA.
  20767.  
  20768.  2. Invoke PWB from the TESTA directory.
  20769.  
  20770.  3. Create a program list.
  20771.  
  20772.  4. Add FOO.C and GOO.C with full path.
  20773.  
  20774.  5. Save the list.
  20775.  
  20776.  The resulting makefile will contain the line:
  20777.  
  20778.     OBJS = goo.c foo.c
  20779.  
  20780.  The correct line should read:
  20781.  
  20782.     OBJS = goo.c ..\TEST\foo.c
  20783.  
  20784.  Changing the location of the project makefile or changing the names of
  20785.  the subdirectories will generate the correct paths for dependencies in
  20786.  the makefile.
  20787.  
  20788.  Microsoft has confirmed this to be a problem in the Programmer's
  20789.  WorkBench versions 1.00 and 1.10. We are researching this problem and
  20790.  will post new information here as it becomes available.
  20791.  
  20792.  
  20793.  55. PWB Extensions in DOS Cannot Shell to DOS
  20794.  
  20795.  Product Version(s): 1.00 1.10
  20796.  Operating System:   MS-DOS
  20797.  Flags: ENDUSER |
  20798.  Last Modified:  6-FEB-1991    ArticleIdent: Q67792
  20799.  
  20800.  Extensions written for the Programmer's WorkBench (PWB) that require a
  20801.  call to the operating system do not work correctly under DOS. One
  20802.  example of this is the FILTER.C sample extension packaged with
  20803.  Microsoft C 6.00.
  20804.  
  20805.  When PWB.COM is executed under DOS, it spawns the main editor
  20806.  (PWBED.EXE). PWBED.EXE is cleared from memory when a DOS shell is
  20807.  executed from within the editor. Once the shell has completed,
  20808.  PWBED.EXE is reloaded from disk and initialized. The initialization is
  20809.  what causes the problem because it also initializes any extensions to
  20810.  the editor at the same time. This means that any information that the
  20811.  extension was keeping track of is lost.
  20812.  
  20813.  
  20814.  56. Not Enough Core Message Caused by Lack of Memory
  20815.  
  20816.  Product Version(s): 1.00 1.10
  20817.  Operating System:   MS-DOS
  20818.  Flags: ENDUSER |
  20819.  Last Modified:  6-FEB-1991    ArticleIdent: Q68070
  20820.  
  20821.  When loading the Programmer's WorkBench (PWB), a message box may
  20822.  appear on the screen containing the message "Cannot Autoload
  20823.  Extension, not enough core." The extension file that could not be
  20824.  loaded will be indicated. You need to free more memory so that the
  20825.  extensions can be loaded.
  20826.  
  20827.  
  20828.  57. Windows DLL Build Options Ignore .RC Files in PWB 1.10
  20829.  
  20830.  Product Version(s): 1.10   | 1.10
  20831.  Operating System:   MS-DOS | OS/2
  20832.  Flags: ENDUSER | buglist1.10 S_C P_WINSDK
  20833.  Last Modified: 11-JAN-1991    ArticleIdent: Q68155
  20834.  
  20835.  In the Programmer's WorkBench version 1.10, the default build options
  20836.  for creating a Windows DLL will ignore any .RC files included in the
  20837.  Program List, and therefore, will not build them into the project.
  20838.  
  20839.  Use the following steps to correct this problem:
  20840.  
  20841.   1. If there is a Program List currently set, clear it.
  20842.  
  20843.   2. Set the Main Language to C.
  20844.  
  20845.   3. Set the Initial Build Options to Windows DLL.
  20846.  
  20847.   4. Create a new Program List containing all the files you want in your
  20848.      project.
  20849.  
  20850.   5. Save the Program List. At this point, PWB will tell you that your
  20851.      .RC file will be ignored. Choose OK when that dialog box appears.
  20852.  
  20853.   6. Choose Editor Settings from the Options menu.
  20854.  
  20855.   7. Find the line that starts:
  20856.  
  20857.         build: target $(PROJ).dll
  20858.  
  20859.   8. Change the word "res_dll" on that line to "rc_dll".
  20860.  
  20861.   9. Move the cursor off that line to highlight the change. Press SHIFT+F2
  20862.      to save the new settings.
  20863.  
  20864.  10. Press F2 to exit the ASSIGN pseudofile.
  20865.  
  20866.  11. Choose Edit Program List from the Make menu.
  20867.  
  20868.  12. Choose Save List. The .RC file will now be saved in the Program
  20869.      List and used as expected.
  20870.  
  20871.  After these steps are taken, the settings will be saved in the .STS
  20872.  file for that project, and will remain correct as long as Set Initial
  20873.  Build Options is never selected when this Program List is set. In
  20874.  order to keep from repeating these steps for future projects, the
  20875.  build options should be saved under a descriptive name, such as
  20876.  "Corrected Windows DLL Settings." They can then be chosen for any
  20877.  future Windows DLLs.
  20878.  
  20879.  Microsoft has confirmed this to be a problem in the Programmer's
  20880.  WorkBench version 1.10. We are researching this problem and will post
  20881.  new information here as it becomes available.
  20882.  
  20883.  
  20884.  58. PWB Build Switch Reference Available as an Application Note
  20885.  
  20886.  Product Version(s): 1.00 1.10 | 1.00 1.10
  20887.  Operating System:   MS-DOS    | OS/2
  20888.  Flags: ENDUSER | appnote softlib SW0330
  20889.  Last Modified: 29-JAN-1991    ArticleIdent: Q68367
  20890.  
  20891.  The "PWB Build Switch Reference" contains detailed descriptions and
  20892.  examples for customizing PWB build switches.
  20893.  
  20894.  The Programmer's WorkBench (PWB) can build various types of projects
  20895.  based on the information contained in "build switches." These build
  20896.  switches are interpreted by PWB in order to create a makefile for a
  20897.  project. The switches are normally set for you by PWB for common types
  20898.  of projects, but you may define your own build switches to handle an
  20899.  advanced project where you require more control over the build
  20900.  process. For example, customized build switches will allow you to
  20901.  utilize different languages, to incorporate other tools into a
  20902.  project, or to build new kinds of targets.
  20903.  
  20904.  Although build switch customization is documented in the PWB online
  20905.  help, the information is somewhat limited. Therefore, an application
  20906.  note was created to cover the customization process in detail. The
  20907.  title of this application note is "PWB Build Switch Reference" and it
  20908.  can be obtained by calling Microsoft Product Support Services at (206)
  20909.  637-7096.
  20910.  
  20911.  The "PWB Build Switch Reference" can also be found in the Software/
  20912.  Data Library (as file SW0330.ARC) by searching on the keyword SW0330,
  20913.  the Q number of this article, or S12875. SW0330 was archived using the
  20914.  PKware file-compression utility.
  20915.  
  20916.  Note that the application note found in the Software/Data Library is
  20917.  an ordinary text file, which lacks the typefaces and formatting of the
  20918.  printed version that is available by calling Microsoft Product Support
  20919.  Services. Because the printed application note is clearer and easier
  20920.  to follow, it is highly recommended that you call for the printed
  20921.  version, and that you use the downloaded version only as an interim
  20922.  copy.
  20923.  
  20924.  Also note that you normally DO NOT need to modify build switches just
  20925.  to customize the compile and link operations -- this can generally be
  20926.  done by selecting commands from the Options menu. By selecting options
  20927.  from the Compile or LINK Options dialog boxes, the correct build
  20928.  switches are automatically modified to contain the desired
  20929.  information.
  20930.  
  20931.  
  20932.  59. Brown Screen Color Changes to Yellow After Running PWB
  20933.  
  20934.  Product Version(s): 1.00 1.10
  20935.  Operating System:   MS-DOS
  20936.  Flags: ENDUSER | s_c buglist1.00 buglist1.10 remapping
  20937.  Last Modified:  6-FEB-1991    ArticleIdent: Q69064
  20938.  
  20939.  After running PWB, the brown screen color changes to yellow until the
  20940.  system is rebooted or the video mode is reset.
  20941.  
  20942.  For example, if you run PWB and then run the Microsoft editor, the
  20943.  brown characters will appear yellow.
  20944.  
  20945.  To work around this problem, you can create a batch file called
  20946.  PWB.BAT. In this file, you can start PWB and then reset the video
  20947.  mode. For example:
  20948.  
  20949.      pwb.bat
  20950.              pwb %1 %2 %3 %4
  20951.              mode co80,25
  20952.  
  20953.  Microsoft has confirmed this to be a problem in PWB versions 1.00 and
  20954.  1.10. We are researching this problem and will post new information
  20955.  here as it becomes available.
  20956.  
  20957.  
  20958.  60. Reinitializing After Changing Editor Settings Is Very Slow
  20959.  
  20960.  Product Version(s): 1.10   | 1.10
  20961.  Operating System:   MS-DOS | OS/2
  20962.  Flags: ENDUSER |
  20963.  Last Modified: 11-FEB-1991    ArticleIdent: Q69142
  20964.  
  20965.  The current editor settings in the Programmer's WorkBench (PWB) may be
  20966.  changed by choosing Editor Settings from the Options menu, making a
  20967.  change to the <assign> pseudofile, and then saving that file. If
  20968.  SHIFT+F8 (initialize) is pressed while the <assign> pseudofile is
  20969.  still displayed, PWB may appear as though it is hung; it is actually
  20970.  reinitializing each statement of the editor settings (<assign>)
  20971.  pseudofile.
  20972.  
  20973.  The following steps will reproduce this behavior:
  20974.  
  20975.  1. Enter PWB and select the Options menu.
  20976.  
  20977.  2. Choose the Editor Settings menu.
  20978.  
  20979.  3. Make a change in the <assign> pseudofile and then save it.
  20980.  
  20981.  4. Press the "initialize" keystroke combination (SHIFT+F8) and a popup
  20982.     box will appear stating "reinitializing...". The reinitialization
  20983.     is actually taking place but it is very slow because PWB is
  20984.     rebuilding the <assign> pseudofile for each entry in your TOOLS.INI
  20985.     file.
  20986.  
  20987.  This behavior does not occur in PWB version 1.00. Version 1.10
  20988.  includes a change to the earlier version; you can see a new assignment
  20989.  (made via "arg textarg <assign>") immediately updated if you are
  20990.  viewing the <assign> pseudofile.
  20991.  
  20992.  This is expected behavior because the <assign> pseudofile is meant to
  20993.  show the settings that were in effect at the time the file was
  20994.  displayed. It is not recommended that it be dynamically updated except
  20995.  via the mechanism of actually editing the file. If you changed a
  20996.  setting via "arg textarg assign" (ALT+A textarg ALT+=), a better way
  20997.  to view your new setting(s) is by using "refresh" (SHIFT+F7), or by
  20998.  switching away and back again via "setfile" (F2).
  20999.  
  21000.  
  21001.  61. PWB Ignores Certain Compiler Switches in Additional Options
  21002.  
  21003.  Product Version(s): 1.00 1.10 | 1.00 1.10
  21004.  Operating System:   MS-DOS    | OS/2
  21005.  Flags: ENDUSER | s_c
  21006.  Last Modified: 25-FEB-1991    ArticleIdent: Q69145
  21007.  
  21008.  The compiler switches
  21009.  
  21010.     /Fo, /Fe, /F hexnum, /Fm, and /link link-info
  21011.  
  21012.  are ineffective when entered in the Additional Options field of the C
  21013.  Compiler Options dialog box from the Options menu of the Programmer's
  21014.  Workbench (PWB). This is the intended behavior. The functionality of
  21015.  all of these switches is provided through the Compiler, Link, and
  21016.  Build Options dialog boxes from the Options menu.
  21017.  
  21018.  The /Fo switch is overridden by PWB as it creates the .MAK file needed
  21019.  to build the project. To perform this function correctly:
  21020.  
  21021.  1. Set a program list from the Make menu.
  21022.  2. Choose Build Options from the Options menu.
  21023.  3. Choose the Build Directory button.
  21024.  4. Enter the destination path in that field, such as:
  21025.  
  21026.        C:\C600\PROJECT\
  21027.  
  21028.  5. Rebuild the project, and both the .EXE and .OBJ files will be placed
  21029.     in that directory.
  21030.  
  21031.  The other switches are used only to pass information to the linker
  21032.  when the CL command is used outside PWB without the /c option. Because
  21033.  PWB always compiles and links separately, these switches are lost. To
  21034.  utilize these switches from within PWB, select the appropriate options
  21035.  in the Link Options dialog box from the Options menu.
  21036.  
  21037.  
  21038.  62. How to Increase the Size of the PWB Build Status Box Under DOS
  21039.  
  21040.  Product Version(s): 1.00 1.10
  21041.  Operating System:   MS-DOS
  21042.  Flags: ENDUSER | window dialog
  21043.  Last Modified: 22-FEB-1991    ArticleIdent: Q69475
  21044.  
  21045.  In the DOS version of the Microsoft Programmer's WorkBench (PWB)
  21046.  versions 1.00 and 1.10, the status box displayed in the center of the
  21047.  screen during a compile can be made larger by increasing the length of
  21048.  the command being executed.
  21049.  
  21050.  When Build or Rebuild All is selected from the Make menu in PWB, a
  21051.  build status box appears on the screen showing the command currently
  21052.  being executed. Unfortunately, this box is often too small and the
  21053.  current command being displayed gets truncated. One way to increase
  21054.  the size of this box is to increase the length of the NMAKE command
  21055.  line.
  21056.  
  21057.  To increase the length of the NMAKE command line, add the following
  21058.  text (without the quotation marks) to the NMAKE Options dialog box,
  21059.  which can be selected from the Options menu:
  21060.  
  21061.     "                                                /NOLOGO"
  21062.  
  21063.  Be sure to include the spaces when you type this line. Then, when you
  21064.  select Build or Rebuild All from the Make menu, the build status box
  21065.  will be almost as wide as the screen, allowing most of the subsequent
  21066.  commands to fit completely into the box.
  21067.  
  21068.  If you use the PWB "compile" command, or choose the Compile File
  21069.  option from the Make menu, the build status box behaves similarly --
  21070.  the longer the command to be executed command, the larger the box will
  21071.  be.
  21072.  
  21073.  
  21074.  
  21075.  
  21076.  
  21077.  
  21078.  Microsoft CodeView
  21079.  =============================================================================
  21080.  
  21081.  
  21082.  1. Sequential Mode Not Available in CodeView Version 3.00
  21083.  
  21084.  Product Version(s): 3.00 3.01 3.11  | 3.00 3.01 3.11
  21085.  Operating System:   MS-DOS          | OS/2
  21086.  Flags: ENDUSER |
  21087.  Last Modified:  6-FEB-1991    ArticleIdent: Q69065
  21088.  
  21089.  The CodeView sequential mode (/T option) is not available in CodeView
  21090.  version 3.00.
  21091.  
  21092.  In CodeView versions 2.30 and earlier, the /T option caused the
  21093.  debugger to operate in "sequential mode," which means that only a
  21094.  command-line interface was available. You could then type the command
  21095.  "=COM1" to redirect the input and output to the COM port, which
  21096.  allowed debugging via a remote terminal.
  21097.  
  21098.  The /T option and the "=COM1" command are not available in CodeView
  21099.  3.00, 3.10, and 3.11 because of the new windowing environment used in
  21100.  these versions.
  21101.  
  21102.  However, you can still redirect CodeView output to COM1 using the
  21103.  Redirected Output command.
  21104.  
  21105.  The Redirected Output command causes the CodeView debugger to write
  21106.  all subsequent command output to a device, such as another terminal, a
  21107.  printer, or a file. The term "output" includes not only the output
  21108.  from commands but also the command characters that are echoed as you
  21109.  type them.
  21110.  
  21111.  The second greater-than symbol (optional) appends the output to an
  21112.  existing file. If you redirect output to an existing file without this
  21113.  symbol, the existing file will be replaced. For example:
  21114.  
  21115.     >>COM1
  21116.  
  21117.  In the example above, output is redirected to the device designated as
  21118.  COM1 (probably a remote terminal). You might want to enter this
  21119.  command, for example, when you are debugging a graphics program and
  21120.  want CodeView commands to be displayed on a remote terminal while the
  21121.  program display appears on the originating terminal.
  21122.  
  21123.     >>OUTFILE.TXT
  21124.  
  21125.  In the example above, output is redirected to the file OUTFILE.TXT.
  21126.  This command is helpful in keeping a permanent record of a CodeView
  21127.  session.
  21128.  
  21129.  
  21130.  2. How Interrupts Are Handled in CodeView
  21131.  
  21132.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30
  21133.  Operating System:   MS-DOS
  21134.  Flags: ENDUSER | TAR55548
  21135.  Last Modified:  9-AUG-1989    ArticleIdent: Q11817
  21136.  
  21137.  Question:
  21138.  
  21139.  How does CodeView handle interrupt vectors? Does it mask any
  21140.  interrupts when it runs?
  21141.  
  21142.  Response:
  21143.  
  21144.  CodeView saves and restores about 60 interrupt vectors as a safety
  21145.  feature. However, it only redirects the following nine vectors for its
  21146.  own use:
  21147.  
  21148.     0       Divide By 0
  21149.     1       Single Step
  21150.     2       NMI
  21151.     3       Breakpoint
  21152.     9       Keyboard
  21153.     21H     DOS functions
  21154.     22H     DOS terminate
  21155.     23H     ^C
  21156.     24H     Critical Error
  21157.  
  21158.  The remaining estimated 51 vectors are never altered by CodeView
  21159.  unless something else (e.g. the program being debugged) alters them
  21160.  after CodeView has started up. In this case, CodeView restores them to
  21161.  their original value as it exits.
  21162.  
  21163.  When you enter G(o) and let your program run, CodeView relinquishes
  21164.  control and lets all interrupts (except the nine listed above) flow
  21165.  into your application for processing. However, when you hit a
  21166.  breakpoint, the 8259 Programmable Interrupt Controller is masked. This
  21167.  prevents interrupts from coming into your application while your
  21168.  program is suspended. If you enter G(o) again, CodeView reenables
  21169.  interrupts to your application.
  21170.  
  21171.  To avoid a bug in the 8086 family, CodeView masks the interrupt
  21172.  controller during T(race) commands and some P(rogram step) commands.
  21173.  CodeView Versions 2.00 and above solve this restriction by emulating
  21174.  the interrupts for your application.
  21175.  
  21176.  You normally do not single-step or trace real-time code, so this
  21177.  should not be a problem for developers writing interrupt-driven code.
  21178.  However, it is something you should be aware of if you are depending
  21179.  on interrupts to get to your application. For example, it will not
  21180.  work if you enter "T 1000" and expect your program to catch and
  21181.  process interrupts during the trace. You will need to set a breakpoint
  21182.  at the instruction with which you are concerned, then enter G(o).
  21183.  
  21184.  
  21185.  3. Debugging Routines That Are in Libraries
  21186.  
  21187.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
  21188.  Operating System:   MS-DOS                        | OS/2
  21189.  Flags: ENDUSER | TAR55321
  21190.  Last Modified: 21-AUG-1989    ArticleIdent: Q11877
  21191.  
  21192.  Question:
  21193.  
  21194.  When CodeView attempts to debug a function from a library module, it
  21195.  is unable to find the source even when that module was compiled with
  21196.  -Zi. It prompts me to "Enter Directory for Program (CR for None)?". I
  21197.  enter the directory in which PROGRAM.C resides, but CodeView cannot
  21198.  find it. Is there any solution other than not placing modules I wish
  21199.  to debug in libraries?
  21200.  
  21201.  Response:
  21202.  
  21203.  This is a consequence of the way the LIB utility works. When adding an
  21204.  object module to a library, LIB records only the source file's base
  21205.  name, not its extension. Therefore, "c:\c\source\module1.c" becomes
  21206.  "c:\c\source\module1" (no extension). When you are debugging an
  21207.  application that calls "module1", CodeView attempts to find
  21208.  "c:\c\source\module1". However, it does not accept the filename you
  21209.  give because the file is really named "module1.c".
  21210.  
  21211.  One way to work around this restriction is to rename your source file
  21212.  from "c:\c\source\module1.c" to "c:\c\source\module1" (no extension)
  21213.  after you have compiled it and put it into a library. This way, the
  21214.  actual name will match the name CodeView is searching for.
  21215.  
  21216.  Another solution is to use Library Manager Version 3.07 (which came
  21217.  with MASM 5.00) or later; this solves the problem by not stripping the
  21218.  file's extension as it is put into a library.
  21219.  
  21220.  
  21221.  4. CVP May Generate a Trap B with Large Programs Under OS/2 1.30
  21222.  
  21223.  Product Version(s): 2.20 2.30 3.00 3.10 3.11
  21224.  Operating System:   OS/2
  21225.  Flags: ENDUSER | gp fault protection violation
  21226.  Last Modified: 25-FEB-1991    ArticleIdent: Q69348
  21227.  
  21228.  Debugging a large application with CodeView under OS/2 version 1.30
  21229.  may result in a Trap B system error. Trap B is a "segment not present"
  21230.  exception, which results from changes that were made to this version
  21231.  of the operating system.
  21232.  
  21233.  In version 1.30 of OS/2, the code for DosPTrace() was made swappable,
  21234.  while in previous versions it was not. DosPTrace() is part of the OS/2
  21235.  API that allows a parent process to control the execution of a child
  21236.  process, and to access the child process's memory directly to insert
  21237.  breakpoints or change data.
  21238.  
  21239.  Because CodeView relies heavily on DosPTrace(), problems arise if this
  21240.  code is swapped from memory. The majority of problems occur when
  21241.  execution reaches a breakpoint while the DosPTrace() code is not
  21242.  present; control should then jump to code that is not currently in
  21243.  RAM.
  21244.  
  21245.  Because large programs (or heavily loaded systems) tend to result in
  21246.  more swapping, this problem appears much more readily when debugging
  21247.  large applications.
  21248.  
  21249.  The only sure workaround for this problem is to turn off swapping
  21250.  while debugging, but it also may help to increase or free up available
  21251.  memory. To disable swapping, modify the MEMMAN switch in CONFIG.SYS as
  21252.  follows:
  21253.  
  21254.     MEMMAN=NOSWAP
  21255.  
  21256.  To increase available memory, either install more memory in the
  21257.  computer itself or terminate all other unnecessary processes before
  21258.  debugging (to remove them from memory).
  21259.  
  21260.  This problem is the result of a design change with OS/2 1.30 and is
  21261.  not a problem with CodeView. This change is being reconsidered for
  21262.  future versions of OS/2. New information will be posted here as it
  21263.  becomes available.
  21264.  
  21265.  
  21266.  5. Using Two Monitors with CodeView
  21267.  
  21268.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
  21269.  Operating System:   MS-DOS                        | OS/2
  21270.  Flags: ENDUSER | TAR56465
  21271.  Last Modified: 11-SEP-1989    ArticleIdent: Q11966
  21272.  
  21273.  Question:
  21274.  
  21275.  How do I use CodeView with two monitors? Where is this option
  21276.  documented?
  21277.  
  21278.  Response:
  21279.  
  21280.  Invoke CodeView with the following command:
  21281.  
  21282.     CV /2 PROGRAM
  21283.  
  21284.  This command tells CodeView to put its display on your secondary
  21285.  monitor and lets your program's output go to the default display. This
  21286.  option is documented in the "CodeView Options" section of the
  21287.  "Microsoft CodeView and Utilities Software Development Tools for the
  21288.  MS-DOS Operating System" manual in all products except Microsoft C
  21289.  Version 4.00, where it is documented in the README file.
  21290.  
  21291.  You must have two monitors and two display adapters to use this
  21292.  feature. You must have a monochrome and a non-monochrome monitor;
  21293.  because a monochrome monitor's video memory is in a different
  21294.  location than a CGA, EGA, or VGA's. This is how CodeView implements
  21295.  the /2 option, by writing to both sets of video memory.
  21296.  
  21297.  When you use the /2 option, your program's display appears on the
  21298.  current default adapter and monitor, while the debugging display
  21299.  appears on the secondary adapter and monitor. You can switch which
  21300.  monitor is the current default adapter with the MS-DOS MODE command.
  21301.  "MODE MONO" causes standard output to go to the MDA, while "MODE CO80"
  21302.  causes standard output to go to your CGA, EGA, or VGA.
  21303.  
  21304.  For example, if you have both a CGA and an MDA, you might want to set
  21305.  the CGA up as the default adapter. You could then debug a graphics
  21306.  program with the graphics display appearing on the graphics monitor
  21307.  and the debugging display appearing on the monochrome adapter.
  21308.  
  21309.  
  21310.  6. /L Must Give Full Pathname to .DLL Unless in Current Directory
  21311.  
  21312.  Product Version(s): 2.20 2.30 | 2.20 2.30
  21313.  Operating System:   MS-DOS    | OS/2
  21314.  Flags: ENDUSER |
  21315.  Last Modified: 16-AUG-1989    ArticleIdent: Q47937
  21316.  
  21317.  When debugging dynamic link modules with CodeView Protect (CVP), you
  21318.  must use the /L switch. Before invoking CVP, make certain that the
  21319.  .DLL is in the LIBPATH specified in the CONFIG.SYS file. When invoking
  21320.  CVP with the /L switch, if the .DLL is not located in the current
  21321.  directory, you must specify the full drive and pathname to the DLL. An
  21322.  example is the following:
  21323.  
  21324.     CVP /L d:\os2\dll\stdll.dll stmain.exe
  21325.  
  21326.  In this example, the full drive and pathname are given for the DLL to
  21327.  be debugged. If the full pathname is not given, CodeView will come up.
  21328.  However, you will be unable to step into the DLL. CodeView will simply
  21329.  step over that call.
  21330.  
  21331.  
  21332.  7. CodeView Cannot Trace into Single-Line Functions
  21333.  
  21334.  Product Version(s): 2.20 2.30 | 2.20 2.30
  21335.  Operating System:   MS-DOS    | OS/2
  21336.  Flags: ENDUSER |
  21337.  Last Modified: 15-SEP-1989    ArticleIdent: Q47624
  21338.  
  21339.  CodeView Versions 2.20 and 2.30 do not trace into a function that is
  21340.  contained in a single line of code. For example, if the following
  21341.  program is compiled and loaded into CodeView, an attempt to trace into
  21342.  the function funct() results in the trace stepping over the function,
  21343.  rather than tracing into it.
  21344.  
  21345.  Sample Program
  21346.  --------------
  21347.  
  21348.  /* SIMPLE.C ... a very simplistic sample program                    */
  21349.  
  21350.  int funct(void);
  21351.  int x;
  21352.  
  21353.  void main(void)
  21354.  {
  21355.    x = funct()
  21356.   }
  21357.  
  21358.  /* single-line function. It does nothing more than return a value.  */
  21359.  
  21360.  int funct(void){return 1;}
  21361.  
  21362.  If the above function is modified so that it performs exactly the same
  21363.  task but is located on multiple lines, as follows, then CodeView
  21364.  handles it correctly:
  21365.  
  21366.  int funct(void)
  21367.   {
  21368.     return 1;
  21369.    }
  21370.  
  21371.  
  21372.  
  21373.  8. Trace Stops on Line Following a Loop Before Loop Is Done
  21374.  
  21375.  Product Version(s): 2.20 2.30 | 2.20 2.30
  21376.  Operating System:   MS-DOS    | OS/2
  21377.  Flags: ENDUSER | S_C
  21378.  Last Modified: 15-SEP-1989    ArticleIdent: Q47625
  21379.  
  21380.  In trace mode, CodeView stops on the line following a loop that does
  21381.  not have open and close braces ({}), before the loop is done.
  21382.  
  21383.  When tracing through a loop without the braces ({}), the trace stops
  21384.  on the statement immediately following the loop each time through the
  21385.  loop, giving the impression that the statement is being executed
  21386.  inside the loop. Actual program execution is correct.
  21387.  
  21388.  The following program was compiled with C Version 5.10 with the
  21389.  command line
  21390.  
  21391.     cl /Zi /Od program.c
  21392.  
  21393.  and run using CodeView 2.20, as follows:
  21394.  
  21395.      cv program.exe
  21396.  
  21397.  The trace stops at the printf each time through the loop even though
  21398.  printf is not part of the loop, but does not print anything until the
  21399.  end of the program.
  21400.  
  21401.  Sample Program
  21402.  --------------
  21403.  
  21404.  #include <stdio.h>
  21405.  
  21406.  void main(void)
  21407.  {
  21408.      int i;
  21409.      int count;
  21410.  
  21411.      count = 0;
  21412.  
  21413.      for(i=0;i<3;i++)
  21414.          if(i)
  21415.              count++;
  21416.  
  21417.      printf("Count is %d\n",count);
  21418.  }
  21419.  
  21420.  
  21421.  9. The 37th Call Added to the Calls Menu Corrupts CodeView Screen
  21422.  
  21423.  Product Version(s): 2.20   | 2.20
  21424.  Operating System:   MS-DOS | OS/2
  21425.  Flags: ENDUSER | buglist2.20 fixlist2.30
  21426.  Last Modified: 10-NOV-1989    ArticleIdent: Q50496
  21427.  
  21428.  The CodeView Calls menu shows the current depth of function calls as
  21429.  well as the line number the routine was called from and the parameters
  21430.  passed. The current routine is always at the top and the routine from
  21431.  which the current routine was called is directly below.
  21432.  
  21433.  The routines in the Calls menu are first labeled 0-9, and if you are
  21434.  nested more than ten levels deep, CodeView labels the next 26 calls
  21435.  A-Z, for a display that can accept 36 levels of subroutine calls. If
  21436.  you exceed this limit and then select the Calls menu, the CodeView
  21437.  display becomes corrupted.
  21438.  
  21439.  If the display is corrupted in this manner, the Redraw ("@") dialog
  21440.  command can be used to restore the display to it's original state.
  21441.  
  21442.  The Stack Trace dialog command (K) has the same function as the Calls
  21443.  menu and correctly handles nesting of more than 36 levels deep.
  21444.  
  21445.  Microsoft has confirmed this to be a problem with CodeView Version
  21446.  2.20. This problem was corrected in Version 2.30.
  21447.  
  21448.  
  21449.  10. Quickwatch Seems to Hang When Expanding Very Large Arrays
  21450.  
  21451.  Product Version(s): 3.00 3.10 3.11 | 3.00 3.10 3.11
  21452.  Operating System:   MS-DOS         | OS/2
  21453.  Flags: ENDUSER | s_quickc
  21454.  Last Modified:  6-FEB-1991    ArticleIdent: Q68010
  21455.  
  21456.  When expanding an element in a large array (usually greater than 1000
  21457.  elements, but system dependent), the quickwatch function appears to
  21458.  hang. This apparent problem is caused by the time it takes to re-align
  21459.  the data in the window, and is actually normal operation. If you place
  21460.  the same array element in the Watch Window, it will expand instantly.
  21461.  
  21462.  
  21463.  11. Structures Declared with Near, Far, Pascal, and Fortran
  21464.  
  21465.  Product Version(s): 2.20 2.30 | 2.20 2.30
  21466.  Operating System:   MS-DOS    | OS/2
  21467.  Flags: ENDUSER | S_C S_QuickC buglist2.20 buglist2.30
  21468.  Last Modified: 16-AUG-1989    ArticleIdent: Q47694
  21469.  
  21470.  CodeView is unable to display elements of structures declared with the
  21471.  following keywords:
  21472.  
  21473.     near
  21474.     far
  21475.     pascal
  21476.     fortran
  21477.  
  21478.  Using ?? to display a structure yields the structure table with only
  21479.  one value inside. This value is the first element in the structure.
  21480.  Using w? or ? yields the following error message:
  21481.  
  21482.     Operand types incorrect for this operation
  21483.  
  21484.  Microsoft has confirmed this to be a problem with CodeView Versions
  21485.  2.20 and 2.30. We are researching this problem and will post new
  21486.  information as it becomes available.
  21487.  
  21488.  To work around this problem, recompile without these keywords, or
  21489.  obtain the address of the structure element and put a watch on the
  21490.  memory location.
  21491.  
  21492.  Consider the following large model program:
  21493.  
  21494.  struct { int x;
  21495.           int y;
  21496.           int z;} near a;    /* or far, pascal, fortran */
  21497.  
  21498.  void main(void)
  21499.  {
  21500.    a.x = 1;
  21501.  }
  21502.  
  21503.  To put a watch on a.x, you could issue the following commands:
  21504.  
  21505.  ? &a
  21506.  0x0345:0000       <- result is the address of the structure
  21507.  ww 0x0345:0x0     <- address of x
  21508.  ww 0x0345:0x2     <- address of y (two byte int from x)
  21509.  
  21510.  This puts a watch on the first and second elements (x and y) in the
  21511.  structure.
  21512.  
  21513.  
  21514.  12. Older Vega VGAs Hang CodeView When in VGA Mode
  21515.  
  21516.  Product Version(s): 2.10 2.20 2.30 | 2.20 2.30
  21517.  Operating System:   MS-DOS         | OS/2
  21518.  Flags: ENDUSER |
  21519.  Last Modified: 14-AUG-1989    ArticleIdent: Q27212
  21520.  
  21521.  Question:
  21522.  
  21523.  Why does my old Vega VGA card cause CodeView to hang when I start it
  21524.  in VGA mode? It works properly when I start CodeView when the card is
  21525.  in CGA mode.
  21526.  
  21527.  Response:
  21528.  
  21529.  Some of the older Vega VGAs do not work correctly with CodeView. The
  21530.  Vega VGA card uses the same maskable interrupt for detecting graphics
  21531.  mode as CodeView.
  21532.  
  21533.  We recommend that you contact Vega by calling 1 (800) 248-1850 for
  21534.  advice if you experience this problem.
  21535.  
  21536.  
  21537.  13. Ambiguous Documentation of Enter ASCII (EA) Command
  21538.  
  21539.  Product Version(s): 2.10 2.20 | 2.10 2.20
  21540.  Operating System:   MS-DOS    | OS/2
  21541.  Flags: ENDUSER |
  21542.  Last Modified: 16-AUG-1989    ArticleIdent: Q47764
  21543.  
  21544.  In the "Microsoft C 5.1 Optimizing Compiler" manual, the "CodeView and
  21545.  Utilities" section does not thoroughly document the EA command for
  21546.  CodeView. The following is a more complete explanation:
  21547.  
  21548.     EA address [list]
  21549.  
  21550.     The Enter ASCII (EA) command modifies array to the value of [list].
  21551.     Address refers to what you want to modify. [list] refers to a
  21552.     string literal such as "hello". EA will copy [list] to array. Thus,
  21553.     if you specify address by giving an array, such as an array of
  21554.     characters, the array will have [list] copied into it. However, if
  21555.     you were to give a pointer to a character, then the bytes that make
  21556.     up the pointer will be directly modified, not the block of memory
  21557.     the pointer is pointing at.
  21558.  
  21559.  Consider the following examples:
  21560.  
  21561.  char array[] = "Hello";
  21562.  char *ptr    = "Hello";
  21563.  
  21564.  >EA array "Hi"
  21565.  >EA ptr   "Hi"
  21566.  
  21567.  The result is that the array would contain "Hillo", and ptr will be
  21568.  pointing to some unknown memory location.
  21569.  
  21570.  The array is considered a constant pointer to a block of memory, and
  21571.  as such, any operations on it can only affect the block of memory.
  21572.  However, ptr is a variable; therefore, any operations on it affect the
  21573.  value of ptr, which happens to be a two- or four-byte number. That
  21574.  number happens to refer to a location in memory.
  21575.  
  21576.  If you want to changed the block of memory that ptr points to, you
  21577.  must do the following:
  21578.  
  21579.     >EA &ptr[0] "Hi"
  21580.  
  21581.  Essentially, this takes the address of the character that ptr is
  21582.  pointing at, gives a constant address, and thus modifies the block of
  21583.  memory there. To clarify, imagine you have a character located some
  21584.  place in memory. To move a character, you must make a copy of it to
  21585.  some other memory location; it is not possible to take its address and
  21586.  modify the address directly to change where the character is located.
  21587.  Thus, the address of that character is always a constant value. ptr[0]
  21588.  happens to be a character located someplace in memory. As such, the
  21589.  address of that specific character is a constant value. Since a
  21590.  constant cannot be modified, EA changes the block of memory starting
  21591.  at where the constant pointer is pointing.
  21592.  
  21593.  
  21594.  14. Debugging of DLLs That Do Not Have the .DLL Extension
  21595.  
  21596.  Product Version(s): 2.30   | 2.30
  21597.  Operating System:   MS-DOS | OS/2
  21598.  Flags: ENDUSER |
  21599.  Last Modified: 21-AUG-1989    ArticleIdent: Q47938
  21600.  
  21601.  CodeView Protect (CVP) Version 2.30 has the ability to debug DLLs that
  21602.  are called with DosLoadModule(). DosLoadModule() can load DLLs that
  21603.  do not have the .DLL extension. However, CVP 2.30 cannot debug DLLs
  21604.  that do not have the .DLL extension. If you want to debug DLLs that
  21605.  are called with DosLoadModule, they must have the .DLL extension.
  21606.  
  21607.  Microsoft is aware of this limitation with CodeView Protect 2.30. We
  21608.  are researching this problem and will post new information as it
  21609.  becomes available.
  21610.  
  21611.  
  21612.  15. Resident Software May Cause "Internal Debugger Error 80"
  21613.  
  21614.  Product Version(s): 1.x 2.00 2.10 2.10 2.30
  21615.  Operating System:   MS-DOS
  21616.  Flags: ENDUSER |
  21617.  Last Modified: 29-AUG-1989    ArticleIdent: Q47989
  21618.  
  21619.  Question:
  21620.  
  21621.  Sometimes when I run CodeView, I get an "Internal Debugger Error 80"
  21622.  message. What causes this?
  21623.  
  21624.  Response:
  21625.  
  21626.  Internal Debugger Error messages are usually caused by problems in
  21627.  your MS-DOS environment; the most likely cause is the presence of
  21628.  memory-resident software, commonly referred to as TSRs (terminate-
  21629.  and-stay-resident software).
  21630.  
  21631.  For example, running CodeView with Borland's Sidekick loaded has been
  21632.  known to cause "Internal Debugger Error 80" and "R6002: Floating Point
  21633.  not loaded" error messages. "Internal Debugger Error 80" has also been
  21634.  reported when CodeView was run with Software Solutions' "Software
  21635.  Carousel" loaded into memory.
  21636.  
  21637.  CodeView Versions 2.00 and later have become increasingly more
  21638.  sensitive to TSRs. If you receive an Internal Debugger Error message,
  21639.  or you are experiencing strange problems within CodeView, make sure
  21640.  you are running CodeView with no memory-resident software loaded
  21641.  (including, but not limited to, device drivers, screen savers,
  21642.  keyboard enhancers, command-line editors, etc.). Disabling your
  21643.  resident software, but not rebooting, may not completely remove its
  21644.  interference, so be sure to "boot clean" when trying to resolve a
  21645.  problem of this type.
  21646.  
  21647.  If you continue to receive the error message without memory-resident
  21648.  programs, try running CodeView on some other program to see if the
  21649.  error is related to particular code. If the error is related to the
  21650.  specific code, and you are unable to determine the cause, you may want
  21651.  to call Microsoft Product Support for assistance at (206) 454-2030.
  21652.  
  21653.  If the error is not dependent on your code, the problem might be the
  21654.  particular sequence of CodeView commands you execute. Make a note of
  21655.  what operations you performed, i.e., the sequence of Trace, Go, Watch,
  21656.  Tracepoint, etc., commands that were issued, and contact Microsoft
  21657.  Product Support via phone, letter, or Microsoft OnLine.
  21658.  
  21659.  
  21660.  16. CVP Restart Command (Dialog Version) Doesn't Properly Set argc
  21661.  
  21662.  Product Version(s): 2.20 2.30 | 2.20 2.30
  21663.  Operating System:   MS-DOS    | OS/2
  21664.  Flags: ENDUSER | buglist2.20 buglist2.30
  21665.  Last Modified: 28-AUG-1989    ArticleIdent: Q48000
  21666.  
  21667.  When using the dialog version of the Restart command, you can restart
  21668.  your program with command-line arguments; however, under CodeView
  21669.  Protect (CVP) Versions 2.20 and 2.30, argc does not get properly set.
  21670.  
  21671.  The Dialog Restart command is often used to restart a program with
  21672.  command line arguments. For example, you could use the following:
  21673.  
  21674.     L arg1 arg2 arg3
  21675.  
  21676.  This example restarts the current executable file, retaining any
  21677.  breakpoints, watchpoints, and tracepoints, with arg1, arg2, and arg3
  21678.  loaded into argv[1], argv[2], and argv[3], respectively. Argv[0] is
  21679.  always set to the name of the current executable file. Argc, at this
  21680.  point, should be set to four. The problem presents itself here; argc
  21681.  either remains unchanged from the value it was initially set to when
  21682.  CodeView was started, or is decremented by one. If, for example,
  21683.  CodeView is started with two command-line arguments (argc would then
  21684.  be set to three) and then executed, the previous example argc (which
  21685.  should then set argc to four) would remain unchanged. When using the
  21686.  Dialog Restart command and specifying fewer arguments than were
  21687.  specified at start up, argc sometimes is decremented by one.
  21688.  
  21689.  Microsoft has confirmed this to be a problem with CodeView Versions
  21690.  2.20 and 2.30. We are researching this problem and will post new
  21691.  information as it becomes available.
  21692.  
  21693.  
  21694.  17. Cannot Load CTRL+Z-Terminated Files with Less than 129 Bytes
  21695.  
  21696.  Product Version(s): 1.00 1.10 2.00 2.10
  21697.  Operating System:   MS-DOS
  21698.  Flags: ENDUSER | buglist1.00 buglist1.10 buglist2.00 buglist2.10 qfbv
  21699.  Last Modified:  4-NOV-1988    ArticleIdent: Q26548
  21700.  
  21701.  Problem:
  21702.  
  21703.  When using the F(ile) O(pen) command to load a text file which has
  21704.  less than 129 bytes and is terminated with a hex 1A (decimal 26,
  21705.  CTRL+Z, EOF), CodeView issues the error message "Not a text file." If
  21706.  the CTRL+Z character is removed, or if the file size is 129 bytes or
  21707.  greater, CodeView has no problem loading it.
  21708.  
  21709.  Response:
  21710.  
  21711.  Microsoft has confirmed this to be a problem in Version 1.00, 1.10,
  21712.  2.00, and 2.10. We are researching this problem and will post new
  21713.  information as it becomes available.
  21714.  
  21715.  
  21716.  18. Debugging High Resolution EGA or VGA Graphics
  21717.  
  21718.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
  21719.  Operating System:   MS-DOS                        | OS/2
  21720.  Flags: ENDUSER | TAR61178
  21721.  Last Modified: 14-AUG-1989    ArticleIdent: Q23308
  21722.  
  21723.  Question:
  21724.  
  21725.  I am trying to debug a program that does EGA or VGA graphics. When I
  21726.  continue from a breakpoint after the program has painted the screen,
  21727.  the screen is not as it was before the breakpoint. I think that all
  21728.  colors have been turned to black, but I am not sure.
  21729.  
  21730.  I tried this procedure with no switches, with /s, and with /t. The
  21731.  program is using the EGA in 640x350 16-color mode. Is this supposed to
  21732.  work? If it does not work, why not? What will you do about supporting
  21733.  the higher modes for the new machines such as the Personal System 2
  21734.  series from IBM?
  21735.  
  21736.  Response:
  21737.  
  21738.  This behavior is partly related to the size of the buffer that
  21739.  CodeView creates for storing screen information. If you are running on
  21740.  a CGA, EGA or VGA board, this buffer is by default 16K. If you are running
  21741.  on a monochrome board, this buffer is by default 4K. As you are
  21742.  finding, 16K is simply not enough memory for a color image using
  21743.  640x350 resolution (the maximum resolution supported would be
  21744.  640x200).
  21745.  
  21746.  One of the reasons why CodeView does not have the ability to handle
  21747.  the buffer requirements of an EGA image is that the EGA registers are
  21748.  write only. There is no way for CodeView to detect what mode the EGA
  21749.  currently is in so it can adjust the size accordingly. Also note that
  21750.  with the different resolutions the image is stored in different memory
  21751.  locations. The black on black characters may simply be a blank image
  21752.  because CodeView cannot tell that the resolution is different and
  21753.  therefore the image is located elsewhere.
  21754.  
  21755.  With the PS/2 machines this is not an issue because the EGA registers
  21756.  have read capability. We are reviewing this with regard to future
  21757.  implementations of CodeView.
  21758.  
  21759.  The following are some ways to work around this current limitation:
  21760.  
  21761.  1. Try writing a routine that will place the display in the desired
  21762.     mode before you invoke CodeView. CodeView will be able to judge
  21763.     which mode is currently in effect and can locate the image in the
  21764.     correct area of memory. Note that the image will not be displayed
  21765.     in color. You will only see the higher resolution since the buffer
  21766.     is not big enough.
  21767.  
  21768.  2. Debug your applications that run in high resolution graphics with a
  21769.     second monitor (use the /2 switch). Since the display is going to a
  21770.     different screen, CodeView will not have to worry about changing
  21771.     the video modes or the buffering.
  21772.  
  21773.  
  21774.  19. CodeView Version 2.20 Is Called CVPCK.EXE by DOS Version 2.10
  21775.  
  21776.  Product Version(s): 2.20
  21777.  Operating System:   MS-DOS
  21778.  Flags: ENDUSER | CV CVPCK CVPACK 2.x
  21779.  Last Modified: 21-SEP-1989    ArticleIdent: Q48689
  21780.  
  21781.  Question:
  21782.  
  21783.  When trying to invoke CodeView Version 2.20 under DOS Version 2.10 or
  21784.  2.11, I get the messages "Cannot Find CVPCK.EXE" and "Please enter new
  21785.  program spec:". How can I get CodeView 2.20 to work under DOS Versions
  21786.  2.1x?
  21787.  
  21788.  Response:
  21789.  
  21790.  If you rename CV.EXE to CVPCK.EXE, you can run CodeView Version 2.20
  21791.  under DOS Version 2.10 or 2.11. You must also rename CV.HLP to C.HLP
  21792.  to make the on-line help accessible.
  21793.  
  21794.  CodeView Version 2.20 is included with C Version 5.10, FORTRAN Version
  21795.  4.10, Pascal Version 4.00, and Macro Assembler (MASM) Version 5.10.
  21796.  
  21797.  Many people mistakenly assume that CodeView is actually looking for
  21798.  CVPACK.EXE, which also comes with the software packages listed above.
  21799.  If you rename CVPACK.EXE to CVPCK.EXE and then try to run CVPCK.EXE,
  21800.  you will receive the error message "overlay not found." If you receive
  21801.  this error, delete CVPCK.EXE, copy both CV.EXE and CVPACK.EXE from the
  21802.  installation disks, and follow the instructions above.
  21803.  
  21804.  Under DOS Versions 3.x, a C program's name is available from argv[0].
  21805.  Under DOS Versions 2.x, argv[0] always equals the letter "C", so
  21806.  programs that need to find themselves under DOS Versions 2.x also have
  21807.  their own names hard coded as the filename to locate. Unfortunately,
  21808.  the hard-coded name within CodeView Version 2.20 is "CVPCK.EXE", so
  21809.  this is what it looks for under DOS Versions 2.x.
  21810.  
  21811.  
  21812.  20. CodeView String Search Length Limited to 19 Characters
  21813.  
  21814.  Product Version(s): 2.10 2.20 2.30 | 2.10 2.20 2.30
  21815.  Operating System:   MS-DOS         | OS/2
  21816.  Flags: ENDUSER | SR# G890810-24574 P_WinSDK
  21817.  Last Modified: 19-SEP-1989    ArticleIdent: Q48863
  21818.  
  21819.  CodeView Versions 2.20 and 2.30 and CodeView for Windows Version 2.10
  21820.  have a 19-character limit in the "Find..." option of the Search menu,
  21821.  even though the dialog box is much longer than 19 characters. Entering
  21822.  a search string longer than 19 characters results in one of two error
  21823.  messages.
  21824.  
  21825.  If the search string entered is 20 or 21 characters long, CodeView
  21826.  displays the erroneous message "No match of regular expression," even
  21827.  if the search string does exist in the file. If the search string is
  21828.  22 characters or more in length, CodeView displays the more
  21829.  appropriate message "Regular expression too long."
  21830.  
  21831.  Although 19 characters sometimes can be limiting, CodeView does
  21832.  substring searches so that searching for the following
  21833.  
  21834.     AFunctionWithAVeryL
  21835.  
  21836.  finds the following string:
  21837.  
  21838.     AFunctionWithAVeryLongName
  21839.  
  21840.  You will have problems only if you have both of the following and
  21841.  you are trying to locate one, but not the other:
  21842.  
  21843.     AFunctionWithAVeryLongName()
  21844.     AFunctionWithAVeryLongParameterList(a,b,c,d,e,f,g,h,i,j)
  21845.  
  21846.  In this case, you won't be able to specify search strings long enough
  21847.  to distinguish between the two. However, you can repeatedly use the
  21848.  Next command from the Search menu to find the next occurrence of the
  21849.  following:
  21850.  
  21851.     AFunctionWithAVeryL
  21852.  
  21853.  The Next command will find whichever of the above two function names
  21854.  that comes next in the source file.
  21855.  
  21856.  
  21857.  21. Files, Environment Inaccessible Only While Running under CVP
  21858.  
  21859.  Product Version(s): 2.20
  21860.  Operating System:   OS/2
  21861.  Flags: ENDUSER |
  21862.  Last Modified: 30-NOV-1989    ArticleIdent: Q49313
  21863.  
  21864.  Due to combined problems in both protected-mode CodeView (CVP) Version
  21865.  2.20 and OS/2 Version 1.00 or 1.10, programs that correctly access
  21866.  data files and/or system environment information could fail when
  21867.  attempting this same access while running under CVP 2.20. This is
  21868.  strictly a protected-mode problem and is unrelated to the use of
  21869.  CodeView under MS-DOS. The sample program at the end of this article
  21870.  can be used to demonstrate this problem.
  21871.  
  21872.  The system environment information includes such items as the path and
  21873.  other environment variables, as well as the current working directory
  21874.  for each disk drive. This information is normally available to an
  21875.  executing program, but for a program being debugged with CVP 2.20
  21876.  running under OS/2 1.00 or 1.10, most of this environment information
  21877.  is inaccessible.
  21878.  
  21879.  This inaccessibility is a result of environment handling problems in
  21880.  both CVP 2.20 and OS/2 Version 1.00. Since CodeView is run from the
  21881.  command prompt, all the current environment information is available
  21882.  to CodeView itself, but the program being debugged is given its own
  21883.  new screen group in which to run. It is in this new screen group that
  21884.  the current environment information is lost because it is not carried
  21885.  over by either OS/2 or CodeView.
  21886.  
  21887.  Although the OS/2 problem has been corrected in Version 1.10, the
  21888.  CodeView problem still prevents access to the environment. Therefore,
  21889.  upgrading either CodeView or OS/2 alone does not solve the problem.
  21890.  Only with CodeView Version 2.30 running under OS/2 Version 1.10 is the
  21891.  problem eliminated.
  21892.  
  21893.  There may be some environment information available to the program
  21894.  being debugged, but only if it was set in the CONFIG.SYS file at start
  21895.  up. Since each new screen group is begun with a copy of the original
  21896.  start-up system environment, any SET commands carried out in the
  21897.  CONFIG.SYS file will then be duplicated for all subsequent screen
  21898.  groups.
  21899.  
  21900.  Otherwise, if a program needs access to environment variables that
  21901.  were set in the current screen group where CodeView will be invoked,
  21902.  then the only way to make the information available while debugging is
  21903.  to temporarily hard code the information into the program. After
  21904.  debugging, the program can be changed back to using the actual
  21905.  environment strings.
  21906.  
  21907.  The only other alternative to temporarily hard code the environment
  21908.  information into the program is to set the environment variables in the
  21909.  CONFIG.SYS file at boot time, rather than setting them in the current
  21910.  screen group.
  21911.  
  21912.  The only reason a file access will fail only while the program is
  21913.  running under CodeView is if the program is assuming the file is in
  21914.  the current working directory on the current or another drive.
  21915.  
  21916.  If this is the case, then one of the following workarounds may be used
  21917.  to gain access to files while debugging:
  21918.  
  21919.  1. Use full pathnames for all file accesses, since this alleviates any
  21920.     dependency on knowing the current working directory for the drive
  21921.     that is being accessed. If it is not feasible to have hard-coded
  21922.     pathnames in the completed program, at least adding the full paths
  21923.     temporarily will allow debugging.
  21924.  
  21925.  2. Put the files to be accessed in the root directory of the boot
  21926.     drive. This allows them to be found even under CodeView because
  21927.     with no environment information, the current working directory
  21928.     defaults to the root of the boot drive.
  21929.  
  21930.  3. Use a two-monitor debugging setup and start CodeView with the /2
  21931.     option. In this situation, CVP does not need to start a new screen
  21932.     group for the program being debugged because it can run it on the
  21933.     second monitor. Thus, the current environment information is
  21934.     available to both programs because they are both running in the
  21935.     current screen group.
  21936.  
  21937.     For more information about debugging with a two-monitor setup, query
  21938.     on the following:
  21939.  
  21940.        CodeView two monitor debugging
  21941.  
  21942.  The following C program can be used to demonstrate this environment
  21943.  problem:
  21944.  
  21945.  Program Example:
  21946.  ---------------
  21947.  
  21948.      /* TEST.C - shows inaccessible files under CodeView
  21949.  
  21950.         Compile with : CL /Zi /Od test.c
  21951.         Run with : test <filename>      where <filename> is any file
  21952.                         in the current directory.  The file will be
  21953.                         opened properly.
  21954.         Begin CVP with : CVP test <filename>     where <filename> is
  21955.                         the same as before. The file will not be
  21956.                         found when the program is run or traced.
  21957.      */
  21958.  
  21959.      #include <stdio.h>
  21960.      void main(int, char *[]);
  21961.  
  21962.      void main(int argc, char *argv[])
  21963.      {
  21964.          FILE *dfile ;
  21965.  
  21966.          if ((dfile = fopen(argv[1], "rb")) == NULL) {
  21967.              perror ("") ;
  21968.              printf ("Cannot open file '%s'.\n\n", argv[1]) ;
  21969.          }
  21970.          else {
  21971.              printf("File %s opened OK.\n\n", argv[1]) ;
  21972.              fclose (dfile) ;
  21973.          }
  21974.      }
  21975.  
  21976.  
  21977.  22. COM Port Time-Out Halts Redirection of CVP to Remote Terminal
  21978.  
  21979.  Product Version(s): 2.20 2.30
  21980.  Operating System:   OS/2
  21981.  Flags: ENDUSER |
  21982.  Last Modified: 27-OCT-1989    ArticleIdent: Q49376
  21983.  
  21984.  When using protected-mode CodeView (CVP) under OS/2, there is a
  21985.  problem with the serial communications (COM) ports timing out after 60
  21986.  to 90 seconds of inactivity. This time-out makes it essentially
  21987.  impossible to do remote terminal debugging with CVP. Once the time-out
  21988.  occurs, no further input is accepted from the remote terminal. The
  21989.  only workaround is to quit CodeView and begin again, or to do a break
  21990.  and then restart the redirection to the COM port.
  21991.  
  21992.  The CodeView Debugger allows redirection of input and output to a file
  21993.  or device. This procedure is commonly used to set up a remote (dumb)
  21994.  terminal for CodeView input and output, while the PC screen is used
  21995.  for displaying the program input and output. The terminal is connected
  21996.  through a COM port, which eliminates the need for a second video
  21997.  adapter as is required when using two monitors with the /2 option.
  21998.  Entering "=COM1" at the CodeView command prompt enables input and
  21999.  output redirection to the device designated as COM1.
  22000.  
  22001.  This debugging arrangement works great with CodeView under MS-DOS, but
  22002.  it becomes unworkable with CVP under OS/2 because the internal calls
  22003.  that are used to set up the redirection do not account for time-outs
  22004.  due to inactivity. Thus, if you are entering commands from the remote
  22005.  terminal at a steady pace, everything proceeds smoothly. However, if you
  22006.  stop and wait for more than about 60 seconds without doing any input,
  22007.  the port will time-out and leave you stranded because the keyboard no
  22008.  longer responds.
  22009.  
  22010.  In a normal debugging session, it is quite likely that there would be
  22011.  many instances greater than 60 seconds where input is not yet needed
  22012.  or desired; therefore, this situation quickly becomes intolerable. The
  22013.  only way to regain control is to enter CTRL+C at the PC keyboard,
  22014.  which ends the redirection. At that point, you could enter "=COM1"
  22015.  again on the PC keyboard to restart the redirection if you so desired.
  22016.  
  22017.  
  22018.  23. CVP 2.30 Does Not Allow Pathnames for DLLs Specified with /L
  22019.  
  22020.  Product Version(s): 2.30
  22021.  Operating System:   OS/2
  22022.  Flags: ENDUSER | buglist2.30
  22023.  Last Modified: 10-OCT-1989    ArticleIdent: Q49377
  22024.  
  22025.  Protected-mode CodeView (CVP) Version 2.30 allows debugging of dynamic
  22026.  link libraries (DLLs) by specifying their names on the command line
  22027.  with the /L switch. Because of a problem exclusive to CVP 2.30, this
  22028.  particular version of the debugger does not allow a pathname to be
  22029.  used with /L to specify the DLL's location in another directory.
  22030.  Therefore, all DLLs to be debugged with CVP 2.30 must reside in the
  22031.  current working directory.
  22032.  
  22033.  Since DLLs are also required to be in a directory that is on the
  22034.  LIBPATH, two copies of the DLL may need to be resident on the disk,
  22035.  unless the current working directory is also a LIBPATH directory.
  22036.  
  22037.  Microsoft has confirmed this to be a problem with CodeView Version
  22038.  2.30. We are researching this problem and will post new information as
  22039.  it becomes available.
  22040.  
  22041.  When tracing a program under CodeView that calls DLLs, the only way to
  22042.  trace into the code of a particular DLL is if the DLL was specified
  22043.  ahead of time on the command line with /L when CVP was invoked. If a
  22044.  program statement is traced that calls a DLL that was not specified by
  22045.  /L, then CodeView executes all the code in the DLL and returns control
  22046.  back at the line following the call to the DLL. Thus, the call is
  22047.  handled as if the step command, rather than the trace command, had
  22048.  been used.
  22049.  
  22050.  You can indicate only one DLL with the /L switch, so debugging
  22051.  multiple DLLs requires multiple /L switches. Normally, the switch is
  22052.  followed by a space and the name of the DLL to be debugged, and if the
  22053.  DLL is not located in the current directory, a path may precede the
  22054.  DLL name. It is only with CVP 2.30 that this becomes a problem because
  22055.  a pathname is not recognized with this version, so tracing into the
  22056.  DLL is prevented.
  22057.  
  22058.  Unfortunately, CodeView does not display error messages for improper
  22059.  use of the /L switch, so if the DLL is not found, there is no message
  22060.  indicating this. Instead, CodeView does not allow debugging of the
  22061.  improperly specified DLL. Use of a pathname with /L with CVP 2.30
  22062.  causes this same behavior.
  22063.  
  22064.  The only workaround for DLL debugging with CVP 2.30 is to keep a copy
  22065.  of the DLL in the current working directory from which CodeView is
  22066.  invoked. Thus, if the current directory is not a directory specified
  22067.  on the LIBPATH, there must be two copies of the DLL on the disk. It is
  22068.  very important that the two copies are exactly the same because
  22069.  differing code makes any attempts at debugging very difficult and
  22070.  confusing.
  22071.  
  22072.  A common practice is to put a period (.) as the first directory on
  22073.  the LIBPATH because this makes the current working directory a LIBPATH
  22074.  directory, eliminating the need for two copies of the DLL. More
  22075.  information on this practice can be found by querying on the
  22076.  following words:
  22077.  
  22078.     CodeView DLL debugging and libpath
  22079.  
  22080.  
  22081.  24. Label Finding Command Does Whole Word Search, Not Text Search
  22082.  
  22083.  Product Version(s): 2.20 2.30 | 2.20 2.30
  22084.  Operating System:   MS-DOS    | OS/2
  22085.  Flags: ENDUSER |
  22086.  Last Modified: 27-OCT-1989    ArticleIdent: Q49378
  22087.  
  22088.  In CodeView Versions 2.20 and 2.30, under the Search menu is the Label
  22089.  option for searching for a label. Unlike the Find option, which
  22090.  searches the source code for any regular expression, the Label option
  22091.  searches the executable code for an assembly language label.
  22092.  
  22093.  This search is not a text search and does not accept regular
  22094.  expressions. The only way to find a label is to specify the entire
  22095.  label name as the search string. In addition, if the Case Sense option
  22096.  is selected on the Options menu, the label is found only if the case
  22097.  of each character matches exactly.
  22098.  
  22099.  For example, if you want to find the code for the standard C
  22100.  stack-checking function "_chkstk", choose Search Label, and type in
  22101.  "__chkstk" (without the quotation marks), and press ENTER. This
  22102.  switches you into assembly mode, if you weren't there already, and
  22103.  puts the line with the __chkstk label at the top of the window. The
  22104.  two underscores are required since C appends an underscore to the
  22105.  front of all labels and the original function name is "_chkstk".
  22106.  
  22107.  You will receive the error message "Unknown Symbol" if the label
  22108.  cannot be found or if you mistype or incompletely type the correct
  22109.  name. For example, "_chkstk", "chkstk", "__chk", and "__chkstks" all
  22110.  fail to find a match in the above example. If Case Sense is on,
  22111.  searching for the label "__CHKSTK" also results in failure.
  22112.  
  22113.  
  22114.  25. The Assemble Command with ADD Instructions
  22115.  
  22116.  Product Version(s): 2.20 2.30  | 2.20 2.30
  22117.  Operating System:   MS-DOS | OS/2
  22118.  Flags: ENDUSER | buglist2.20 buglist2.30
  22119.  Last Modified:  9-AUG-1989    ArticleIdent: Q40225
  22120.  
  22121.  Problem:
  22122.  
  22123.  In CodeView, I'm using the assemble command to change my ADD
  22124.  instruction, and it changes all the code from that point on.
  22125.  
  22126.  Response:
  22127.  
  22128.  If you had the instruction ADD AL,44, for example, and you wanted to
  22129.  change the 44 to 45 (or any other number), you could use the Assemble
  22130.  command to do it. The Microsoft Macro Assembler generates a 04 44 for
  22131.  that instruction; however, when changing the 44 to 45, CodeView
  22132.  generates an 80 C0 45, which is still the correct instruction of ADD
  22133.  AL,45. However, it's a 3-byte instruction. Inserting one extra byte
  22134.  into your code will cause each op code from that point on to be off by
  22135.  one.
  22136.  
  22137.  Microsoft has confirmed this to be a problem in Versions 2.20
  22138.  and 2.30 of CodeView. We are researching this problem and will
  22139.  post new information as it becomes available.
  22140.  
  22141.  
  22142.  
  22143.  26. CV Prior to 3.00 Needs /S for Mouse to Appear in OS/2 DOS Box
  22144.  
  22145.  Product Version(s): 1.00 1.10 1.11 2.00 2.10 2.20 2.30 2.35
  22146.  Operating System:   MS-DOS
  22147.  Flags: ENDUSER |
  22148.  Last Modified:  6-FEB-1991    ArticleIdent: Q23646
  22149.  
  22150.  With all versions of real-mode CodeView (CV) earlier than version
  22151.  3.00, the mouse cursor does not display when running in a DOS session
  22152.  under OS/2 in the DOS compatibility box.
  22153.  
  22154.  The situation exists because the mouse draws the pointer only in video
  22155.  page zero, while CodeView uses video page one. This problem is caused
  22156.  by OS/2 itself because the mouse cursor works normally under DOS.
  22157.  
  22158.  To work around this limitation with CV 1.x or 2.x, invoke CodeView
  22159.  with the /S switch so screen swapping is used as the method of screen
  22160.  exchange. This method forces CodeView to swap in and out of page zero.
  22161.  
  22162.  Beginning with version 3.00, CodeView detects whether it is running in
  22163.  a DOS session under OS/2, and if so, automatically starts up with /S
  22164.  as the default in order to make the mouse visible.
  22165.  
  22166.  
  22167.  27. CVPACK /p Causes a More Complete Packing
  22168.  
  22169.  Product Version(s): 2.20
  22170.  Operating System:   MS-DOS
  22171.  Flags: ENDUSER |
  22172.  Last Modified: 28-MAR-1989    ArticleIdent: Q38020
  22173.  
  22174.  When you are unable to load your program into CodeView, try packing
  22175.  the program with CVPACK.EXE. If you want a more complete packing of
  22176.  your executable, then run CVPACK.EXE with the /p option. This option
  22177.  will take longer to run, but it will generate better results.
  22178.  
  22179.  The /p option for CVPACK.EXE is documented on Page update-17 in the
  22180.  "Microsoft C 5.1 Optimizing Compiler, CodeView and Utilities,
  22181.  Microsoft Editor Mixed-Language Programmer's Guide."
  22182.  
  22183.  Normally, CVPACK discards unused debugging information and appends
  22184.  it to the file. With the /p option, CVPACK discards the unused
  22185.  debugging information, then proceeds to sort it throughout the
  22186.  executable file.
  22187.  
  22188.  
  22189.  28. Mouse Cursor Disappears After Right Click
  22190.  
  22191.  Product Version(s): 2.20 2.30 | 2.20 2.30
  22192.  Operating System:   MS-DOS    | OS/2
  22193.  Flags: ENDUSER |
  22194.  Last Modified: 14-AUG-1989    ArticleIdent: Q38021
  22195.  
  22196.  Problem:
  22197.  
  22198.  I have just clicked my right mouse button to acknowledge a pop-up
  22199.  message and my mouse cursor has disappeared. I had just clicked my
  22200.  right mouse button before for another operation.
  22201.  
  22202.  Note: This also occurs when you hit any button on the three button
  22203.  Logitech mouse.
  22204.  
  22205.  Response:
  22206.  
  22207.  To get your mouse cursor back again, redraw the screen with the "@"
  22208.  command.
  22209.  
  22210.  
  22211.  29. CVP 2.30 Hangs When /O Is Specified, but Child Is Not Debugged
  22212.  
  22213.  Product Version(s): 2.30
  22214.  Operating System:   OS/2
  22215.  Flags: ENDUSER | buglist2.30
  22216.  Last Modified: 27-OCT-1989    ArticleIdent: Q49381
  22217.  
  22218.  Beginning with protected-mode CodeView (CVP) Version 2.30, you can
  22219.  debug child processes from within a parent process's CodeView session
  22220.  by invoking CodeView with the /O switch. When the program is executed
  22221.  to the point where the child process is invoked, CodeView displays a
  22222.  prompt showing you the child's process ID (PID) and asks, "Do you wish
  22223.  to debug (y/n)?". Entering "y" brings up the child process and allows
  22224.  you to debug it. Pressing "n" should cause the child to execute
  22225.  without any debugging.
  22226.  
  22227.  Unfortunately, there is a problem in CVP 2.30 that causes CodeView to
  22228.  hang if you answer no to debugging the child. The only workaround is
  22229.  to always answer yes when prompted to debug a child process, or to
  22230.  invoke CodeView without the /O switch because this prevents the prompt
  22231.  entirely.
  22232.  
  22233.  Microsoft has confirmed this to be a problem with CodeView Version
  22234.  2.30. We are researching this problem and will post new information as
  22235.  it becomes available.
  22236.  
  22237.  If the program you are debugging is not a Presentation Manager (PM)
  22238.  application, you may be able to kill the CodeView session if it should
  22239.  hang as a result of answering "n" to the debugging child process. You
  22240.  must switch to the Task Manager and use it to close the hung CodeView
  22241.  session. If you are working on a PM application, the only workaround
  22242.  may be to reboot the computer.
  22243.  
  22244.  
  22245.  30. Cannot Debug Code in Overlays in Small or Compact Model
  22246.  
  22247.  Product Version(s): 2.10 2.20 2.30
  22248.  Operating System:   MS-DOS
  22249.  Flags: ENDUSER |
  22250.  Last Modified: 14-AUG-1989    ArticleIdent: Q27128
  22251.  
  22252.  Question:
  22253.  
  22254.  I have a C program, compiled with Microsoft C Version 5.00, which
  22255.  consists of several modules linked together as overlays. I am not able
  22256.  to trace into code in the overlays. I compiled in the default memory
  22257.  model. What is wrong?
  22258.  
  22259.  Response:
  22260.  
  22261.  The modules must be compiled in medium or large memory model to be
  22262.  overlaid. In the default model (small), or in the compact model, there
  22263.  is only one code segment, which cannot be overlaid. The main module is
  22264.  always resident and cannot be overlaid. You must use the compile
  22265.  option /AH, /AL, or /AM.
  22266.  
  22267.  
  22268.  31. Code that Will Hang IBM XTs or Compatibles
  22269.  
  22270.  Product Version(s): 1.00
  22271.  Operating System:   MS-DOS
  22272.  Flags: ENDUSER | TAR57675 buglist1.00
  22273.  Last Modified:  8-NOV-1988    ArticleIdent: Q23856
  22274.  
  22275.  Problem:
  22276.  
  22277.  The following code will hang IBM XTs or compatibles if specific
  22278.  commands are issued when inside of CodeView:
  22279.  
  22280.     #include <stdio.h>
  22281.     main()
  22282.     {
  22283.          int n;
  22284.          double f;
  22285.  
  22286.          while(1)   {
  22287.                     scanf("%d",&n);
  22288.                 f=1.0;
  22289.                 while (n>1) f=f*n--;
  22290.                    printf("%.101g%c",f,'\n');
  22291.                     }
  22292.     }
  22293.  
  22294.  For the program to fail in CodeView, first set a breakpoint at
  22295.  instruction f=1.0. Issue the Go command, then the P command.
  22296.  
  22297.  Response:
  22298.  
  22299.  This is corrected in CodeView version 2.20.
  22300.  
  22301.  A workaround is to place a breakpoint at the instruction before or
  22302.  after the assignment to f.
  22303.  
  22304.  
  22305.  32. /DOSSEG Link Switch Fails to Make CodeView .exe
  22306.  
  22307.  Product Version(s): 2.20 2.30
  22308.  Operating System:   MS-DOS
  22309.  Flags: ENDUSER |
  22310.  Last Modified:  9-AUG-1989    ArticleIdent: Q38163
  22311.  
  22312.  Question:
  22313.  
  22314.  CodeView is failing on an .exe produced using the /DOSSEG linker
  22315.  switch. CodeView responded to an attempt to run with this .exe
  22316.  with a "not enough space" diagnostic. What is the problem?
  22317.  
  22318.  Response:
  22319.  
  22320.  The modules below demonstrate the problem. In this case, compiling the
  22321.  C source module and assembling the MASM source module with the
  22322.  appropriate CodeView switches, then linking with the /CO /DO switches
  22323.  generates a bad .exe. The problem is that CodeView displays source
  22324.  with extended ASCII characters.
  22325.  
  22326.  To work around this problem, put .DOSSEG in the MASM modules
  22327.  being linked, and omit the /DO switch rather that trying to
  22328.  force the linker to do the work. Also, switching the order of
  22329.  the linker switches may solve the problem.
  22330.  
  22331.  The following example demonstrates the problem:
  22332.  
  22333.  #include <stdio.h>
  22334.  main ()
  22335.    {
  22336.    long int getds(void), getdsq(void);
  22337.    printf("ds.DATA  = %lX\nds.DATA? = %lX\n",getds(),getdsq());
  22338.    }
  22339.  
  22340.  **************************************************************
  22341.  ;        DOSSEG could be put here
  22342.          .MODEL  small
  22343.          .DATA
  22344.  array   dd      0
  22345.          .DATA?
  22346.  arrayq  dd      ?
  22347.          .CODE
  22348.          PUBLIC  _getds,_getdsq
  22349.  _getds  PROC
  22350.          mov     ax,SEG array
  22351.          mov     dx,ds
  22352.          ret
  22353.  _getds  ENDP
  22354.  _getdsq PROC
  22355.          mov     ax,SEG arrayq
  22356.          mov     dx,ds
  22357.          ret
  22358.  _getdsq ENDP
  22359.          END
  22360.  
  22361.  
  22362.  33. 3270 ERMA Emulator
  22363.  
  22364.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30
  22365.  Operating System:   MS-DOS
  22366.  Flags: ENDUSER |
  22367.  Last Modified:  9-AUG-1989    ArticleIdent: Q24200
  22368.  
  22369.  Question:
  22370.     Does CodeView support the 3270 ERMA emulator?
  22371.  
  22372.  Response:
  22373.     CodeView does not directly support any other program. In this case,
  22374.  the 3270 ERMA emulator would have to accommodate CodeView. CodeView
  22375.  performs some hardware specific routines (e.g. checking to see if an
  22376.  EGA is present) and makes some assumptions on the state of the
  22377.  machine. If another program changes the state of the machine, it may
  22378.  not work with CodeView. It has been reported that CodeView will hang
  22379.  if the 3270 ERMA emulator is enabled; we recommend you disable the
  22380.  emulator before running CodeView.
  22381.  
  22382.  
  22383.  34. Flipping and Swapping Screens
  22384.  
  22385.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30
  22386.  Operating System:   MS-DOS
  22387.  Flags: ENDUSER |
  22388.  Last Modified:  9-AUG-1989    ArticleIdent: Q24201
  22389.  
  22390.  Question:
  22391.     What is the difference between flipping and swapping in CodeView?
  22392.  
  22393.  Response:
  22394.     Both are ways of maintaining two alternate screens for display on
  22395.  one monitor. The difference is in the way the task is accomplished.
  22396.     When swapping is selected, CodeView allocates a 16K buffer (a 4K
  22397.  buffer for a monochrome adapter) to hold the alternate screen. When
  22398.  the other screen is required, CodeView swaps the screen into the
  22399.  display buffer and places the other screen into the storage buffer.
  22400.  Swapping takes memory and time, but it does not have the limitations
  22401.  of flipping.
  22402.     Flipping uses the video-display pages of the graphics adapter to
  22403.  store each screen of text. When the alternate screen is required, the
  22404.  other page is selected. Flipping is much faster than swapping and does
  22405.  not require the 16K buffer. However, it cannot be used with a
  22406.  monochrome adapter, or with programs that display graphics or use the
  22407.  video pages.
  22408.  
  22409.  
  22410.  35. CODEVIEW.DOC Incorrectly States /E Uses Extended Memory
  22411.  
  22412.  Product Version(s): 2.20
  22413.  Operating System:   MS-DOS
  22414.  Flags: ENDUSER | docerr
  22415.  Last Modified: 10-NOV-1988    ArticleIdent: Q27763
  22416.  
  22417.  The CODEVIEW.DOC file included in Microsoft C Version 5.10 states that
  22418.  the /E switch enables use of extended memory for CodeView's symbol
  22419.  table.
  22420.  
  22421.  This is a documentation error in the CODEVIEW.DOC file. CodeView uses
  22422.  expanded, not extended memory.
  22423.  
  22424.  
  22425.  36. WINDOWCOMPAT Directs CodeView to Create a Window
  22426.  
  22427.  Product Version(s): 2.20 2.30
  22428.  Operating System:   OS/2
  22429.  Flags: ENDUSER | S_C
  22430.  Last Modified: 10-NOV-1989    ArticleIdent: Q49423
  22431.  
  22432.  The WINDOWCOMPAT directive in a linker definition file can cause
  22433.  strange behavior in non-Presentation Manager (PM) programs being
  22434.  debugged under CodeView. WINDOWCOMPAT is one of three application
  22435.  types that can be specified after the NAME directive. WINDOWCOMPAT is
  22436.  used for OS/2 programs that use VIO, MOU, and KBD calls and can be
  22437.  used inside a PM window or as a separate screen group.
  22438.  
  22439.  Debugging a non-PM application that was linked with the WINDOWCOMPAT
  22440.  option instructs CodeView to create a PM window to run the program. In
  22441.  some cases this feature could be desirable, but for most debugging, a
  22442.  PM window is only cumbersome. The way to work around this feature is
  22443.  to relink without the WINDOWCOMPAT directive.
  22444.  
  22445.  
  22446.  37. The CodeView Port Input Command Example Is Unclear
  22447.  
  22448.  Product Version(s): 2.20 2.30 | 2.20 2.30
  22449.  Operating System:   MS-DOS    | OS/2
  22450.  Flags: ENDUSER | H_MASM H_FORTRAN S_Pascal
  22451.  Last Modified: 27-OCT-1989    ArticleIdent: Q49537
  22452.  
  22453.  The CodeView example for port input command is unclear in the
  22454.  following manuals:
  22455.  
  22456.  1. Page 150 of Microsoft C 5.10 "CodeView And Utilities, Microsoft
  22457.     Editor, Mixed Language Programming Guide"
  22458.  
  22459.  2. Page 150 of Microsoft Macro Assembler 5.10 CodeView and Utilities
  22460.  
  22461.  3. Page 150 of Microsoft Pascal 4.00 CodeView and Utilities
  22462.  
  22463.  4. Page 127 of Microsoft FORTRAN 5.10 CodeView and Utilities
  22464.  
  22465.  The example assumes the radix is in hexadecimal. To set the radix to
  22466.  hexadecimal, type in the following command:
  22467.  
  22468.     >n16
  22469.  
  22470.  After setting the radix to hexadecimal, the example works properly.
  22471.  
  22472.  If the radix is not in hexadecimal, a "0x" must be present for
  22473.  CodeView to recognize the value as a hex format. The following example
  22474.  shows how to use the port input command if CodeView is not in
  22475.  hexadecimal radix:
  22476.  
  22477.     >I 0x2f8
  22478.  
  22479.  
  22480.  38. The Difference Among Watch, Watchpoint, and Tracepoint
  22481.  
  22482.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
  22483.  Operating System:   MS-DOS                        | OS/2
  22484.  Flags: ENDUSER |
  22485.  Last Modified: 14-AUG-1989    ArticleIdent: Q24225
  22486.  
  22487.  Question:
  22488.  
  22489.  What is the difference between a watch, a watchpoint, and a
  22490.  tracepoint?
  22491.  
  22492.  Response:
  22493.  
  22494.  A "watch" command will monitor an expression or a range of memory
  22495.  addresses, and update the watch window each time the expression or any
  22496.  location in the range changes. Using a watch never will cause program
  22497.  execution to stop; it simply "watches" unconditionally.
  22498.  
  22499.  A "watchpoint" monitors an expression (and an expression only) during
  22500.  program execution. It will update its value in the watch window
  22501.  whenever it changes. However, when the watchpoint expression becomes
  22502.  true (nonzero), program execution is stopped.
  22503.  
  22504.  A "tracepoint" monitors an expression or a range of memory addresses
  22505.  and displays the expression or the range being monitored in the watch
  22506.  window. It will stop program execution when the expression or any
  22507.  location in the range changes. Please note that writing over the old
  22508.  value at a memory location with the same value is not considered a
  22509.  change.
  22510.  
  22511.  The following example summarizes this information:
  22512.  
  22513.  Command     Object To Watch          Conditionally    Condition To
  22514.                                       Stops            Stop On
  22515.  -------     ---------------          -------------    ------------
  22516.  
  22517.  WATCH       expression or            No               (none)
  22518.              range of memory
  22519.  
  22520.  WATCHPOINT  expression               Yes             expression becomes
  22521.                                                       true (nonzero)
  22522.  
  22523.  TRACEPOINT  expression or            Yes             expression or
  22524.              range of memory                          in range changes
  22525.                                                       location
  22526.  
  22527.  Note: the "monitoring" described above is done in only window mode. If
  22528.  sequential mode is being used, you must use the Watch List command to
  22529.  see the values of any of the three types of watch statements.
  22530.  
  22531.  
  22532.  39. Tracking Down a Null Pointer Assignment Error
  22533.  
  22534.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
  22535.  Operating System:   MS-DOS                        | OS/2
  22536.  Flags: ENDUSER | S_C
  22537.  Last Modified: 21-AUG-1989    ArticleIdent: Q24270
  22538.  
  22539.  Question:
  22540.  
  22541.  I consistently get the error number R6001 "null pointer assignment"
  22542.  when I run my program. How can I use CodeView to determine the point
  22543.  at which the null pointer assignment is occurring?
  22544.  
  22545.  Response:
  22546.  
  22547.  Use a tracepoint, which can be set to watch a range of memory up to
  22548.  128 bytes. It will halt the execution of the program when any value in
  22549.  this range is changed. If you set a tracepoint over the entire range
  22550.  of the null segment, the program will halt immediately after the
  22551.  instruction that wrote over the null segment.
  22552.  
  22553.  The location of the null segment is available in the link maps of
  22554.  Microsoft compilers. It starts at DS:0 and is 42H bytes long. The
  22555.  Microsoft copyright notice is written there at program startup and
  22556.  if this area is written to during the course of the program, the
  22557.  error r6001 is generated. The most common cause of this error is
  22558.  using a pointer that has not been initialized to point to a memory
  22559.  area. Pointers that have not had space allocated for them (using
  22560.  malloc for example) or that have not been assigned to a specific
  22561.  data element (arrays or structures for example) are considered
  22562.  uninitialized.
  22563.  
  22564.  An example of using CodeView to determine where an unitialized pointer
  22565.  is being used follows:
  22566.  
  22567.  g main                  /* go to the beginning of main() */
  22568.  n16                     /* switch to hexadecimal (base 16) */
  22569.  tpb DS:0 DS:42          /* set a Trace Point of type Byte starting
  22570.                                at address DS:0 and extending to DS:42 */
  22571.  
  22572.  When any value in the specified range changes, CodeView will stop the
  22573.  execution of your program. The previously executed line was probably
  22574.  the line that caused the R6001 error.
  22575.  
  22576.  
  22577.  40. How to Successfully Debug VioPopUp() Code with CodeView
  22578.  
  22579.  Product Version(s): 2.20 2.30 2.35
  22580.  Operating System:   OS/2
  22581.  Flags: ENDUSER |
  22582.  Last Modified: 27-FEB-1990    ArticleIdent: Q58647
  22583.  
  22584.  Debugging programs that take advantage of OS/2's VioPopUp() call can
  22585.  present a potentially dangerous situation. Due to the nature of the
  22586.  VioPopUp() call, any attempts to trace into the VioPopUp call will cause
  22587.  your machine to hang. The workaround for this difficulty is to set a
  22588.  breakpoint outside of the VioPopUp() call [after the VioEndPopUp()], and
  22589.  then press F5 to instruct CodeView to execute to the next breakpoint.
  22590.  
  22591.  The VioPopUp() call brings forward a temporary pop-up text screen group
  22592.  that can be used to display text information without altering the
  22593.  context of the foreground screen. When a VioPopUp() call is executed, the
  22594.  current foreground screen group loses the keyboard focus to the pop-up
  22595.  screen. Therefore, when you trace into a VioPopUp() call, the pop-up
  22596.  text comes forward and CodeView, running in the foreground, loses the
  22597.  keyboard focus and cannot execute a trace instruction. At this time,
  22598.  CTRL+ESC or ALT+ESC will not change the deadlock situation and the
  22599.  only alternative is to reboot.
  22600.  
  22601.  To work around this problem, it is essential that you do NOT step into
  22602.  a VioPopUp call. Instead, press F5 to execute to the next breakpoint.
  22603.  Setting the breakpoint AFTER the VioEndPopUp() call is critical.
  22604.  
  22605.  
  22606.  41. Capabilities of Real Mode CodeView and the 386
  22607.  
  22608.  Product Version(s): 2.00
  22609.  Operating System:   MS-DOS
  22610.  Flags: ENDUSER | s_c, h_masm, h_fortran, s_pascal
  22611.  Last Modified:  1-DEC-1988    ArticleIdent: Q38205
  22612.  
  22613.  The information below discusses the CodeView debugger and its use
  22614.  of 80386 hardware capabilities.
  22615.  
  22616.  The DOS CodeView does not keep track of any of this information because
  22617.  DOS does not use any of these features. Essentially, a 386 running DOS
  22618.  is just a very fast PC and CodeView treats it as such.
  22619.  
  22620.  The OS/2 CodeView does not have the privilege to track many of the
  22621.  OS/2 functionality.
  22622.  
  22623.  The following is a list of CodeView behaviors:
  22624.  
  22625.  1. CodeView does not keep track of task states.
  22626.  
  22627.  2. CodeView does not handle privilege levels.
  22628.  
  22629.  3. CodeView Version 2.20 makes limited use of the 386 debug
  22630.     registers. Previous versions do not use these registers.
  22631.  
  22632.  4. CodeView does not keep track of interrupt gates and trap gates.
  22633.  
  22634.  5. CodeView cannot operate in both real and Virtual 86 mode.
  22635.  
  22636.  6. CodeView cannot trace to protected mode and back to real mode.
  22637.  
  22638.  7. CodeView does not handle traces in protected mode.
  22639.  
  22640.  
  22641.  42. Flip/Swap Setting Crucial to Debugging PM Apps with Children
  22642.  
  22643.  Product Version(s): 2.30
  22644.  Operating System:   OS/2
  22645.  Flags: ENDUSER |
  22646.  Last Modified: 10-NOV-1989    ArticleIdent: Q50514
  22647.  
  22648.  Using protected mode CodeView (CVP) to debug Presentation Manager (PM)
  22649.  programs that spawn one or more child processes can be rather
  22650.  difficult. CVP works correctly for debugging just the parent PM
  22651.  process, but once you begin CodeView with the /O option to specify
  22652.  that you also want to debug child processes, you may find that you
  22653.  hang the computer quite regularly during your debugging session.
  22654.  
  22655.  CodeView itself does not have a problem with PM programs even if they
  22656.  do invoke child processes. It is only when you use the /O switch to
  22657.  debug the children at the same time that you run into difficulty. This
  22658.  is because of problems with CodeView conflicting with the OS/2 kernel
  22659.  as you bring a process to the foreground for debugging, while a
  22660.  system-dependent process like the PM parent is relegated to the
  22661.  background where it can become blocked.
  22662.  
  22663.  For example, if the parent gets to a point where it is waiting on a
  22664.  message, but it is not in the foreground, there is no way to get the
  22665.  focus back to this waiting process and you are essentially hung. The
  22666.  parent cannot process the message because it must be in the foreground
  22667.  to do so, and CodeView cannot continue until the message is processed,
  22668.  so it just waits.
  22669.  
  22670.  The key to debugging the parent and child processes of a PM program at
  22671.  the same time is the setting of Flip/Swap on the Options menu. Under
  22672.  CodeView, Flip/Swap ON forces messaging, Flip/Swap OFF does not.
  22673.  Therefore, you must turn Flip/Swap on and off as you go, depending on
  22674.  which particular part of the program you are currently debugging. The
  22675.  Flip/Swap setting is crucial in determining whether you hang the
  22676.  system or not.
  22677.  
  22678.  The ability to debug child processes from the parent's CodeView
  22679.  session became an available option beginning with CVP Version 2.30. By
  22680.  specifying the /O switch on the command line, CVP allows you to trace
  22681.  into child processes. (See the CVP 2.30 Note below if you are using
  22682.  that particular version of CodeView.)
  22683.  
  22684.  As far as actually debugging child processes in PM programs, you must
  22685.  proceed in an exacting manner. Unfortunately, the specifics are
  22686.  different for every program, so an all-encompassing set of debugging
  22687.  procedures cannot be devised. Nevertheless, the following general
  22688.  guidelines can be used for debugging most PM applications with their
  22689.  accompanying child processes:
  22690.  
  22691.   1. It is only with the /O option that any of this becomes critical.
  22692.  
  22693.   2. You need to debug in a full screen and not a PM window.
  22694.  
  22695.   3. Remember, Flip/Swap ON forces messaging, Flip/Swap OFF does not.
  22696.      Therefore, while you begin debugging in the parent program, you
  22697.      should have Flip/Swap ON, since you need messaging whenever you
  22698.      are doing any of the window initialization routines.
  22699.  
  22700.   4. Set a breakpoint in the parent somewhere after the window
  22701.      initialization code, but before the call to start the child
  22702.      process. It varies, but it usually works to put the breakpoint at
  22703.      the "while get message - dispatch message" loop or in the
  22704.      ClientWndProc procedure at the main switch statement.
  22705.  
  22706.   5. You must make sure that the breakpoint is placed in a position
  22707.      where you will stop at it before the prompt appears to ask you if
  22708.      you want to debug the child, but after ALL the window
  22709.      initialization has been completed. You will also probably need to
  22710.      set another breakpoint at the point where the parent program is
  22711.      going to begin executing again after you have finished working
  22712.      with the child.
  22713.  
  22714.   6. Do a GO, and when the breakpoint is reached, turn Flip/Swap OFF.
  22715.      Make sure that the prompt to debug the child is not already
  22716.      visible or you will lock up.
  22717.  
  22718.   7. Do a GO (or some traces) and you should get the prompt to debug
  22719.      the child. Answer "Y" and you should be able to debug the child
  22720.      process at this point.
  22721.  
  22722.   8. Use the Process command (the "|") to gain access to the child.
  22723.      Never use CTRL+ESC or ALT+ESC to switch to the other processes
  22724.      because these will almost assuredly cause you to hang.
  22725.  
  22726.   9. Go ahead and set breakpoints, watches, etc. in the child and do
  22727.      your debugging.
  22728.  
  22729.  10. After the child process is completed, use the Quit command to exit
  22730.      the child process's CodeView screen or use the Process command to
  22731.      reselect the parent process.
  22732.  
  22733.  11. Once you have returned to the parent process, and before you do a
  22734.      Restart (or load), or before you do ANY other window
  22735.      initialization, you MUST turn Flip/Swap ON again.
  22736.  
  22737.  12. Remember to always be aware of where you are in the program and
  22738.      what the current state of Flip/Swap is, since turning Flip/Swap on
  22739.      or off at the wrong time will almost always cause you to hang.
  22740.  
  22741.  Again, this is only the general outline of steps to follow and each
  22742.  application requires different specific steps. Don't be too surprised
  22743.  if you still run into occasional lock-ups.
  22744.  
  22745.  CVP 2.30 Note: When using the /O switch with CVP Version 2.30, there
  22746.  is a bug that may also cause you to hang. The problem involves using
  22747.  /O on the command line and then saying "No" when asked if you want to
  22748.  debug the child. So, with this version of CodeView, you should always
  22749.  answer "Yes" when asked if you wish to debug the child.
  22750.  
  22751.  For more information on this problem, use the following query:
  22752.  
  22753.     CodeView 2.30 hangs debugging child processes
  22754.  
  22755.  
  22756.  43. Can't Debug .COM Files in Source Mode
  22757.  
  22758.  Product Version(s): 2.00 2.10 2.20 2.30
  22759.  Operating System:   MS-DOS
  22760.  Flags: ENDUSER |
  22761.  Last Modified:  9-AUG-1989    ArticleIdent: Q38288
  22762.  
  22763.  The .COM format files created with the Microsoft Macro Assembler
  22764.  cannot contain symbolic and source-line information for the CodeView
  22765.  debugger. You can only debug these files in assembly mode.
  22766.  
  22767.  
  22768.  44. CODEVIEW.DOC File Error: Mouse Works with the /2 Option
  22769.  
  22770.  Product Version(s): 2.20
  22771.  Operating System:   MS-DOS
  22772.  Flags: ENDUSER |
  22773.  Last Modified:  8-NOV-1988    ArticleIdent: Q27764
  22774.  
  22775.  Question:
  22776.     The CODEVIEW.DOC file included with Microsoft C Version 5.10 states
  22777.  that using the /2 switch disables mouse support on the debugging
  22778.  display. Is this true?
  22779.  
  22780.  Response:
  22781.     This is an error in the CODEVIEW.DOC file.
  22782.     CodeView does support the mouse when using the /2 switch. In fact,
  22783.  if you are debugging a program which itself uses the mouse, using the
  22784.  /2 switch will allow you to use the mouse on CodeView's debugging
  22785.  screen as well as your application's output screen.
  22786.  
  22787.  
  22788.  45. "?CANNOT DISPLAY" After Column 135 in Command Window
  22789.  
  22790.  Product Version(s): 3.00 3.11 | 3.00 3.11 3.50
  22791.  Operating System:   MS-DOS    | OS/2
  22792.  Flags: ENDUSER |
  22793.  Last Modified:  6-FEB-1991    ArticleIdent: Q68696
  22794.  
  22795.  The code below demonstrates a limitation of the CodeView debugger.
  22796.  When the command "?y" is executed in the COMMAND window, the structure
  22797.  "y" is displayed. However, CodeView displays the structure only to
  22798.  column 135 and then prints "?CANNOT DISPLAY," ignoring the rest of the
  22799.  elements in the structure. The output appears as follows:
  22800.  
  22801.     --------------------------command----------------------------
  22802.    |>?y                                                          |
  22803.    |{this_field_01=0x0000, ... ,this_field_07=?CANNOT DISPLAY    |
  22804.    |                        ^                 ^                  |
  22805.    |                        |                 |                  |
  22806.    |                  Fields 2-6 displayed    Column 135         |
  22807.    |                                                             |
  22808.     -------------------------------------------------------------
  22809.  
  22810.                        CodeView Command Window
  22811.  
  22812.  To view all elements of a structure, you should use the QUICK WATCH
  22813.  function. In the example below, the contents of the whole structure
  22814.  can be seen by typing "??y". A dialog box will appear on the screen
  22815.  showing the contents of the structure. By scrolling down in the dialog
  22816.  box, the contents of every element of the structure can be seen. The
  22817.  structure contents are displayed as follows:
  22818.  
  22819.            --------------- Quick Watch -----------------
  22820.           |                                             |
  22821.           |-y                                           |
  22822.           |   this_field_01=0                           |
  22823.           |   this_field_02=0                           |
  22824.           |   this_field_03=0                           |
  22825.           |   this_field_04=0                           |
  22826.           |   this_field_05=0                           |
  22827.           |   this_field_06=0                           |
  22828.           |   this_field_07=0                           |
  22829.           |   this_field_08=0                           |
  22830.           |   this_field_09=0                           |
  22831.           |   this_field_10=0                           |
  22832.           |   this_field_11=0                           |
  22833.           |   this_field_12=0                           |
  22834.           |   this_field_13=0                           |
  22835.           |   this_field_14=0                           |
  22836.           |   this_field_15=0                           |
  22837.            ---------------------------------------------
  22838.  
  22839.                        Quick Watch of Variable
  22840.  
  22841.  Sample Code
  22842.  -----------
  22843.  
  22844.  struct x {
  22845.     int this_field_01;
  22846.     int this_field_02;
  22847.     int this_field_03;
  22848.     int this_field_04;
  22849.     int this_field_05;
  22850.     int this_field_06;
  22851.     int this_field_07;
  22852.     int this_field_08;
  22853.     int this_field_09;
  22854.     int this_field_10;
  22855.     int this_field_11;
  22856.     int this_field_12;
  22857.     int this_field_14;
  22858.     int this_field_15;
  22859.     int this_field_16;
  22860.     int this_field_17;
  22861.     int this_field_18;
  22862.     int this_field_19;
  22863.     int this_field_20;
  22864.  };
  22865.  
  22866.  main()
  22867.  {
  22868.      struct x y;
  22869.  }
  22870.  
  22871.  
  22872.  46. Debugging PM Apps with Two Monitors Does Not Require /2 Switch
  22873.  
  22874.  Product Version(s): 2.20 2.30
  22875.  Operating System:   OS/2
  22876.  Flags: ENDUSER |
  22877.  Last Modified: 17-JUL-1990    ArticleIdent: Q49824
  22878.  
  22879.  Problem:
  22880.  
  22881.  I am using CodeView to debug my Presentation Manager (PM) program and
  22882.  I am using the /2 switch to redirect the CodeView screen to a
  22883.  monochrome monitor. When I press F5 to start my program, a protection
  22884.  violation occurs, but it works correctly when I run it from the OS/2
  22885.  command line.
  22886.  
  22887.  Response:
  22888.  
  22889.  The /2 switch for CodeView is not supported for Presentation Manager
  22890.  application debugging. However, you may redirect the CodeView screen to
  22891.  a monochrome monitor if you do the following:
  22892.  
  22893.  1. Start a full-screen command prompt.
  22894.  
  22895.  2. At the prompt, type the following command (this puts the prompt on
  22896.     the monochrome monitor):
  22897.  
  22898.        mode mono
  22899.  
  22900.     Note: You must be in a 25-line screen mode before you attempt the
  22901.     mode mono. If you are in a 43- or 50-line mode, the display is
  22902.     corrupted.
  22903.  
  22904.  3. At the prompt, type the following command, where "appname" is your
  22905.     application's name:
  22906.  
  22907.        cvp appname
  22908.  
  22909.  4. After you are finished debugging, you can return the prompt to your
  22910.     primary display by typing the following command:
  22911.  
  22912.        mode co80
  22913.  
  22914.  
  22915.  47. How CodeView Interprets Values (octal, decimal, hexadecimal)
  22916.  
  22917.  Product Version(s): 1.x 2.00 2.10 2.20 | 2.20
  22918.  Operating System:   MS-DOS             | OS/2
  22919.  Flags: ENDUSER |
  22920.  Last Modified: 23-NOV-1988    ArticleIdent: Q38299
  22921.  
  22922.  Problem:
  22923.  
  22924.  When trying to watch a portion of memory, I have a problem with
  22925.  the following command at the dialog prompt:
  22926.  
  22927.     WW DS:0050 L 4.
  22928.  
  22929.  I thought this should have created a watch on the four words starting
  22930.  at offset 0x50. It actually set the watch starting at 0x28, CodeView
  22931.  interpreted the number as if it had been in base 8. Using the N
  22932.  command to change the radix doesn't make any difference.
  22933.  
  22934.  Response:
  22935.  
  22936.  In this case, the 0's before the offset cause CodeView to evaluate the
  22937.  expression in octal. CodeView provides three different prefixes for
  22938.  numbers to use an explicit base: 0 signifies octal, 0n signifies
  22939.  decimal, and 0x signifies hexadecimal. The current radix setting will
  22940.  have no bearing on numbers entered with these prefixes; however, it
  22941.  will affect those without prefixes.
  22942.  
  22943.  The lines below have different meanings when setting watches.
  22944.  The left column is the command, while the right column is an example
  22945.  of the display produced in the watch window. Radix is assumed to be 10.
  22946.  
  22947.  The following is an example:
  22948.  
  22949.  1. ww 50               50    :  0067:0032  6942
  22950.  
  22951.  2. ww 050              050   :  0067:0028  6328
  22952.  
  22953.  3. ww 0n50             0n50  :  0067:0032  6942
  22954.  
  22955.  4. ww 0x50             0x50  :  0067:0050  6163
  22956.  
  22957.  The first command sets the watch at the address specified using the
  22958.  current radix. This address will change when you use the N command to
  22959.  change the radix; the 50 on the left of the watch remains the same;
  22960.  however, the offset in the address will change to watch 50 in the new
  22961.  base. This address will always be displayed in hexadecimal, but 50
  22962.  will be evaluated differently.
  22963.  
  22964.  Examples 2 through 4 show watches being set in octal, decimal, and
  22965.  hexadecimal modes, respectively. These addresses will never change
  22966.  with a change of radix.
  22967.  
  22968.  Notice that watches 1 and 3 match. This is because by default CodeView
  22969.  is in base 10, so 50 and 0n50 evaluate to the same thing. Using N 8 will
  22970.  cause watches 1 and 2 to match, and N 16 will match 1 and 4.
  22971.  
  22972.  
  22973.  48. Interrupt Conflict with Greenleaf Libraries
  22974.  
  22975.  Product Version(s): 2.20    | 2.20
  22976.  Operating System:   MS-DOS  | OS/2
  22977.  Flags: ENDUSER | CV CVP
  22978.  Last Modified: 23-NOV-1988    ArticleIdent: Q38314
  22979.  
  22980.  The Greenleaf Comm Library, a collection of asynchronous
  22981.  communications functions for use with the C compiler, causes severe
  22982.  complications with CodeView (e.g. crashes, lockups) due to interrupt
  22983.  conflicts. Greenleaf Software is aware of this difficulty and will
  22984.  advise customers of the incompatibility.
  22985.  
  22986.  No workarounds are available. Greenleaf Software is located in
  22987.  Carrollton, TX, and can be reached at (214) 248-2561.
  22988.  
  22989.  
  22990.  49. CodeView Gives "Illegal Instruction" on Clone 386
  22991.  
  22992.  Product Version(s): 2.20
  22993.  Operating System:   MS-DOS
  22994.  Flags: ENDUSER | CV
  22995.  Last Modified: 23-NOV-1988    ArticleIdent: Q38317
  22996.  
  22997.  Some clones that are not entirely IBM-compatible under CodeView may
  22998.  give an "illegal instruction" message upon executing Go (F5), and then
  22999.  hang, requiring a warm boot. If the instruction being called illegal
  23000.  is FINIT or FNINIT, the particular ROM BIOS probably has a built-in
  23001.  387 emulator. Either turn off the emulator, or set the environment
  23002.  variable SET NO87=(some string).
  23003.  
  23004.  
  23005.  
  23006.  50. Thirty-Two-Bit Register Not Visible under OS/2
  23007.  
  23008.  Product Version(s): 2.20
  23009.  Operating System:   OS/2
  23010.  Flags: ENDUSER |
  23011.  Last Modified: 23-NOV-1988    ArticleIdent: Q38375
  23012.  
  23013.  Thirty-two-bit registers are not viewable (using F2) under CVP even if
  23014.  you have an 80386-based machine. This is not a problem with CodeView;
  23015.  it is a limitation.
  23016.  
  23017.  Real mode CodeView (CV) DOES support viewing 32-bit registers. This
  23018.  is because of the unprotected and generally more flexible nature of
  23019.  DOS. Using the full 32-bits of the 80386 under OS/2 is considered
  23020.  hazard-prone and is not supported by CVP.
  23021.  
  23022.  
  23023.  
  23024.  51. CodeView Instruction Pointer Miscounts Very Long Lines
  23025.  
  23026.  Product Version(s): 2.20
  23027.  Operating System:   MS-DOS
  23028.  Flags: ENDUSER | buglist2.20
  23029.  Last Modified:  1-DEC-1988    ArticleIdent: Q38382
  23030.  
  23031.  CodeView may display the "current instruction" highlight on the wrong
  23032.  line if the source file contains lines that are very long.
  23033.  
  23034.  The compiler counts the long lines as one line, but CodeView counts
  23035.  the very long lines as two lines. This makes the line number
  23036.  calculations incorrect and causes the "current line" highlight to
  23037.  appear on the wrong line. This problem does not occur if the source
  23038.  lines are less than 251 characters in length.
  23039.  
  23040.  Because the Microsoft Editor breaks lines that are longer than 250
  23041.  characters, this problem does not occur if you create and maintain
  23042.  your source files with the Microsoft Editor.
  23043.  
  23044.  Microsoft has confirmed this to be a problem in CodeView Version 2.20.
  23045.  We are researching this problem and will post new information as it
  23046.  becomes available.
  23047.  
  23048.  
  23049.  52. CodeView Requires PUBLIC to Trace MASM Program in Source Mode
  23050.  
  23051.  Product Version(s): 2.20
  23052.  Operating System:   MS-DOS
  23053.  Flags: ENDUSER | H_MASM
  23054.  Last Modified:  3-MAY-1989    ArticleIdent: Q44006
  23055.  
  23056.  A MASM program that runs perfectly from a DOS prompt refuses to trace
  23057.  in source mode inside of CodeView. The program single-steps in
  23058.  assembly mode, but an attempt to trace into the code in source mode
  23059.  results in the program terminating upon reaching the first data
  23060.  declaration.
  23061.  
  23062.  In addition, the program does not come up in source mode when CodeView
  23063.  is started, but can be changed into source mode with "View" "Source".
  23064.  
  23065.  This problem happens when the code and data segments are not declared
  23066.  as "PUBLIC". The code is valid and executes perfectly inside of
  23067.  CodeView or from a DOS prompt. However, CodeView cannot follow the
  23068.  logic at a source level.
  23069.  
  23070.  A program constructed in the following manner exhibits the symptoms
  23071.  described above:
  23072.  
  23073.  TITLE    myprog
  23074.  
  23075.  StackSeg Segment STACK
  23076.  .
  23077.  .
  23078.  .
  23079.  DataSeg  Segment DATA
  23080.  .
  23081.  .
  23082.  .
  23083.  CodeSeg  Segment CODE
  23084.  .
  23085.  .
  23086.  .
  23087.  END      myprog
  23088.  
  23089.  However, if the following minor changes are made to the program, and
  23090.  the segments are declared as "PUBLIC", CodeView can trace through the
  23091.  program in source mode:
  23092.  
  23093.  TITLE    myprog
  23094.  
  23095.  StackSeg Segment STACK
  23096.  .
  23097.  .
  23098.  .
  23099.  DataSeg  Segment WORD PUBLIC 'DATA'
  23100.  .
  23101.  .
  23102.  .
  23103.  CodeSeg  Segment WORD PUBLIC 'CODE'
  23104.  .
  23105.  .
  23106.  .
  23107.  END      myprog
  23108.  
  23109.  
  23110.  53. Cannot Use /2 Switch on IBM PS/2 in CodeView
  23111.  
  23112.  Product Version(s): 2.10 2.20  2.30 | 2.20 2.30
  23113.  Operating System:   MS-DOS | OS/2
  23114.  Flags: ENDUSER | SR# G881031-5515
  23115.  Last Modified:  9-AUG-1989    ArticleIdent: Q38865
  23116.  
  23117.  To use the /2 switch with CodeView, your computer must be equipped
  23118.  with a monochrome display (MDA) and a color display (CGA/EGA/VGA). The
  23119.  IBM PS/2 computers aren't currently configurable this way because they
  23120.  come with built-in VGAs or MDAs, but not both.
  23121.  
  23122.  If a hardware vendor starts selling MDAs that can be added to systems
  23123.  with built-in VGAs, this problem will be solved. An MDA card is
  23124.  needed that plugs into the PS/2 and works correctly in conjunction
  23125.  with the built-in VGA so that PS/2 owners can have a dual-monitor
  23126.  system.
  23127.  
  23128.  Currently, there is no solution to this debugging restriction other
  23129.  than using CodeView through the com port in sequential mode (/T) with
  23130.  a debugging terminal.
  23131.  
  23132.  
  23133.  54. CodeView Does Not Support Debugging Spawned Process
  23134.  
  23135.  Product Version(s): 2.20 2.30
  23136.  Operating System:   MS-DOS
  23137.  Flags: ENDUSER |
  23138.  Last Modified: 26-FEB-1990    ArticleIdent: Q58653
  23139.  
  23140.  The following are several reasons why CodeView doesn't provide
  23141.  debugging support for spawned processes under DOS:
  23142.  
  23143.  1. DOS is not a multitasking operating system. CodeView cannot start
  23144.     another thread/process to watch the execution of the spawned
  23145.     process.
  23146.  
  23147.  2. DOS does not provide debugging support for the DOS BIOS calls (int
  23148.     21h). Since all spawn() and exec() functions under DOS have to go
  23149.     through the BIOS to run, CodeView cannot follow the spawned
  23150.     program.
  23151.  
  23152.  3. DOS only recognizes 640K of memory; therefore, there is
  23153.     insufficient memory to debug a large program, since both the parent
  23154.     and child processes have to reside in memory at the same time.
  23155.  
  23156.  
  23157.  55. Display Settings for Compaq Gas Plasma Screen
  23158.  
  23159.  Product Version(s): 1.00 2.10 2.20 | 2.20
  23160.  Operating System:   MS-DOS         | OS/2
  23161.  Flags: ENDUSER |
  23162.  Last Modified:  6-DEC-1988    ArticleIdent: Q38866
  23163.  
  23164.  The default monitor settings for CodeView do not work properly with
  23165.  the Compaq gas plasma display adapter. Invoking CodeView with the /b
  23166.  switch corrects the problem.
  23167.  
  23168.  
  23169.  56. CodeView: Watchpoints and Tracepoints with Enumerated Types
  23170.  
  23171.  Product Version(s): 2.20   | 2.20
  23172.  Operating System:   MS-DOS | OS/2
  23173.  Flags: ENDUSER | s_c
  23174.  Last Modified: 28-MAR-1989    ArticleIdent: Q42601
  23175.  
  23176.  CodeView will not display the members of an enumerated type as they
  23177.  are declared in a C program. Only the integer representations of these
  23178.  types of variables can be shown. The following is an example:
  23179.  
  23180.  /*  Example enumerated type.
  23181.   */
  23182.  
  23183.  enum e_type
  23184.  {
  23185.      var1,
  23186.      var2,
  23187.      var3
  23188.  };
  23189.  
  23190.  enum e_type foo = var1;
  23191.  
  23192.  CodeView will not display "var1", "var2", or "var3" when watching a
  23193.  variable of type e_type, such as foo. CodeView will instead show the
  23194.  integer values of the variable: 0, 1, and 2, respectively. In order to
  23195.  watch the variable foo, you must explicitly display its value as an
  23196.  integer. The following command will add the proper watch:
  23197.  
  23198.      w? foo,d
  23199.  
  23200.  To set a watchpoint or a tracepoint on the same variable, further type
  23201.  casts must be made. These lines will produce watchpoints and
  23202.  tracepoints on foo, as follows:
  23203.  
  23204.      wp? *(int *)&foo == 1
  23205.      tp? *(int *)&foo
  23206.  
  23207.  Trying to set a watchpoint without the proper type cast will result in
  23208.  the following error:
  23209.  
  23210.      Operand types incorrect for this operation
  23211.  
  23212.  Setting a tracepoint on foo without this type cast will set the
  23213.  tracepoint but will only show "?CANNOT DISPLAY" in the watch window.
  23214.  Going through the right steps will display the current integer value
  23215.  of the variable, as it should.
  23216.  
  23217.  
  23218.  57. "?CANNOT DISPLAY" Error Not Documented in CodeView Documents
  23219.  
  23220.  Product Version(s): 2.00 2.10 2.20 2.30 | 2.20 2.30
  23221.  Operating System:   MS-DOS              | OS/2
  23222.  Flags: ENDUSER | TAR64267 docerr
  23223.  Last Modified: 21-AUG-1989    ArticleIdent: Q24877
  23224.  
  23225.  Problem:
  23226.  
  23227.  When trying to evaluate (?), a function that returns void, I get the
  23228.  error "?CANNOT DISPLAY". I cannot find this error message in the
  23229.  "Microsoft CodeView Utilities and Editor" manual.
  23230.  
  23231.  Response:
  23232.  
  23233.  This error message is not contained in the CodeView manual.
  23234.  
  23235.  The "?CANNOT DISPLAY" error message will be displayed in cases where
  23236.  the expression evaluator cannot return a value, such as a function
  23237.  returning void.
  23238.  
  23239.  
  23240.  58. Watch Bytes (wb) Command Can Be Used to Watch a Buffer in HEX
  23241.  
  23242.  Product Version(s): 2.20 2.30 | 2.20 2.30
  23243.  Operating System:   MS-DOS    | OS/2
  23244.  Flags: ENDUSER |
  23245.  Last Modified: 17-JUL-1990    ArticleIdent: Q50224
  23246.  
  23247.  Question:
  23248.  
  23249.  Is there a way to keep tabs on the contents of a buffer via a watch
  23250.  command? We want to observe the contents of a 20-character buffer in
  23251.  HEX. The buffer is not necessarily null terminated.
  23252.  
  23253.  Response:
  23254.  
  23255.  The way to watch a buffer in CodeView in hexadecimal with the Watch
  23256.  command is to use Watch Bytes (wb) as follows:
  23257.  
  23258.     >wb *buffer L 10  ; this will watch the first 10 bytes of
  23259.                         buffer in HEX
  23260.  
  23261.  For the given example, you should follow the previous command with the
  23262.  following:
  23263.  
  23264.     >wb *(buffer + 10) L 10  ; this will watch the next 10
  23265.                                bytes in HEX.
  23266.  
  23267.  Please note that both the length specifier as well as the number 10
  23268.  used to offset the pointer in the second command are taken in the
  23269.  current radix. The example above assumes a radix of 10. You can
  23270.  explicitly specify the base of the number in hex as follows:
  23271.  
  23272.     >wb *buffer L 0x0a
  23273.     >wb *(buffer + 0x0a) L 0x0a
  23274.  
  23275.  For more information on the wb command in CodeView, see the "Microsoft
  23276.  CodeView and Utilities, Microsoft Editor, Mixed-Language Programming
  23277.  Guide" manual.
  23278.  
  23279.  
  23280.  59. Specifying Both /T and /W Disables Mouse
  23281.  
  23282.  Product Version(s): 2.20    | 2.20
  23283.  Operating System:   MS-DOS  | OS/2
  23284.  Flags: ENDUSER |
  23285.  Last Modified:  6-DEC-1988    ArticleIdent: Q38867
  23286.  
  23287.  If you invoke CodeView with the following, the use of your mouse is
  23288.  disabled:
  23289.  
  23290.     CV /T /W program
  23291.  
  23292.  Don't specify the /T switch. Using /T with /W produces mutually
  23293.  exclusive modes of operation.
  23294.  
  23295.  
  23296.  60. Illegal Instruction in CodeView
  23297.  
  23298.  Product Version(s): 1.x 2.00 2.10 2.20 | 2.20
  23299.  Operating System:   MS-DOS             | OS/2
  23300.  Flags: ENDUSER | S_C h_fortran S_PASCAL
  23301.  Last Modified:  6-DEC-1988    ArticleIdent: Q38868
  23302.  
  23303.  Question:
  23304.  
  23305.  When I compile and link my C program and try to run it under CodeView,
  23306.  execution stops on the open curly brace of main. The view then goes to
  23307.  assembly, and the message "Illegal instruction" appears in the dialog
  23308.  window. Is there something wrong with the startup code?
  23309.  
  23310.  Response:
  23311.  
  23312.  This error can be produced when the main module of a program is
  23313.  compiled for one memory model and is then explicitly linked with a
  23314.  library for a different model. When the startup code is linked to the
  23315.  entry point of the program, different size instructions are used for
  23316.  the different memory models. If the program expects one size and the
  23317.  linker links in a different size, the startup instructions will be
  23318.  misinterpreted and result in this error.
  23319.  
  23320.  
  23321.  61. Entering Double Words at a Prompt Prevents Reloading Program
  23322.  
  23323.  Product Version(s): 2.20 2.30
  23324.  Operating System:   MS-DOS
  23325.  Flags: ENDUSER| | S_C S_PASCAL H_FORTRAN H_MASM buglist2.30
  23326.  Last Modified: 30-NOV-1989    ArticleIdent: Q50410
  23327.  
  23328.  When using the Enter Double word (ED) command within the CodeView
  23329.  symbolic debugger and allowing the debugger to prompt, you will
  23330.  prevent the debugger from reloading your executable (using the L
  23331.  command). This problem occurs only when you allow the debugger to
  23332.  prompt you for the double word and you enter a double word.
  23333.  
  23334.  This problem can manifest itself in several ways, depending on the
  23335.  version and on other unpredictable circumstances. Symptoms of the
  23336.  problem include the following:
  23337.  
  23338.  1. Giving the message "No such file/directory"
  23339.  
  23340.  2. Giving the message "Arg list too long"
  23341.  
  23342.  3. Generating an internal debugger error 7
  23343.  
  23344.  Valid workarounds consist of entering words (not double words) at the
  23345.  prompt, or entering double words on the command line (without being
  23346.  prompted).
  23347.  
  23348.  Microsoft has confirmed this to be a problem with CodeView Version
  23349.  2.30. We are researching this problem and will post new information
  23350.  here as it becomes available.
  23351.  
  23352.  
  23353.  62. CodeView 2.20 Does Not Allow Routine.Variable Specification
  23354.  
  23355.  Product Version(s): 2.20   | 2.20
  23356.  Operating System:   MS-DOS | OS/2
  23357.  Flags: ENDUSER | S_PASCAL S_C H_FORTRAN H_MASM DOCERR
  23358.  Last Modified: 10-NOV-1989    ArticleIdent: Q50698
  23359.  
  23360.  On Pages 91-92 of the "CodeView and Utilities" manual that accompanied
  23361.  C 5.10 and Pascal 4.00 for CodeView Version 2.20, the period is
  23362.  documented as being useful as a specifier of local variables in parent
  23363.  functions. The syntax is stated to be as follows:
  23364.  
  23365.     routine_name.variable_name
  23366.  
  23367.  However, this feature was not implemented in Version 2.20 of CodeView.
  23368.  It was implemented in CodeView Version 2.30 (which accompanied FORTRAN
  23369.  5.00).
  23370.  
  23371.  This feature is useful in all languages, but particularly helpful in
  23372.  Pascal because of the "nested-scoping" (the ability of a function to
  23373.  access variables from the routine that called it) that occurs in
  23374.  Pascal.
  23375.  
  23376.  To use this feature in CodeView 2.30, you must be in either the
  23377.  routine where the variable is defined or in a routine that is a child
  23378.  (or grandchild, etc.) of that routine. After entering the proper
  23379.  routine, any variable name can be referenced with a routine and
  23380.  variable name (see example below).
  23381.  
  23382.  program first (input, output) ;
  23383.  var a: integer ;            { Available throughout the program }
  23384.  
  23385.      procedure second ;
  23386.      var b: integer ;        { Available in second and third }
  23387.  
  23388.          procedure third ;
  23389.          var c: integer ;    { Available in third }
  23390.  
  23391.          begin
  23392.              a := 3 ;
  23393.              b := 3 ;
  23394.              c := 3 ;
  23395.          end ;
  23396.  
  23397.      begin
  23398.          a := 2 ;
  23399.          b := 2 ;
  23400.          third ;
  23401.      end ;
  23402.  
  23403.  begin
  23404.      a := 1 ;                { Cannot watch second/third variables }
  23405.      second ;
  23406.  end.
  23407.  
  23408.  When in procedure third, you can place a watch on the variables in
  23409.  procedure second in the following manner:
  23410.  
  23411.  w? second.b
  23412.  
  23413.  This will display the variable in procedure second. This variable
  23414.  cannot be displayed from the main program, however.
  23415.  
  23416.  
  23417.  63. Using a Debugging Terminal with CodeView
  23418.  
  23419.  Product Version(s): 2.20
  23420.  Operating System:   MS-DOS
  23421.  Flags: ENDUSER |
  23422.  Last Modified: 12-JAN-1989    ArticleIdent: Q39179
  23423.  
  23424.  It is possible to use either a dumb terminal or another machine (PC or
  23425.  Macintosh, running a communications package at 9600 baud) as a
  23426.  debugging terminal for CodeView. To take advantage of this option, do
  23427.  the following:
  23428.  
  23429.  1. Connect the second terminal to the com port (COM1 or COM2).
  23430.  
  23431.  2. Initialize the communications package to set up the
  23432.     second machine as a dumb terminal. Set the baud rate at
  23433.     9600.
  23434.  
  23435.  3. Start CodeView in either window or sequential mode.
  23436.  
  23437.  4. Redirect either the output ( >COM1 ) or both input and output
  23438.     ( =COM1 ) to the second terminal.
  23439.  
  23440.     If you redirect just the output to the second terminal, you will
  23441.     see the debugging output on the second terminal, and program output
  23442.     on the primary terminal. If you redirect input and output, you will
  23443.     also be able input program information (responses to prompts,
  23444.     input from the keyboard, etc.) on the primary terminal, and input
  23445.     CodeView information on the secondary terminal.
  23446.  
  23447.  5. Set your options and run the program.
  23448.  
  23449.  
  23450.  64. Pascal Version of CodeView Version 2.20
  23451.  
  23452.  Product Version(s): 2.20   | 2.20
  23453.  Operating System:   MS-DOS | OS/2
  23454.  Flags: ENDUSER | S_PasCal
  23455.  Last Modified: 14-AUG-1989    ArticleIdent: Q39181
  23456.  
  23457.  CodeView Version 2.20 is different for Pascal then the rest of the
  23458.  languages. The Pascal version of CodeView 2.20 is the only version
  23459.  that has the Pascal Expression Evaluator. The way you can determine
  23460.  whether you are running the Pascal version is that Pascal will appear
  23461.  under the Languages menu.
  23462.  
  23463.  If you have multiple Microsoft Languages, you do not have to keep
  23464.  multiple versions of CodeView on your system. CodeView Version 2.20 is
  23465.  compatible with all of our languages. However, there is one exception
  23466.  -- if you are using Microsoft Pascal, make sure you use the version
  23467.  that came with Pascal. It is the only version that has the Pascal
  23468.  Expression Evaluator and all of the other language evaluators.
  23469.  
  23470.  To check if the version you have is the Pascal version, invoke
  23471.  CodeView and pull down the Languages menu. If it lists Pascal in the
  23472.  menu, you are using the Pascal version that is compatible with all of
  23473.  the Microsoft languages.
  23474.  
  23475.  
  23476.  65. "." on the LIBPATH Eases DLL Debugging, But Not for CVP 2.20
  23477.  
  23478.  Product Version(s): 2.20 2.30
  23479.  Operating System:   OS/2
  23480.  Flags: ENDUSER |
  23481.  Last Modified: 10-NOV-1989    ArticleIdent: Q50711
  23482.  
  23483.  When debugging OS/2 DLLs with protected mode CodeView (CVP), you must
  23484.  specify each DLL on the command line with an /L switch, and the DLL
  23485.  must be in the current directory as well as in a directory on the
  23486.  LIBPATH as set in CONFIG.SYS.
  23487.  
  23488.  For ease of debugging, if you put a period ("."), which means the
  23489.  current directory, as one of the directories on your LIBPATH, then a
  23490.  DLL in the current directory will also be on the LIBPATH and you won't
  23491.  need to have two copies of a DLL present on disk for debugging.
  23492.  
  23493.  This method only works for versions of CVP beginning with 2.30. CVP
  23494.  Version 2.20 will not recognize DLLs in a "." LIBPATH directory.
  23495.  
  23496.  If a copy of the DLL called by the program being debugged is not in
  23497.  the current working directory, you will not be able to trace into the
  23498.  DLL. If a copy of the DLL is not in a LIBPATH directory, CodeView will
  23499.  not be able to find the DLL. In this case, instead of coming up in the
  23500.  usual "debugging mode," CodeView immediately exits and returns to the
  23501.  command prompt after several seconds.
  23502.  
  23503.  Many DLL debugging problems arise from the fact that the copy of a DLL
  23504.  that is on the LIBPATH may be inadvertently out of date compared to
  23505.  the version in the current directory that is being used for debugging.
  23506.  By putting a period on the LIBPATH, the current directory becomes a
  23507.  LIBPATH directory and only one copy of the DLL needs to exist, thus
  23508.  eliminating any DLL update inconsistencies.
  23509.  
  23510.  
  23511.  66. CodeView Trace Skips Statement Following Switch Statement
  23512.  
  23513.  Product Version(s): 2.20 2.30 | 2.20 2.30
  23514.  Operating System:   MS-DOS    | OS/2
  23515.  Flags: ENDUSER | buglist2.20 buglist2.30
  23516.  Last Modified:  7-MAR-1990    ArticleIdent: Q59315
  23517.  
  23518.  CodeView incorrectly maps assembly level instructions to source code
  23519.  in the first statement following a switch statement with seven or more
  23520.  cases.
  23521.  
  23522.  As shown in the code sample below, the statement following the switch
  23523.  is executed correctly, but CodeView steps over the statement while
  23524.  tracing in source mode. In mixed source and assembly mode, the
  23525.  statement following the switch may be traced into.
  23526.  
  23527.  Sample Code
  23528.  -----------
  23529.  
  23530.  # include<stdio.h>
  23531.  
  23532.  void main(void)
  23533.  {
  23534.  
  23535.     short tag, marker;
  23536.  
  23537.     marker = 0;
  23538.     tag = 5;
  23539.  
  23540.     switch(tag){
  23541.        case 1:
  23542.           break;
  23543.        case 2:
  23544.           break;
  23545.        case 3:
  23546.           break;
  23547.        case 4:
  23548.           break;
  23549.        case 5:
  23550.           break;
  23551.        case 6:
  23552.           break;
  23553.        case 7:
  23554.           break;
  23555.        default:
  23556.           break;
  23557.     }
  23558.  
  23559.        marker = 2;
  23560.  
  23561.  }
  23562.  
  23563.  
  23564.  67. Using CodeView to Create Disassembled Program Listings
  23565.  
  23566.  Product Version(s): 2.20 2.30 | 2.20 2.30
  23567.  Operating System:   MS-DOS    | OS/2
  23568.  Flags: ENDUSER |
  23569.  Last Modified: 12-APR-1990    ArticleIdent: Q51323
  23570.  
  23571.  The following steps can be used to create an assembly listing of a
  23572.  program with CodeView:
  23573.  
  23574.  1. Begin CodeView in sequential mode by using the /T command-line
  23575.     switch.
  23576.  
  23577.  2. Specify a listing file to redirect CodeView output to by typing the
  23578.     redirection operator ">" followed by a filename at the dialog
  23579.     prompt. You may redirect the output directly to a printer by
  23580.     specifying the printer after the ">" (e.g., >PRN).
  23581.  
  23582.     (Note: From this point on, commands will not be viewable.)
  23583.  
  23584.  3. Use the Unassemble command "U" to disassemble the code and send a
  23585.     listing of the program to the output file. If you do not specify
  23586.     the starting address and the range to unassemble, CodeView will
  23587.     unassemble the next eight lines of code. See the CodeView
  23588.     documentation for more information on the Unassemble command.
  23589.  
  23590.  You can use this method on any files, whether or not they contain
  23591.  CodeView information. In this regard, you can create assembly listings
  23592.  of programs that were not created with a Microsoft compiler. Please
  23593.  also note that you cannot create assembly listings of instructions
  23594.  other than 8086 instructions.
  23595.  
  23596.  
  23597.  68. Debugging DLLs with Codeview
  23598.  
  23599.  Product Version(s): 2.20 2.30
  23600.  Operating System:   OS/2
  23601.  Flags: ENDUSER |
  23602.  Last Modified: 18-DEC-1989    ArticleIdent: Q51764
  23603.  
  23604.  To debug most DLLs (Dynamic Link Libraries) in CodeView, CVP
  23605.  (protected mode CodeView) Version 2.20 or later is required. For DLLs
  23606.  loaded via DosLoadModule(), CVP Version 2.30 or later is required.
  23607.  
  23608.  Invoke CodeView with the /L switch as follows:
  23609.  
  23610.     cvp /L dll1name /L dll2name main.exe
  23611.  
  23612.  Make sure that each DLL you want to trace into is specified by the /L
  23613.  option.
  23614.  
  23615.  CodeView cannot debug DLLs that have either IOPL or EXECUTEONLY
  23616.  specified with the CODE directive in the associated definition (.DEF)
  23617.  file. For DLLs that require these controls, the Kernel Debugger
  23618.  supplied with the SDK is required.
  23619.  
  23620.  Note: With CVP 2.30, pathnames cannot be specified for DLLs;
  23621.  therefore, the DLL must reside in the current directory. For more
  23622.  information, query on the following:
  23623.  
  23624.      CODEVIEW DLL LIBPATH
  23625.  
  23626.  
  23627.  69. Debugging Bound Applications
  23628.  
  23629.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 | 1.11 2.02.02 2.20 2.30
  23630.  Operating System:   MS-DOS                   | OS/2
  23631.  Flags: ENDUSER | TAR63888
  23632.  Last Modified: 14-AUG-1989    ArticleIdent: Q25219
  23633.  
  23634.  CodeView does not support the debugging of bound applications in real
  23635.  mode. However, CVP in protected mode will allow you to debug such
  23636.  applications.
  23637.  
  23638.  
  23639.  70. No Symbolic Information Generated for Pascal Units
  23640.  
  23641.  Product Version(s): 2.20   | 2.20
  23642.  Operating System:   MS-DOS | OS/2
  23643.  Flags: ENDUSER | s_pascal
  23644.  Last Modified: 12-JAN-1989    ArticleIdent: Q39811
  23645.  
  23646.  The Microsoft Pascal Compiler Version 4.00 generates no symbolic
  23647.  debugging information for Pascal Units. As a result, when tracing
  23648.  through a Pascal program Unit, attempting to access any local
  23649.  variables by using trace/watchpoints, dumps, examines, etc. yields a
  23650.  "symbol unknown" error.
  23651.  
  23652.  The only workaround is to transform the program Units into Modules.
  23653.  
  23654.  
  23655.  71. "Internal Debugger Error: 0" When Watching Structure Members
  23656.  
  23657.  Product Version(s): 2.20 2.30 | 2.20 2.30
  23658.  Operating System:   MS-DOS    | OS/2
  23659.  Flags: ENDUSER | buglist2.30 cv
  23660.  Last Modified: 29-DEC-1989    ArticleIdent: Q51834
  23661.  
  23662.  When watching a member of a structure using the "w?" or "?" commands,
  23663.  it is possible to get the message "internal debugger error: 0". When
  23664.  this happens, the only way to view the contents of the member is to
  23665.  use the "D" or "??" commands.
  23666.  
  23667.  Code Example
  23668.  ------------
  23669.  
  23670.  typedef struct {
  23671.     char *(*instruction)[];
  23672.     } *structype;
  23673.  
  23674.  structype mac;
  23675.  
  23676.  void main (void)
  23677.  {
  23678.  }
  23679.  
  23680.  If you set a watch on an element of the structure variable in the
  23681.  above program such as "w? mac->instruction[0]" (without the quotation
  23682.  marks) you'll get the message "internal debugger error: 0." Use the
  23683.  dump command "D" or the special "??" structure viewing command to look
  23684.  at the contents of the member.
  23685.  
  23686.  Microsoft has confirmed this to be a problem in CodeView Version 2.30.
  23687.  We are researching this problem and will post new information here as
  23688.  it becomes available.
  23689.  
  23690.  
  23691.  72. Incorrect Error Generated for Very Small COM Files
  23692.  
  23693.  Product Version(s): 2.00 2.10 2.20 2.30
  23694.  Operating System:   MS-DOS
  23695.  Flags: ENDUSER | TAR65183 buglist2.00
  23696.  Last Modified: 21-AUG-1989    ArticleIdent: Q25365
  23697.  
  23698.  Problem:
  23699.  
  23700.  If my COM file is less than 8 bytes long and I try to load it into
  23701.  CodeView, I get the error message "Invalid executable file format -
  23702.  please relink."
  23703.  
  23704.  Response:
  23705.  
  23706.  This problem occurs only on COM files less than 8 bytes in length.
  23707.  
  23708.  Microsoft has confirmed this to be a problem with CodeView Version
  23709.  2.00. We are researching this problem and will post new information as
  23710.  it becomes available.
  23711.  
  23712.  
  23713.  73. Dual-Monitor Setup Requires 8-Bit Data Paths for Both Monitors
  23714.  
  23715.  Product Version(s): 1.00 2.00 2.10 2.20 2.30 | 2.20 2.30
  23716.  Operating System:   MS-DOS                   | OS/2
  23717.  Flags: ENDUSER | s_c s_pascal h_fortran h_masm b_basiccom
  23718.  Last Modified: 21-MAR-1990    ArticleIdent: Q51870
  23719.  
  23720.  When writing to a system that has a dual-monitor setup, you must make
  23721.  sure that both the monochrome monitor and the color monitor are using
  23722.  an 8-bit data path. In any dual-monitor write scheme, both display
  23723.  cards must be configured to write to a common data path (either both
  23724.  8-bit or both 16-bit mode). Today's monochrome adapters use 8-bit
  23725.  paths exclusively.
  23726.  
  23727.  Most display cards that use a 16-bit mode can autosense whether they
  23728.  are being written to in a dual-monitor mode, but some cards, such as
  23729.  the ATI VGA Wonder card, do not sense for this situation; therefore,
  23730.  you must set the card to an 8-bit path manually.
  23731.  
  23732.  If you are using dual monitors and you experience strange behavior
  23733.  such as garbage or blinking characters on the monochrome screen, make
  23734.  sure that your 16-bit video card is running in 8-bit mode.
  23735.  
  23736.  The most common use for a dual-monitor setup is for debugging graphics
  23737.  applications in CodeView.
  23738.  
  23739.  
  23740.  74. Retrieving Previously Entered Commands
  23741.  
  23742.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
  23743.  Operating System:   MS-DOS                        | OS/2
  23744.  Flags: ENDUSER | TAR65921
  23745.  Last Modified: 14-AUG-1989    ArticleIdent: Q25539
  23746.  
  23747.  Question:
  23748.  
  23749.  Is there a method to retrieve commands after typing them in once? For
  23750.  instance, if I type "d some_data_area l 40", I would like to retrieve
  23751.  the command without having to retype it. A suggested method would be
  23752.  to allow the user to scroll on the command, then press a key to make
  23753.  the command active.
  23754.  
  23755.  Response:
  23756.  
  23757.  The only way to retrieve commands is to highlight them with the mouse
  23758.  and press the INS key. This method inserts the command into the
  23759.  command line. We are considering making an easier way to scroll
  23760.  through the commands and may implement it in a future version.
  23761.  
  23762.  
  23763.  75. system() Call May Cause CodeView to Terminate Process
  23764.  
  23765.  Product Version(s): 2.20 2.30
  23766.  Operating System:   MS-DOS
  23767.  Flags: ENDUSER | buglist2.20 buglist2.30
  23768.  Last Modified: 22-JAN-1990    ArticleIdent: Q57867
  23769.  
  23770.  Using real-mode CodeView to trace over the system() run-time function
  23771.  will cause the debugger to terminate the parent process upon return
  23772.  from the child process in certain situations where the child does a
  23773.  multiple directory-level traversal.
  23774.  
  23775.  Instead of tracing, use the "Go" Command (F5) to run past the system()
  23776.  call. This procedure allows the program to run to completion.
  23777.  
  23778.  The program below demonstrates this problem, but it requires that
  23779.  TREE.COM be somewhere in the path. Compile the code with the /Zi and
  23780.  /Od options and use CodeView to trace into the program, using F8.
  23781.  After TREE.COM executes, CodeView will display the "Program terminated
  23782.  normally" message, preventing the last printf() from being executed.
  23783.  
  23784.  Microsoft has confirmed this to be a problem with CodeView Versions
  23785.  2.20 and 2.30. We are researching this problem and will post new
  23786.  information here as it becomes available.
  23787.  
  23788.  Code Example
  23789.  ------------
  23790.  
  23791.  #include <process.h>
  23792.  #include <stdio.h>
  23793.  
  23794.  void main (void)
  23795.  {
  23796.          printf ("This is the beginning of the program\n");
  23797.          printf ("Calling TREE.COM\n");
  23798.          system ("tree");
  23799.  
  23800.          /* This line will never be executed */
  23801.          printf ("Back from spawn\n");
  23802.  }
  23803.  
  23804.  
  23805.  76. CodeView Versions 2.10 to 2.30 Use Four Extra File Handles
  23806.  
  23807.  Product Version(s): 2.30 2.20 2.10 2.00
  23808.  Operating System:   MS-DOS
  23809.  Flags: ENDUSER |
  23810.  Last Modified: 19-JAN-1990    ArticleIdent: Q25950
  23811.  
  23812.  Problem:
  23813.  
  23814.  CodeView Versions 2.00 to 2.30 seem to be using four additional file
  23815.  handles. The following program attempts to open 20 files, reporting
  23816.  its success or failure after each attempt:
  23817.  
  23818.      #include <stdio.h>
  23819.      #include <string.h>
  23820.      #include <stdlib.h>
  23821.  
  23822.      main()
  23823.      {
  23824.              FILE *streams[20];
  23825.              int i;
  23826.              char buffer[12];
  23827.              char *p;
  23828.  
  23829.              for (i = 0; i < 20; i++) {
  23830.                      p = itoa(i, buffer, 10);
  23831.                      p = strcat(buffer, ".dat");
  23832.                      streams[i] = fopen(buffer, "w+");
  23833.                      printf("streams[%d] = %d\n", i, streams[i]);
  23834.              }
  23835.      }
  23836.  
  23837.  Running outside of CodeView, the call to fopen() fails after 15
  23838.  streams have been opened. Running in CodeView Versions 1.x, the call
  23839.  fails after 15 files have been opened. However, in CodeView Versions
  23840.  2.00 to 2.30, it fails after 11 file handles have been opened.
  23841.  
  23842.  Response:
  23843.  
  23844.  CodeView Versions 2.00 to 2.30 require four file handles for their own
  23845.  use. Remember that MS-DOS itself has five preopened file handles. If
  23846.  you want to open more than 15 files, follow the steps specified in the
  23847.  C Version 5.10 README.DOC to modify the C start-up code to allow
  23848.  opening more than 20 files.
  23849.  
  23850.  
  23851.  77. Copying Text from Display Window to Dialog Window
  23852.  
  23853.  Product Version(s): 2.20   | 2.20
  23854.  Operating System:   MS-DOS | OS/2
  23855.  Flags: ENDUSER |
  23856.  Last Modified: 12-JAN-1989    ArticleIdent: Q40110
  23857.  
  23858.  Question:
  23859.  
  23860.  Is it possible to copy text from the display window down to the dialog
  23861.  window to use at the command line in Microsoft CodeView?
  23862.  
  23863.  Response:
  23864.  
  23865.  Yes, if you have a mouse. You can highlight with the mouse the section
  23866.  of text you would like to copy and press the INSERT key. The
  23867.  highlighted text will appear in the dialog box.
  23868.  
  23869.  This is very useful if you have very long variable names that you want
  23870.  to watch and don't want to retype the long variable name each time.
  23871.  Simply type a w? on the command line, then highlight the variable name
  23872.  with the mouse and press the INSERT key.
  23873.  
  23874.  Strange behavior can occur if you use the SHIFT key in combination
  23875.  with the INSERT key. For example, if you use the INSERT key on the
  23876.  extended keyboard along with the SHIFT key, it works the same as using
  23877.  INSERT alone. However, if you turn NUM LOCK off on the keypad so you
  23878.  can you the INSERT key with the SHIFT key, you will get a zero instead
  23879.  of the string of text. To get the string of text, you have to turn NUM
  23880.  LOCK on. This seems backwards because with NUM LOCK on you would
  23881.  expect to get a zero, but you get the text.
  23882.  
  23883.  The workaround is not to use the SHIFT key in conjunction with the
  23884.  INSERT key. INSERT alone works correctly.
  23885.  
  23886.  
  23887.  78. OS2PATCH for CVP Not Needed in OS/2 Version 1.10.
  23888.  
  23889.  Product Version(s): 2.20 2.30
  23890.  Operating System:   OS/2
  23891.  Flags: ENDUSER |
  23892.  Last Modified: 14-NOV-1988    ArticleIdent: Q30976
  23893.  
  23894.     The OS2PATCH supplied with CodeView (protected) Versions 2.20 and
  23895.  2.30 allows you to use command 7 on machines with math coprocessors.
  23896.  This patch works only with OS/2 Version 1.00. The PTRACE feature was
  23897.  updated in Version 1.10, so this patch is not needed in OS/2 Version
  23898.  1.10.
  23899.     This patch only works on IBMs version of OS/2 1.00.  If they have
  23900.  a different version have them talk to the people who they received
  23901.  OS/2 from.  If it was from us then they need to systems languages
  23902.  support.
  23903.     Please refer to the file OS2PATCH.DOC for more information.
  23904.  
  23905.  
  23906.  
  23907.  79. I/O Redirection Under CV Not Supported Prior to Version 2.30
  23908.  
  23909.  Product Version(s): 1.x 2.10 2.20 2.30 | 2.20 2.30
  23910.  Operating System:   MS-DOS             | OS/2
  23911.  Flags: ENDUSER |
  23912.  Last Modified: 23-JAN-1990    ArticleIdent: Q57870
  23913.  In versions of CodeView earlier than Version 2.30, it was not possible
  23914.  to redirect the input or output of the program being debugged. For
  23915.  example, a "filter" program that takes input from a file specified by
  23916.  the input redirection operator ("<") is hindered by this limitation
  23917.  under pre-2.30 CodeView because there is no way to specify that you
  23918.  want the redirection to apply to the application rather than to
  23919.  CodeView itself.
  23920.  
  23921.  In CodeView (CV) or protected-mode CodeView (CVP) Version 2.30,
  23922.  redirection on the command line following the program name is directed
  23923.  to the program being debugged. For example, invoking CodeView 2.30
  23924.  with the following command line
  23925.  
  23926.     CV test < test.dat
  23927.  
  23928.  causes all input to the program TEST.EXE to be read from the file
  23929.  TEST.DAT.
  23930.  
  23931.  Redirecting I/O to CodeView itself is useful for involved debugging
  23932.  sessions where many CodeView dialog commands can be put into a
  23933.  separate text file that is automatically read by CodeView during
  23934.  debugging. For instance, this method will allow a complicated
  23935.  debugging scenario to be accurately repeated any number of times.
  23936.  Prior to CV and CVP 2.30, this was the only type of redirection
  23937.  supported while debugging.
  23938.  
  23939.  Starting with CodeView 2.30, you can redirect I/O to both the
  23940.  application being debugged and to CodeView. The CodeView redirection
  23941.  is done with the /C command-line option, or from within CV itself with
  23942.  the redirection dialog commands ("<" and ">"). Since the /C switch
  23943.  allows you to specify CV dialog commands on the command line, you can
  23944.  specify the redirection at this point. For example, the following
  23945.  command line
  23946.  
  23947.     CV "/C<cv.dat" test < test.dat
  23948.  
  23949.  brings up CodeView with TEST.EXE as in the example above (with the
  23950.  TEST.EXE input coming from TEST.DAT), but this time CodeView also
  23951.  reads the debugging instructions to perform from the file CV.DAT.
  23952.  
  23953.  
  23954.  80. /2 and /O Switches Not Compatible
  23955.  
  23956.  Product Version(s): 2.30
  23957.  Operating System:   OS/2
  23958.  Flags: ENDUSER |
  23959.  Last Modified:  9-NOV-1988    ArticleIdent: Q30978
  23960.  
  23961.     The UTILITY.DOC states that the /O switch is not compatible with
  23962.  the /2 switch. However, the SDK Installation Notes file uses the
  23963.  following code as the example of how to debug child processes:
  23964.  
  23965.      cvp /2 /O <program> <program arguments>
  23966.  
  23967.     This file recommends that the /2 switch be used when debugging PM
  23968.  applications. The UTILITY.DOC file is correct. You cannot use the /2
  23969.  and /O switches at the same time.
  23970.  
  23971.  
  23972.  81. CVP Prompts "SYS0197 OS/2 Not Configured..." Error Message
  23973.  
  23974.  Product Version(s): 2.20
  23975.  Operating System:   OS/2
  23976.  Flags: ENDUSER |
  23977.  Last Modified:  9-NOV-1988    ArticleIdent: Q31658
  23978.  
  23979.     When loading CodeView protected mode (CVP), the "SYS0197 OS/2 not
  23980.  configured to run this application" error message may appear. A
  23981.  request for help on 0197 prompts the "requires input/output privilege"
  23982.  message. You need to set IOPL=YES in CONFIG.SYS to run CVP.
  23983.  
  23984.     The following information is from the section titled "Microsoft(R)
  23985.  CodeView(R) Debugger" of the Microsoft C Version 5.10 UTILITY.DOC
  23986.  file, the FORTRAN Version 4.10 CVREADME.DOC file, and the Microsoft
  23987.  Macro Assembler Version 5.10 README.DOC file.
  23988.  
  23989.  CONFIG.SYS Setting for CVP
  23990.     To run the protected-mode CodeView debugger (CVP.EXE), you must
  23991.  have the following line in your CONFIG.SYS file:
  23992.  
  23993.     IOPL=YES
  23994.  
  23995.  
  23996.  
  23997.  82. Methods for Debugging Large Programs within the 640K DOS Limit
  23998.  
  23999.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30
  24000.  Operating System:   MS-DOS
  24001.  Flags: ENDUSER |
  24002.  Last Modified: 12-FEB-1990    ArticleIdent: Q57941
  24003.  Because of the 640K limit under DOS, it is common to run out of memory
  24004.  when trying to debug large programs with CodeView. CodeView requires
  24005.  over 200K of RAM, not including the program being debugged. In
  24006.  addition, the symbolic information added by compiling with the /Zi
  24007.  switch greatly increases the executable size of the program you are
  24008.  trying to debug.
  24009.  
  24010.  The following is a list of the possible ways of getting around the
  24011.  limited memory problems for debugging:
  24012.  
  24013.  1. Include full symbolic information only in those modules that
  24014.     contain source code that you are currently trying to debug. In
  24015.     other words, compile only those modules with the /Zi switch. For
  24016.     the other modules, compile with the /Zd option, to put only line
  24017.     number information in the object files.
  24018.  
  24019.  2. Use overlays to swap parts of your code in and out, even if it is
  24020.     just during the development process. You can always link without
  24021.     overlays once your application is debugged.
  24022.  
  24023.  3. If you have expanded memory, use it by invoking CodeView with the
  24024.     /E switch. To work properly with CodeView, you should have LIM EMS
  24025.     3.2 or (preferably) 4.0. Expanded memory is used for storing the
  24026.     symbolic information, which can be a great percentage of your .EXE
  24027.     size.
  24028.  
  24029.  4. Use the CVPACK utility, which is documented in the Update Section
  24030.     of the C 5.1 "Microsoft CodeView and Utilities Software Development
  24031.     Tools for MS OS/2 and MS-DOS Operating Systems Update" manual.
  24032.     CVPACK will compress the debug information in the file by removing
  24033.     duplicate references. Use the /p option to achieve maximum
  24034.     compression.
  24035.  
  24036.  In trying to obtain a workable solution, you can use any combination
  24037.  of the above methods. If adequate debugging is still impossible, then
  24038.  you might look into the following possibilities:
  24039.  
  24040.  5. Switch to the OS/2 operating system. This may be limited as far as
  24041.     how much real mode program debugging you can do, depending on how
  24042.     compatible your application is with protected mode requirements.
  24043.  
  24044.  6. You might look into MagicCV from Nu-Mega Technologies of New
  24045.     Hampshire. MagicCV requires a 386-based computer because it uses
  24046.     virtual-86 mode of the processor to run CodeView in extended
  24047.     memory. This method reportedly allows CodeView to use only about 8K
  24048.     of conventional DOS memory. It should be noted that Microsoft does
  24049.     not endorse MagicCV or make any claims as to its usage. The
  24050.     information is offered only as a potential option. Nu-Mega can be
  24051.     reached at (603) 888-2386.
  24052.  
  24053.  
  24054.  83. Problems with CodeView and Logitech Mouse with Older Drivers
  24055.  
  24056.  Product Version(s): 2.00 2.10 2.20
  24057.  Operating System:   MS-DOS
  24058.  Flags: ENDUSER |
  24059.  Last Modified: 23-JAN-1990    ArticleIdent: Q31918
  24060.  
  24061.  Incompatibility problems have been reported with Logitech's mouse and
  24062.  CodeView. Some of the problems encountered are as follows:
  24063.  
  24064.  1. The Logitech mouse fails to function correctly with CodeView
  24065.     Version 2.20 when in 43-line mode. The characters within
  24066.     highlighted cells are incorrect until they are unhighlighted.
  24067.  
  24068.  2. When in either 43-line or 25-line mode, garbage characters are
  24069.     occasionally found at the DOS prompt following an exit from
  24070.     CodeView.
  24071.  
  24072.  The problems seem to be with Versions 3.20 and earlier of the Logitech
  24073.  mouse driver. An update of the mouse driver is available that corrects
  24074.  these problems. Logitech can be reached at (415) 795-0427. Logitech
  24075.  also has a bulletin board service, which may contain the latest driver
  24076.  and can be reached at (415) 795-0408.
  24077.  
  24078.  A Microsoft Mouse or 100 percent Microsoft-compatible mouse is
  24079.  required for use with CodeView. In addition, you must use Microsoft's
  24080.  mouse driver Version 6.00 or later, or a driver that exactly emulates
  24081.  these Microsoft drivers.
  24082.  
  24083.  
  24084.  84. Using the T Command to Echo CodeView Output
  24085.  
  24086.  Product Version(s): 2.00 2.10 2.20
  24087.  Operating System:   MS-DOS
  24088.  Flags: ENDUSER |
  24089.  Last Modified: 16-NOV-1988    ArticleIdent: Q31919
  24090.  
  24091.     To generate and record a history of the source lines stepped
  24092.  through in the course of a debugging session, do the following:
  24093.  
  24094.     1. Start CodeView in sequential mode using the /T option.
  24095.     2. While in sequential mode, enter the Redirect Output (>) command,
  24096.  followed by a filename. If no filename is specified, then stdout will
  24097.  be assumed.
  24098.     3. If you wish to view the output as it is redirected, precede the
  24099.  redirection operator with the echo command (T).
  24100.     4. If a second redirection operator is specified, the redirection
  24101.  file is appended to rather than truncated before output.
  24102.  
  24103.     For more information on output redirection, refer to the "System
  24104.  Commands" section of the "Microsoft CodeView and Utilities" manual.
  24105.  
  24106.     The following example demonstrates this process:
  24107.  
  24108.  CV> T > log.dat  or T >> log.dat
  24109.  CV> t
  24110.  CV> t
  24111.  CV> t
  24112.  CV> .
  24113.  CV> .
  24114.  CV> .
  24115.  CV> q
  24116.  
  24117.     The lines traced will be written both to the console and to the log
  24118.  file.
  24119.  
  24120.  
  24121.  85. CHAIN Statement in Compiled BASIC Not Supported by CodeView
  24122.  
  24123.  Product Version(s): 2.20
  24124.  Operating System:   MS-DOS
  24125.  Flags: ENDUSER | B_QuickBas B_BasicCom
  24126.  Last Modified: 16-NOV-1988    ArticleIdent: Q32265
  24127.  
  24128.     In Microsoft CodeView, when debugging compiled BASIC programs that
  24129.  CHAIN, you can view only the first program executed (the one given in
  24130.  the CV command line). The modules that are CHAINed-to cannot be viewed
  24131.  or stepped through, and their variables cannot be looked at, even if
  24132.  these modules are successfully executed. In fact, you cannot gain any
  24133.  information about the CHAINed modules, other than whether or not they
  24134.  execute correctly, unless you execute them separately in CodeView.
  24135.     This information applies to QuickBASIC Versions 4.00 and 4.00b,
  24136.  and the Microsoft BASIC Compiler Version 6.00 for MS-DOS and OS/2.
  24137.  
  24138.  
  24139.  
  24140.  86. CodeView Cannot Debug Source Code in Include Files
  24141.  
  24142.  Product Version(s): 1.00 1.10 1.11 2.00 2.02.02 2.10 2.20
  24143.  Operating System:   MS-DOS
  24144.  Flags: ENDUSER |
  24145.  Last Modified:  9-NOV-1988    ArticleIdent: Q34922
  24146.  
  24147.  CodeView cannot debug source code in include files. This information
  24148.  is documented on Page 7 of the "Microsoft CodeView and Utilities"
  24149.  manual. The explanation for the restriction on include files says "You
  24150.  will not be able to use the CodeView debugger to debug source code in
  24151.  include files."
  24152.  
  24153.  This information means programs with include files that contain
  24154.  executable statements cannot be debugged with CodeView.
  24155.  
  24156.  The usual symptom of this problem is that after tracing or otherwise
  24157.  trying to execute your program, you will be viewing one of your
  24158.  include files instead of your normal source code. Repeated attempts
  24159.  to view the main or other source files will result in viewing the
  24160.  include file again.
  24161.  
  24162.  This is program design for the product. Microsoft's compilers do not
  24163.  generate symbolic information for code in include files. As a result,
  24164.  CodeView is confused by the discrepancies, and the subsequent behavior
  24165.  is unpredictable. Include files only can contain prototypes,
  24166.  declarations, #defines or #includes, etc.
  24167.  
  24168.  (Note that these items are all "nonexecutable" statements )
  24169.  
  24170.  Although it is valid C code, include files must not contain
  24171.  initializations or function definitions or other executable statements
  24172.  for CodeView to be able to debug your programs properly.
  24173.  
  24174.  
  24175.  87. No Symbolic Information Generated for Pascal Units
  24176.  
  24177.  Product Version(s): 2.10 2.20 2.30 | 2.20 2.30
  24178.  Operating System:   MS-DOS         | OS/2
  24179.  Flags: ENDUSER | s_pascal
  24180.  Last Modified:  8-MAR-1990    ArticleIdent: Q57943
  24181.  
  24182.  The Microsoft Pascal Compiler Version 4.00 does not generate symbolic
  24183.  debugging information for Pascal units. As a result, when tracing
  24184.  through a Pascal program unit, any attempt to access local variables
  24185.  by using trace/watchpoints, dumps, examines, etc. yields a "symbol
  24186.  unknown" error.
  24187.  
  24188.  The only workaround is to transform the program units into modules.
  24189.  
  24190.  
  24191.  88. CVP Accessing I/O Ports
  24192.  
  24193.  Product Version(s): 2.20 2.30
  24194.  Operating System:   OS/2
  24195.  Flags: ENDUSER | buglist2.20 buglist2.30
  24196.  Last Modified: 14-AUG-1989    ArticleIdent: Q36885
  24197.  
  24198.  In the "Microsoft CodeView and Utilities Software Development Tools
  24199.  for the MS-DOS Operating System," Sections 6.6 and 10.5 discuss the
  24200.  Port Input and Port Output commands respectively. These commands
  24201.  function correctly in CV under MS-DOS. However, CVP under OS/2
  24202.  generates a protection violation when trying to access a port. The
  24203.  port input and output commands do not function in CVP Version 2.20
  24204.  under OS/2.
  24205.  
  24206.  Microsoft has confirmed this to be a problem in Version 2.20. We are
  24207.  researching this problem and will post new information as it becomes
  24208.  available.
  24209.  
  24210.  
  24211.  89. Using CodeView to Examine FORTRAN Arrays
  24212.  
  24213.  Product Version(s): 2.20 2.30 | 2.20 2.30
  24214.  Operating System:   MS-DOS    | OS/2
  24215.  Flags: ENDUSER |
  24216.  Last Modified: 14-AUG-1989    ArticleIdent: Q37548
  24217.  
  24218.  Question:
  24219.  
  24220.  I have allocated memory for a three-dimensional array in FORTRAN. How
  24221.  can I examine the contents of a row using CodeView?
  24222.  
  24223.  Response:
  24224.  
  24225.  You can use CodeView to display a single element of the array using
  24226.  ?arrayname(x,x,x), where "arrayname" consists of the first six
  24227.  characters of the array name and "(x,x,x)" must be a valid cell in the
  24228.  array.
  24229.  
  24230.  There is no way to display more than one cell of the array using this
  24231.  command. To display many cells, you must do a memory dump of the
  24232.  addresses where the array is stored. Use the examine command (X) to
  24233.  get the starting address of the array, and dump (D) to dump the
  24234.  elements.
  24235.  
  24236.  FORTRAN stores array elements in column-major order. Use the following
  24237.  formula to determine the address where any cell (i,j,k) is stored,
  24238.  where Max_Row is the maximum i possible and Max_Col is the maximum j
  24239.  possible:
  24240.  
  24241.      MemAddr = start_addr+(size of elements)*
  24242.                       (Max_Row((k-1)(Max_Col)+(j-1))+(i-1))
  24243.  
  24244.  "Size of elements" is the number of bytes of each element in the
  24245.  array.
  24246.  
  24247.  
  24248.  90. CodeView Unexpectedly Exits to DOS
  24249.  
  24250.  Product Version(s): 2.10 2.20
  24251.  Operating System:   MS-DOS
  24252.  Flags: ENDUSER |
  24253.  Last Modified:  8-APR-1990    ArticleIdent: Q37566
  24254.  
  24255.  When debugging a program with CodeView, certain operations cause it to
  24256.  exit to DOS without giving any warning or error message. Some of the
  24257.  things that cause this behavior are trying to access help, setting a
  24258.  watch variable, and returning from a DOS shell.
  24259.  
  24260.  This problem occurs because not enough file handles are being
  24261.  allocated at boot time with "files=XX" in CONFIG.SYS. An error message
  24262.  is printed, but then over written before most people can see it.
  24263.  
  24264.  The solution is to make sure files are set to 20 in CONFIG.SYS.
  24265.  
  24266.  
  24267.  91. How CodeView Handles DosExitList Routines
  24268.  
  24269.  Product Version(s): 2.20
  24270.  Operating System:   OS/2
  24271.  Flags: ENDUSER |
  24272.  Last Modified: 12-JAN-1989    ArticleIdent: Q40270
  24273.  
  24274.  Question:
  24275.  
  24276.  CodeView does not seem to be executing my DosExitList. What should I
  24277.  do to execute the exit list?
  24278.  
  24279.  Response:
  24280.  
  24281.  If you are in your program and issue the GO command, your program
  24282.  executes to the end of your application, giving the message "Thread
  24283.  terminated normally." At this point, you can use the GO command or
  24284.  trace into your exit routine. However, if you would like to quit your
  24285.  program and go to your exit handler in the middle of executing your
  24286.  program, you have two choices.
  24287.  
  24288.  When you quit CodeView ("q"), your code including your DosExitList
  24289.  will not be executed. The first method to execute your DosExitList is
  24290.  the safest, but you are not able to trace through your exit routine.
  24291.  When you want to exit, type the following:
  24292.  
  24293.     ? myexithandler()
  24294.  
  24295.  This command executes the function "myexithandler", which is your
  24296.  DosExitList routine. After this command has been performed, you can
  24297.  quit CodeView ("q") because all of your cleanup has been accomplished.
  24298.  
  24299.  The second method, which is less reliable, is to modify the instruction
  24300.  pointer (IP) so that you can effectively jump to the end of your
  24301.  program. Before you do this, make certain that you are not in a
  24302.  subfunction. If you are not in main(), jumping to the end of the
  24303.  program causes problems with the stack. While in your main() routine,
  24304.  enter the following at the CodeView command line, where XXXX is the
  24305.  value of the IP when you are at the last curly brace at the end of
  24306.  your program:
  24307.  
  24308.     R IP XXXX
  24309.  
  24310.  This command causes a jump to the last curly brace; you can step
  24311.  through your program from there. This method allows you to step
  24312.  through your exit routine, but it is a little more risky.
  24313.  
  24314.  
  24315.  92. You Cannot Display Past Column 71 in CodeView
  24316.  
  24317.  Product Version(s): 2.20   | 2.20
  24318.  Operating System:   MS-DOS | OS/2
  24319.  Flags: ENDUSER |
  24320.  Last Modified: 20-JAN-1989    ArticleIdent: Q40428
  24321.  
  24322.  Can I view my code beyond column 71 in CodeView like I can in the
  24323.  Microsoft editor?
  24324.  
  24325.  In CodeView Version 2.20, you cannot scroll your code to the right.
  24326.  You should either rewrite the source code or, if you used tabs in the
  24327.  source code, reduce the tab size with the # dialog command, as
  24328.  described on Page 240 of the "Microsoft CodeView and Utilities"
  24329.  manual.
  24330.  
  24331.  
  24332.  
  24333.  93. Display Command Returns Incorrect Result for FORTRAN Function
  24334.  
  24335.  Product Version(s): 2.20 2.30 | 2.20 2.30
  24336.  Operating System:   MS-DOS    | OS/2
  24337.  Flags: ENDUSER | buglist2.20 buglist2.30
  24338.  Last Modified: 14-AUG-1989    ArticleIdent: Q40586
  24339.  
  24340.  The display command does not return correct values for the
  24341.  user-defined FORTRAN real functions in Microsoft CodeView.
  24342.  
  24343.  The display command calls integer functions and returns correct
  24344.  results.
  24345.  
  24346.  Microsoft has confirmed this to be a problem in Version 2.20. We are
  24347.  researching this problem and will post new information as it becomes
  24348.  available.
  24349.  
  24350.  The display command is discussed in Chapter 6 of the "Microsoft
  24351.  CodeView and Utilities" manual. The valid FORTRAN expressions for
  24352.  CodeView are discussed in the Chapter 4 of the same manual.
  24353.  
  24354.  
  24355.  94. CodeView Does Not Work with Grouped Code Segments
  24356.  
  24357.  Product Version(s): 2.20   | 2.20
  24358.  Operating System:   MS-DOS | OS/2
  24359.  Flags: ENDUSER | H_MASM
  24360.  Last Modified:  9-FEB-1989    ArticleIdent: Q40784
  24361.  
  24362.  When using MASM it is possible to associate various segments into a
  24363.  group; DGROUP is an example of this technique. Grouped data or stack
  24364.  segments do not affect CodeView, but CodeView does not recognize
  24365.  grouped code segments. The program will execute correctly under
  24366.  CodeView, but none of the CodeView functions will be available on the
  24367.  second and subsequent segments in the code group.
  24368.  
  24369.  The following code segment illustrates this behavior:
  24370.  
  24371.  codegroup  GROUP ASEG,BSEG
  24372.          assume cs:codegroup
  24373.  
  24374.  ASEG    SEGMENT WORD PUBLIC 'CODE'
  24375.  A:
  24376.          mov ax,1
  24377.          mov ax,1
  24378.          JMP B
  24379.  ASEG    ends
  24380.  
  24381.  ;   Will not be able to single step through this section
  24382.  BSEG    SEGMENT WORD PUBLIC 'CODE'
  24383.  B:      mov ax,1
  24384.          mov ax,1
  24385.          mov ax,1
  24386.          int 21h
  24387.  BSEG    ends
  24388.          end A
  24389.  
  24390.  Once the program executes into the BSEG segment, all CodeView
  24391.  functionality will be lost. You cannot set any breakpoints or single
  24392.  step through the BSEG segment of code. It appears that CodeView does
  24393.  not store any symbolic information for the BSEG segment. Any attempt
  24394.  to single step through this section of code will result in CodeView
  24395.  executing the BSEG segment of code until the program is completed.
  24396.  
  24397.  Microsoft is researching this problem and will post new information as
  24398.  it becomes available.
  24399.  
  24400.  
  24401.  95. CodeView and Video Pages
  24402.  
  24403.  Product Version(s): 2.00 2.10 2.20 | 2.20
  24404.  Operating System:   MS-DOS         | OS/2
  24405.  Flags: ENDUSER |
  24406.  Last Modified:  2-MAR-1989    ArticleIdent: Q41101
  24407.  
  24408.  Question:
  24409.  
  24410.  Is there anyway to specify which video page CodeView uses? I have an
  24411.  application that uses video page one; I am not able to use CodeView
  24412.  with it because CodeView also uses video page one.
  24413.  
  24414.  Response:
  24415.  
  24416.  CodeView does not allow you to specify which video page it will use.
  24417.  As a result, any application that uses video page one conflicts with
  24418.  CodeView and the screen becomes corrupted.
  24419.  
  24420.  The recommend work around in this situation is to use the two monitor
  24421.  option for CodeView. This option allows CodeView to send the
  24422.  application's output to one screen while using the first screen for
  24423.  its own output.
  24424.  
  24425.  Another less desirable workaround would be to avoid the use of video
  24426.  page one in programs that will be used under CodeView.
  24427.  
  24428.  
  24429.  
  24430.  96. Removing CodeView Information from .LIBs and .EXEs
  24431.  
  24432.  Product Version(s): 2.20   | 2.20
  24433.  Operating System:   MS-DOS | OS/2
  24434.  Flags: ENDUSER | SR# G890207-11424
  24435.  Last Modified:  2-MAR-1989    ArticleIdent: Q41371
  24436.  
  24437.  Question:
  24438.  
  24439.  Is there a way to remove CodeView symbols from a .LIB or .EXE file?
  24440.  
  24441.  Response:
  24442.  
  24443.  Although there is no utility that removes CodeView information from
  24444.  libraries, EXEPACK will remove CodeView information from .EXE files in
  24445.  the course of packing them. You can also remove information from an
  24446.  .EXE file by relinking it without the /CODEVIEW option.
  24447.  
  24448.  The only way to remove CodeView information from a library is to
  24449.  recompile the source modules and use the LIB utility to rebuild the
  24450.  library.
  24451.  
  24452.  
  24453.  97. CodeView: Debugging Presentation Manager Printer Drivers
  24454.  
  24455.  Product Version(s): 2.20 2.30
  24456.  Operating System:   OS/2
  24457.  Flags: ENDUSER |
  24458.  Last Modified: 28-MAR-1989    ArticleIdent: Q42780
  24459.  
  24460.  To debug OS/2 Presentation Manager (PM) printer drivers, you must use
  24461.  the kernel debugger. Currently, PM printer drivers fall under the same
  24462.  category as lower-level device drivers. These device drivers cannot be
  24463.  debugged using the current version of CodeView.
  24464.  
  24465.  
  24466.  98. Dump Command on Arrays in FORTRAN Gives Syntax Error
  24467.  
  24468.  Product Version(s): 1.10 2.20 | 2.20
  24469.  Operating System:   MS-DOS    | OS/2
  24470.  Flags: ENDUSER | H_FORTRAN buglist2.20 buglist2.30
  24471.  Last Modified: 21-AUG-1989    ArticleIdent: Q42942
  24472.  
  24473.  Microsoft CodeView Versions 2.20 and 2.30 gives a "Syntax error" when
  24474.  attempting to use the Dump command on an array of dimension greater
  24475.  than 1.
  24476.  
  24477.  For example, issuing the DI i(1,3) command to dump the contents of an
  24478.  array element fails.
  24479.  
  24480.  To work around this problem use one of the following methods:
  24481.  
  24482.  1. Use the "?" command, as follows:
  24483.  
  24484.        ? i(1,3)
  24485.  
  24486.  2. Enclose each dimension index within parentheses and omit the comma,
  24487.     as follows:
  24488.  
  24489.        DI i((1)(3))
  24490.  
  24491.     DI i(1(3)) and DI i((1)3) are also acceptable.
  24492.  
  24493.     A three dimensional example would look like the following:
  24494.  
  24495.        DI j(1(2)3)
  24496.  
  24497.     Any permutation of the parenthesis around the index is sufficient.
  24498.  
  24499.  Microsoft has confirmed this to be a problem in Versions 2.20 and
  24500.  2.30. We are researching this problem and will post new information as
  24501.  it becomes available.
  24502.  
  24503.  
  24504.  99. CodeView Protect: /43 Switch Doesn't Work on VGA Adapters
  24505.  
  24506.  Product Version(s): 2.20
  24507.  Operating System:   OS/2
  24508.  Flags: ENDUSER | buglist2.20
  24509.  Last Modified: 18-APR-1989    ArticleIdent: Q43043
  24510.  
  24511.  The /43 switch for CodeView, used to debug in 43 line mode, is ignored
  24512.  when a VGA video adapter is being used under OS/2. This switch works
  24513.  properly as documented in DOS, or when an EGA adapter is being used.
  24514.  The /50 switch, used to debug in 50 line mode, also works properly as
  24515.  documented.
  24516.  
  24517.  If you wish to use CodeView Version 2.20 in 43 line mode under OS/2,
  24518.  the MODE command can be used first to set the entire screen group into
  24519.  43 line mode. Using MODE 80,43 at the OS/2 prompt will accomplish this
  24520.  result. Starting CodeView without any switches will then cause it to
  24521.  use the current video mode.
  24522.  
  24523.  Microsoft has confirmed this to be a problem in CodeView Protect
  24524.  Version 2.20. This feature is under review and will be considered for
  24525.  inclusion in a future release.
  24526.  
  24527.  
  24528.  100. CV: K Command in Secondary Module Sets Breakpoints in Main
  24529.  
  24530.  Product Version(s): 2.20   | 2.20
  24531.  Operating System:   MS-DOS | OS/2
  24532.  Flags: ENDUSER | buglist2.20
  24533.  Last Modified:  6-APR-1989    ArticleIdent: Q43170
  24534.  
  24535.  In some cases the K (call stack) command will cause CodeView to become
  24536.  uncertain as to where to set breakpoints.
  24537.  
  24538.  If an attempt to set a breakpoint is made in a module of a
  24539.  multi-module program immediately after using the K command then the
  24540.  breakpoint will be set in the module containing main() instead of in
  24541.  the current module.
  24542.  
  24543.  If the corresponding line in the first module is not an executable
  24544.  line then CodeView will issue the expected beep to indicate that the
  24545.  breakpoint could not be set.
  24546.  
  24547.  If the corresponding line is an executable line then there will be no
  24548.  indication at all that the breakpoint has been set until that module
  24549.  is again in view. At that point the breakpoint will be highlighted as
  24550.  usual. This behavior will occur in any module accessed after the one
  24551.  containing main().
  24552.  
  24553.  Breakpoints will be set properly after using the K command if any
  24554.  stepping is performed, the view is changed, or the Calls menu is
  24555.  accessed.
  24556.  
  24557.  Microsoft is researching this problem and will post new information as
  24558.  it becomes available.
  24559.  
  24560.  
  24561.  101. Vertical Scroll Inactive with MODE CO40 and Dual Monitors
  24562.  
  24563.  Product Version(s): 2.x
  24564.  Operating System:   MS-DOS
  24565.  Flags: ENDUSER | S_C buglist2.20
  24566.  Last Modified: 18-APR-1989    ArticleIdent: Q43260
  24567.  
  24568.  While debugging a program using Microsoft CodeView and dual monitors,
  24569.  the vertical scroll bar is disabled when the video mode is set to
  24570.  40-line color text. This occurs if the mode is set either at the
  24571.  command line
  24572.  
  24573.     MODE CO40
  24574.  
  24575.  or from within a program as follows:
  24576.  
  24577.     _setvideomode(_TEXTC40);
  24578.  
  24579.  The scroll bar remains inactive until the mode is changed. This
  24580.  problem does not occur on a single monitor system or in any other
  24581.  video modes.
  24582.  
  24583.  Microsoft has confirmed this to be a problem in Version 2.20. We are
  24584.  researching the problem and will post new information as it becomes
  24585.  available.
  24586.  
  24587.  The following program demonstrates the problem:
  24588.  
  24589.  #include <graph.h>
  24590.  
  24591.  void main (void)
  24592.  {
  24593.    _setvideomode(_TEXTC40);
  24594.    _setvideomode(DEFAULTMODE);
  24595.  }
  24596.  
  24597.  
  24598.  
  24599.  102. Selecting Text for Use with Commands
  24600.  
  24601.  Product Version(s): 2.20 2.30 | 2.20 2.30
  24602.  Operating System:   MS-DOS    | OS/2
  24603.  Flags: ENDUSER | docerr insert
  24604.  Last Modified:  9-APR-1990    ArticleIdent: Q59408
  24605.  
  24606.  In CodeView Versions 2.20 and 2.30, you supposedly can press the left
  24607.  mouse button to highlight the command to be copied, and then press the
  24608.  INS key to copy the command. However, this method works only with the
  24609.  mouse and not with the keyboard.
  24610.  
  24611.  On Page 64 of the "Microsoft FORTRAN CodeView and Utilities User's
  24612.  Guide" Version 5.0 manual, it incorrectly states that you can copy any
  24613.  text that appears in any window. This is incorrect because you can
  24614.  only copy text in the command window.
  24615.  
  24616.  
  24617.  103. CodeView: View Command Fails with Underscore in Filenames
  24618.  
  24619.  Product Version(s): 2.20   | 2.20
  24620.  Operating System:   MS-DOS | OS/2
  24621.  Flags: ENDUSER | buglist2.20
  24622.  Last Modified:  3-MAY-1989    ArticleIdent: Q43508
  24623.  
  24624.  Assume that two source files, MAINPROG.C and FILE_NAM.C, have been
  24625.  compiled with CodeView information. The main function in MAINPROG.C
  24626.  calls a function in FILE_NAM.C.
  24627.  
  24628.  When the following command is executed in CodeView, CodeView responds
  24629.  with "syntax error":
  24630.  
  24631.     V.FILE_NAM.C
  24632.  
  24633.  When FILE_NAM.C is renamed and recompiled as FILENAM.C, the following
  24634.  command works properly, and the source code in FILENAM.C is displayed:
  24635.  
  24636.     V.FILENAM.C
  24637.  
  24638.  Attempts to open a file with an underscore character will work
  24639.  correctly through the "Open" menu in CodeView, but will fail with the
  24640.  View command.
  24641.  
  24642.  Microsoft has confirmed this to be a problem in Version 2.20. We are
  24643.  researching this problem and will post new information as it becomes
  24644.  available.
  24645.  
  24646.  
  24647.  104. Cannot Set Breakpoint on an Executable Line with CodeView 3.00
  24648.  
  24649.  Product Version(s): 3.00   | 3.00
  24650.  Operating System:   MS-DOS | OS/2
  24651.  Flags: ENDUSER |
  24652.  Last Modified: 19-APR-1990    ArticleIdent: Q60338
  24653.  
  24654.  If you cannot set a breakpoint on a particular line of code, make sure
  24655.  you have used the -Zi and -Od options to create executable code that
  24656.  has full CodeView debugging capabilities.
  24657.  
  24658.  Some code in the executable is concatenated if the -Od option is not
  24659.  used.
  24660.  
  24661.  Sample Code
  24662.  -----------
  24663.  
  24664.  #include <stdio.h>
  24665.  
  24666.  int foo();
  24667.  
  24668.  void main (void)
  24669.  {
  24670.     int a,b,c;
  24671.  
  24672.     a = foo();/* this line would be concatenated into the next */
  24673.     b = a + c;/* line to look like b=(a=foo())+c.              */
  24674.  }
  24675.  
  24676.  int foo()
  24677.  {
  24678.     return(10);
  24679.  }
  24680.  
  24681.  
  24682.  105. Commands Invoked with "?" Command Must Be Compiled with /Zi
  24683.  
  24684.  Product Version(s): 2.20   | 2.20
  24685.  Operating System:   MS-DOS | OS/2
  24686.  Flags: ENDUSER |
  24687.  Last Modified:  3-MAY-1989    ArticleIdent: Q43556
  24688.  
  24689.  Invoking C functions in CodeView using the "?" command works as
  24690.  expected as long as the function is contained in a module that was
  24691.  compiled with /Zi for the CodeView information. However, if you invoke
  24692.  a run-time library function, CodeView returns the error message
  24693.  "syntax error."
  24694.  
  24695.  The reason for the error message is that the module containing the
  24696.  library function is not compiled with the CodeView option /Zi. The
  24697.  error message is not dependent on the fact that the function is in the
  24698.  library rather than being user-defined. If a user-defined function is
  24699.  contained in a module that is compiled without /Zi for the CodeView
  24700.  information and you try to invoke it with the "?" command, CodeView
  24701.  will return the same error message.
  24702.  
  24703.  The "?" command is formally referred to in the CodeView Utilities
  24704.  menu as the Display Expression command.
  24705.  
  24706.  
  24707.  106. CodeView May Single Step onto a Comment Line
  24708.  
  24709.  Product Version(s): 2.20   | 2.20
  24710.  Operating System:   MS-DOS | OS/2
  24711.  Flags: ENDUSER | buglist2.20
  24712.  Last Modified:  2-JUN-1989    ArticleIdent: Q43601
  24713.  
  24714.  When using CodeView to single step the following program, the current
  24715.  execution line will be put on the first comment line. CodeView should
  24716.  always skip over the comment line.
  24717.  
  24718.  The program is compiled as required for running in CodeView. The
  24719.  compiling command used could be the following:
  24720.  
  24721.     cl /Zi /Od test.c
  24722.  
  24723.  Microsoft has confirmed this to be a problem with CodeView Version
  24724.  2.20. We are researching the problem and will post new information as
  24725.  it becomes available.
  24726.  
  24727.  This problem has no effect on the application program's performance.
  24728.  
  24729.  The following is the program:
  24730.  
  24731.  /*   test.c   */
  24732.  #include <stdio.h>
  24733.  int i = 1 ;
  24734.  void main (void)
  24735.  {
  24736.  if ( i )
  24737.       i = 0 ;
  24738.       /* first comment line */
  24739.  else
  24740.       /* more comment */
  24741.       i = 1 ;
  24742.  }
  24743.  
  24744.  
  24745.  107. Returning Control to CodeView
  24746.  
  24747.  Product Version(s): 2.20
  24748.  Operating System:   MS-DOS
  24749.  Flags: ENDUSER | CONTROL-C CONTROL+C CONTROL+BREAK CONTROL-BREAK ^C ^BREAK
  24750.  Last Modified:  3-MAY-1989    ArticleIdent: Q43648
  24751.  
  24752.  The following are two software methods of returning control to
  24753.  CodeView during program execution:
  24754.  
  24755.  1. Use the debug interrupt, interrupt 03, in your code. Interrupt 03
  24756.     is called a microprocessor (or logical) interrupt. It is the
  24757.     interrupt that CodeView uses to make breakpoints. Hard code
  24758.     interrupt 03 into your code in selected places where you want to
  24759.     return control to CodeView. The following sample program will
  24760.     demonstrate the technique. Note that a macro could easily be
  24761.     constructed to insert breakpoints where desired.
  24762.  
  24763.          #include <dos.h>
  24764.          #include <stdio.h>
  24765.  
  24766.          void main()
  24767.          {
  24768.              union REGS    inregs;
  24769.              int           i = 1;
  24770.  
  24771.              for( ;; )
  24772.              {
  24773.                  printf( "Loop iteration: %d\n", i++ );
  24774.                  int86( 0x03, &inregs, &inregs );
  24775.              }
  24776.  
  24777.  2. Use CTRL+C and CTRL+BREAK to return control to CodeView. This is
  24778.     a useful method for breaking out of a program is currently running
  24779.     or that has locked up.  The position in the source code to which
  24780.     you are returned depends on when you hit the ^C and what caused
  24781.     the system to hang, e.g. an infinite loop, a bad pointer, etc.
  24782.     Execution may be continued from this point in the usual manner
  24783.     (F5, F8, F10, etc.).
  24784.  
  24785.     Under OS/2 CTRL+BREAK does not return control to CodeView. CTRL+C
  24786.     may be used to abort a normally executing program but you cannot
  24787.     continue to debug from that point as you can in DOS.
  24788.  
  24789.  There is no hardware interrupt that will return control to CodeView.
  24790.  
  24791.  
  24792.  108. Cannot Open Source File Under CVP
  24793.  
  24794.  Product Version(s): 2.20
  24795.  Operating System:   OS/2
  24796.  Flags: ENDUSER | buglist2.20 buglist2.30 buglist2.4.1
  24797.  Last Modified: 18-SEP-1989    ArticleIdent: Q45135
  24798.  
  24799.  Problem:
  24800.  
  24801.  When using CodeView Protect (CVP) Version 2.20, I trace my program
  24802.  through a number of source files and after some number of files CVP is
  24803.  no longer able to open source files. When CVP gets into this
  24804.  situation, it automatically goes into mixed mode -- displaying line
  24805.  numbers but no source text. In this state, trying to use the "v"
  24806.  command to look at another (not previously looked at) file results in
  24807.  a red message box telling me that CVP can't open the file.
  24808.  
  24809.  Response:
  24810.  
  24811.  This is a problem with CVP Version 2.20 and 2.30. CVP is running into a
  24812.  file limit. To work around this problem, before you step out of the first
  24813.  module, open the source file containing the code you wish to debug and
  24814.  set a breakpoint there. Now "go" to this location by pressing the F5
  24815.  key. This procedure allows you to start debugging at a location deep
  24816.  into the file without opening multiple source files.
  24817.  
  24818.  Microsoft has confirmed this to be a problem with CodeView versions
  24819.  2.20 and 2.30. We are researching this problem and will post new
  24820.  information as it becomes available.
  24821.  
  24822.  
  24823.  109. Incorrect Handling of SP Can Cause CodeView to Corrupt Stack
  24824.  
  24825.  Product Version(s): 2.20 2.30 | 2.20 2.30
  24826.  Operating System:   MS-DOS    | OS/2
  24827.  Flags: ENDUSER |
  24828.  Last Modified:  7-JUN-1989    ArticleIdent: Q45183
  24829.  
  24830.  CodeView will use your program's stack for temporary variables in
  24831.  between assembly instructions. Thus, when writing an assembly language
  24832.  program, if you forget to increase the stack pointer (SP) to point
  24833.  beyond the memory locations you are using on the stack, CodeView will
  24834.  overwrite that memory.
  24835.  
  24836.  This is expected behavior. Even if CodeView did not use the stack, you
  24837.  would still have to increment the stack pointer to keep your program
  24838.  from overwriting your variables when you make a call, or with any
  24839.  operation that pushes values on the stack.
  24840.  
  24841.  
  24842.  110. Switching Out of PM Application Hangs System under Codeview
  24843.  
  24844.  Product Version(s): 2.20
  24845.  Operating System:   OS/2
  24846.  Flags: ENDUSER |
  24847.  Last Modified: 16-MAY-1989    ArticleIdent: Q44418
  24848.  
  24849.  Question:
  24850.  
  24851.  I am using CodeView to debug my Presentation Manager (PM) application.
  24852.  Why does my machine sometimes hang when I use CTRL+ESC to switch to
  24853.  the OS/2 program selector?
  24854.  
  24855.  Response:
  24856.  
  24857.  Presentation Manager applications require the use of the Presentation
  24858.  Manager shell. To debug PM applications, CodeView must put hooks into
  24859.  the Presentation Manager before the PM application is executed. This
  24860.  process works properly while inside CodeView, but if you try to switch
  24861.  back to the program selector, PM is in an unknown execution state.
  24862.  
  24863.  Therefore, to switch out of CodeView while debugging a PM application,
  24864.  you must first restart or end the program inside CodeView. This tells
  24865.  CodeView to restore the Presentation Manager to its original
  24866.  condition.
  24867.  
  24868.  
  24869.  111. SYS0317 Caused by Running CVP on a DOS Application
  24870.  
  24871.  Product Version(s): 2.20
  24872.  Operating System:   OS/2
  24873.  Flags: ENDUSER |
  24874.  Last Modified: 31-MAY-1989    ArticleIdent: Q44707
  24875.  
  24876.  The following message results from running a DOS application under
  24877.  Microsoft CodeView Version 2.20 or 2.30 for protected mode:
  24878.  
  24879.     SYS0317: The system cannot find message 0491
  24880.     in message file OSO001.MSG
  24881.  
  24882.  The screen is then cleared and the OS/2 prompt returns.
  24883.  
  24884.  
  24885.  112. /43 Starts CodeView with Screen Swapping Enabled
  24886.  
  24887.  Product Version(s): 2.20 2.30 | 2.20 2.30
  24888.  Operating System:   MS-DOS    | OS/2
  24889.  Flags: ENDUSER |
  24890.  Last Modified:  7-JUN-1989    ArticleIdent: Q45185
  24891.  
  24892.  When CodeView is started with the /43 switch to bring it up in 43-line
  24893.  mode, screen swapping is automatically enabled. This behavior is by
  24894.  design, although it is not stated in the documentation for the
  24895.  product.
  24896.  
  24897.  
  24898.  113. Setting a Breakpoint Highlights More Than One Line
  24899.  
  24900.  Product Version(s): 2.20
  24901.  Operating System:   MS-DOS
  24902.  Flags: ENDUSER | buglist2.20
  24903.  Last Modified:  7-JUN-1989    ArticleIdent: Q45241
  24904.  
  24905.  When setting a breakpoint, CodeView may highlight two or more lines of
  24906.  code when you do the following:
  24907.  
  24908.  1. Compile C program (e.g., "Hello, world") with /Zi /Od.
  24909.  
  24910.  2. Load CodeView with 50 line mode (in VGA mode) as follows:
  24911.  
  24912.        cv /50 hello.c).
  24913.  
  24914.  3. Display mixed source and assembly.
  24915.  
  24916.  4. Move the cursor to the edit window and scroll down two or three
  24917.     pages of start-up assembly code.
  24918.  
  24919.  5. Set and remove breakpoints at arbitrary locations. In some cases,
  24920.     multiple lines will be highlighted and the display altered. The
  24921.     code itself is not changed. To restore the altered display, page
  24922.     down and then page up to the altered location.
  24923.  
  24924.  CVP does display this problem.
  24925.  
  24926.  Microsoft has confirmed this to be a problem in CodeView Version 2.20.
  24927.  We are researching this problem and will post more new as it becomes
  24928.  available.
  24929.  
  24930.  After setting a breakpoint that highlights more than one line of code,
  24931.  using the BL command will list only the one breakpoint you set.
  24932.  
  24933.  
  24934.  114. "No Symbolic Information" May Be Caused by Using Wrong Linker
  24935.  
  24936.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 2.35 | 2.20 2.30 2.35
  24937.  Operating System:   MS-DOS                             | OS/2
  24938.  Flags: ENDUSER | S_LINK
  24939.  Last Modified: 19-SEP-1990    ArticleIdent: Q59540
  24940.  
  24941.  To debug programs at the source level with CodeView, it is critical
  24942.  that a proper version of LINK be used. Particular versions of CodeView
  24943.  are matched to particular versions of LINK and using a version of LINK
  24944.  newer than the versions matched to a particular version of CodeView
  24945.  will prevent CodeView from recognizing the symbolic information in the
  24946.  .EXE file.
  24947.  
  24948.  This mismatch will cause CodeView to come up in assembly mode and
  24949.  produce the message "No Symbolic Information," even though the source
  24950.  files may have been compiled and linked with the correct options for
  24951.  CodeView symbolic debugging.
  24952.  
  24953.  The difference between the linkers is in the way they store symbolic
  24954.  information in .EXE files. A newer version of CodeView generally can
  24955.  always display symbolic information for programs produced with
  24956.  previous versions of LINK, but the opposite is NOT true. Using a more
  24957.  recent linker with an older version of CodeView is where potential
  24958.  problems arise.
  24959.  
  24960.  The following information applies to both real-mode CodeView (CV) and
  24961.  protected-mode CodeView (CVP).
  24962.  
  24963.  Versions of CodeView prior to Version 3.00 cannot display symbolic
  24964.  information for .EXE files produced with LINK 5.10. In other words,
  24965.  if LINK 5.10 (supplied with C 6.00) is used for linking, then
  24966.  CodeView 3.00 is the ONLY matched version of CodeView that can
  24967.  display the program's symbolic information.
  24968.  
  24969.  CodeView Version 2.35 is matched to LINK 5.05 (both were released with
  24970.  BASIC 7.00). Therefore, CodeView 2.35 is the ONLY version of CodeView
  24971.  that can display symbolic information for a program linked with LINK
  24972.  5.05.
  24973.  
  24974.  For CodeView Versions 2.00, 2.10, 2.20, and 2.30, any linker with a
  24975.  version number from 3.60 to 5.03 is acceptable.
  24976.  
  24977.  For CodeView Versions 1.00 and 1.10, LINK versions later than or equal
  24978.  to 3.51, but earlier than 3.60, must be used.
  24979.  
  24980.  
  24981.  115. Mouse Disabled When Single-Stepping over Video Mode Change
  24982.  
  24983.  Product Version(s): 2.20 2.30
  24984.  Operating System:   OS/2
  24985.  Flags: ENDUSER | buglist2.20 buglist2.30
  24986.  Last Modified: 21-JUN-1989    ArticleIdent: Q45617
  24987.  
  24988.  When CodeView is run in the OS/2 compatibility box with screen
  24989.  swapping enabled (started with either /s or /43), single-stepping (F8)
  24990.  over a _setvideomode() call or an INT 10 call to change the video mode
  24991.  to a graphics mode causes the mouse cursor to disappear. Exiting
  24992.  CodeView and running another mouse-driven program reveals that the
  24993.  mouse has been completely disabled in the compatibility box. The only
  24994.  way to regain the mouse is to reboot the computer. Attempting to
  24995.  reload the mouse by typing "mouse" at a prompt results in the
  24996.  following message:
  24997.  
  24998.     Session Title: DOS Command Prompt
  24999.  
  25000.  This error occurs because a DOS mode program changes an interrupt
  25001.  vector that is owned by the system causing the program to end.
  25002.  
  25003.  The behavior described above applies to tracing in SOURCE mode.
  25004.  Attempting to trace in assembly language or mixed mode through the
  25005.  code that changes the video mode produces erratic results, which range
  25006.  from hanging the DOS box to halting the entire system with an
  25007.  "internal processing error."
  25008.  
  25009.  Microsoft has confirmed this to be a problem in CodeView Versions 2.20
  25010.  and 2.30. We are researching this problem and will post new information
  25011.  as it becomes available.
  25012.  
  25013.  The following program illustrates the problem:
  25014.  
  25015.  #include <graph.h>
  25016.  
  25017.  void main(void)
  25018.  {
  25019.    _setvideomode(_ERESCOLOR);    /* when this line is executed, the  */
  25020.                                  /* mouse cursor will disappear.     */
  25021.    _setvideomode(_DEFAULTMODE);
  25022.  
  25023.  }
  25024.  
  25025.  
  25026.  116. CodeView "??" Command Can't Show All of Large Structures
  25027.  
  25028.  Product Version(s): 2.20 2.30 | 2.20 2.30
  25029.  Operating System:   MS-DOS    | OS/2
  25030.  Flags: ENDUSER | SR# G890607-19918
  25031.  Last Modified:  8-AUG-1989    ArticleIdent: Q45624
  25032.  
  25033.  Question:
  25034.  
  25035.  How can I view structures with many members in CodeView with the "??"
  25036.  command? It shows only those members that fit on the screen. Is there
  25037.  some trick I haven't found?
  25038.  
  25039.  Response:
  25040.  
  25041.  Unfortunately, the "??" command is limited in this respect -- there is
  25042.  no way to view the last members of a large structure with this
  25043.  command. This feature is under review and will be considered for
  25044.  inclusion in a future release.
  25045.  
  25046.  Instead, however, you can view each element of the structure by itself
  25047.  by dereferencing the struct and element, i.e., "?structname.field".
  25048.  
  25049.  There are at least two ways to work around the problem in CodeView
  25050.  Versions 2.20 and 2.30. One way is to shrink or nest the structures.
  25051.  Another workaround is to use the "?" or Watch command to look at the
  25052.  individual member(s) you want to see.
  25053.  
  25054.  
  25055.  117. Problem Debugging StartSession from a Child Process
  25056.  
  25057.  Product Version(s): 2.30
  25058.  Operating System:   OS/2
  25059.  Flags: ENDUSER | buglist2.30
  25060.  Last Modified:  9-AUG-1989    ArticleIdent: Q45707
  25061.  
  25062.  When a program spawns another program that starts a new session,
  25063.  CodeView has difficulty stepping into that new session. This process
  25064.  is shown graphically in the following diagram:
  25065.  
  25066.         --------------        -------------------
  25067.     A --| DosExecPgm |--> B --| DosStartSession |--> C
  25068.         --------------        -------------------
  25069.  
  25070.  The following describes how to duplicate this process and re-create
  25071.  the problem:
  25072.  
  25073.  1. Invoke CodeView on Program A with offspring debugging enabled, as
  25074.     follows:
  25075.  
  25076.        CVP /O A
  25077.  
  25078.  2. Program A calls DosExecPgm to spawn Program B. Trace into Program B
  25079.     by pressing F8 on the DosExecPgm function. You will be informed
  25080.     that a new process has begun and you will be asked if you wish to
  25081.     debug it. Answer yes and switch to the newly created CodeView
  25082.     session.
  25083.  
  25084.  3. Program B calls DosStartSession to begin a new session. The program
  25085.     that will execute in that session is Program C. Attempt to trace
  25086.     into the new session by pressing F8 on the DosStartSession function.
  25087.  
  25088.  The problem is demonstrated in Step 3. CodeView does not give you the
  25089.  opportunity to debug Program C as it should. Further, when Program B
  25090.  has completed execution and CodeView returns back to Program A, the
  25091.  first single step will inform you that a new process has been started.
  25092.  This message should have been presented on the call to
  25093.  DosStartSession.
  25094.  
  25095.  CodeView has no difficulty stepping into a new session when the
  25096.  initial program being debugged is Program B. To work around this
  25097.  problem, invoke CodeView on Program B with the /O switch.
  25098.  
  25099.  Microsoft has confirmed this to be a problem with CodeView Version
  25100.  2.30. We are researching this problem and will post new information
  25101.  as it becomes available.
  25102.  
  25103.  The following three modules demonstrate this problem:
  25104.  
  25105.  //***********************************************************
  25106.  // A.C - spawn a child from here.
  25107.  
  25108.  #define INCL_BASE
  25109.  #include <os2.h>
  25110.  
  25111.  void main (void)
  25112.  {
  25113.    char        failbuf[80];
  25114.    RESULTCODES ExecCode;
  25115.  
  25116.    DosExecPgm (failbuf, 40, EXEC_ASYNC, NULL, NULL, &ExecCode, "B.EXE");
  25117.    VioWrtTTY ("End of A.\r\n", 11, 0);
  25118.  }
  25119.  
  25120.  //***********************************************************
  25121.  // B.C - start a new session from here.
  25122.  
  25123.  #define INCL_BASE
  25124.  #include <os2.h>
  25125.  #include <string.h>
  25126.  
  25127.  void main (void)
  25128.  {
  25129.    USHORT    Disk;
  25130.    ULONG     Drives;
  25131.    BYTE      SessionProg [80];
  25132.    USHORT    MaxLen = sizeof(SessionProg)-14;
  25133.    STARTDATA StartData;
  25134.    USHORT    Session;
  25135.    USHORT    Process;
  25136.  
  25137.    // Build program name to run in new session.
  25138.    DosQCurDisk (&Disk, &Drives);
  25139.    strcpy (SessionProg, "*:\\");
  25140.    SessionProg[0] = (char) ('A' + Disk - 1);
  25141.    DosQCurDir (0, SessionProg + strlen(SessionProg), &MaxLen);
  25142.    strcat (SessionProg, "\\C.EXE");
  25143.  
  25144.    StartData.Length      = sizeof(STARTDATA);
  25145.    StartData.Related     = 1;
  25146.    StartData.FgBg        = 0;
  25147.    StartData.TraceOpt    = 0;
  25148.    StartData.PgmTitle    = "Test Session";
  25149.    StartData.PgmName     = SessionProg;
  25150.    StartData.PgmInputs   = "sample param";
  25151.    StartData.TermQ       = NULL;
  25152.    StartData.Environment = NULL;
  25153.    StartData.InheritOpt  = 0;
  25154.    StartData.SessionType = 1;
  25155.    StartData.IconFile    = NULL;
  25156.    StartData.PgmHandle   = 0;
  25157.  
  25158.    DosStartSession (&StartData, &Session, &Process);
  25159.    VioWrtTTY ("End of B.\r\n", 11, 0);
  25160.  }
  25161.  
  25162.  //***********************************************************
  25163.  // C.C - the test session.
  25164.  
  25165.  #define INCL_VIO
  25166.  #include <os2.h>
  25167.  
  25168.  void main (void)
  25169.  {
  25170.    VioWrtTTY ("In test session", 15, 0);
  25171.  }
  25172.  
  25173.  
  25174.  118. CodeView Skips Over a Line of Source Code
  25175.  
  25176.  Product Version(s): 2.20 2.30 | 2.20 2.30
  25177.  Operating System:   MS-DOS    | OS/2
  25178.  Flags: ENDUSER | S_QuickC
  25179.  Last Modified: 14-AUG-1989    ArticleIdent: Q46010
  25180.  
  25181.  After setting a breakpoint on the indicated line in the program below
  25182.  and executing the program, CodeView executes that line without
  25183.  stopping. Likewise, if you single step through the code, CodeView
  25184.  steps past that line. This problem also occurs in the QuickC
  25185.  integrated debugger.
  25186.  
  25187.  The workaround is to flip your source into mixed mode and set the
  25188.  breakpoint on the correct assembly line.
  25189.  
  25190.  This is due to the fact that CodeView is line-based and the C compiler
  25191.  is token-based. This will not be corrected; it is a restriction.
  25192.  
  25193.  Sample Program
  25194.  --------------
  25195.  
  25196.  int i, j, k, l;
  25197.  
  25198.  void main(void)
  25199.  {
  25200.      for(i = 0; i < 20; i++)
  25201.      {
  25202.          j = 0;
  25203.          for(k = 0; k < 20; k++)
  25204.              if(j == 0)
  25205.                  break;
  25206.  
  25207.          j = 1; /*** set breakpoint here ***/
  25208.      }
  25209.  
  25210.      l = 0;
  25211.  }
  25212.  
  25213.  
  25214.  119. Capabilities and Limits of the /R switch on 80386 Machines
  25215.  
  25216.  Product Version(s): 2.20 2.30 2.35 3.00 | 2.20 2.30 2.35 3.00
  25217.  Operating System:   MS-DOS              | OS/2
  25218.  Flags: ENDUSER | 386
  25219.  Last Modified: 12-APR-1990    ArticleIdent: Q46448
  25220.  
  25221.  The /R command line switch for CodeView beginning with Version 2.20 is
  25222.  used only on 80386 machines. The /R switch tells CodeView to use the
  25223.  four debug registers available on the 80386 chip, and also allows
  25224.  hardware breakpoints. This causes CodeView to run faster when
  25225.  performing debugger-intensive steps such as monitoring a tracepoint.
  25226.  
  25227.  The /R switch works under DOS and OS/2's DOS compatibility box. It is
  25228.  an unrecognized switch under OS/2. The /R switch speeds operation of
  25229.  Tracepoint but not Watchpoint or Breakpoint commands.
  25230.  
  25231.  Note: because there are only four debug registers, only four
  25232.  tracepoints (of up to 4 bytes each) may be specified when utilizing
  25233.  these registers. Specifying any combination of tracepoints greater
  25234.  than 16 bytes will require CodeView to use software tracepoints rather
  25235.  than the debug registers and all performance gains will be lost.
  25236.  
  25237.  
  25238.  120. Using CodeView /2 with Hercules Graphics Cards and Libraries
  25239.  
  25240.  Product Version(s): 2.20 2.30
  25241.  Operating System:   MS-DOS
  25242.  Flags: ENDUSER |
  25243.  Last Modified: 16-OCT-1990    ArticleIdent: Q46949
  25244.  
  25245.  Using CodeView in the dual-monitor mode with a Hercules graphics card
  25246.  as the primary (application) monitor requires the Hercules card to be
  25247.  configured in the half mode. Using the Hercules graphics library, the
  25248.  monitor must be configured using the config(0) function call. This
  25249.  function call is a part of the Hercules graphics library and does not
  25250.  use Microsoft graphics library or the MSHERC.COM program. Therefore,
  25251.  this information applies only if you are using the Hercules graphics
  25252.  libraries. This is NOT the same as using the /h switch with CodeView.
  25253.  
  25254.  The first page of the Hercules graphics display card is mapped to
  25255.  memory location B0000 (same as MDA), and the second page is mapped to
  25256.  B8000. The CGA/EGA/VGA also use B8000 as the beginning of their video
  25257.  memory. CodeView uses these two different address to run in the
  25258.  dual-monitor mode, sending the application output to the primary
  25259.  address, usually located at B8000, and the CodeView information to the
  25260.  secondary monitor, usually located at B0000.
  25261.  
  25262.  This works well until a Hercules graphics card is used as the primary
  25263.  monitor (in graphics mode) and the CGA/EGA/VGA card is used as the
  25264.  secondary monitor. The Hercules graphics card uses both pages (one at
  25265.  B0000 and the other at B8000) in the full mode. Therefore, use
  25266.  config(0) and only the first page (B0000) will be used and CodeView
  25267.  will function properly in dual-monitor mode.
  25268.  
  25269.  
  25270.  121. DEF File Entry of EXECUTEONLY Causes Problems with CVP
  25271.  
  25272.  Product Version(s): 2.20 2.30
  25273.  Operating System:   OS/2
  25274.  Flags: ENDUSER |
  25275.  Last Modified: 30-AUG-1989    ArticleIdent: Q47103
  25276.  
  25277.  Question:
  25278.  
  25279.  When I step into my DLL, I can see and step through the source code
  25280.  correctly. I also can look at local variables. However, I cannot set
  25281.  breakpoints in the DLL. Also, when I try to look at the disassembled
  25282.  code I see the following:
  25283.  
  25284.     ??? No Code ???
  25285.  
  25286.  I am using the correct Compile and Link options. Why is CodeView
  25287.  acting strangely?
  25288.  
  25289.  Response:
  25290.  
  25291.  In the .DEF file for the DLL, you had the EXECUTEONLY attribute as
  25292.  opposed to the default EXECUTEREAD. When you choose EXECUTEONLY,
  25293.  CodeView cannot read the code segment as it must to work correctly.
  25294.  Removing the EXECUTEONLY attribute corrects the problem.
  25295.  
  25296.  
  25297.  122. OS/2 SDK Version of CVP 2.30 Won't Debug DosLoadModule DLLs
  25298.  
  25299.  Product Version(s): 2.30
  25300.  Operating System:   OS/2
  25301.  Flags: ENDUSER |
  25302.  Last Modified: 11-JUL-1990    ArticleIdent: Q59610
  25303.  
  25304.  The OS/2 version 1.10 Software Development Kit (SDK) includes a
  25305.  prerelease version of protected-mode CodeView (CVP) version 2.30. This
  25306.  version is identical to the regular retail release of CVP 2.30, except
  25307.  that it does not allow the debugging of DLLs loaded with
  25308.  DosLoadModule. The regular retail version of CVP 2.30 is included with
  25309.  FORTRAN 5.00 and the OS/2 Presentation Manager Toolkit for OS/2
  25310.  version 1.10. This release DOES support debugging DLLs loaded at run
  25311.  time with DosLoadModule.
  25312.  
  25313.  The prerelease version of CVP 2.30 released in the OS/2 SDK may be
  25314.  identified by a file date of 2-24-89. The regular release version is
  25315.  dated 3-21-89. The file date is the only discernible difference
  25316.  between these two versions since the files themselves are exactly the
  25317.  same size.
  25318.  
  25319.  
  25320.  123. Minimum Extended Memory (384K) Causes CV 3.00 to Use Extra RAM
  25321.  
  25322.  Product Version(s): 3.00
  25323.  Operating System:   MS-DOS
  25324.  Flags: ENDUSER | docerr HIMEM
  25325.  Last Modified: 27-SEP-1990    ArticleIdent: Q59890
  25326.  
  25327.  Real-mode CodeView (CV) Version 3.00 is documented as being able to
  25328.  run in extended memory as long as there is at least 384K of extended
  25329.  memory available. This 384K minimum is accurate as far as CV being
  25330.  able to utilize the extended memory, but it is not enough for CodeView
  25331.  to remove all of itself from conventional RAM. In fact, a system
  25332.  configuration with only 384K extended memory will result in LESS
  25333.  memory being available for the debuggee (the program being debugged)
  25334.  than if no extended memory is utilized at all.
  25335.  
  25336.  The CodeView 3.00 documentation states that "if HIMEM.SYS or another
  25337.  extended-memory driver is installed, all but 16K of CodeView, plus all
  25338.  of the symbolic information for the program you are debugging, are
  25339.  placed in extended memory." But, for CodeView to truly work with this
  25340.  16K "footprint" in conventional memory, a minimum of approximately
  25341.  600K extended memory must be available.
  25342.  
  25343.  When no extended memory is available, CodeView normally utilizes
  25344.  overlays to keep as much of itself out of memory as possible, so that
  25345.  the debuggee can have more space to load. (The new /Dnnn option
  25346.  actually allows you to specify the size of the overlays -- a bigger
  25347.  overlays means CV runs faster, but a smaller overlays mean a bigger
  25348.  program can be loaded for debugging.)
  25349.  
  25350.  Once CodeView detects extended memory, it assumes that overlays are no
  25351.  longer needed, since CV itself and the debuggee's symbolic information
  25352.  will both (supposedly) be loaded into extended memory. However, the
  25353.  result may be that CodeView seems to get bigger because what Codeview
  25354.  can't fit into extended memory is loaded into conventional memory.
  25355.  
  25356.  Since no overlays are used, this can result in a much larger
  25357.  footprint. For instance, if the minimum of 384K extended memory is all
  25358.  that is available, then the footprint will be well over 200K.
  25359.  Obviously, as the amount of extended memory is increased from 384K,
  25360.  the footprint will shrink accordingly.
  25361.  
  25362.  The /X command-line option instructs CodeView to use extended memory.
  25363.  However, CV will automatically detect extended memory and use it if it
  25364.  is available. Consequently, if the /X option is not specified, CodeView
  25365.  will still use extended memory.
  25366.  
  25367.  Thus, if you have a limited amount of extended memory and decide to
  25368.  run CodeView in conventional RAM only, you have two options. You can
  25369.  explicitly specify /D (for example, /D16) to tell CodeView to use
  25370.  overlays, or you can remove (or comment out) the line in your
  25371.  CONFIG.SYS file that loads the extended memory driver (HIMEM.SYS) and
  25372.  reboot.
  25373.  
  25374.  
  25375.  124. If COMSPEC Is Invalid, Invoking DOS Shell May Hang Machine
  25376.  
  25377.  Product Version(s): 2.x 3.00
  25378.  Operating System:   MS-DOS
  25379.  Flags: ENDUSER | s_quickc s_pwb s_quickasm s_editor
  25380.  Last Modified: 19-APR-1990    ArticleIdent: Q60748
  25381.  
  25382.  If you set your COMSPEC environment variable to point to an invalid
  25383.  command interpreter, and then shell out of any DOS application, your
  25384.  machine will hang. This problem occurs because the file that COMSPEC
  25385.  points to is assumed to be a valid command interpreter and cannot be
  25386.  checked for validity.
  25387.  
  25388.  This is expected behavior. Because .COM files have no standard file
  25389.  header structure, they cannot be checked for validity. Therefore, DOS
  25390.  must assume that whatever the COMSPEC environment variable points to
  25391.  must be a valid command interpreter, and can do no further error
  25392.  checking.
  25393.  
  25394.  This behavior can easily be demonstrated in any program that allows
  25395.  you to access a DOS shell, including CodeView, Programmer's WorkBench
  25396.  (PWB), the Microsoft Editor (M), and the Quick environments. Type the
  25397.  following line at the DOS prompt:
  25398.  
  25399.     set comspec=a:\foo.c ; Invalid command.com file
  25400.  
  25401.  Then enter a DOS application and shell out. Your machine will hang,
  25402.  and you may receive strange error messages.
  25403.  
  25404.  If you are running under OS/2, you will be warned about an invalid
  25405.  command interpreter when you attempt to shell to the operating system.
  25406.  Under OS/2, the system expects an .EXE file to be the command
  25407.  interpreter, and .EXE files have a standard, recognizable structure
  25408.  that can be checked.
  25409.  
  25410.  
  25411.  125. /I Documented Incorrectly in "Advanced Programming Techniques"
  25412.  
  25413.  Product Version(s): 3.00   | 3.00
  25414.  Operating System:   MS-DOS | OS/2
  25415.  Flags: ENDUSER | docerr
  25416.  Last Modified: 19-APR-1990    ArticleIdent: Q60829
  25417.  
  25418.  In Section 9.7, "Controlling CodeView with Command-Line Options," on
  25419.  Page 204 of the "Microsoft C Advanced Programming Techniques" manual,
  25420.  it incorrectly states that the /I switch (used to turn the nonmaskable
  25421.  interrupts and 8259 interrupts on or off) is followed by either a 1 or
  25422.  a 2 (either /I1 or /I2).
  25423.  
  25424.  The correct switch options are /I0 to trap these interrupts, or /I1 to
  25425.  ignore these interrupts. Both the online documentation and the
  25426.  "Microsoft C Reference" give this correct usage of the /I switch.
  25427.  
  25428.  
  25429.  126. OS/2 1.20 Requirements for Dual-Monitor Debugging
  25430.  
  25431.  Product Version(s): 2.x 3.00
  25432.  Operating System:   OS/2
  25433.  Flags: ENDUSER | PM
  25434.  Last Modified: 17-JUL-1990    ArticleIdent: Q60866
  25435.  
  25436.  To do dual-monitor debugging under OS/2 Version 1.20 with CodeView,
  25437.  make sure that you have the correct display DLLs specified in your
  25438.  CONFIG.SYS file.
  25439.  
  25440.  For example, the following three lines in your OS/2 CONFIG.SYS file
  25441.  specify the device drivers needed to use a VGA and a monochrome
  25442.  adapter:
  25443.  
  25444.     set video_devices=bvh_vga,bvh_mpa
  25445.     set bvh_vga=device(bvhvga)
  25446.     set bvh_mpa=device(bvhmpa)
  25447.  
  25448.  If you have a CGA or an EGA monitor and adapter for your primary
  25449.  (color) display, replace device(bvhvga) with device(bvhcga) or
  25450.  device(bvhega), depending on your adapter type.
  25451.  
  25452.  Next, make sure that both of the BVH*.DLL files (in the above case,
  25453.  BVHVGA.DLL and BVHMPA.DLL) specified in the device(name) section are
  25454.  in your LIBPATH. OS/2 setup places these files in your C:\OS2\DLL
  25455.  directory by default.
  25456.  
  25457.  Note: You can substitute any name for bvh_vga or bvh_mpa, as long as
  25458.  those two placeholders match up with the name tab in the set
  25459.  <name>=device... lines.
  25460.  
  25461.  Remember, the two monitors must be unique for OS/2 to determine which
  25462.  monitor is which. For instance, debugging with two VGA monitors will
  25463.  not work because OS/2 and, therefore, CodeView will be unable to
  25464.  determine which adapter/monitor is the primary adapter/monitor and
  25465.  which is the secondary adapter/monitor.
  25466.  
  25467.  This point is critical to remember when considering dual-monitor
  25468.  debugging on a microchannel machine (for example, an IBM PS/2 Model 50
  25469.  and above). Since there are currently no microchannel monochrome
  25470.  adapter cards on the market, the only alternative is to use a VGA and
  25471.  an 8514 as the two monitors. The following are the matching three
  25472.  lines for your OS/2 CONFIG.SYS file for that scenario:
  25473.  
  25474.     set video_devices=bvh_vga,bvh_8514
  25475.     set bvh_8514=device(bvh8514)
  25476.     set bvh_vga=device(bvhvga)
  25477.  
  25478.  Using this setup, the 8514 monitor displays the graphics output (or
  25479.  the Presentation Manager screen) and the VGA is the debug monitor and
  25480.  displays all text output.
  25481.  
  25482.  
  25483.  127. Debugging Large DOS Applications in CodeView 3.0 with /X /E /D
  25484.  
  25485.  Product Version(s): 3.00
  25486.  Operating System:   MS-DOS
  25487.  Flags: ENDUSER |
  25488.  Last Modified: 15-MAY-1990    ArticleIdent: Q61473
  25489.  
  25490.  CodeView version 3.00 includes enhanced support for debugging
  25491.  applications under DOS. CodeView 3.00 may access extended memory or
  25492.  expanded memory, or the size of the overlay swap area that CodeView
  25493.  uses may be adjusted.
  25494.  
  25495.  CodeView 3.00 offers three command-line parameters (/X, /E, and /D)
  25496.  for specifying memory utilization. If you DO NOT specify the /X, /E,
  25497.  or /D options when you start a CodeView session, CodeView will
  25498.  automatically search for extended memory. If CodeView finds extended
  25499.  memory, it will place the symbolic information and most of itself into
  25500.  extended memory (as long as enough extended memory is available).
  25501.  
  25502.  If there is no extended memory on your system, Codeview will search
  25503.  for expanded memory. If there is expanded memory, Codeview will place
  25504.  the symbolic information for your program in expanded memory.
  25505.  
  25506.  If there is no extended or expanded memory on your machine, CodeView
  25507.  will load itself, your application, and symbolic information for your
  25508.  program in base memory.
  25509.  
  25510.  Since CodeView does this automatic scan for extended and expanded
  25511.  memory, the /X and /E switches are needed only if you explicitly want
  25512.  to specify the use of one form of memory or the other and you do not
  25513.  want to enter CodeView if this memory type is not available.
  25514.  
  25515.  CodeView's /X option tells the debugger to load into extended memory
  25516.  ONLY, and to return an error message if extended memory is not
  25517.  available on your system. This message has the following form:
  25518.  
  25519.     CV1302 Error: /X : HIMEM.SYS not loaded
  25520.  
  25521.  CodeView's /E option tells the debugger to access expanded memory
  25522.  ONLY, and to return an error message if there is no expanded memory on
  25523.  your machine. This message has the following form:
  25524.  
  25525.     CV1304 Error: /E : EMM driver not loaded
  25526.  
  25527.  CodeView's /D option specifies that CodeView should use disk overlays.
  25528.  When you use this option, you can also specify a decimal size in
  25529.  kilobytes between 16K and 128K to explicitly set the overlay swap area
  25530.  size. The default size of the swap area is 64K if /D is used but no
  25531.  size is explicitly specified. If extended and expanded memory are not
  25532.  available, /D will not need to be specified for the default 64K
  25533.  overlay swap area to be used.
  25534.  
  25535.  A larger overlay swap area allows CodeView to run faster because it
  25536.  doesn't have to swap to disk as frequently as with a smaller swap
  25537.  area, but it means more memory is used up by CodeView itself. A
  25538.  smaller swap area allows you to debug larger applications under DOS,
  25539.  but CodeView runs slower because of the more frequent need to swap
  25540.  code from disk to memory.
  25541.  
  25542.  
  25543.  128. P70 Display Creates Problems Under CodeView and PWB
  25544.  
  25545.  Product Version(s): 3.00
  25546.  Operating System:   OS/2
  25547.  Flags: ENDUSER | buglist3.00 S_PWB S_Editor
  25548.  Last Modified: 15-AUG-1990    ArticleIdent: Q61557
  25549.  
  25550.  CodeView version 3.00 and Programmer's WorkBench (PWB) version 1.00
  25551.  have problems recognizing the built-in monitor of IBM P70 portables
  25552.  under OS/2. Symptoms of this problem include the following error
  25553.  messages:
  25554.  
  25555.     Product     Error Message
  25556.     -------     -------------
  25557.  
  25558.     CodeView    Internal Debugger Error 0 at load time
  25559.     PWB         Inability to change from 43-line mode
  25560.  
  25561.  Microsoft has confirmed this to be a problem with CodeView version
  25562.  3.00. We are researching this problem and will post new information
  25563.  here as it becomes available.
  25564.  
  25565.  This problem is directly related to the video configuration of the IBM
  25566.  P70. In its documentation, IBM mentions briefly that it might be
  25567.  necessary to type MODE CO80 to make some software recognize the
  25568.  built-in plasma display. An added condition for PWB and CodeView is
  25569.  the necessity of being in 43-line mode. PWB automatically places you
  25570.  in 43-line mode no matter what you previous mode was and thus gets
  25571.  around this limitation. If you attempts to change the height switch
  25572.  while editing, PWB doesn't complain but still stays in 43-line mode.
  25573.  
  25574.  CodeView cannot make the mode change in the same way that PWB can. If
  25575.  invoked without the above considerations, CodeView will crash with an
  25576.  Internal Debugger Error 0. The following are several ways to work
  25577.  around this problem if want to use CodeView with this type of
  25578.  configuration.
  25579.  
  25580.  1. Type MODE CO80 or BW80 and invoke CodeView with the /43 switch.
  25581.  
  25582.  2. Type MODE CO80,43 or BW80,43 before invoking CodeView.
  25583.  
  25584.  3. Use an external monitor with the built-in VGA port.
  25585.  
  25586.  4. Invoke CodeView from PWB, which makes the change automatically.
  25587.  
  25588.  
  25589.  129. CodeView Does Not Reset Initial Graphics Mode on Exit
  25590.  
  25591.  Product Version(s): 2.x 3.00    | 2.x 3.00
  25592.  Operating System:   MS-DOS      | OS/2
  25593.  Flags: ENDUSER |
  25594.  Last Modified: 29-MAY-1990    ArticleIdent: Q61611
  25595.  
  25596.  When CodeView exits, it leaves the screen in the current video mode
  25597.  and does not reset the mode to the mode that was active when CodeView
  25598.  was initially loaded.
  25599.  
  25600.  This behavior is by design. However, if you start CodeView with the /s
  25601.  option to enable screen swapping, the video mode that was active when
  25602.  CodeView was loaded will be reset because CodeView has separate
  25603.  swappable video memory pages to hold the output screen as well as the
  25604.  CodeView screen.
  25605.  
  25606.  
  25607.  130. CV 3.00 Gives R6000, Hangs When Accessing Help During Start-Up
  25608.  
  25609.  Product Version(s): 3.00
  25610.  Operating System:   MS-DOS
  25611.  Flags: ENDUSER | buglist3.00 fixlist3.10
  25612.  Last Modified:  5-FEB-1991    ArticleIdent: Q61919
  25613.  
  25614.  Accessing help in the "Enter directory for filename.c (cr for none)?"
  25615.  window results in the following error in CodeView version 3.00:
  25616.  
  25617.     run-time error R6000
  25618.     -stack overflow
  25619.  
  25620.  Then, the machine hangs requiring a cold reboot.
  25621.  
  25622.  To reproduce the error, do the following:
  25623.  
  25624.  1. Compile and link a program with symbolic information for CodeView.
  25625.  
  25626.  2. Delete or rename the source file and then go into CodeView. A
  25627.     window will appear asking you to "Enter directory for filename.c
  25628.     (cr for none)?".
  25629.  
  25630.  3. Choose the Help option at the bottom of the window. The run-time
  25631.     error message will be printed over the CodeView screen and the machine
  25632.     will be hung.
  25633.  
  25634.  The problem does not occur under OS/2.
  25635.  
  25636.  Microsoft has confirmed this to be a problem in CodeView version 3.00.
  25637.  This problem was corrected in CodeView version 3.10.
  25638.  
  25639.  
  25640.  131. CodeView 3.00 Fades with Monochrome VGA
  25641.  
  25642.  Product Version(s): 3.00   | 3.00
  25643.  Operating System:   MS-DOS | OS/2
  25644.  Flags: ENDUSER |
  25645.  Last Modified: 11-JUL-1990    ArticleIdent: Q61970
  25646.  
  25647.  If you invoke CodeView version 3.00 on certain machines with
  25648.  monochrome VGA monitors and then trace through several lines of code,
  25649.  the screen will fade and become unreadable. Exiting and re-entering
  25650.  CodeView refreshes the screen, but the screen immediately starts to
  25651.  fade again.
  25652.  
  25653.  This problem is caused by an error in the video ROM BIOS and has been
  25654.  verified to occur on the following machines:
  25655.  
  25656.  l. PS/2 Model P70 with monochrome VGA
  25657.  
  25658.  2. Siemens with Video 7 monochrome VGA
  25659.  
  25660.  3. Northgate 386 with Video 16 monochrome VGA
  25661.  
  25662.  The following are different methods of working around this problem:
  25663.  
  25664.  1. Switch into color mode using the mode CO80 command (may not have
  25665.     any effect).
  25666.  
  25667.  2. From the options menu inside Codeview, turn flip/swap off using
  25668.     the screen-swap option.
  25669.  
  25670.     If you don't want to give up flip/swap functionality, try option 3.
  25671.  
  25672.  3. If the video BIOS is replaceable, replace it with an updated video
  25673.     BIOS.
  25674.  
  25675.  4. If the video BIOS is not replaceable, replace the card.
  25676.  
  25677.  
  25678.  132. CodeView 3.00 Hangs on gets() with Screen Swap Off
  25679.  
  25680.  Product Version(s): 3.00   | 3.00
  25681.  Operating System:   MS-DOS | OS/2
  25682.  Flags: ENDUSER | s_c s_quickc s_quickasm
  25683.  Last Modified: 25-JUL-1990    ArticleIdent: Q62663
  25684.  
  25685.  CodeView 3.00 will hang if you step or execute past a call to the
  25686.  gets() run-time routine if the Screen Swap option is turned off.
  25687.  
  25688.  Sample Code
  25689.  -----------
  25690.  
  25691.  #include <stdio.h>
  25692.  
  25693.  char string[256];
  25694.  
  25695.  void main (void)
  25696.  {
  25697.      printf ( "Enter a string: ") ;
  25698.      gets ( string ) ;
  25699.      printf ( "Echoing : %s\n", string) ;
  25700.  }
  25701.  
  25702.  Compile the above file with the following:
  25703.  
  25704.     cl /Od /Zi test.c
  25705.  
  25706.  Bring the file up in CodeView, then select the Options.Screen Swap
  25707.  option. Next, step past the gets() call. Under DOS, your machine will
  25708.  hang, and under OS/2, the current screen group will be hung.
  25709.  
  25710.  
  25711.  133. DosSetMaxFH Between 0-39 Fails Under CodeView 3.00
  25712.  
  25713.  Product Version(s): 3.00
  25714.  Operating System:   OS/2
  25715.  Flags: ENDUSER | buglist3.00
  25716.  Last Modified: 25-JUL-1990    ArticleIdent: Q62666
  25717.  
  25718.  OS/2's DosSetMaxFH routine can be called to reset the OS/2 default
  25719.  limit of a maximum of 20 open file handles to a larger number. By
  25720.  definition, DosSetMaxFH fails when trying to set the number smaller
  25721.  than the current maximum amount of handles. Under OS/2, the default
  25722.  maximum number of files is 20, so a DosSetMaxFH to a number between
  25723.  0-19 should fail.
  25724.  
  25725.  However, under CodeView 3.00, calling DosSetMaxFH with a number
  25726.  between 0-39 will return a fail value.
  25727.  
  25728.  Sample Code
  25729.  -----------
  25730.  
  25731.  /* compile with : cl /Od /Zi file.c */
  25732.  
  25733.  #define INCL_DOSFILEMGR
  25734.  
  25735.  #include <stdio.h>
  25736.  #include <os2.h>
  25737.  
  25738.  void main(void)
  25739.  {
  25740.     int i;
  25741.     for ( i = 0 ; i < 1000 ; i ++ )
  25742.  
  25743.     if ( DosSetMaxFH ( i ) )
  25744.     {
  25745.        printf ( " DosSetMaxFH to %d failed!\n ",i ) ;
  25746.     }
  25747.  }
  25748.  
  25749.  This program prints the error message on parameters from 0 to 39.
  25750.  
  25751.  You can call the DosSetMaxFH routine to set at least 40 file handles
  25752.  to work around this problem.
  25753.  
  25754.  
  25755.  134. CV Limits Input of Period Character (2Eh) into Memory Window
  25756.  
  25757.  Product Version(s): 3.00 3.10 | 3.00 3.10
  25758.  Operating System:   MS-DOS    | OS/2
  25759.  Flags: ENDUSER | buglist3.00 buglist3.10 decimal point dot
  25760.  Last Modified: 31-AUG-1990    ArticleIdent: Q65241
  25761.  
  25762.  When viewing memory in byte format in a memory window in CodeView
  25763.  version 3.00 or 3.10, you cannot change the value of a byte in memory
  25764.  to the hexadecimal value 2E. The hex value 2E has an ASCII character
  25765.  equivalent of the period ("."). In CodeView, a period is used to
  25766.  display any nondisplayable character (for example, null, a carriage
  25767.  return, control characters, etc.), which means the period character
  25768.  can sometimes have special meaning to CodeView when it appears in a
  25769.  memory window.
  25770.  
  25771.  Because of the special usage of the period character in a memory
  25772.  window, CodeView does not allow periods to be typed directly into
  25773.  memory. In CodeView 3.00, attempts to change a byte value to 2E
  25774.  results in either the 2 or the E being entered and the other digit
  25775.  being ignored, depending on which value you enter first. In CodeView
  25776.  3.10, both the 2 and the E are returned to their original values once
  25777.  they have both been entered. If you move to the right side of the
  25778.  memory window where the ASCII equivalents are shown and you try to
  25779.  type in a period there, CodeView will also ignore that input.
  25780.  
  25781.  If you switch the memory window so that you are viewing memory in
  25782.  ASCII mode, actual periods can be typed in to any memory location.
  25783.  However, there is a problem with this because ALL other periods on the
  25784.  same line, which really represent various nondisplayable ASCII
  25785.  characters, are all converted to 2Es.
  25786.  
  25787.  If you use are viewing memory in a format other than bytes or ASCII,
  25788.  CodeView will allow a 2E to be entered. The workaround, then, if a
  25789.  period needs to be entered into memory, is to choose a different
  25790.  viewing mode other than ASCII or byte-mode, and then enter the period
  25791.  in the desired location as the value 2E. You can cycle through the
  25792.  available memory viewing modes by repeatedly pressing SHIFT+F3, or you
  25793.  can select the desired mode from the Memory Window option on the
  25794.  Options menu.
  25795.  
  25796.  Microsoft has confirmed this to be a problem in CodeView versions 3.00
  25797.  and 3.10. We are researching this problem and will post new
  25798.  information here as it becomes available.
  25799.  
  25800.  
  25801.  135. CV 3.00 Incorrectly Documents helpbuffer Switch as helpbuffers
  25802.  
  25803.  Product Version(s): 3.00   | 3.00
  25804.  Operating System:   MS-DOS | OS/2
  25805.  Flags: ENDUSER | docerr
  25806.  Last Modified: 25-FEB-1991    ArticleIdent: Q63236
  25807.  
  25808.  In the "Configure CodeView" section of the online help for CodeView
  25809.  version 3.00, the "helpbuffer" switch is incorrectly listed as
  25810.  follows:
  25811.  
  25812.     helpbuffers:<size>
  25813.  
  25814.  This switch should be spelled as follows:
  25815.  
  25816.     helpbuffer:<size>
  25817.  
  25818.  CodeView will not recognize the first spelling. The correct spelling
  25819.  was incorporated into the online help beginning with CodeView version
  25820.  3.10.
  25821.  
  25822.  
  25823.  136. CodeView Crashes in DOS on "Drive Not Ready" Error
  25824.  
  25825.  Product Version(s): 3.00
  25826.  Operating System:   MS-DOS
  25827.  Flags: ENDUSER | buglist3.00
  25828.  Last Modified: 25-JUL-1990    ArticleIdent: Q64026
  25829.  
  25830.  CodeView version 3.00 may hang after encountering a "Drive Not Ready"
  25831.  error. This error may occur if a file is opened on Drive A and a disk
  25832.  is not in the drive.
  25833.  
  25834.  To reproduce this problem, compile the following program with CodeView
  25835.  options (cl /Zi /Od):
  25836.  
  25837.     main () {
  25838.       FILE *fp;
  25839.       fp = fopen("a:\readme.doc","r");
  25840.     }
  25841.  
  25842.  If you run the program in CodeView version 3.00 without a disk in
  25843.  Drive A and press F5 to run the program, the following error will
  25844.  appear:
  25845.  
  25846.     Not ready reading drive A
  25847.     Abort, Retry, Fail?
  25848.  
  25849.  Regardless of what is typed, the machine will hang and you must do a
  25850.  cold reboot to remedy the crash.
  25851.  
  25852.  Note: CodeView versions 2.20 and 2.30 do not hang the machine if the
  25853.  above steps are executed. The fopen() just returns a NULL. OS/2 also
  25854.  handles the error correctly in versions 2.20, 2.30, and 3.00 of
  25855.  CodeView.
  25856.  
  25857.  Microsoft has confirmed this to be a problem with CodeView version
  25858.  3.00. We are researching this problem and will post new information
  25859.  here as it becomes available.
  25860.  
  25861.  
  25862.  137. CV1319 Error May Be Caused by CodeView DOS Extender
  25863.  
  25864.  Product Version(s): 3.00
  25865.  Operating System:   MS-DOS
  25866.  Flags: ENDUSER | buglist3.00 fixlist3.10
  25867.  Last Modified: 31-AUG-1990    ArticleIdent: Q65242
  25868.  
  25869.  Real-mode CodeView (CV) version 3.00 (shipped with Microsoft C 6.00)
  25870.  may encounter problems on certain computers when extended memory is
  25871.  utilized for debugging programs. These problems involve the processing
  25872.  of interrupts while CodeView 3.00's internal DOS extender is being
  25873.  used to run CodeView in protected mode in conjunction with HIMEM.SYS,
  25874.  the extended memory (XMS) driver.
  25875.  
  25876.  The problems manifest themselves in various ways, due to both the
  25877.  varied interrupt handling speeds of different machines and the varied
  25878.  interactions of CodeView itself running in protected mode while the
  25879.  DOS program being debugged is still being run in real mode. The most
  25880.  common error is a protection violation, which shows up in CodeView as
  25881.  either a CV1319 error (internal error - unrecoverable fault) or as a
  25882.  system hang. The errors usually occur when you are paging through the
  25883.  code or manipulating the mouse.
  25884.  
  25885.  Registered Microsoft C 6.00 owners who are experiencing any of these
  25886.  problems with CodeView version 3.00 are encouraged to call Microsoft
  25887.  Technical Support at (206) 637-7096 to obtain information concerning a
  25888.  possible correction for these errors. However, there may be some cases
  25889.  where the only solution is to obtain a newer computer BIOS or to use
  25890.  CodeView without extended memory.
  25891.  Most reported problems have involved IBM PS/2 computers, but a number
  25892.  of these problems have also been reported on computers with an AMI
  25893.  BIOS. Note that CodeView version 3.10 includes modifications that are
  25894.  expected to eliminate most of these interrupt problems, but in some
  25895.  instances (especially with older AMI BIOS machines), an update of the
  25896.  BIOS may be the only solution.
  25897.  
  25898.  The easiest workaround to these protected-mode errors is to start
  25899.  CodeView without the use of extended memory. This can be done by
  25900.  removing the line in CONFIG.SYS that loads the HIMEM.SYS driver (and
  25901.  then rebooting the computer). Another option, if HIMEM is already
  25902.  loaded, is to start CodeView with the /D command-line option to
  25903.  specify explicitly that CodeView should use disk overlays, rather than
  25904.  extended or expanded memory. (Otherwise, if extended memory is
  25905.  available, CodeView will use the /X option by default.)
  25906.  
  25907.  Because these problems can occur only when CodeView is running in
  25908.  protected mode in extended memory, and because CodeView 3.00 requires
  25909.  HIMEM.SYS in order to run in protected mode, the problems are often
  25910.  mistakenly attributed to HIMEM.SYS. In reality, HIMEM.SYS is not
  25911.  responsible for the errors because it is just the memory manager that
  25912.  CodeView utilizes to get at extended memory. The errors are the result
  25913.  of an interrupt handling incompatibility between certain hardware
  25914.  configurations and the DOS extender built into CodeView.
  25915.  
  25916.  Microsoft has confirmed this to be a problem in CodeView version 3.00.
  25917.  This problem has been corrected in version 3.10.
  25918.  
  25919.  
  25920.  138. Label/Function Search Command Fails Under Codeview 3.00/3.10
  25921.  
  25922.  Product Version(s): 3.00 3.10 | 3.00 3.10
  25923.  Operating System:   MS-DOS    | OS/2
  25924.  Flags: ENDUSER | buglist3.00 buglist3.10
  25925.  Last Modified: 31-AUG-1990    ArticleIdent: Q65312
  25926.  
  25927.  Under CodeView versions 3.00 and 3.10, the Label/Function search
  25928.  command is described in the online help as performing a search of the
  25929.  current source window for an assembly-language label or function name.
  25930.  If the label is found, the debugger should switch from source to
  25931.  assembly mode to display a label in a library routine or assembly
  25932.  language module.
  25933.  
  25934.  In reality, this command fails with a message "Error - Unknown
  25935.  Symbol". The debugger does not switch into assembly mode. This problem
  25936.  can be reproduced by selecting Search from the CodeView menu, then
  25937.  selecting Label/Function and typing in "__chkstk" (without the
  25938.  quotation marks).
  25939.  
  25940.  Microsoft has confirmed this to be a problem with CodeView Versions
  25941.  3.00 and 3.10. We are researching this problem and will post new
  25942.  information here as it becomes available.
  25943.  
  25944.  
  25945.  139. Cannot Enable A20! with Orchid 386s
  25946.  
  25947.  Product Version(s): 3.00
  25948.  Operating System:   MS-DOS
  25949.  Flags: ENDUSER |
  25950.  Last Modified: 17-DEC-1990    ArticleIdent: Q65360
  25951.  
  25952.  Using HIMEM.SYS version 2.50 with Orchid 386/25 motherboards with the
  25953.  caching controllers can cause the following error message:
  25954.  
  25955.     Cannot enable A20!
  25956.  
  25957.  Orchid Technology has verified that this is a problem with the PAL
  25958.  chip on these motherboards. Customers who are experiencing this
  25959.  problem should call Orchid Technology at (415) 683-0300 for an update
  25960.  of their PAL chip. Please have the revision of the motherboard on hand
  25961.  when calling.
  25962.  
  25963.  
  25964.  140. Mouse Cursor on Wrong Monitor During Dual-Monitor Debugging
  25965.  
  25966.  Product Version(s): 3.00 3.10
  25967.  Operating System:   MS-DOS
  25968.  Flags: ENDUSER | H_MOUSE
  25969.  Last Modified: 17-SEP-1990    ArticleIdent: Q65528
  25970.  
  25971.  Under certain conditions, when invoking real-mode CodeView (CV) in
  25972.  dual-monitor mode with /2, the mouse cursor appears on the wrong
  25973.  monitor. When this occurs, a "sprite" mouse cursor appears on the
  25974.  monitor that the application is to run on, while the secondary monitor
  25975.  where CodeView is running does not have a mouse cursor. Several
  25976.  workarounds to this problem are given below.
  25977.  
  25978.  The sprite mouse cursor is a "graphic" arrow cursor similar to that in
  25979.  Windows 3.00 or OS/2 Presentation Manager (PM), as opposed to the
  25980.  traditional "text" block cursor that usually appears when running
  25981.  CodeView or the Programmer's WorkBench (PWB).
  25982.  
  25983.  The problem of the mouse appearing on the wrong monitor occurs only on
  25984.  computers that have "extended register" video boards, such as some of
  25985.  the Video 7 VGA cards. Certain mouse drivers enable the sprite cursor
  25986.  when they detect these extended video registers. Because a monochrome
  25987.  monitor cannot support this extended mode mouse cursor, the cursor
  25988.  fails to switch to the secondary monitor when focus is switched to
  25989.  that monitor after CodeView is invoked with the /2 switch.
  25990.  
  25991.  The following are three possible workarounds to this problem:
  25992.  
  25993.  1. Upgrade to mouse driver version 7.04 or later. This version
  25994.     provides a new switch, /Y, which can be used with either the
  25995.     MOUSE.COM program or the MOUSE.SYS device driver. The /Y switch
  25996.     tells the mouse driver to disable the sprite cursor. The mouse
  25997.     driver update can be obtained free of charge by contacting
  25998.     Microsoft Product Support Services at (206) 637-7096.
  25999.  
  26000.  2. If a mouse driver earlier than version 7.04 is used, the problem
  26001.     may be worked around by creating a batch file or adding the
  26002.     following commands to the AUTOEXEC.BAT file:
  26003.  
  26004.        mode mono
  26005.        mouse
  26006.        mode co80
  26007.  
  26008.     These commands will switch focus to the monochrome monitor while
  26009.     the mouse is being invoked and then will switch the focus back to
  26010.     the color monitor. This method will prevent the mouse driver from
  26011.     detecting the extended registers and using the sprite cursor.
  26012.  
  26013.  3. Disable the extended video registers. Check the video card
  26014.     documentation to see if this method is possible with your
  26015.     particular card.
  26016.  
  26017.  
  26018.  141. CV May Come Up Only in Monochrome with 8514/A Display Adapter
  26019.  
  26020.  Product Version(s): 3.00 3.10
  26021.  Operating System:   MS-DOS
  26022.  Flags: ENDUSER | appnote SV0337.ARC B_QuickBas
  26023.  Last Modified: 16-OCT-1990    ArticleIdent: Q65701
  26024.  
  26025.  Real-mode CodeView (CV) may display only in monochrome (black and
  26026.  white) mode on some systems with an 8514 or color VGA monitor attached
  26027.  to an 8514/A display adapter. On these systems, the installation of an
  26028.  8514/A video card causes the BIOS video functions to return an
  26029.  incorrect value indicating that a monochrome VGA monitor is attached,
  26030.  rather than a color monitor.
  26031.  
  26032.  This same BIOS information contributes to the way in which these
  26033.  versions of CodeView (and various other programs) detect the type of
  26034.  video adapter present; thus, CodeView may incorrectly determine that
  26035.  it is running on a monochrome system and may display the screen only
  26036.  in black and white.
  26037.  
  26038.  Workaround
  26039.  ----------
  26040.  
  26041.  As a workaround, an application note titled "8514/A Monochrome to
  26042.  Color Patch" is available from Microsoft Product Support Services by
  26043.  calling (206) 637-7096. This application note contains a program,
  26044.  which may be run before CodeView is invoked and which will configure
  26045.  the BIOS information correctly for CodeView to come up in color.
  26046.  The program is also available in the Software/Data Library by querying
  26047.  on SV0337, the Q number of the article, or S12719. SV0337 was archived
  26048.  using the PKware file-conversion utility.
  26049.  
  26050.  This monochrome video problem is specific to DOS, and therefore, does
  26051.  not occur with protected-mode CodeView (CVP) under OS/2. However, the
  26052.  problem may appear if real-mode CodeView is run in the DOS
  26053.  compatibility box under OS/2. In addition, the problem may occur with
  26054.  other software, such as Microsoft QuickBASIC.
  26055.  
  26056.  With CodeView, another symptom of this problem is that the program
  26057.  output screen (which can be accessed by pressing F4) will usually
  26058.  appear as dark blue characters on a black background. This screen is
  26059.  essentially unreadable and remains this way even after CodeView is
  26060.  terminated. Typing MODE CO80 at the DOS prompt after exiting CV should
  26061.  restore the system to the default colors.
  26062.  
  26063.  Microsoft intends to change the video detection routine in future
  26064.  software releases in order to circumvent this problem. Although the
  26065.  problem is not specifically caused by CodeView, a more sophisticated
  26066.  video detection routine will determine what video adapter and monitor
  26067.  are present without relying on the possibly inaccurate BIOS data.
  26068.  
  26069.  
  26070.  142. CV /E Avoids Windows 3.00 386 Enhanced Mode Protection Error
  26071.  
  26072.  Product Version(s): 2.35 3.00 3.10
  26073.  Operating System:   MS-DOS
  26074.  Flags: ENDUSER | SR# S900919-57 B_QuickBas B_BasicCom W_Win3
  26075.  Last Modified: 24-OCT-1990    ArticleIdent: Q65934
  26076.  
  26077.  When you start Microsoft CodeView under Windows 3.00 in a 386 enhanced
  26078.  mode DOS box, the following error message is displayed:
  26079.  
  26080.     You have attempted to run protected-mode application under 386
  26081.     enhanced mode. To run the application, exit and run Windows using
  26082.     either the WIN /s or the WIN /r command.
  26083.  
  26084.  However, using WIN /s or /r is unnecessary. To avoid the error
  26085.  message, start CodeView with the /E option to tell CodeView that
  26086.  expanded memory is available, as follows:
  26087.  
  26088.     CV /E
  26089.  
  26090.  This information applies to Microsoft CodeView versions 2.35, 3.00,
  26091.  and 3.10 for MS-DOS.
  26092.  Note that CodeView version 2.35 is shipped with Microsoft BASIC
  26093.  Professional Development System (PDS) version 7.00; CodeView version
  26094.  3.00 is shipped with Microsoft C Compiler PDS version 6.00; and
  26095.  CodeView 3.10 is shipped with Microsoft BASIC PDS version 7.10.
  26096.  
  26097.  You may find that after the error message is generated, if you return
  26098.  to the DOS box and wait a few seconds, CodeView will start up. To
  26099.  avoid the error message, start CodeView as follows with the expanded
  26100.  memory (/E) switch (where <filename.exe> is the name of the program
  26101.  you want to debug):
  26102.  
  26103.     CV /E <filename.exe>
  26104.  
  26105.  To increase the size of programs that can be loaded into CodeView in
  26106.  conjunction with the /E switch, you can create a PIF file for CodeView
  26107.  and specify -1 for the Expanded Memory KB Limit, which instructs
  26108.  Windows to give the program all the EMS that it needs.
  26109.  
  26110.  CodeView will run without the above error message in a Windows 3.00
  26111.  DOS box in standard mode, WIN /S.
  26112.  
  26113.  
  26114.  143. CV1319 Error May Be Caused by Generic Breakpoints
  26115.  
  26116.  Product Version(s): 3.00   | 3.10
  26117.  Operating System:   MS-DOS | OS/2
  26118.  Flags: ENDUSER |
  26119.  Last Modified: 24-OCT-1990    ArticleIdent: Q66215
  26120.  
  26121.  In some situations a program will hang with the CodeView
  26122.  initialization error CV1319 even though the program runs correctly
  26123.  outside of CodeView. Deleting any generic breakpoints in the
  26124.  CURRENT.STS file may resolve this problem. The following is an
  26125.  example:
  26126.  
  26127.     [debug-]
  26128.           genericbp='E 0x47:0x0007
  26129.  
  26130.  The problem is that when you recompile your program, the code moves
  26131.  and the absolute breakpoint may now be set in the middle of a
  26132.  multibyte instruction rather than the beginning of the instruction.
  26133.  
  26134.  Additional Workaround
  26135.  ---------------------
  26136.  
  26137.  Invoke CodeView with the /TSF ("Toggle StateFileread") option. This
  26138.  option will either read or ignore the CURRENT.STS file based on what
  26139.  the statefileread switch is set to in the TOOLS.INI file.
  26140.  
  26141.  For example, if the statefileread switch is set to "yes" (the default)
  26142.  and CodeView is invoked with the /TSF option, the CURRENT.STS file
  26143.  will be ignored.
  26144.  
  26145.  
  26146.  144. Running Out of Memory in CodeView with /X
  26147.  
  26148.  Product Version(s): 3.00 3.10 3.11
  26149.  Operating System:   MS-DOS
  26150.  Flags: ENDUSER |
  26151.  Last Modified: 24-OCT-1990    ArticleIdent: Q66230
  26152.  
  26153.  Under some circumstances, CodeView may still run out of memory while
  26154.  debugging large applications with the /X switch invoked to take
  26155.  advantage of extended memory with HIMEM.SYS. The debug information
  26156.  gets expanded when CodeView loads the program, so the following
  26157.  suggestions may help the problem:
  26158.  
  26159.  1. Don't use the quick compile (/qc) option. The symbolic information
  26160.     created by the quick compiler may expand much more when loaded by
  26161.     CodeView than the symbolic information created by the standard
  26162.     compiler. In addition, the quick compiler may create some duplicate
  26163.     debug references in the executable file. These duplicate references
  26164.     can take up significant memory when CodeView loads the program.
  26165.  
  26166.  2. Use the CVPACK utility, which is documented in the online
  26167.     documentation and on Page 21 of the "Microsoft C Reference" manual.
  26168.     CVPACK will compress the debug information in the file by removing
  26169.     duplicate references. Use the /P option to achieve maximum
  26170.     compression.
  26171.  
  26172.  
  26173.  145. CodeView Fails to Return Value in ES
  26174.  
  26175.  Product Version(s): 3.00 3.10 3.11
  26176.  Operating System:   MS-DOS
  26177.  Flags: ENDUSER | buglist3.00 buglist3.10 buglist3.11
  26178.  Last Modified:  9-NOV-1990    ArticleIdent: Q66507
  26179.  
  26180.  When CodeView is running in extended memory and a call is made to
  26181.  interrupt 15h function C0h, the value in the ES register is not
  26182.  changed. This interrupt call should return the segment of the system
  26183.  configuration table in the ES register. If CodeView is run with the /D
  26184.  or /E option, a value is returned in the ES register as it should be.
  26185.  
  26186.  Microsoft has confirmed this to be a problem in CodeView versions
  26187.  3.00, 3.10, and 3.11. We are researching this problem and will post
  26188.  new information here as it becomes available.
  26189.  
  26190.  Sample Code
  26191.  -----------
  26192.  
  26193.  main ()
  26194.    {
  26195.     _asm mov ah, 0xC0
  26196.    _asm int 0x15
  26197.    }
  26198.  
  26199.  
  26200.  146. Memory Requirements for Real-Mode CodeView (CV.EXE)
  26201.  
  26202.  Product Version(s): 3.00 3.10 3.11 | 3.00 3.10 3.11
  26203.  Operating System:   MS-DOS         | OS/2
  26204.  Flags: ENDUSER |
  26205.  Last Modified: 11-NOV-1990    ArticleIdent: Q66513
  26206.  
  26207.  Real-mode versions of CodeView (CV) beginning with version 3.00 offer
  26208.  a number of ways to utilize available memory in order to make the
  26209.  greatest amount of conventional memory available to the program being
  26210.  debugged. The amount of memory actually used depends on the
  26211.  command-line options specified as well as the configuration of the
  26212.  system used for debugging.
  26213.  
  26214.  The following table shows the size of CodeView in standard DOS memory
  26215.  with each of the memory-specific command-line options (see the "More
  26216.  Information" section below for further details):
  26217.  
  26218.     Option  RAM Usage                   Option  RAM Usage
  26219.     ------  ---------                   ------  ---------
  26220.  
  26221.      /X       16K                       /D16     210K
  26222.      /E      192K                       /D32     225K
  26223.      /D      256K (same as /D64)        /D128    320K
  26224.  
  26225.  The following descriptions of the three memory-related CodeView
  26226.  options explain the ways in which each option affects memory
  26227.  utilization in addition to the respective amounts of conventional
  26228.  memory that CodeView requires with each. (This information pertains
  26229.  only to CodeView versions 3.00 and later -- versions of CodeView
  26230.  earlier than 3.00 require approximately 230K of RAM specifically for
  26231.  CodeView.)
  26232.  
  26233.  /X - Specifies that CodeView should utilize extended memory. Assuming
  26234.       that enough extended memory is available, this option moves both
  26235.       the symbolic information and most of CV itself into extended
  26236.       memory. Allowing CV to be loaded into high memory requires that
  26237.       approximately 16K to 19K of "control" code remain in conventional
  26238.       memory, thus all free conventional RAM over 19K is available to
  26239.       load the program to be debugged (the "debuggee").
  26240.  
  26241.  /E - Specifies that CodeView should utilize expanded memory. Assuming
  26242.       that enough expanded memory is available, this option moves both
  26243.       the symbolic information and CodeView's own overlays into
  26244.       expanded memory. The size of the CV "root" without the extra
  26245.       overlayed code is approximately 192K. Since the overlays do not
  26246.       cause any additional overhead with /E, all free conventional RAM
  26247.       over 192K is available to load the debuggee.
  26248.  
  26249.  /D - Specifies that CodeView should utilize disk overlays in
  26250.       conventional memory. By default, this option creates a 64K buffer
  26251.       area for loading disk overlays. With the 192K root, the 64K
  26252.       buffer means CV will take about 256K of conventional memory with
  26253.       /D. In addition, the symbolic information must also be loaded
  26254.       into conventional memory; therefore, since symbolic data varies
  26255.       with each program, it is not possible to specify the amount of
  26256.       memory available for the debuggee alone.
  26257.  
  26258.       The /D option can also be specified with a value that indicates
  26259.       the size of the overlay buffer area. This parameter can be any
  26260.       value from 16 to 128, which represents an overlay buffer size
  26261.       from 16K to 128K. Specifying /D16 will minimize CodeView's size
  26262.       with disk overlays to approximately 210K. This maximizes the
  26263.       amount of conventional memory that will be available to load the
  26264.       debuggee and the symbolic information. At the other extreme,
  26265.       /D128 causes CV to use approximately 320K of conventional RAM.
  26266.       This provides faster CodeView execution speed, but it will only
  26267.       work with smaller debuggees.
  26268.  
  26269.  Note: CodeView will default to the best memory usage possible. In
  26270.  other words, if NO memory usage option is specified, CV will try to
  26271.  use extended memory. If extended memory is unavailable, CV looks for
  26272.  expanded memory. CV will use disk overlays on its own only if expanded
  26273.  memory is not found.
  26274.  
  26275.  
  26276.  147. CV2206 Warning: Corrupt OMF Detected in <filename>
  26277.  
  26278.  Product Version(s): 2.x 3.00 3.10 | 2.x 3.00 3.10
  26279.  Operating System:   MS-DOS        | OS/2
  26280.  Flags: ENDUSER | S_MASM H_MASM
  26281.  Last Modified: 11-NOV-1990    ArticleIdent: Q66702
  26282.  
  26283.  When trying to debug a Macro Assembler program with CodeView, the
  26284.  following message may appear:
  26285.  
  26286.     CV2206 Warning: Corrupt debug OMF detected in <filename>,
  26287.        discarding source line information
  26288.  
  26289.  The error occurs when code segments are not of class "CODE". Page 104
  26290.  of the "Macro Assembler 5.10 Programmer's Guide" states the following:
  26291.  
  26292.     The CodeView debugger also expects code segments to have the class
  26293.     name 'CODE'. If you fail to assign a class type to a code segment,
  26294.     or if you give it a class type other than 'CODE', then labels may
  26295.     not be properly aligned for symbolic debugging.
  26296.  
  26297.  This is also mentioned in the "CodeView and Utilities" manual under
  26298.  section 1.3.8 titled "Preparing Assembly Programs."
  26299.  
  26300.  The following is an example of the problem:
  26301.  
  26302.  _text segment para public   ; 'CODE' should be added to this line
  26303.  
  26304.  begin    proc
  26305.        mov ah, 4ch
  26306.        int 21h
  26307.  begin    endp
  26308.  
  26309.  _text ends
  26310.        end begin
  26311.  
  26312.  
  26313.  148. How to Execute a Function From the Command or Watch Window
  26314.  
  26315.  Product Version(s): 2.x 3.00 3.10 3.11 | 2.x 3.00 3.10 3.11
  26316.  Operating System:   MS-DOS             | OS/2
  26317.  Flags: ENDUSER | docerr s_c 6.00 6.00a
  26318.  Last Modified:  4-DEC-1990    ArticleIdent: Q67007
  26319.  
  26320.  Page 201 of the "Advanced Programming Techniques" (APT) manual that
  26321.  accompanies Microsoft C versions 6.00 and 6.00a states that "any C
  26322.  function in your program (whether user-written or from the library)
  26323.  can be called from the Command window or the Watch window."
  26324.  
  26325.  This statement is not completely true. Actually, only functions
  26326.  compiled with full CodeView symbolic information can be called. This
  26327.  restriction eliminates all of the C run-time functions from being
  26328.  executed in this manner because they contain no symbolic information.
  26329.  A simple example of how to call a C run-time function is shown below.
  26330.  
  26331.  If an attempt is made to execute a function that has not been compiled
  26332.  with symbolic information via the Command window, the following error
  26333.  will be displayed in the Command window:
  26334.  
  26335.     CV1017 Error: Syntax error
  26336.  
  26337.  In CodeView versions 2.x, an "unknown symbol" error is displayed in
  26338.  the Command window.
  26339.  
  26340.  If an attempt is made to add the function to the Watch window via the
  26341.  Watch menu and the "Add Watch" command, CodeView will ignore the entry
  26342.  and beep. In versions 2.x, CodeView will give an "unknown symbol"
  26343.  error.
  26344.  
  26345.  The APT gives an example of calling a C function from the Command
  26346.  window via the following command:
  26347.  
  26348.     ?funcname (varlist)
  26349.  
  26350.  This command will only invoke the function and display its return
  26351.  value in the Command window. To add the function to the Watch window,
  26352.  a slightly different command must be used, as follows:
  26353.  
  26354.     w?funcname (varlist)
  26355.  
  26356.  The function name can also be added to the Watch window by choosing
  26357.  the Watch menu and the "Add Watch" command, and typing only the
  26358.  function name plus its variable list enclosed in parenthesis. Neither
  26359.  the "w" or the "?" are needed in this situation.
  26360.  
  26361.  It is important to note that you should be sure that the screen
  26362.  flip/swap option on the Options menu is turned on if the function you
  26363.  execute performs any screen input or output.
  26364.  
  26365.  For example, if you want to call a C run-time function or any other
  26366.  function that does not contain CodeView symbolic information, you must
  26367.  create a shell function that calls the desired function itself and
  26368.  gives the same return value.
  26369.  
  26370.  Therefore, if you wanted to call the C run-time function sqrt()
  26371.  directly from the CodeView Command window or Watch window, you would
  26372.  create a shell function that resembles the following:
  26373.  
  26374.  1. #include <math.h>
  26375.  2. double my_sqrt(double x)
  26376.  3. {
  26377.  4.    return(sqrt(x)) ;
  26378.  5. }
  26379.  
  26380.  You would then compile this function with CodeView information by
  26381.  compiling with the /Zi switch, and then link it into your program
  26382.  being sure to include /CO in your link command. Note that your program
  26383.  does not need to make a call to the function in order for it to be
  26384.  available for direct execution.
  26385.  
  26386.  To execute this function from the Command window, enter the following
  26387.  command:
  26388.  
  26389.     ?my_sqrt(4.0)
  26390.  
  26391.  The return value should be displayed on the next line in the Command
  26392.  window. In this example, 2.0000000000000 should be displayed as a
  26393.  result of the square root of 4.0.
  26394.  
  26395.  To add the function to the Watch window via the Command window, you
  26396.  would enter the following command:
  26397.  
  26398.     w?my_sqrt(4.0)
  26399.  
  26400.  The function could also be added to the watch window by choosing the
  26401.  "Add Watch" command from the Watch menu and entering the following at
  26402.  the Add Watch prompt:
  26403.  
  26404.     my_sqrt(4.0)
  26405.  
  26406.  When a function is added to the Watch window, that function is
  26407.  executed any time the Watch window is updated.
  26408.  
  26409.  Although these examples show a constant value as the parameter to the
  26410.  function, any variable that is in scope at the time could be entered
  26411.  as a parameter.
  26412.  
  26413.  
  26414.  149. Syntax Error When Watching Variables That Begin with "P"
  26415.  
  26416.  Product Version(s): 2.20 2.30 | 2.20 2.30
  26417.  Operating System:   MS-DOS    | OS/2
  26418.  Flags: ENDUSER | buglist2.10 buglist2.20 fixlist3.00
  26419.  Last Modified: 18-NOV-1990    ArticleIdent: Q67008
  26420.  
  26421.  When the following command is entered in the Command window to watch a
  26422.  variable that begins with the letter "p", the result is a syntax
  26423.  error:
  26424.  
  26425.  > W pvariable
  26426.  
  26427.  The syntax for watching a memory location is W[type] range, where the
  26428.  type and range specify the format and length of memory to be
  26429.  displayed, respectively.
  26430.  
  26431.  When no type is declared, as in the above example, the default type is
  26432.  used. The default type will be the last type used by a Dump, Enter,
  26433.  Watch Memory, or Tracepoint Memory command. If none of these commands
  26434.  has been used during the session, the default type is byte.
  26435.  
  26436.  The workaround for this problem is to explicitly declare a type in the
  26437.  watch statement, for example:
  26438.  
  26439.  > WB pvariable.
  26440.  
  26441.  Microsoft has confirmed this to be a problem in Microsoft CodeView
  26442.  versions 2.x. This problem has been corrected in Microsoft CodeView
  26443.  version 3.00.
  26444.  
  26445.  Additional keywords: buglist2.30 buglist2.35
  26446.  
  26447.  
  26448.  150. CV1017: Syntax Error Can Be Caused by a Leading Zero
  26449.  
  26450.  Product Version(s): 3.00 3.10 3.11 | 3.00 3.10 3.11
  26451.  Operating System:   MS-DOS         | OS/2
  26452.  Flags: ENDUSER |
  26453.  Last Modified:  4-JAN-1991    ArticleIdent: Q67160
  26454.  
  26455.  Since CodeView treats all values with a leading zero as octal numbers,
  26456.  the following error is reported when the value is not a valid octal
  26457.  number:
  26458.  
  26459.     CV1017: syntax error
  26460.  
  26461.  To enter a number in hexadecimal form, the value must be preceded with
  26462.  "0x" (without the quotation marks). If the value is a number in
  26463.  decimal form, any leading zeros should be dropped.
  26464.  
  26465.  You can also use the "0n" prefix to specify decimal numbers,
  26466.  independent of the current radix.
  26467.  
  26468.  
  26469.  151. CodeView Asks for Path to a Source File Without Extension
  26470.  
  26471.  Product Version(s): 2.x 3.00 3.10 3.11 3.50
  26472.  Operating System:   MS-DOS
  26473.  Flags: ENDUSER | s_lib s_utility
  26474.  Last Modified:  4-DEC-1990    ArticleIdent: Q67271
  26475.  
  26476.  If an old version of the LIB utility is used to store OBJ modules in a
  26477.  library, the extension may not be stored. This can cause a problem if
  26478.  a module is compiled with debug information and an .EXE is built for
  26479.  CodeView to debug. When CodeView attempts to open the source file for
  26480.  the module in the library, it will fail because there is no extension.
  26481.  It will then prompt you for the filename.
  26482.  
  26483.  This is a problem with the Microsoft LIB utilities earlier than version
  26484.  3.08 and some third-party library managers. Beginning with LIB version
  26485.  3.08, the full filename is stored in the library.
  26486.  
  26487.  
  26488.  152. CodeView Does Not Debug kbhit() Correctly
  26489.  
  26490.  Product Version(s): 3.00 3.10 3.11  | 3.00 3.10 3.11
  26491.  Operating System:   MS-DOS          | OS/2
  26492.  Flags: ENDUSER | buglist3.00 buglist3.10 buglist3.11
  26493.  Last Modified:  4-DEC-1990    ArticleIdent: Q67360
  26494.  
  26495.  When setting a breakpoint between the kbhit() function and a function
  26496.  to read a character from the input stream, CodeView will grab the
  26497.  character from the input stream when the breakpoint is executed.
  26498.  
  26499.  The following code example demonstrates the problem. If a breakpoint
  26500.  is placed on the line containing the getch() function, the character
  26501.  input from the keyboard will be placed in CodeView before the getch()
  26502.  function is actually stepped over. You will not be prompted for the
  26503.  character when you step over the getch() function. The character you
  26504.  typed to stop the kbhit() loop will be used for the getch() function
  26505.  call when that line is executed.
  26506.  
  26507.  Microsoft has confirmed this to be a problem in CodeView versions
  26508.  3.00, 3.10, and 3.11. We are researching this problem and will post
  26509.  new information as it becomes available.
  26510.  
  26511.  Sample Code
  26512.  -----------
  26513.  
  26514.  #include <stdio.h>
  26515.  #include <conio.h>
  26516.  
  26517.  void main(void)
  26518.  {
  26519.          int a;
  26520.  
  26521.          do {
  26522.                  printf(".");
  26523.          } while(!kbhit());
  26524.  
  26525.          a = getch();         // put breakpoint here
  26526.  
  26527.          printf("%c\n", a);
  26528.  }
  26529.  
  26530.  
  26531.  
  26532.  
  26533.  
  26534.  
  26535.  Microsoft Linker
  26536.  =============================================================================
  26537.  
  26538.  
  26539.  1. Corrupted Library Causes Error L1102
  26540.  
  26541.  Product Version(s): 3.61 3.64 3.65 | 5.01.20 5.01.21
  26542.  Operating System:   MS-DOS         | OS/2
  26543.  Flags: ENDUSER |
  26544.  Last Modified:  6-DEC-1988    ArticleIdent: Q38201
  26545.  
  26546.  The link error "L1102: unexpected end-of-file" is generated when the
  26547.  linker attempts to resolve externals in a corrupted or null-length
  26548.  library.
  26549.  
  26550.  This error most commonly occurs with a combined library, mlibx.lib,
  26551.  that is corrupted during the library creation stage of SETUP. Make
  26552.  sure to check the \LIB subdirectory for odd or null size libraries.
  26553.  Library rebuilding is needed if insufficiently-sized libraries are
  26554.  found.
  26555.  
  26556.  The L1102 error can also be generated if you inadvertently type in the
  26557.  name of a used library at the "list file" prompt, as follows:
  26558.  
  26559.     Run File  [SPUD.EXE]:      main.exe
  26560.     List File [NUL.MAP]:       libname.lib    (generates faulty library)
  26561.     Libraries [.LIB]:          libname.lib
  26562.     Definition File [NUL.DEF]: main.def
  26563.  
  26564.  This process creates a map listing with the specified library name in
  26565.  the current working directory. Because this directory is searched
  26566.  before the directory specified in the LIB environment variable, the
  26567.  incorrect library containing the map listing is used during linkage,
  26568.  causing the error L1102.
  26569.  
  26570.  
  26571.  2. /I Linker Option Should Read /INF
  26572.  
  26573.  Product Version(s): 3.61 3.65
  26574.  Operating System:   MS-DOS
  26575.  Flags: ENDUSER | docerr
  26576.  Last Modified: 18-OCT-1988    ArticleIdent: Q30515
  26577.  
  26578.  Pages 266 and 267 of the "Microsoft C Optimizing Compiler CodeView and
  26579.  Utilities" manual for Versions 5.00 and 5.10 incorrectly list the
  26580.  shortened name of the /INFORMATION option as /I.
  26581.  
  26582.  If /I is given as an option, the result is an error stating that /I is
  26583.  an unrecognized option.
  26584.  
  26585.  The correct shortened name for /INFORMATION is /INF.
  26586.  
  26587.  
  26588.  3. Maximum Libraries LINK Can Handle
  26589.  
  26590.  Product Version(s): 3.x 5.01.20 5.01.21
  26591.  Operating System:   MS-DOS
  26592.  Flags: ENDUSER |
  26593.  Last Modified: 18-OCT-1988    ArticleIdent: Q31986
  26594.  
  26595.     LINK can handle no more than 32 libraries, i.e., on the LIBRARY
  26596.  prompt, you can specify up to 32 libraries.
  26597.     If you have more libraries, you have two choices: combine libraries
  26598.  or specify some of them at the object modules prompt. In the second
  26599.  case, LINK will treat the library as a collection of object modules,
  26600.  all of which should be included in your .EXE file.
  26601.  
  26602.  
  26603.  4. Maximum Number of Object Modules LINK Allows
  26604.  
  26605.  Product Version(s): 3.x 5.01.20 5.01.21
  26606.  Operating System:   MS-DOS
  26607.  Flags: ENDUSER |
  26608.  Last Modified: 18-OCT-1988    ArticleIdent: Q31987
  26609.  
  26610.     There is no limit to the number of object modules LINK allows;
  26611.  however, LINK can operate only in certain limits imposed by the amount
  26612.  of available resources.
  26613.  
  26614.  
  26615.  5. The Meaning of an Invalid Object Module
  26616.  
  26617.  Product Version(s): 3.x 5.01.20 5.01.21
  26618.  Operating System:   MS-DOS
  26619.  Flags: ENDUSER |
  26620.  Last Modified: 13-OCT-1988    ArticleIdent: Q31988
  26621.  
  26622.  An invalid object-module error message means that an object module
  26623.  does not conform to Microsoft object format. The description of object
  26624.  format can be found in "MS-DOS Encyclopedia Part E: Programming Tools
  26625.  Article 19: Object Module."
  26626.  
  26627.  
  26628.  6. Object Modules Handled by LINK
  26629.  
  26630.  Product Version(s): 3.x 5.01.20 5.01.21
  26631.  Operating System:   MS-DOS
  26632.  Flags: ENDUSER |
  26633.  Last Modified: 15-JUL-1988    ArticleIdent: Q31989
  26634.  
  26635.     Successive versions of LINK always are backward compatible, but not
  26636.  necessarily upward compatible, i.e., the most recent versions should
  26637.  link any existing object module, but not necessarily any future object
  26638.  module.
  26639.     To solve this problem, update to the latest version of LINK.
  26640.  
  26641.  
  26642.  
  26643.  7. How LINK Orders and Combines Segments
  26644.  
  26645.  Product Version(s): 3.x 5.01.20 5.01.21
  26646.  Operating System:   MS-DOS
  26647.  Flags: ENDUSER |
  26648.  Last Modified: 15-JUL-1988    ArticleIdent: Q31991
  26649.  
  26650.     Every segment belongs to a named class such as 'CODE', 'DATA', or
  26651.  'BSS'. LINK orders all segments with the same class name contiguously.
  26652.     Within each class, segments are placed in the same order as LINK
  26653.  encounters them. Segment classes are placed in the order they appear.
  26654.  If you do not give a class name when you define a segment in assembly,
  26655.  the segment gets the null class, which is treated like any other segment.
  26656.  If the /DOSSEG option is given, or one of the Microsoft language run-time
  26657.  libraries is used, LINK imposes the following additional order:
  26658.  
  26659.        code (class ending in 'CODE')
  26660.        far data (everything but DGROUP and 'CODE')
  26661.        DGROUP - the default data segment
  26662.            class 'BEGDATA' (special runtime segment)
  26663.            near initialized data (everything but 'BSS' and 'STACK')
  26664.            near BSS--uninitialized data  (class 'BSS')
  26665.            stack
  26666.  
  26667.  
  26668.  
  26669.  8. Link Error L1053 Symbol Table Overflow
  26670.  
  26671.  Product Version(s): 3.x 5.01.20 5.01.21
  26672.  Operating System:   MS-DOS
  26673.  Flags: ENDUSER |
  26674.  Last Modified: 13-OCT-1988    ArticleIdent: Q31992
  26675.  
  26676.  Question:
  26677.  
  26678.  I am receiving link error L1053: symbol table overflow. What is the
  26679.  limit of the symbol table?
  26680.  
  26681.  Response:
  26682.  
  26683.  Under MS-DOS, this limit using the DOS-only linker (Versions
  26684.  3.x) is dependent on the amount of available memory in your computer.
  26685.  LINK can use all conventional memory available under DOS (up to 640K).
  26686.  
  26687.  Under OS/2, the segmented-executable linker (Versions 5.x and above)
  26688.  has no limit on the size of the symbol table because it extends the
  26689.  symbol table in virtual memory.
  26690.  
  26691.  
  26692.  9. Temporary Files Created at Link Time
  26693.  
  26694.  Product Version(s): 3.x 5.01.20 5.01.21
  26695.  Operating System:   MS-DOS
  26696.  Flags: ENDUSER |
  26697.  Last Modified: 22-JUL-1988    ArticleIdent: Q31993
  26698.  
  26699.     The linker creates a temporary file when it runs out of memory to
  26700.  hold the symbol table or the load image and run-time relocations of
  26701.  the program being linked.
  26702.  
  26703.  
  26704.  
  26705.  10. How Overlays Are Set Up By the Linker
  26706.  
  26707.  Product Version(s): 3.x 4.06 4.07 5.01.20 5.01.21 5.03
  26708.  Operating System:   MS-DOS
  26709.  Flags: ENDUSER |
  26710.  Last Modified: 26-JAN-1990    ArticleIdent: Q31994
  26711.  
  26712.  The overlay linker uses an interrupt to call in overlaid files. By
  26713.  default, the interrupt number used for passing control to overlays is
  26714.  63 (3f hex).
  26715.  
  26716.  The linker links the Microsoft overlay manager from the standard
  26717.  Microsoft language run-time libraries. The linker assigns segments to
  26718.  overlays based on the grouping you indicate. It replaces
  26719.  overlay-to-overlay far calls and root-to-overlay far calls with an
  26720.  interrupt sequence that calls the overlay manager. The overlay manager
  26721.  swaps overlays if necessary and returns control to the program.
  26722.  
  26723.  The linker replaces root-to-overlay and overlay-to-overlay far calls
  26724.  with the following sequence:
  26725.  
  26726.     INT     3Fh         ; can change # with /OVERLAYINTERRUPT:#
  26727.     DB      ?           ; target overlay segment number, where
  26728.                         ; every non-root code segment is numbered
  26729.                         ; starting at 1
  26730.     DW      ?           ; target offset within segment
  26731.  
  26732.  The interrupt handler is set to the overlay manager code that swaps
  26733.  out the resident overlay if necessary and swaps in the target overlay,
  26734.  then jumps to the target address. The overlay manager does nothing
  26735.  unusual in servicing the interrupts; it does not disable interrupts.
  26736.  However, it may issue INT 21h calls to swap overlays.
  26737.  
  26738.  The overlay manager assumes that once your initialization code has
  26739.  been executed, DS and SS will always be the same. Furthermore, it
  26740.  assumes you will initialize DS and SS to the value of DGROUP (the
  26741.  default data segment defined by Microsoft languages). Note that your
  26742.  program also must have a stack segment.
  26743.  
  26744.  A more detailed description of the overlay manager can be found on
  26745.  Page 715 of the "MS-DOS Encyclopedia," "Article 20: The Microsoft
  26746.  Object Linker."
  26747.  
  26748.  
  26749.  11. Why the First Module in the Code Segment Starts at Offset 16
  26750.  
  26751.  Product Version(s): 3.x 4.06 4.07 5.01.21 5.03 | 5.01.21 5.03
  26752.  Operating System:   MS-DOS                     | OS/2
  26753.  Flags: ENDUSER | s_c s_quickc s_quickasm h_masm h_fortran
  26754.  Last Modified: 14-FEB-1990    ArticleIdent: Q58688
  26755.  
  26756.  Question:
  26757.  
  26758.  Under some circumstances, I get 16 zero bytes at the beginning of my
  26759.  code segment. I'm linking with my own replacement C library with
  26760.  start-up code. The entry point to this start-up module is the first
  26761.  item in the module, and it always ends up at offset 16. Why is this?
  26762.  
  26763.  Response:
  26764.  
  26765.  The linker will insert 16 bytes at the beginning of the code segment
  26766.  if it determines that you are using standard segment naming
  26767.  conventions (/MS-DOSSEG) and the NULL segment is not explicitly
  26768.  removed (/NONULLSMS-DOSSEG). In your case, the linker assumes that you
  26769.  need support for signal() and allocates the first 16 bytes for it.
  26770.  
  26771.  Note: This will always be done for C programs by the compiler.
  26772.  
  26773.  
  26774.  12. Linker Outputs Information with Invalid Object Module
  26775.  
  26776.  Product Version(s): 3.x 5.01.20 5.01.21
  26777.  Operating System:   MS-DOS
  26778.  Flags: ENDUSER |
  26779.  Last Modified: 15-JUL-1988    ArticleIdent: Q31999
  26780.  
  26781.     When an invalid object-module error message occurs, some
  26782.  information about the record and the position is printed.
  26783.     This information includes the object record type and the relative
  26784.  position of the record in the .OBJ file. There is little you can do
  26785.  with this information; it is mainly for compiler and assembler
  26786.  developers to point to the wrong object record.
  26787.  
  26788.  
  26789.  13. Incremental Linking
  26790.  
  26791.  Product Version(s): 3.x 5.01.20 5.01.21
  26792.  Operating System:   MS-DOS
  26793.  Flags: ENDUSER |
  26794.  Last Modified: 15-JUL-1988    ArticleIdent: Q32000
  26795.  
  26796.     The following is a description of the incremental-linking process.
  26797.     Your file is built from a set of .OBJ files. Each .OBJ file is
  26798.  produced by the compiler or assembler from a source file. If a set of
  26799.  .OBJ files is large, then linking time can be long. If you change only
  26800.  one source file (i.e., in your set of .OBJ files you have one new .OBJ
  26801.  file), you can link all .OBJs one more time, or patch your .EXE file
  26802.  with the new .OBJ file. This patching is called incremental linking.
  26803.     Incremental linking only is supported for OS/2 and Windows
  26804.  programs.
  26805.  
  26806.  
  26807.  
  26808.  14. Explanation of a MAP File
  26809.  
  26810.  Product Version(s): 3.x 5.01.20 5.01.21
  26811.  Operating System:   MS-DOS
  26812.  Flags: ENDUSER |
  26813.  Last Modified: 15-JUL-1988    ArticleIdent: Q32001
  26814.  
  26815.     A MAP file gives you a picture of how your code and data are
  26816.  arranged in memory when the program is loaded.
  26817.     First you get the list of segments in the order in which they will
  26818.  be loaded into memory. For each segment, you have its starting
  26819.  address, length, name, and class. Following the segments are groups,
  26820.  each specifying the starting address of the group.
  26821.     If you specify the /MAP switch and list filename, in the MAP you
  26822.  will get two lists of public symbols in your program. The first list
  26823.  will be sorted alphabetically, the second by addresses.
  26824.     If you specify the /LINENUMBERS switch, then in the MAP, you will
  26825.  get line numbers and the associated addresses of your source program.
  26826.  To produce line numbers in the MAP, give LINK an object file with
  26827.  line-number information. Use the /Zd option with any Microsoft
  26828.  compiler to include line numbers in the object file.
  26829.     Information from the MAP will help you debug your program and
  26830.  understand how the program is loaded into memory.
  26831.  
  26832.  
  26833.  15. L1087: "Unexpected End-of-File on Scratch File"
  26834.  
  26835.  Product Version(s): 3.x 5.x  | 5.10
  26836.  Operating System:   MS-DOS   | OS/2
  26837.  Flags: ENDUSER |
  26838.  Last Modified: 13-OCT-1988    ArticleIdent: Q34669
  26839.  
  26840.  The Link Utility generates the error message L1087: "unexpected
  26841.  end-of-file on scratch file" when a disk with the temporary linker
  26842.  output file has been removed. This information is documented in the
  26843.  "Microsoft Macro Assembler CodeView and Utilities Guide."
  26844.  
  26845.  The error message L1087 also can be caused by insufficient memory
  26846.  available on the disk that contains the temporary linker output file.
  26847.  The disk can be a hard disk, floppy disk, or RAM disk.
  26848.  
  26849.  
  26850.  16. Assigning Addresses to Overlay Segments
  26851.  
  26852.  Product Version(s): 3.x 5.01.20 5.01.21
  26853.  Operating System:   MS-DOS
  26854.  Flags: ENDUSER |
  26855.  Last Modified: 15-JUL-1988    ArticleIdent: Q32003
  26856.  
  26857.     The linker assigns only code segments (identified by class names
  26858.  ending in "CODE") to overlays. Data segments go in the root. The
  26859.  particular overlay the segment goes in is determined by the module
  26860.  that first defines the segment.
  26861.  
  26862.     Note that the linker assigns segments, not object modules, to
  26863.  overlays. Therefore, if you have the following command
  26864.  
  26865.      LINK A+(B+C)
  26866.  
  26867.  where
  26868.  
  26869.      A   defines public SEG1
  26870.      B   defines public SEG2
  26871.      C   defines public SEG1
  26872.  
  26873.  then C's contribution to SEG1 goes in the root, not in the first
  26874.  overlay, because SEG1 was first defined in a root module.
  26875.     The linker orders all segments as it normally would, ignoring the
  26876.  overlays and using the class and combine-type rules described
  26877.  elsewhere. The linker then assigns addresses for every segment in the
  26878.  root up to the first overlay segment. Before the first overlay
  26879.  segment, it defines a special empty segment called OVERLAY_AREA. Then
  26880.  for each overlay it assigns addresses for every segment in the overlay
  26881.  so that the first segment in the overlay starts at OVERLAY_AREA. One
  26882.  particular overlay will end at a higher address than all the others;
  26883.  at this address, the linker defines a special empty segment called
  26884.  OVERLAY_END. Finally, the linker assigns addresses for all remaining
  26885.  segments in the root so that the first one starts at OVERLAY_END. The
  26886.  load image looks like the following:
  26887.  
  26888.          ------------+-> 0000
  26889.          |           |
  26890.          |  root     |
  26891.          |           |
  26892.          +-----------+-> OVERLAY_AREA
  26893.          |  overlay  |
  26894.          |  area     |
  26895.          |           |
  26896.          +-----------+-> OVERLAY_END
  26897.          |  root     |
  26898.          +-----------+
  26899.  
  26900.     The resultant MAP file has some different contents than the
  26901.  pre-overlay file. All items listed are declared as "res", meaning
  26902.  resident. The items contained within the overlay modules are also
  26903.  declared as "res".
  26904.     At the top of the MAP file, the segments are listed in the exact
  26905.  order in which they will be in the load image, and each segment is
  26906.  identified as being in a particular overlay or the root.
  26907.     Every symbol marked "res" is in a root segment and every symbol
  26908.  marked "ovl" is in an overlay segment. If symbols are not where you
  26909.  think they ought to be, remember the linker assigns segments, not
  26910.  modules, to overlays.
  26911.     For more information on overlays, refer to the 1988 "MS-DOS
  26912.  Encyclopedia."
  26913.  
  26914.  
  26915.  17. Link Error L1089
  26916.  
  26917.  Product Version(s): 3.51 3.55 3.60 3.61 3.64 3.65 5.01.20 5.01.21
  26918.  Operating System:   MS-DOS
  26919.  Flags: ENDUSER |
  26920.  Last Modified: 22-JUL-1988    ArticleIdent: Q32829
  26921.  
  26922.     If you are receiving the following error message, check to see if
  26923.  the TMP environment variable is set correctly:
  26924.  
  26925.     L1089   'filename' : cannot open response file
  26926.  
  26927.    If the TMP variable is not set, temporary files cannot be created
  26928.  and this error may occur.
  26929.  
  26930.  
  26931.  
  26932.  18. Cannot Overlay Small-Model Code
  26933.  
  26934.  Product Version(s): 3.60 3.61 3.64 3.65 5.01.20 5.01.21
  26935.  Operating System:   MS-DOS
  26936.  Flags: ENDUSER |
  26937.  Last Modified: 12-OCT-1988    ArticleIdent: Q34294
  26938.  
  26939.  Problem:
  26940.  
  26941.  I have specified overlays for my small-model code, but the link map
  26942.  shows that no overlays are produced.
  26943.  
  26944.  Response:
  26945.  
  26946.  You cannot overlay small-model code. You must change the memory model
  26947.  to medium, large, or huge. Page 285 of the "Microsoft CodeView
  26948.  Utilities" manual that comes with C Versions 5.00 and 5.10, MASM
  26949.  Versions 5.00 and 5.10, and Pascal Version 4.00, and Page 135 of the
  26950.  "Microsoft FORTRAN Optimizing Compiler User's Guide" states that you
  26951.  can overlay only modules to which control is transferred and returned
  26952.  by a standard 8086 long (32-bit) call/return instruction.
  26953.  
  26954.  
  26955.  19. Link Error 4051
  26956.  
  26957.  Product Version(s): 3.60 3.61 3.64 3.65 5.01.20 5.01.21
  26958.  Operating System:   MS-DOS
  26959.  Flags: ENDUSER |
  26960.  Last Modified: 22-JUL-1988    ArticleIdent: Q32831
  26961.  
  26962.     If you receive link error 4051, check the following:
  26963.  
  26964.     1. Is the LIB environment variable set correctly? Check
  26965.        for spaces around the equal sign or any extra characters
  26966.        at the end of the line.
  26967.     2. Which version of the linker is being used? Old versions of
  26968.        the linker do not recognize the LIB environment variable.
  26969.           Make sure the linker being used is the one that came with
  26970.        the product.
  26971.     3. Are the library names being asked for component libraries or
  26972.        combined libraries? Libraries compiled under C Version 4.00 or
  26973.        earlier have component library names embedded in the .OBJ files.
  26974.        With later versions of the C compiler, combined libraries are used
  26975.        and the component libraries will not be found.
  26976.           This behavior also exist when upgrading from Pascal Versions 3.32
  26977.        or earlier to Pascal Versions 4.00 or greater.
  26978.           The work-around for this behavior is to recompile all .OBJ file
  26979.       (and libraries) with the new compiler or to use the /NOD switch
  26980.       when linking, and specify all the libraries (combined and otherwise)
  26981.       to be used. The following is an example:
  26982.  
  26983.              link /NOD  test,,,llibce.lib;
  26984.  
  26985.     4. Is the correct library available for the math option chosen?
  26986.     FORTRAN defaults to the co-processor library (e.g. LLIBFOR7.LIB).
  26987.     C and Pascal default to the emulator math library (e.g. SLIBCE.LIB
  26988.     and LIBPASE.LIB)
  26989.  
  26990.  
  26991.  
  26992.  20. LINK /CO /DO in OS/2 Gives Protection Violation
  26993.  
  26994.  Product Version(s): 5.01.21 | 5.01.21
  26995.  Operating System:   MS-DOS  | OS/2
  26996.  Flags: ENDUSER | buglist5.01.21
  26997.  Last Modified: 13-OCT-1988    ArticleIdent: Q34374
  26998.  
  26999.  The Microsoft Segmented Link Utility Version 5.01.21 will
  27000.  incorrectly generate a protection violation under OS/2 when the
  27001.  command line uses the options /CO /DO, respectively.
  27002.  
  27003.  OS/2 gives the message SYS1943: "A program caused a protection
  27004.  violation." The SYS1811 violation follows, indicating the process has
  27005.  stopped.
  27006.  
  27007.  The work around for this problem is to order the switches differently.
  27008.  Instead of including /CO /DO in the command line, the command line can
  27009.  be reorder to /DO /CO.
  27010.  
  27011.  Microsoft has confirmed this to be a problem in Version 5.01.21. We are
  27012.  researching this problem and will post new information as it becomes
  27013.  available.
  27014.  
  27015.  
  27016.  21. /NOE Option for Redefinition Error L2044
  27017.  
  27018.  Product Version(s): 3.x 5.x | 5.10
  27019.  Operating System:   MS-DOS  | OS/2
  27020.  Flags: ENDUSER |
  27021.  Last Modified: 13-OCT-1988    ArticleIdent: Q34502
  27022.  
  27023.  The /NOEXTDICTIONARY switch tells the linker NOT to take advantage of
  27024.  additional information recorded in Extended Dictionary in the library
  27025.  file. This additional information describes which module in the library
  27026.  calls any other module from the same library, saving linker number
  27027.  of passes through the library file to pick up all required modules.
  27028.  
  27029.  If you have a call in your code to the library function FOO and FOO
  27030.  calls another function BAR from the same library, then at processing
  27031.  time of FOO, the linker will pull out BAR. This process occurs because
  27032.  the extended dictionary has a link between FOO and BAR.
  27033.  
  27034.  Linking without /NOE causes the following error if you want to pull
  27035.  FOO in from the library but you want to provide its own BAR:
  27036.  
  27037.  L2044 BAR : symbol multiply defined, use /NOE
  27038.  
  27039.  This error resulted from the linker pulling FOO and BAR from the
  27040.  same library, then later it sees BAR coming from user .OBJ file.
  27041.  
  27042.  Using /NOE in this case prevents the linker from pulling out
  27043.  BAR from the library, so your BAR routine is used instead.
  27044.  
  27045.  If you have genuine symbol redefinition, then when linking with /NOE
  27046.  you will see the following error:
  27047.  
  27048.  L2025 BAR : symbol defined more than once
  27049.  
  27050.  
  27051.  22. L2001 Fixups without Data
  27052.  
  27053.  Product Version(s): 3.65 5.01.21 | 5.01.21
  27054.  Operating System:   MS-DOS       | OS/2
  27055.  Flags: ENDUSER |
  27056.  Last Modified: 12-OCT-1988    ArticleIdent: Q35155
  27057.  
  27058.  The Link Utility can generate the linker error message L2001:
  27059.  fixup(s) without data. In the manual, the linker error is described
  27060.  as follows:
  27061.  
  27062.  A FIXUPP record occurred without a data record immediately
  27063.  preceding it. This is probably a compiler error. (See
  27064.  the "Microsoft MS-DOS Programmer's Reference" for more information
  27065.  on FIXUPP.
  27066.  
  27067.  In most cases, the error message is generated from an
  27068.  assembly-language program that doesn't make sense from the linker's
  27069.  point of view, but is convenient for users. The following is an
  27070.  example:
  27071.  
  27072.      extrn   foo:word
  27073.  
  27074.      ABSEG   segment at 123          ; absolute segment
  27075.  
  27076.      dw      offset DGROUP:foo       ; offset portion of address of "foo"
  27077.  
  27078.      ABSEG   ends
  27079.  
  27080.  This tells the linker to fix up a location in ABSEG with the address
  27081.  of foo. But ABSEG is an absolute segment and has no data to be fixed
  27082.  up.
  27083.  
  27084.  Another example is when you include the same STRUC definitions in both
  27085.  absolute and non-absolute segments, so that the STRUC definitions
  27086.  contain relocatable addresses.
  27087.  
  27088.  
  27089.  
  27090.  23. Setting the Overlay Interrupt (/O) in LINK
  27091.  
  27092.  Product Version(s): 3.61 3.65
  27093.  Operating System:   MS-DOS
  27094.  Flags: ENDUSER | docerr
  27095.  Last Modified: 20-JAN-1989    ArticleIdent: Q40408
  27096.  
  27097.  Question:
  27098.  
  27099.  Page 272, Section 12.2.12, of the "Microsoft CodeView and Utilities
  27100.  Software Development Tools for the MS-DOS Operating System" manual
  27101.  states that you can change the default overlay interrupt. The default
  27102.  interrupt is 3F hexadecimal. Is the manual correct? Do you have to
  27103.  change the interrupt if you have a program that uses overlays and it
  27104.  spawns a program that also uses overlays?
  27105.  
  27106.  Doesn't the compiler save interrupts? Suppose both Programs A and B
  27107.  use overlays and A spawns B. If B is a Microsoft C Version 5.00 or
  27108.  5.10 program, shouldn't it restore the original INT 3F address when it
  27109.  exits? Thus, everything should work correctly without
  27110.  /OVERLAYINTERRUPT.
  27111.  
  27112.  Response:
  27113.  
  27114.  You are correct; the C Versions 5.00 and 5.10 compiler saves and
  27115.  restores the interrupt so there should be no conflict. The C Versions
  27116.  5.00 and C 5.10 manual is incorrect. This switch need only be used if
  27117.  you are linking a program with overlays, and INT 3F is being used by
  27118.  something else when you run the program. For example, INT 3F might be
  27119.  used to communicate with a hardware board or a TSR might use it;
  27120.  however, this is unlikely.
  27121.  
  27122.  This option is for advanced users who know their configurations well
  27123.  enough to know who is using which interrupt vectors and know there is
  27124.  a conflict.
  27125.  
  27126.  
  27127.  24. LINK Environment Variable Ignored When Linking Through CL
  27128.  
  27129.  Product Version(s): 5.00 5.10 | 5.10
  27130.  Operating System:   MS-DOS    | OS/2
  27131.  Flags: ENDUSER | S_C S_QuickC
  27132.  Last Modified: 15-AUG-1989    ArticleIdent: Q47503
  27133.  
  27134.  Problem:
  27135.  
  27136.  To increase the size of my stack, when I set an environment variable
  27137.  called LINK equal to /ST:4096, it doesn't work correctly when I link
  27138.  using CL.
  27139.  
  27140.  Response:
  27141.  
  27142.  Before CL spawns the linker, it clears the environment of all
  27143.  variables except LIB. Consequently, the LINK environment variable
  27144.  doesn't exist when the linker is invoked, and any options that were
  27145.  specified by it are not seen. When linking with CL, any desired linker
  27146.  options should be specified on the CL command line after the /link
  27147.  switch.
  27148.  
  27149.  The same behavior is seen with the command line compilers from QuickC
  27150.  Version 1.00 and 1.01, but not with QuickC 2.00 or QuickAssembler.
  27151.  
  27152.  
  27153.  25. Why Unitialized Global Variables Don't Appear in C 5.10
  27154.  
  27155.  Product Version(s): 3.65
  27156.  Operating System:   MS-DOS
  27157.  Flags: ENDUSER | SR# G881021-5044
  27158.  Last Modified:  6-DEC-1988    ArticleIdent: Q38725
  27159.  
  27160.  Questions:
  27161.  
  27162.  Why don't uninitialized global variables show up in the library
  27163.  listing when the module containing them has been placed in the
  27164.  library? It appears that the librarian does not "see" uninitialized
  27165.  global variables.
  27166.  
  27167.  If my main program declares an extern, and an .OBJ with which its
  27168.  linked declares it globally (without extern), but doesn't initialize
  27169.  it, the symbol appears in the link map and space is allocated for it
  27170.  in the .EXE. This behavior seems different from previous versions of
  27171.  the compiler. If the .OBJ file is placed as a library rather than
  27172.  linked explicitly, the symbol does not appear in the .EXE. Why does it
  27173.  behave differently?
  27174.  
  27175.  Response:
  27176.  
  27177.  In Version 5.00 of the C Compiler, we introduced a new concept into
  27178.  our linking process called "communal data." Communal data can be
  27179.  declared in many modules, but only one copy of the data will exist
  27180.  in the linked .EXE file. (It is similar to the concept of COMMON
  27181.  blocks in FORTRAN.)
  27182.  
  27183.  In C, data declared outside of a function without a storage class is
  27184.  now considered to be communal data. (This is a change from previous
  27185.  versions.) Communal data declarations generate no definitions, just
  27186.  declarations; whereas initialized, or global, data declarations
  27187.  generate both definitions and declarations.
  27188.  
  27189.  Communal declarations may refer to a global definition. If they do,
  27190.  the linker simply adjusts the address as necessary. However, if
  27191.  there is no global definition of the variable, the linker combines
  27192.  the declarations into one definition and allocates the appropriate
  27193.  amount of space. For example, it is legal to declare
  27194.  
  27195.     int x;
  27196.  
  27197.  in several different modules without a corresponding
  27198.  
  27199.     int x = 0;
  27200.  
  27201.  Communal declarations are NOT copied into libraries. (This is
  27202.  documented on Page 84 of the "Microsoft C Language Reference Manual.")
  27203.  If you want the variable to appear in a library, it MUST be
  27204.  initialized so that it is global rather than communal. Communal
  27205.  variables are not included in libraries because they can cause
  27206.  strange conflicts. For example, let's suppose you
  27207.  unwittingly used a variable name that was also the name of a communal
  27208.  variable in your library. At link time, the linker would allocate
  27209.  only ONE copy of that variable without generating any warning.
  27210.  
  27211.  The symptom would be that your variable would mysteriously change
  27212.  every time you called the library function that used the communal
  27213.  variable. This problem would be a very difficult to trace.
  27214.  
  27215.  Now that we understand communal variables and how they interact with
  27216.  libraries, we can answer your questions.
  27217.  
  27218.  The first question was basically, "Why don't my communal variables
  27219.  show up in the library listing?" Because communal data is not placed
  27220.  into the library, it won't show up in the listing.
  27221.  
  27222.  The second question was, "How come the communal variable shows up in
  27223.  the .EXE file if I link it from an .OBJ file but not from a .LIB
  27224.  file?" It shows up from the .OBJ file because the communal variable
  27225.  is allocated space by the linker if it doesn't resolve to a global
  27226.  definition. It does NOT appear in the link produced by the .LIB file
  27227.  because it does not appear in the library dictionary.
  27228.  
  27229.  Note: this behavior is the result of doing something we ask you not to
  27230.  do; namely, putting communal data in a library. Data intended to be
  27231.  placed in a library must be initialized.
  27232.  
  27233.  
  27234.  26. Example of Using a Response File with LINK
  27235.  
  27236.  Product Version(s): 3.65   | 5.01.20
  27237.  Operating System:   MS-DOS | OS/2
  27238.  Flags: ENDUSER |
  27239.  Last Modified: 20-JAN-1989    ArticleIdent: Q40429
  27240.  
  27241.  The following is a small example of using a response file with LINK.
  27242.  
  27243.  A response file contains responses to the LINK prompts. The responses
  27244.  must be in the same order as the LINK prompts.
  27245.  
  27246.  LINK treats the input from the response file just as if you had
  27247.  entered it in response to prompts or in a command line. It treats any
  27248.  carriage-return-linefeed combination in the response file the same as
  27249.  if you had pressed the ENTER key in response to a prompt or included a
  27250.  comma in a command line.
  27251.  
  27252.  Note: You cannot put comments in response files.
  27253.  
  27254.  The following is an example of a file named RESPONSE.ONE:
  27255.  
  27256.  file1 file2 file3 file4
  27257.  /pause /map
  27258.  filelist
  27259.  graphics.lib
  27260.  
  27261.  Type the following at the command line:
  27262.  
  27263.     LINK @response.one
  27264.  
  27265.  
  27266.  27. Error L2025: Symbol Defined More than Once
  27267.  
  27268.  Product Version(s): 5.10   | 5.10
  27269.  Operating System:   MS-DOS | OS/2
  27270.  Flags: ENDUSER |
  27271.  Last Modified: 20-JAN-1989    ArticleIdent: Q40485
  27272.  
  27273.  Problem:
  27274.  
  27275.  I cannot link a function name in my object file with a library
  27276.  containing that same function name and have the resulting EXE call my
  27277.  function and not the library's.
  27278.  
  27279.  I am using /NOE; however, I receive the following error:
  27280.  
  27281.  (...): error L2025: (my function name) : symbol defined more than once
  27282.   pos: (some number) Record type: 53E8
  27283.  
  27284.  Response:
  27285.  
  27286.  You can only perform this task if the function name is an individual
  27287.  module. The following procedure demonstrates the error:
  27288.  
  27289.  1. Create a file CALL.C that calls functions A() and B().
  27290.  
  27291.  2. Create functions A() and B() in fileA.c and fileB.c, and compile
  27292.     them to objects.
  27293.  
  27294.  3. Do the following to create TEST.LIB:
  27295.  
  27296.        LIB TEST +fileA +fileB, test.lst
  27297.  
  27298.  4. Change B() in fileB.c and compile the following:
  27299.  
  27300.        cl call.c fileB.c test.lib /link /NOE /INF
  27301.  
  27302.     You will have an EXE that calls A() from the library and B() from
  27303.     your modified fileB.c.
  27304.  
  27305.  5. Combine fileA.c and fileB.c into one file called TEST.C.
  27306.  
  27307.  6. Compile to object code.
  27308.  
  27309.  7. Delete the old TEST.LIB, and do the following:
  27310.  
  27311.        LIB TEST +test, test.lst
  27312.  
  27313.     (Normally you would change fileB.c, but this is not necessary here.)
  27314.  
  27315.        cl call.c fileB.c test.lib /link /NOE /INF
  27316.  
  27317.  You will receive the following error:
  27318.  
  27319.  TEST.LIB(test.c) : error L2025: _B : symbol defined more than once
  27320.   pos: 13E Record type: 53E8
  27321.  There was 1 error detected
  27322.  
  27323.  When you encounter this error, it is usually because the function you
  27324.  are trying to overwrite is part of a set appearing in one module.
  27325.  
  27326.  The library listing looks as follows in the first case:
  27327.  
  27328.  _A................fileA             _B................fileB
  27329.  
  27330.  fileA             Offset: 00000010H  Code and data size: 95H
  27331.    _A
  27332.  
  27333.  fileB             Offset: 000002a0H  Code and data size: 92H
  27334.    _B
  27335.  
  27336.  You will be able to replace A() or B(). The listing in the
  27337.  second example looks as follows:
  27338.  
  27339.  _A................test              _B................test
  27340.  
  27341.  test              Offset: 00000010H  Code and data size: deH
  27342.    _A                _B
  27343.  
  27344.  You will not be able to replace either A() or B() without removing the
  27345.  TEST module with the LIB utility. You may have to provide replacements
  27346.  for both functions and not just the one you want to change. For more
  27347.  information, query on the following words in this KnowledgeBase:
  27348.  
  27349.     L2029 unresolved externals
  27350.  
  27351.  
  27352.  28. Default for NODATA When Using the _export Keyword
  27353.  
  27354.  Product Version(s): 5.01.21 | 5.01.21
  27355.  Operating System:   MS-DOS  | OS/2
  27356.  Flags: ENDUSER | buglist5.10.21 buglist5.02 fixlist5.03
  27357.  Last Modified: 21-AUG-1989    ArticleIdent: Q47826
  27358.  
  27359.  Question:
  27360.  
  27361.  What is the default for NODATA when using the _export keyword? The
  27362.  _export keyword is used to mark functions in DLLs for export. It
  27363.  appears that for real-mode windows, for normal applications, _export
  27364.  does not use NODATA. However, for DLLs (also for real-mode windows)
  27365.  _export marks the function NODATA. How does the keyword _export mark
  27366.  functions (NODATA or not).
  27367.  
  27368.  Response:
  27369.  
  27370.  The default as issued by the compiler is not NODATA, i.e., the
  27371.  exported routine is assumed to use the shared data segment.
  27372.  Unfortunately, the linker has a problem that causes it to mistakenly
  27373.  assume NODATA for all exports declared from the .OBJ file.
  27374.  
  27375.  Microsoft has confirmed this to be a problem with LINK Version 5.01.21
  27376.  and 5.02. The problem was corrected in LINK Version 5.03 and later.
  27377.  
  27378.  In OS/2 this should not make any difference. In Windows, the program
  27379.  loader looks for the -Gw sequence in the prolog of the exported entry
  27380.  and replaces it with a sequence to load DS. The _loadds keyword will
  27381.  generate the load-DS sequence in the first place.
  27382.  
  27383.  In any case, a workaround is to not use the _export keyword and
  27384.  declare the routine in EXPORTS in the .DEF file.
  27385.  
  27386.  
  27387.  29. No Default Extension for a Linker Response File
  27388.  
  27389.  Product Version(s): 3.55 3.60 3.61 3.64 3.65  | 5.01.21 5.01.21
  27390.  Operating System:   MS-DOS                    | OS/2
  27391.  Flags: ENDUSER |
  27392.  Last Modified:  2-MAR-1989    ArticleIdent: Q41611
  27393.  
  27394.  The Microsoft Overlay Linker does not have a default extension for a
  27395.  response file; unlike Phoenix's PLINK, which uses a default .LNK
  27396.  extension.
  27397.  
  27398.  This information also applies to the Microsoft Segmented-Executable
  27399.  Linker.
  27400.  
  27401.  
  27402.  30. Ambiguous Switch /PAC with QuickC 2.00 Linker
  27403.  
  27404.  Product Version(s): 4.06
  27405.  Operating System:   MS-DOS
  27406.  Flags: ENDUSER | s_quickc b_quickbas docerr
  27407.  Last Modified: 22-JAN-1990    ArticleIdent: Q42027
  27408.  
  27409.  Using the /PAC switch with LINK Version 4.06 results in the
  27410.  following error:
  27411.  
  27412.     fatal error L1001: PAC : option name ambiguous
  27413.  
  27414.  This same option works correctly on Versions 3.65 and 5.01.21, and is
  27415.  documented as being a valid shorthand name for /PACKCODE on Page 131
  27416.  of the "QuickC Tool Kit."
  27417.  
  27418.  The problem is due to a conflict with an option that is not documented
  27419.  in the Tool Kit, but is displayed when LINK is invoked with /HELP. The
  27420.  option that causes the ambiguity is /PACKDATA, which causes data
  27421.  segments to be combined.
  27422.  
  27423.  The shortest version of /PACKCODE that can be used is /PACKC.
  27424.  Similarly, /PACKD is the shortest version of /PACKDATA that can be
  27425.  used.
  27426.  
  27427.  
  27428.  31. /CO before /DO Causes Problems in LINK
  27429.  
  27430.  Product Version(s): 3.65 4.06 5.01
  27431.  Operating System:   MS-DOS
  27432.  Flags: ENDUSER | h_masm s_pascal h_fortran buglist3.65 buglist5.01
  27433.  Last Modified: 28-MAR-1989    ArticleIdent: Q42212
  27434.  
  27435.  When compiling or assembling with the /Zi switch to include CodeView
  27436.  symbolic information and linking with /CO to preserve it, the
  27437.  placement of the /DO switch is crucial. If the /CO switch is specified
  27438.  before /DO, the following behavior may occur when running CodeView:
  27439.  
  27440.     Message                                Behavior
  27441.  
  27442.     Enter directory for  (cr for none)?    When CodeView is executed,
  27443.                                            no source code will appear.
  27444.  
  27445.     Unable to open file
  27446.  
  27447.     Internal debugger error: 13            When attempting to change
  27448.                                            from assembly view to source
  27449.                                            CodeView. Hanging of the
  27450.                                            machine when executing
  27451.                                            CodeView.
  27452.  
  27453.  If switching the order of the /CO and the /DO switches does not
  27454.  take care of the problem then you have to put the .DOSSEG into
  27455.  your MASM routines and not use the /DO switch.
  27456.  
  27457.  Microsoft has confirmed this to be a problem in Versions 3.65 and
  27458.  5.01. We are researching this problem and will post new information as
  27459.  it becomes available.
  27460.  
  27461.  While LINK Version 5.01 may be used in OS/2, the /DO switch has no
  27462.  meaning. Using it, however, causes the linker to GP fault if /CO
  27463.  precedes /DO.
  27464.  
  27465.  
  27466.  
  27467.  32. Unimplemented Switch /BI with QuickC 2.00 Linker
  27468.  
  27469.  Product Version(s): 4.06
  27470.  Operating System:   MS-DOS
  27471.  Flags: ENDUSER | S_QUICKC
  27472.  Last Modified: 24-JAN-1990    ArticleIdent: Q42849
  27473.  
  27474.  The /BINARY switch for Link Version 4.06 is documented on Page 122 of
  27475.  the "Microsoft QuickC Tool Kit" as a switch used to create .COM files
  27476.  for assembly-language programs. Its shorthand version is /BI. This
  27477.  switch is an alternative to creating .EXE files and then running them
  27478.  through EXE2BIN.
  27479.  
  27480.  This switch is currently not implemented, a fact documented in the
  27481.  README.DOC on line 665, "Creating a .COM file." Using it will result
  27482.  in the following error:
  27483.  
  27484.      fatal error L1002: BINARY : unrecognized option name
  27485.  
  27486.  
  27487.  33. How /NOE (No Extended Dictionary) Is Used by the Linker
  27488.  
  27489.  Product Version(s): 3.65 4.06 5.01 | 5.01
  27490.  Operating System:   MS-DOS         | OS/2
  27491.  Flags: ENDUSER | S_C H_FORTRAN S_QUICKC
  27492.  Last Modified:  6-APR-1989    ArticleIdent: Q43009
  27493.  
  27494.  This article contains information about the LINK option /NOE and how
  27495.  it relates to the three following topics:
  27496.  
  27497.  1. The Extended Dictionary and how LINK uses it
  27498.  
  27499.  2. The definition of genuine redefinition
  27500.  
  27501.  3. Why redefinitions are not detected in some situations
  27502.  
  27503.  The LINK option /NOE stands for No Extended Dictionary.
  27504.  
  27505.  What is the extended dictionary and how does LINK use it? How does
  27506.  LINK use the extended dictionary?
  27507.  
  27508.  LINK uses the extended dictionary to speed up library searching. For
  27509.  example, if the library module A calls functions in module B and
  27510.  module C, the extended dictionary tells LINK that, if your program
  27511.  requires module A from library, it will also require modules B and C.
  27512.  According to this information, LINK pulls in the three modules A, B,
  27513.  and C all at once. This way, LINK doesn't have to search the library a
  27514.  second time to resolve references from module A to modules B and C.
  27515.  
  27516.  What is a genuine redefinition?
  27517.  
  27518.  The ERRMSG.DOC file states that when linker error L2044 occurs, the
  27519.  /NOE switch should be used. When linker error L2025 occurs, the
  27520.  program has a genuine redefinition problem.
  27521.  
  27522.  A genuine redefinition is any redefinition that has nothing to do with
  27523.  the extended dictionary. A redefinition error that occurs when you
  27524.  specify the /NOE switch indicates a genuine redefinition, as in the
  27525.  following example:
  27526.  
  27527.      FOO.OBJ:
  27528.          defines "_foo"
  27529.          calls "_libfunc"
  27530.  
  27531.      Module A: (in XYZ.LIB):
  27532.          defines "_libfunc"
  27533.          defines "_foo"
  27534.  
  27535.  If you run "LINK foo /NOE,,,xyz.lib", the L2025 error will be produced
  27536.  because module A is pulled in and redefines the symbol "_foo".
  27537.  
  27538.  When LINK encounters the redefinition while processing a library
  27539.  module, it assumes that the error might go away if you were to add the
  27540.  /NOE switch. This would be true if the symbols were defined like this
  27541.  as follows:
  27542.  
  27543.      FOO.OBJ:
  27544.          defines "_foo"
  27545.          calls "_libfunc"
  27546.  
  27547.      Module A (in XYZ.LIB):
  27548.          defines "_libfunc"
  27549.          calls "_foo"
  27550.  
  27551.      Module B ( in XYZ.LIB ):
  27552.          defines "_foo"
  27553.  
  27554.  The extended dictionary tells LINK to link modules A and B, even
  27555.  though module B should not be linked because "_foo" is already
  27556.  defined. In this case, the /NOE switch will eliminate the error.
  27557.  
  27558.  LINK cannot figure out when the error is due to the extended
  27559.  dictionary and when it is not; therefore, it assumes that the extended
  27560.  dictionary will cause a redefinition error when processing a library
  27561.  module.
  27562.  
  27563.  Please note that redefinitions not detected in some situations. For
  27564.  example, when the function 'printf' is redefined in a program module
  27565.  and the module is linked with SLIBCER.LIB without using the /NOE
  27566.  switch, LINK does not complain about the redefinition at all. LINK
  27567.  does not detect a redefinition because the module that defines printf
  27568.  in the library is not pulled in; thus, there is no redefinition.
  27569.  
  27570.  If your program module redefines a library function that is also
  27571.  called by other library functions used by your program, you will get a
  27572.  redefinition error. The extended dictionary specifies which library
  27573.  modules call routines in other library modules. Consider a
  27574.  "second-level" function to be any library function called by a library
  27575.  function in another module. For example, spawnve and _setargv are
  27576.  second-level functions because they are called by other library
  27577.  functions; printf is not. You can get a redefinition error only if you
  27578.  redefine a second-level library function called by some first-level
  27579.  routine being linked into your program.
  27580.  
  27581.  
  27582.  34. Producing an _TEXT Segment for Multiple Object Modules
  27583.  
  27584.  Product Version(s): 3.x 4.06 | 5.01.20 5.01.21
  27585.  Operating System:   MS-DOS   | OS/2
  27586.  Flags: ENDUSER | S_C
  27587.  Last Modified:  6-APR-1989    ArticleIdent: Q43128
  27588.  
  27589.  In a map file, a <modulename>_TEXT will be produced for each logical
  27590.  code segment in your program. Since small and compact model programs
  27591.  have only one code segment, you only get one logical segment, _TEXT.
  27592.  Medium- and large-model programs, however, will have a separate
  27593.  logical segment for each object module in the program, and thus produce
  27594.  a <modulename>_TEXT for each logical segment.
  27595.  
  27596.  To generate a map file, use the /M option with LINK or the /Fm option
  27597.  with CL.
  27598.  
  27599.  The following is an example map file generated when compiling a
  27600.  program with two object modules in small-memory model:
  27601.  
  27602.   Start  Stop   Length Name                   Class
  27603.   00000H 016EAH 016EBH _TEXT                  CODE
  27604.   ...
  27605.  
  27606.  The following is an example map file generated when compiling the same
  27607.  program with two object modules in large-memory model:
  27608.  
  27609.   Start  Stop   Length Name                   Class
  27610.   00000H 0000DH 0000EH MAPL_TEXT              CODE
  27611.   0000EH 00023H 00016H MAP2_TEXT              CODE
  27612.   00024H 01B2CH 01B09H _TEXT                  CODE
  27613.   ...
  27614.  
  27615.  MAPL_TEXT and MAP2_TEXT come from the files MAPL.OBJ and MAP2.OBJ,
  27616.  respectively. The _TEXT is the Microsoft run-time library and any
  27617.  third-party libraries.
  27618.  
  27619.  
  27620.  
  27621.  35. LINK: Renaming Overlayed Executables Will Cause Problems
  27622.  
  27623.  Product Version(s): 5.01.21
  27624.  Operating System:   DOS
  27625.  Flags: ENDUSER | s_C s_Pascal h_FORTRAN
  27626.  Last Modified:  6-APR-1989    ArticleIdent: Q43139
  27627.  
  27628.  When the Microsoft linker creates an executable file with overlays,
  27629.  the name of that EXE is hard coded into the file for use by the overlay
  27630.  manager. The Microsoft linker only creates internal overlays, i.e.,
  27631.  rather than producing FOO.EXE, FOO1.OVL, and FOO2.OVL, the two
  27632.  overlays are contained in FOO.EXE.
  27633.  
  27634.  If the executable is renamed at any point after linking, the overlay
  27635.  manager will still use the hard-coded name found in the EXE to locate
  27636.  the overlays, and will fail with the following prompt:
  27637.  
  27638.     Cannot find <oldname>
  27639.     Please enter new program spec:
  27640.  
  27641.  In order to change the name of the executable without receiving this
  27642.  error, it must be relinked and given the new name at that time.
  27643.  
  27644.  
  27645.  36. LINK: Creating and Accessing _edata and _end
  27646.  
  27647.  Product Version(s): 3.X 4.06 | 5.01.20 5.01.21
  27648.  Operating System:   MS-DOS   | OS/2
  27649.  Flags: ENDUSER | s_c
  27650.  Last Modified:  6-APR-1989    ArticleIdent: Q43165
  27651.  
  27652.  LINK creates the two symbols _edata and _end when the LINK option
  27653.  /DOSSEG is used. If a program is compiled by a Microsoft high-level
  27654.  language compiler, or if an assembly program written in Microsoft MASM
  27655.  uses .DOSSEG directive, LINK uses this option automatically.
  27656.  
  27657.  LINK gives _edata the address of the beginning of BSS segment and
  27658.  gives _end the address of the end of BSS segment. Since the STACK
  27659.  segment is directly above the BSS segment, the address of _end also
  27660.  marks the lowest address of the STACK segment.
  27661.  
  27662.  To obtain the addresses for these two symbols, declare the following
  27663.  in your C program:
  27664.  
  27665.  unsigned char edata, end ;
  27666.  
  27667.  The addresses, &edata and &end, can now be used to locate _BSS and
  27668.  STACK. They can also be examined in CodeView. Modifying these two
  27669.  variables is not recommended.
  27670.  
  27671.  Note: The segment BSS referred to in this article actually includes
  27672.  the segment C_COMMON. However in a map file created by LINK, BSS and
  27673.  C_COMMON are listed as two separate segments.
  27674.  
  27675.  
  27676.  
  27677.  37. Linker Options /PADDATA and /PADCODE
  27678.  
  27679.  Product Version(s): 4.06
  27680.  Operating System:   MS-DOS
  27681.  Flags: ENDUSER | S_QuickC docerr
  27682.  Last Modified: 18-SEP-1989    ArticleIdent: Q44928
  27683.  
  27684.  Question:
  27685.  
  27686.  I ran the linker Version 4.06 that comes with the Microsoft QuickC
  27687.  Compiler Version 2.00 with the /help option as follows:
  27688.  
  27689.     LINK /HELP
  27690.  
  27691.  I noticed two switches for which I couldn't find documentation:
  27692.  /PADDATA and /PADCODE. What are these options for?
  27693.  
  27694.  Response:
  27695.  
  27696.  The /PADC[ODE]:padsize option causes LINK to add filler bytes to the
  27697.  end of each code module. The option is followed by a colon and the
  27698.  number of bytes to add. (Decimal radix is assumed, but you can specify
  27699.  special octal or hexadecimal numbers by using a C-language prefix.)
  27700.  Thus, the following adds an additional 256 bytes to each code module:
  27701.  
  27702.     /PADCODE:256
  27703.  
  27704.  The default size for code-module padding is 0 bytes.
  27705.  
  27706.  The /PADD[ATA]:padsize option performs a function similar to
  27707.  /PADCODE, except that it specifies padding for data segments (or data
  27708.  modules, if the program uses small or medium-memory models). Thus,
  27709.  the following adds an additional 32 bytes to each data module:
  27710.  
  27711.     /PADDATA:32
  27712.  
  27713.  The default size for data-segment padding is 16 bytes. Note that if
  27714.  you specify too large a value for padsize, you may exceed the 64K
  27715.  limitation on the size of the default data segment.
  27716.  
  27717.  These two options are quite useful when used in conjunction with
  27718.  QuickC Version 2.00's incremental linking option. Using them correctly
  27719.  increases the incremental linking speed of a program.
  27720.  
  27721.  These two options are documented on Page 64 in the update section of
  27722.  the Microsoft C Optimizing Compiler Version 5.10 "CodeView and
  27723.  Utilities, Microsoft Editor, Mixed-Language Programming Guide" manual.
  27724.  
  27725.  
  27726.  38. Linker Error L2013 May Be a Result of a Problem in MASM 5.10
  27727.  
  27728.  Product Version(s): 3.x 4.06 4.07 5.01.21 5.02 5.03 5.05
  27729.  Operating System:   MS-DOS
  27730.  Flags: ENDUSER | h_masm
  27731.  Last Modified: 27-DEC-1990    ArticleIdent: Q59894
  27732.  
  27733.  The error message for linker error L2013 is as follows:
  27734.  
  27735.     error L2013 LIDATA record too large
  27736.        pos: xxx Record type: 743C
  27737.  
  27738.  In the README.DOC file that comes with MASM version 5.10, Microsoft C
  27739.  version 5.10, and the "Microsoft FORTRAN CodeView and Utilities User's
  27740.  Guide" version 5.00 manual, the recommended course of action is to
  27741.  call Microsoft Product Support at (206) 637-7096.
  27742.  
  27743.  The error is a result of an invalid object module. This is a known
  27744.  problem in MASM 5.10. The most likely cause is a duplication of some
  27745.  large data item, such as a structure.
  27746.  
  27747.  The easiest workaround is to break up the duplication(s) into smaller
  27748.  parts.
  27749.  
  27750.  
  27751.  39. LINK 5.02 Should Not Be Used with ILINK 1.10
  27752.  
  27753.  Product Version(s): 5.02
  27754.  Operating System:   MS-DOS
  27755.  Flags: ENDUSER | S_QuickC
  27756.  Last Modified: 30-AUG-1989    ArticleIdent: Q45536
  27757.  
  27758.  LINK Version 5.02, which comes as a secondary linker for QuickC 2.00,
  27759.  should not be used with ILINK Version 1.10, which also comes with
  27760.  QuickC 2.00.
  27761.  
  27762.  Inside the QuickC environment, this combination has caused problems
  27763.  with floating point-values being printed with printf. Outside of the
  27764.  environment, the same executable results in math error M6104.
  27765.  
  27766.  The source code below prints "FP = 0.00000" instead of "FP =
  27767.  5.020000". Running from the DOS prompt, in this case, produces the
  27768.  same results.
  27769.  
  27770.  Source Code
  27771.  -----------
  27772.  
  27773.      #include <stdio.h>
  27774.  
  27775.      void main( void )
  27776.      {
  27777.          float fp = 5.02F;
  27778.  
  27779.          printf( "FP = %f\n", fp );
  27780.      }
  27781.  
  27782.  LINK Version 4.06 should be used if ILINK is also to be used. If it is
  27783.  necessary to use Version 5.02 of the linker, incremental linking
  27784.  should be disabled from within the environment.
  27785.  
  27786.  Microsoft is researching this problem and will post new information as
  27787.  it becomes available.
  27788.  
  27789.  
  27790.  40. Linker Errors L4013, L2048, and L4038: Overlaying in OS/2
  27791.  
  27792.  Product Version(s): 5.01.20 | 5.03
  27793.  Operating System:   MS-DOS  | OS/2
  27794.  Flags: ENDUSER | S_C H_Fortran
  27795.  Last Modified: 21-JUN-1989    ArticleIdent: Q45619
  27796.  
  27797.  The linker does not overlay files when linking with protected mode
  27798.  run-time libraries. If told to overlay a program that is being linked
  27799.  with a protected mode run-time library, the linker responds with one
  27800.  or more of the following errors:
  27801.  
  27802.     LINK : warning L4013: invalid option for new-format executable file
  27803.     ignored
  27804.     LINK : error L2048: Microsoft Overlay Manager module not found
  27805.     LINK : warning L4038: program has no starting address
  27806.  
  27807.  possibly followed by (in DOS):
  27808.  
  27809.     run-time error R6001
  27810.     - null pointer assignment
  27811.  
  27812.  or possibly followed by (in OS/2):
  27813.  
  27814.     A general protection (GP) fault. It may also go into an infinite
  27815.     loop after creating the temporary file (for large executables).
  27816.  
  27817.  The workaround is to create two versions of the executable, an
  27818.  overlayed DOS version and a non-overlayed OS/2 version.
  27819.  
  27820.  Microsoft is researching this problem and will post new information as
  27821.  it becomes available.
  27822.  
  27823.  
  27824.  41. Link Error L1005: /PACKCODE: Packing Limit Exceeds 65,536
  27825.  
  27826.  Product Version(s): 3.65
  27827.  Operating System:   MS-DOS
  27828.  Flags: ENDUSER | docerr
  27829.  Last Modified: 21-JUN-1989    ArticleIdent: Q45724
  27830.  
  27831.  The Microsoft Overlay Linker Version 3.65 presents the following error
  27832.  message when the /PACKCODE: switch is used with a value greater than
  27833.  65,536 (64K):
  27834.  
  27835.     Link Fatal Error L1005:
  27836.  
  27837.  No error message text is supplied, and the error cannot be referenced
  27838.  in the Microsoft C 5.10 "CodeView and Utilities, Microsoft Editor,
  27839.  Mixed-Language Programming Guide." The error message should read as
  27840.  follows:
  27841.  
  27842.     Link Fatal Error L1005: /PACKCODE: Packing Limit Exceeds 65,536
  27843.  
  27844.  The error is reported correctly by the Microsoft QuickC Linker Version
  27845.  4.06 and all 5.0x versions of the Microsoft Segmented-Executable
  27846.  Linker. It is correctly documented in the Version 2.00 "Microsoft
  27847.  QuickC Tool Kit," on Page 278, and on Page 373 of the Version 5.00
  27848.  "Microsoft FORTRAN, Microsoft CodeView and Utilities User's Guide"
  27849.  manual, as follows:
  27850.  
  27851.     The value supplied with the /PACKCODE option exceeds the limit of
  27852.     65,536 bytes.
  27853.  
  27854.  
  27855.  42. What the /HIGH and /DS Linker Options Do
  27856.  
  27857.  Product Version(s): 3.65
  27858.  Operating System:   MS-DOS
  27859.  Flags: ENDUSER | SR# G890607-19979
  27860.  Last Modified: 13-JUL-1989    ArticleIdent: Q46745
  27861.  
  27862.  Question:
  27863.  
  27864.  I would like information on the /HIGH and /DS options of the linker.
  27865.  Specifically, what changes are needed in the .EXE file to tell the
  27866.  loader to put it high?
  27867.  
  27868.  Response:
  27869.  
  27870.  Basically, these are hold-over features from DOS Version 1.00 and from
  27871.  the original Microsoft/IBM Pascal and FORTRAN Compilers -- they're of
  27872.  little or no use under DOS 2.00 and later. Specifically, programs
  27873.  linked with the /HIGH switch are allocated all of the memory in the
  27874.  machine and cannot release unneeded memory back to DOS; therefore, no
  27875.  other program can be loaded into memory.
  27876.  
  27877.  The /HIGH switch sets both the minalloc and maxalloc fields in the .EXE
  27878.  header to zero. This combination of values causes the loader to load
  27879.  the program in high memory.
  27880.  
  27881.  /DSALLOCATE (or /DS) causes DGROUP to be "shifted" upwards so that the
  27882.  high address in the group is always FFFFh. Offsets into DGROUP are
  27883.  adjusted appropriately.
  27884.  
  27885.  These switches are strictly incompatible with our current high-level
  27886.  languages -- the only possible use for them is in a MASM program.
  27887.  Microsoft doesn't recommend using them at all unless you know
  27888.  precisely what you're doing.
  27889.  
  27890.  There is good documentation on what the /HIGH and /DSALLOCATE switches
  27891.  do, as well as how the loader works, in the "MS-DOS Encyclopedia,"
  27892.  starting on Page 719. (This excellent reference manual is now less
  27893.  expensive and available in paperback).
  27894.  
  27895.  
  27896.  43. How Minimum Load Size Is Calculated
  27897.  
  27898.  Product Version(s): 3.65
  27899.  Operating System:   MS-DOS
  27900.  Flags: ENDUSER | SR# G890607-19979
  27901.  Last Modified: 13-JUL-1989    ArticleIdent: Q46774
  27902.  
  27903.  The MS-DOS program loader uses the following formula to calculate the
  27904.  number of 16-byte paragraphs to use when loading a program:
  27905.  
  27906.     TotPages * 20h - NumHeader + 10h + MaxAlloc
  27907.  
  27908.  The formula calculates the number of 16-byte paragraphs, unless
  27909.  there's not enough memory, in which case all the available memory is
  27910.  used. If there are not at least
  27911.  
  27912.     TotPages * 20h - NumHeader + 10h + MinAlloc
  27913.  
  27914.  paragraphs available, DOS cannot and will not load the program.
  27915.  
  27916.  The 20h is the size of a page in paragraphs, which is the size of a
  27917.  page (512 bytes) divided by the size of a paragraph (16 bytes).
  27918.  
  27919.  The 10h is the size in paragraphs of the 256-byte Program Segment
  27920.  Prefix that precedes all programs in memory.
  27921.  
  27922.  All of the values used in the formulae shown above are words (shown in
  27923.  the following) that are stored in standard Intel low-byte-first format
  27924.  in the .EXE file header:
  27925.  
  27926.     Value           Name used by EXEHDR             Offset in .EXE header
  27927.     -----           -------------------             ---------------------
  27928.  
  27929.     TotPages        Pages in file                   4 - 5
  27930.     NumHeader       Paragraphs in header            8 - 9
  27931.     MinAlloc        Extra paragraphs needed         0Ah - 0Bh
  27932.     MaxAlloc        Extra paragraphs wanted         0Ch - 0Dh
  27933.  
  27934.  For more information, refer to a good MS-DOS reference such as the
  27935.  "MS-DOS Encyclopedia."
  27936.  
  27937.  
  27938.  44. L1074 Name: Group Larger Than 64K Bytes
  27939.  
  27940.  Product Version(s): 4.06
  27941.  Operating System:   MS-DOS
  27942.  Flags: ENDUSER | S_C S_QuickC
  27943.  Last Modified: 24-JUL-1989    ArticleIdent: Q46996
  27944.  
  27945.  The Microsoft QuickC Compiler Version 2.00 returns the following
  27946.  linker error message when the size of DGROUP (the default data
  27947.  segment) exceeds 64K:
  27948.  
  27949.     L1074 name: group larger than 64K bytes
  27950.  
  27951.  This error is documented on Page 282 of the "Microsoft QuickC Tool
  27952.  Kit" manual as follows:
  27953.  
  27954.     The given group exceeds the limit of 65,536 bytes.
  27955.  
  27956.     Reduce the size of the group, or remove any unneeded segments from
  27957.     the group (refer to the map file for a listing of segments).
  27958.  
  27959.  There are four ways to resolve this data segment overflow when using
  27960.  QuickC:
  27961.  
  27962.  1. Reduce the stack size in order to reduce the size of DGROUP. In the
  27963.     environment this can be done in the Options.Make.Linker Flags menu.
  27964.     Outside the environment this can be done at compile time with the
  27965.     "/F hexnum" switch, where hexnum is the size of the requested stack
  27966.     in hexadecimal format. Outside the environment, at link time, this
  27967.     can be done with the "/ST:decnum" switch, where decnum is the size
  27968.     of the requested stack in decimal format.
  27969.  
  27970.  2. Declare data with the FAR keyword to move it out of DGROUP.
  27971.  
  27972.     Note: In the small and medium memory models the Microsoft run-time
  27973.     library functions can no longer be used with this data. You must
  27974.     copy this far to a near heap location, before you use the run-time
  27975.     routines on this data.
  27976.  
  27977.  3. Outside the environment, compile in the compact, large, or huge
  27978.     memory models with the "/GtX" switch, where X is a data threshold.
  27979.     All data items larger than X bytes are moved out of DGROUP into a
  27980.     far data segment.
  27981.  
  27982.  4. Reduce the amount of data declared in the program. In the compact,
  27983.     large, and huge memory models, try dynamically allocating space for
  27984.     the data. Memory can also be dynamically allocated outside DGROUP
  27985.     in the small and medium memory models by using _fmalloc() but, as
  27986.     stated in Number 2, the run-time library functions do not work with
  27987.     this data.
  27988.  
  27989.     Reduce the amount of string literals in this default data segment by
  27990.     reading from a data file at run time, or in C 5.00, by using the
  27991.     /Gt patch to allow string literals to be moved from the _CONST
  27992.     segment in DGROUP into a far segment.
  27993.  
  27994.  
  27995.  45. /CP:X Is Not Valid When Linking Protected-Mode Programs
  27996.  
  27997.  Product Version(s): 5.01.21 | 5.01.21
  27998.  Operating System:   MS-DOS  | OS/2
  27999.  Flags: ENDUSER | docerr
  28000.  Last Modified: 26-JUL-1989    ArticleIdent: Q47036
  28001.  
  28002.  Question:
  28003.  
  28004.  I cannot seem to get the /CPARMAXALLOC linker option to work when I
  28005.  link for OS/2 protected mode. When linking a real-mode application, it
  28006.  works correctly. Also, when I type "link /help" in protected mode, the
  28007.  output indicates that this is a valid option. However, when I try to
  28008.  use this option for a protected-mode application, the linker produces
  28009.  the following warning:
  28010.  
  28011.     LINK : warning L4013: invalid option for new-format executable file
  28012.                           ignored
  28013.  
  28014.  What am I doing wrong and what does this error message mean?
  28015.  
  28016.  Response:
  28017.  
  28018.  As documented on Page 27 in the update section of the Microsoft C
  28019.  Optimizing Compiler Version 5.10 "CodeView and Utilities, Microsoft
  28020.  Editor, Mixed-Language Programming Guide" manual, the /CPARMAXALLOC
  28021.  option is for real-mode applications only. The "link /help" indicates
  28022.  that this is a valid option because this option IS valid whenever
  28023.  you're linking real-mode applications, regardless of whether the
  28024.  linker is running under OS/2 or DOS. (By the same token, it is invalid
  28025.  when you're linking a protected-mode application, regardless of which
  28026.  operating system you're using.)
  28027.  
  28028.  This error message was omitted from the documentation. It indicates
  28029.  that one of the options that the linker was passed is invalid.
  28030.  
  28031.  This option is not supported in a protected-mode application because
  28032.  the functionality of it is done automatically by the linker.
  28033.  Protected-mode applications are not given a 64K default data segment;
  28034.  they are only allocated the space that they need. This is documented
  28035.  on Page 33 of the same section and manual listed above.
  28036.  
  28037.  
  28038.  46. Cannot Use Overlays in a Bound Application
  28039.  
  28040.  Product Version(s): 5.01.21 5.03 | 5.01.21 5.03
  28041.  Operating System:   MS-DOS       | OS/2
  28042.  Flags: ENDUSER |
  28043.  Last Modified: 30-AUG-1989    ArticleIdent: Q47104
  28044.  
  28045.  Question:
  28046.  
  28047.  How can I incorporate overlays into my bound application?
  28048.  
  28049.  Response:
  28050.  
  28051.  You cannot use overlays in a bound application. To bind an
  28052.  application, you must first have a runnable OS/2 executable; then, you
  28053.  use the BIND utility to make it run in both OS/2 and DOS. OS/2
  28054.  executables do not understand overlays so you cannot incorporate them
  28055.  into an OS/2 executable. Hence, you cannot use overlays in a bound
  28056.  program.
  28057.  
  28058.  
  28059.  47. Linker Error L1063 and Linking Over 1000 Object Modules
  28060.  
  28061.  Product Version(s): 5.01.21 5.03
  28062.  Operating System:   OS/2
  28063.  Flags: ENDUSER | S_C S_CodeView
  28064.  Last Modified: 16-AUG-1989    ArticleIdent: Q47931
  28065.  
  28066.  Question:
  28067.  
  28068.  When attempting to link a large OS/2 application consisting of over
  28069.  1500 object modules with C 5.10's Link 5.01.21 or FORTRAN 5.00's Link
  28070.  5.03 by using the options /co /map:2078 /noe /se:2078 /packcode, I get
  28071.  the link error "L1063 out of memory for CodeView information." Only
  28072.  one of the .C source files was compiled with /Zi. All were compiled
  28073.  with /AL. Linking without /co (CodeView information) successfully
  28074.  produces a 700K executable file (.EXE), but I need to do some
  28075.  debugging with CVP.
  28076.  
  28077.  What is the L1063 error, and how can I work around it?
  28078.  
  28079.  Response:
  28080.  
  28081.  Information on L1063 is not in the C 5.10 text files or documentation,
  28082.  but it is in Pascal 4.00's README.DOC and in FORTRAN 4.10's
  28083.  CVREADME.DOC as noted in another article in this knowledge base. The
  28084.  following reiterates the error message and its description:
  28085.  
  28086.     L1063 out of memory for CodeView information
  28087.  
  28088.     The linker was given too many object files with debug information,
  28089.     and the linker ran out of space to store it. Reduce the number of
  28090.     object files that have debug information.
  28091.  
  28092.  In this case, it is not the number of modules with CodeView
  28093.  information that is causing the problems exactly; it is the great
  28094.  number of modules and trying to link in any CodeView information.
  28095.  
  28096.  The following are ways to workaround this linker limitation:
  28097.  
  28098.  1. The most effective method is to demodularize your application. That
  28099.     is, put more functions into fewer .C source files.
  28100.  2. Reduce the linker option /se: value to as low as possible for the
  28101.     number of logical segments in the application.
  28102.  3. Link the object files from the current working directory. If you
  28103.     must use different directories for your .OBJs, make the pathnames
  28104.     as short as possible.
  28105.  
  28106.  
  28107.  48. Description of a Linker .MAP File
  28108.  
  28109.  Product Version(s): 3.60 3.61 3.64 3.65 5.01.20 5.01.21 5.03  | 5.01.20 5.01.
  28110.  Operating System:   MS-DOS                                    | OS/2
  28111.  Flags: ENDUSER | S_C S_PasCal H_FORTRAN
  28112.  Last Modified: 19-SEP-1989    ArticleIdent: Q47960
  28113.  
  28114.  A .MAP file generated by the linker is a listing of the addresses and
  28115.  names of a program, as follows:
  28116.  
  28117.     Logical Segments
  28118.     Groups (defined collections of logical segments)
  28119.     Public Symbols listed by name
  28120.     Public Symbols listed again by their relative address
  28121.     Entry Point address (first executable instruction)
  28122.  
  28123.  A linker .MAP file (with a .MAP file extension) contains the address,
  28124.  size, name, and class of logical code and data segments. (One or more
  28125.  logical segments of either code or data can be combined into a
  28126.  physical segment of either code or data, respectively, by the linker.)
  28127.  
  28128.  In DOS or real-mode OS/2, the addresses are 20-bit hex addresses that
  28129.  are RELATIVE to the beginning of the program's load image. In
  28130.  protected-mode OS/2, the hex addresses are in 32-bit segment
  28131.  selector:offset notation (16 bits for the segment selector and 16 bits
  28132.  for the offset) starting with segment selector 1.
  28133.  
  28134.  The _TEXT segment names of class CODE are the code in your object
  28135.  files. The various forms of near logical data segments are described
  28136.  in the DGROUP diagram, which you probably already have. (Briefly,
  28137.  _DATA is initialized near global data, _BSS is uninitialized near
  28138.  "static" data, C_COMMON is uninitialized near data, and CONST is for
  28139.  floating point constants. FAR_DATA and HUGE_DATA are global
  28140.  initialized far and huge data, respectively, and FAR_BSS is global
  28141.  unitialized far or huge data.)
  28142.  
  28143.  Next in the .MAP is the ORIGIN (address) and name of the defined
  28144.  groups of logical segments, notably DGROUP, which is used in our
  28145.  high-level languages for grouping many logical data segments into the
  28146.  "default" physical data segment. The name "default" data segment
  28147.  refers to the fact the the DS register will point to this segment by
  28148.  default so that offset (near) addressing can be used without loading
  28149.  the DS register. Groups allow multiple logical segments to be
  28150.  associated with the same starting address, so near (non-far) data in
  28151.  Microsoft high-level languages is addressed relative to DGROUP.
  28152.  
  28153.  Following the segment descriptions, under the heading of "Publics by
  28154.  Name", the names of Public symbols (i.e., global or extern functions,
  28155.  including numerous internal C library functions, and variables) are
  28156.  listed in ASCII order (capital letters first, then lowercase letters,
  28157.  and finally underscores) along with their hex relative segment:offset
  28158.  addresses (or segment selector:offset in protected-mode OS/2). Public
  28159.  symbols are then listed again, in order of their relative
  28160.  segment:offset addresses under the heading "Publics by Value".
  28161.  
  28162.  Only Public (e.g. global) symbols such as function and variable names
  28163.  appear in the .MAP. No "static" functions or data, "auto" storage
  28164.  class data (e.g. local function data), or data types are listed in the
  28165.  .MAP.
  28166.  
  28167.  A high-level language such as C creates many logical segments in
  28168.  DGROUP for "internal" (e.g. undocumented) purposes, calls numerous
  28169.  internal library functions, and refers to variables for the main
  28170.  program initialization and start-up code. C refers to additional
  28171.  initialization functions and variables for the library functions that
  28172.  your program explicitly calls, still more for floating point
  28173.  functions, as well as termination functions.
  28174.  
  28175.  To get an idea of the functions automatically linked in from the C
  28176.  library, generate and compare .MAP files for simple source modules
  28177.  such as foo(){} or main(){}, main(){puts("hi");}, and a small program
  28178.  that performs floating point arithmetic or calls a C library floating
  28179.  point math function that calls "fp..." routines.
  28180.  
  28181.  The "Program entry point" is the last item in the .MAP file. It refers
  28182.  to the segment:offset address of the first instruction of the program
  28183.  to be executed, relative to the lowest memory address in the .EXE load
  28184.  image.
  28185.  
  28186.  For more information on the entry point, please use the following
  28187.  query:
  28188.  
  28189.     .map file's program entry point
  28190.  
  28191.  
  28192.  49. Linker Can Indiscriminately Bind Different Types
  28193.  
  28194.  Product Version(s): 1.x 2.x 3.x 4.x 5.01 5.02 5.03 | 5.01
  28195.  Operating System:   MS-DOS                         | OS/2
  28196.  Flags: ENDUSER | S_C S_QuickC S_QuickASM S_Pascal S_QuickPas
  28197.  Last Modified:  2-AUG-1990    ArticleIdent: Q48204
  28198.  
  28199.  The object module format used by the Microsoft languages contains a
  28200.  record type that is used to bind symbol definitions to symbol
  28201.  references in other modules. This record is known as a "fixup." As
  28202.  defined by Intel, the fixup record type contains no information as to
  28203.  the type of data that is to be fixed up. Under certain circumstances,
  28204.  this can cause unexpected and undesired binding at link time. The code
  28205.  below demonstrates such an instance:
  28206.  
  28207.      /*----- FILE1.C -----*/
  28208.  
  28209.      void bar( void );
  28210.  
  28211.      void main( void )
  28212.      {
  28213.          bar();
  28214.      }
  28215.  
  28216.      /*----- FILE2.C -----*/
  28217.  
  28218.      int bar;
  28219.  
  28220.  These files both compile without error. When compiled for a model with
  28221.  a single code segment, linker error L2003 is produced saying that an
  28222.  intersegment self-relative fixup was attempted. If a multiple code
  28223.  segment model is used, no link errors are produced. Although a clean
  28224.  link can be obtained, the resultant EXE does not perform as expected
  28225.  due to the fact that the function reference of bar in FILE1.C has been
  28226.  bound to the integer definition of bar in FILE2.C.
  28227.  
  28228.  The linker has no way of determining the types of the reference to,
  28229.  and definition of, bar. This is a limitation of the object file
  28230.  format. If an include file was used to prototype bar and was then
  28231.  included in both files, the compiler could have detected the
  28232.  redefinition of bar.
  28233.  
  28234.  This information applies to all 1.x, 2.x, and 3.x versions of LINK
  28235.  including 3.60, 3.61, 3.64, and 3.65, as well as LINK Versions 4.06,
  28236.  4.07, 5.01, 5.02, and 5.03.
  28237.  
  28238.  
  28239.  50. Novell Network Software May Cause L1084 Error
  28240.  
  28241.  Product Version(s): 5.03
  28242.  Operating System:   MS-DOS
  28243.  Flags: ENDUSER | h_fortran h_masm s_c s_pascal
  28244.  Last Modified: 23-JAN-1990    ArticleIdent: Q57304
  28245.  
  28246.  The resident software used to access a Novell network may cause the
  28247.  following error when linking large programs:
  28248.  
  28249.     L1084:  Cannot create temporary file
  28250.  
  28251.  This problem was observed with Netware versions 2.10 SFT and 2.15 of
  28252.  the Novell network software.
  28253.  
  28254.  
  28255.  51. Relationship between Map File Addresses and Location in Memory
  28256.  
  28257.  Product Version(s): 3.61 3.65
  28258.  Operating System:   MS-DOS
  28259.  Flags: ENDUSER |
  28260.  Last Modified: 19-SEP-1989    ArticleIdent: Q48241
  28261.  
  28262.  In situations where memory is very short or where CodeView interacts
  28263.  with your program, it is sometimes necessary to use the DEBUG.COM
  28264.  program supplied with DOS.
  28265.  
  28266.  Using DEBUG is more difficult than using SYMDEB or CodeView because
  28267.  DEBUG has no symbolic features. You must use the map produced by the
  28268.  /M option when you link with a standard DOS overlay linker (i.e., not
  28269.  a segmented executable linker) to locate specific parts of your
  28270.  program.
  28271.  
  28272.  However, since DOS relocates programs when it loads them, the
  28273.  addresses given in the map need conversion before you can use them.
  28274.  
  28275.  This conversion is simple: DOS adds the address of the start segment
  28276.  (defined below) to each segment address in the load map. The offsets
  28277.  never change from the values shown in the link map -- only the
  28278.  segments change.
  28279.  
  28280.  The start segment is the base address of the Program Segment Prefix
  28281.  (PSP) plus the size of the PSP in paragraphs. Since the PSP is always
  28282.  100h (256) bytes long, the size of the PSP is 10h paragraphs.
  28283.  
  28284.  Note: DOS puts the base segment address of the PSP in DS and in ES
  28285.  when a program begins execution.
  28286.  
  28287.  For example, assume that the link map says that the function _funct is
  28288.  at 0004:05A0 (all values in hex) and that the global variable _errno
  28289.  is at 0192:00E3. Suppose further that when the program is loaded into
  28290.  DEBUG, the DS and ES registers contain 2BA5 -- the segment address of
  28291.  the PSP. (Use the R command to display the values of the registers.)
  28292.  
  28293.  The start segment for loading the program will be 2BB5 -- the value of
  28294.  the PSP base address (2BA5) + 10h to allow for the 10h paragraph
  28295.  length of the PSP (100h bytes).
  28296.  
  28297.  Thus, the function _funct will be located as follows:
  28298.  
  28299.     0004:05A0   -- address of _funct in the link map
  28300.     2BB5        -- start segment address (PSP + 10h)
  28301.     ---------
  28302.     2BB9:05A0
  28303.  
  28304.  And _errno will be located as follows:
  28305.  
  28306.     0192:00E3   -- address of _funct in the link map
  28307.     2BB5        -- start segment address (PSP + 10h)
  28308.     ---------
  28309.     2D47:00E3
  28310.  
  28311.  Use this calculation on any address in the link map to find where the
  28312.  symbol is located in memory when actually loaded.
  28313.  
  28314.  The H (Hex Arithmetic) command in DEBUG can be helpful when performing
  28315.  these calculations, as can a hex calculator with constant feature.
  28316.  
  28317.  
  28318.  52. Warning L4014: /PACKDATA: Option Ignored for Real Mode
  28319.  
  28320.  Product Version(s): 4.06 4.07 5.02 5.03 | 5.02 5.03
  28321.  Operating System:   MS-DOS              | OS/2
  28322.  Flags: ENDUSER |
  28323.  Last Modified: 21-SEP-1989    ArticleIdent: Q48839
  28324.  
  28325.  /PACKDATA is incorrectly listed as an available switch for LINK
  28326.  Versions 4.06 and 4.07. LINK Version 4.06 comes with the QuickC
  28327.  compiler, and LINK Version 4.07 comes with the QuickAssembler.
  28328.  
  28329.  The /PACKDATA option is valid ONLY for segmented-executable files --
  28330.  OS/2 or Windows; it has no meaning for DOS. Real mode executable means
  28331.  a DOS-only program. To use the /PACKDATA switch, create a .DEF file
  28332.  with at least the following statement:
  28333.  
  28334.     NAME    MyProtectModeProgram
  28335.  
  28336.  This switch is implemented in segmented-executable LINK Versions 5.02
  28337.  and later.
  28338.  
  28339.  
  28340.  53. /NOI Switch May Cause L2022 and L2029 in PM Programs
  28341.  
  28342.  Product Version(s): 5.10   | 5.10
  28343.  Operating System:   MS-DOS | OS/2
  28344.  Flags: ENDUSER |
  28345.  Last Modified: 27-OCT-1989    ArticleIdent: Q49008
  28346.  
  28347.  I am compiling and linking a Presentation Manager (PM) program from
  28348.  Charles Petzold's "Programming the OS/2 Presentation Manager" and I
  28349.  get the following link errors:
  28350.  
  28351.     LINK : error L2022: ClientWndProc (alias ClientWndProc) : export
  28352.            undefined
  28353.  
  28354.          : error L2029 : 'ClientWndProc' : unresolved external
  28355.  
  28356.  I get the same errors when compiling WELCOME1.C from the companion
  28357.  disk to "Programming the OS/2 Presentation Manager."
  28358.  
  28359.  The /NOI switch instructs the linker to preserve case. If you are
  28360.  using the /NOI switch, the linker will generate these errors because
  28361.  EXPENTRY (the export entry point) is defined in OS2DEF.H as follows:
  28362.  
  28363.     #define EXPENTRY far pascal
  28364.  
  28365.  The "pascal" keyword instructs the compiler to use the left-to-right
  28366.  calling sequence for the functions that it modifies. The keyword also
  28367.  causes the conversion of the function's name to uppercase letters.
  28368.  
  28369.  All window procedures are defined as EXPENTRY. Thus, the name of your
  28370.  window procedure is converted to uppercase letters. In your .DEF, you
  28371.  export your window procedures as follows:
  28372.  
  28373.     EXPORTS         ClientWndProc
  28374.  
  28375.  Because of the /NOI switch, the linker does not view ClientWndProc and
  28376.  CLIENTWNDPROC as being equal. Consequently, you get the first error
  28377.  message "export undefined."
  28378.  
  28379.  The second error message is generated because ClientWndProc (mixed
  28380.  uppercase and lowercase letters) is not recognized as being defined,
  28381.  so the linker considers it an "unresolved external."
  28382.  
  28383.  Removing the /NOI switch from your link line corrects both errors.
  28384.  
  28385.  
  28386.  54. LINK 5.03 and Later Require EXETYPE WINDOWS in .DEF File
  28387.  
  28388.  Product Version(s): 5.03
  28389.  Operating System:   MS-DOS
  28390.  Flags: ENDUSER |
  28391.  Last Modified: 17-JUL-1990    ArticleIdent: Q49445
  28392.  
  28393.  Microsoft LINK (LINK.EXE) versions 5.03 and later require that the
  28394.  WINDOWS descriptor be placed in the EXETYPE section of your project's
  28395.  .DEF (definitions) file if you are developing a Windows' application.
  28396.  
  28397.  This marks a change from previous linkers' behavior, which would allow
  28398.  the programmer to fail in specifying the type of executable to be
  28399.  created, but still produce a Windows-compatible .EXE file. This
  28400.  failure is no longer acceptable to LINK Versions 5.03 and later.
  28401.  
  28402.  If you fail to inform the linker (via the .DEF file) that you are
  28403.  creating a Windows executable, the linker reaches completion but the
  28404.  resulting .EXE does not execute.
  28405.  
  28406.  To specify the executable type, you must create a .DEF file and submit
  28407.  this to the linker at link time. For example, if you had a project
  28408.  called WINTEST.C, you must modify WINTEST.DEF so that it contains the
  28409.  following line:
  28410.  
  28411.     EXETYPE   WINDOWS
  28412.  
  28413.  The default EXETYPE is OS/2, as stated in the "Microsoft FORTRAN,
  28414.  CodeView and Utilities User's Guide" packaged with FORTRAN Version
  28415.  5.00.
  28416.  
  28417.  For further information regarding the definitions file and other
  28418.  descriptors, consult Section 7, "Using Module-Definition Files," in
  28419.  the "CodeView and Utilities, Microsoft Editor, Mixed Language
  28420.  Programming Guide" (Update Section) for C 5.10.
  28421.  
  28422.  LINK Version 5.03 is shipped with the FORTRAN version 5.00 package.
  28423.  
  28424.  
  28425.  55. Long TMP Environment Variable Causes L1089
  28426.  
  28427.  Product Version(s): 5.03   | 5.03
  28428.  Operating System:   MS-DOS | OS/2
  28429.  Flags: ENDUSER | h_fortran
  28430.  Last Modified:  6-DEC-1989    ArticleIdent: Q48869
  28431.  
  28432.  L1089 occurs when the LINK Utility Version 5.03 is called from FORTRAN
  28433.  Version 5.00 and the TMP environment variable is set to a long
  28434.  pathname.
  28435.  
  28436.  Normal troubleshooting indicates that the TMP variable is corrupt, but
  28437.  this is not the case. It seems that the temporary filename is being
  28438.  truncated.
  28439.  
  28440.  The following sequence produces the error if the subdirectory
  28441.  D:\COMPILER\FORTRAN5\TMP\ already exists:
  28442.  
  28443.  SET TMP=d:\compiler\fortran5\tmp
  28444.  fl sieve.for
  28445.  
  28446.  LINK : fatal error L1089: D:\COMPILER\FORTRAN5\TMP\000054l
  28447.  : cannot open response file
  28448.  
  28449.  This problem occurs in FORTRAN 5.00 and Link 5.03.
  28450.  
  28451.  
  28452.  56. L2041: Stack Plus Data Exceeds 64K -- Documentation Supplement
  28453.  
  28454.  Product Version(s): 3.65 4.06 | 5.01.21
  28455.  Operating System:   MS-DOS    | OS/2
  28456.  Flags: ENDUSER  | s_pascal h_fortran h_masm s_c s_quickc s_quickasm s_error d
  28457.  Last Modified: 30-NOV-1989    ArticleIdent: Q50130
  28458.  
  28459.  The following indicates that there is more than 64K of stack and data
  28460.  to be put into the 64K DGROUP (default data segment):
  28461.  
  28462.     L2041    stack plus data exceeds 64K
  28463.  
  28464.              The combined size of the program stack segment plus DGROUP
  28465.              was greater than 64K; as a result, the program will not
  28466.              load up correctly.
  28467.  
  28468.  To correct this problem, do the following:
  28469.  
  28470.  1. If the file(s) was compiled with C 5.00, a large amount of string
  28471.     literal data in the program may cause this error. Unlike C 5.10,
  28472.     5.00 cannot move string literals out of DGROUP with the /Gt option.
  28473.     This problem can be corrected with the "C 5.00 /Gt Fix" application
  28474.     note, which is available from Microsoft Product Support Services by
  28475.     calling (206) 454-2030.
  28476.  
  28477.  2. Reduce the stack size.
  28478.  
  28479.  3. Use a large data model (compact, large, or huge). Try applying the
  28480.     /Gt compilation option to lower the threshold.
  28481.  
  28482.  4. Use the FAR keyword to move data out of DGROUP.
  28483.  
  28484.  This error is documented in "Linker Error Messages" in the "Microsoft
  28485.  QuickC Compiler for IBM Personal Computers and Compatibles
  28486.  Programmer's Guide," Section D.4, Page 374. It is also in the file
  28487.  ERRMSG.DOC on Compiler Disk 1 for Microsoft C Version 5.10, on the
  28488.  Setup disk for Microsoft C Version 5.00, in the file README.DOC on
  28489.  Disk 1 for Microsoft Macro Assembler Version 5.10, and in the file
  28490.  CVREADME.DOC on the CodeView for MS-DOS disk for Microsoft FORTRAN
  28491.  Version 4.10. It is not found in the "CodeView and Utilities,
  28492.  Microsoft Editor, Mixed-Language Programming Guide" manual.
  28493.  
  28494.  Nonfatal errors indicate problems in the executable file. LINK
  28495.  produces the executable file. Nonfatal error messages have the
  28496.  following format:
  28497.  
  28498.     location : error L2xxx: messagetext
  28499.  
  28500.  In these messages, location is the input file associated with the
  28501.  error, or LINK if there is no input file. If the input file is an .OBJ
  28502.  or .LIB file and has a module name, the module name is enclosed in
  28503.  parentheses.
  28504.  
  28505.  Additional reference words: appnote
  28506.  
  28507.  
  28508.  57. Link Error L2028 Caused by HEAPSIZE, STACKSIZE and DGROUP Size
  28509.  
  28510.  Product Version(s): 5.01.21 | 5.01.21
  28511.  Operating System:   MS-DOS  | OS/2
  28512.  Flags: ENDUSER | docerr
  28513.  Last Modified: 17-JUL-1990    ArticleIdent: Q49935
  28514.  
  28515.  The error L2028 "Automatic data segment plus heap exceeds 64K" was
  28516.  omitted from the linker error messages in the "CodeView and Utilities,
  28517.  Microsoft Editor, Mixed-Language Programming Guide" manual that
  28518.  accompanies Microsoft C 5.10. This error occurs when the stack and
  28519.  data plus the near heap exceeds 64K. The near heap size is set with
  28520.  the HEAPSIZE option in the .DEF file.
  28521.  
  28522.  The error can be corrected by using one of the following methods:
  28523.  
  28524.  1. Reducing the amount of data in the default data segment.
  28525.  
  28526.  2. Decreasing the stack size that was set by /ST:xxxx at the link line
  28527.     or by the STACKSIZE option in the .DEF file.
  28528.  
  28529.  3. Decreasing the amount of near heap that is being requested with the
  28530.     HEAPSIZE option in .DEF file.
  28531.  
  28532.  
  28533.  58. Specifying Link Options with "-" Causes L4046, L1083, or U1013
  28534.  
  28535.  Product Version(s): 5.01.21
  28536.  Operating System:   OS/2
  28537.  Flags: ENDUSER |
  28538.  Last Modified: 10-NOV-1989    ArticleIdent: Q50333
  28539.  
  28540.  LINK command line switches must begin with the linker's option
  28541.  character, the forward slash (/). While it is valid to begin
  28542.  compilation switches with a dash (-), the same is not true for the
  28543.  linker.
  28544.  
  28545.  Code Example
  28546.  ------------
  28547.  
  28548.  #--------------------
  28549.  # test make file
  28550.  #--------------------
  28551.  
  28552.  test.obj : test.c test.h
  28553.       cl -c -Zi -G2sw -W3 test.c
  28554.  
  28555.  test.exe : test.obj test.def
  28556.       link test, -CO -align:16, NUL, os2, test
  28557.  
  28558.  You type:
  28559.          make test
  28560.  
  28561.  Microsoft (R) Program Maintenance Utility  Version 4.07
  28562.  Copyright (C) Microsoft Corp 1984-1988. All rights reserved.
  28563.  
  28564.    link test, -CO -align:16, NUL, os2, test
  28565.  
  28566.  Microsoft (R) Segmented-Executable Linker  Version 5.01.21
  28567.  Copyright (C) Microsoft Corp 1984-1988.  All rights reserved.
  28568.  
  28569.  TEST.DEF(12) : warning L4046: module name different from output file name
  28570.  LINK : fatal error L1083: cannot open run file
  28571.  test(16) : fatal error U1013: 'link test, -CO -align:16, NUL, os2, test'
  28572.           : error 2
  28573.  
  28574.  
  28575.  59. /PACKCODE Incompatible with IOPL Segments with LINK 5.01.21
  28576.  
  28577.  Product Version(s): 5.01.21
  28578.  Operating System:   OS/2
  28579.  Flags: ENDUSER | S_C
  28580.  Last Modified: 10-NOV-1989    ArticleIdent: Q50702
  28581.  
  28582.  LINK Version 5.01.21 does not support the combination of using the
  28583.  /PACKCODE switch and having code segments declared as IOPL (i.e., as
  28584.  having I/O privilege).
  28585.  
  28586.  When combining segments as directed by the /PACKCODE option, LINK
  28587.  5.01.21 will combine the IOPL segment(s) with other segments that do
  28588.  not have I/O privilege. The result is an invalid executable that
  28589.  returns the system error SYS1059 when it is invoked.
  28590.  
  28591.  The lack of ability to combine these options is a limitation of this
  28592.  particular linker version. LINK Version 5.03 allows the combination of
  28593.  /PACKCODE and IOPL segments without a problem.
  28594.  
  28595.  
  28596.  60. LINK : Warning L4011 Caused By Invalid /PACKCODE Group Size
  28597.  
  28598.  Product Version(s): 3.65 4.06 4.07 5.01.21 5.03 | 5.01.21 5.03
  28599.  Operating System:   MS-DOS                      | OS/2
  28600.  Flags: ENDUSER | S_C S_QUICKC S_QUICKASM S_PASCAL DOCERR
  28601.  Last Modified: 10-NOV-1989    ArticleIdent: Q50705
  28602.  
  28603.  The LINK code packing option, /PAC[:n], groups together neighboring
  28604.  code segments into the same segment of maximum size "n" bytes. The
  28605.  results of using /PAC will only be reliable when "n" is in the range
  28606.  of 0 to 65500. Page 278 of the "Microsoft C 5.1 CodeView and
  28607.  Utilities" reference manual states the default value for "n" is 65530.
  28608.  This is incorrect.
  28609.  
  28610.  The linkers from the following products were tested with the /PAC
  28611.  option to determine their behavior with various values of "n":
  28612.  
  28613.     C 5.10
  28614.     Pascal 4.00
  28615.     FORTRAN 5.00
  28616.     QuickC 1.01
  28617.     QuickC 2.00
  28618.     QuickASM 2.01
  28619.  
  28620.  Note: Linkers were checked in both real and protected mode where
  28621.  appropriate.
  28622.  
  28623.  The following table shows the acceptable values that can be used with
  28624.  the /PAC[:n] option and what error message will occur when the value
  28625.  of "n" is out of range:
  28626.  
  28627.  ----------------------------------------------------------------------
  28628.  Value of "n"      LINK Vers.   Error Message
  28629.  ----------------------------------------------------------------------
  28630.  0 to 65500        3.65         No Errors/Warnings
  28631.                    4.06         No Errors/Warnings
  28632.                    4.07         No Errors/Warnings
  28633.                    5.01.21      No Errors/Warnings
  28634.                    5.03         No Errors/Warnings
  28635.  
  28636.  65501 to 65536    3.65         LINK : warning L4011:
  28637.                    4.06         LINK : warning L4011: PACKCODE value
  28638.                                 exceeding 65500 unreliable
  28639.                    4.07         (same as above)
  28640.                    5.01.21      (same as above)
  28641.                    5.03         (same as above)
  28642.  
  28643.  65537 and over    3.65         LINK : fatal error L1005:
  28644.                    4.06         LINK : fatal error L1005: packing limit
  28645.                                 exceeds 65536 bytes
  28646.                    4.07         (same as above)
  28647.                    5.01.21      (same as above)
  28648.                    5.03         (same as above)
  28649.  ----------------------------------------------------------------------
  28650.  
  28651.  Note : With LINK Version 5.03 and later, the /PAC option has been
  28652.  changed to /PACKC to differentiate /PACKC[ODE] from the new
  28653.  /PACKD[ATA] option.
  28654.  
  28655.  
  28656.  61. How and When to Specify Stack Size (Clarification)
  28657.  
  28658.  Product Version(s): 3.65 4.06 4.07 | 5.01.21
  28659.  Operating System:   MS-DOS         | OS/2
  28660.  Flags: ENDUSER |
  28661.  Last Modified: 30-NOV-1989    ArticleIdent: Q50950
  28662.  
  28663.  Question:
  28664.  
  28665.  When I want to specify a certain stack size for a program, should I
  28666.  use the /F compiler option, the /ST linker option, or both?
  28667.  
  28668.  Response:
  28669.  
  28670.  This depends on how you are compiling and linking. If you using the CL
  28671.  command to compile and link, the /F compiler option is all that is
  28672.  necessary. This option will pass the correct size of the stack to the
  28673.  linker.
  28674.  
  28675.  On the other hand, if you are invoking the compiler and the linker
  28676.  separately (as in a make file), the /ST link option can be used to get
  28677.  the desired stack size. The /ST link option is documented on Page 123
  28678.  of the "Microsoft C Optimizing Compiler User's Guide."
  28679.  
  28680.  No stack information is stored in the object module. Therefore, using
  28681.  the /F and /c (compile only) options together and then invoking link
  28682.  separately will not generate the desired stack size. The /F compile
  28683.  option is documented on Page 102 of the "Microsoft C Optimizing
  28684.  Compiler User's Guide."
  28685.  
  28686.  
  28687.  62. Linking Method May Result in Unexpected Increase in .EXE Size
  28688.  
  28689.  Product Version(s): 3.x 4.06 4.07 5.01.21 5.03 | 5.01.21 5.03
  28690.  Operating System:   MS-DOS                     | OS/2
  28691.  Flags: ENDUSER |
  28692.  Last Modified: 21-FEB-1990    ArticleIdent: Q58689
  28693.  
  28694.  Question:
  28695.  
  28696.  When my program is linked in the following manner
  28697.  
  28698.     link  file1.obj file2.obj library.lib;
  28699.  
  28700.  the resulting executable file is much larger than if the program is
  28701.  linked this way:
  28702.  
  28703.     link  file1.obj file2.obj,,,library.lib;
  28704.  
  28705.  What causes the difference in size?
  28706.  
  28707.  Response:
  28708.  
  28709.  This is expected behavior, the difference in size is due to the
  28710.  difference in linking method.
  28711.  
  28712.  The first method has the library name in the same field as the object
  28713.  files. Libraries entered in this field are called "load libraries" as
  28714.  opposed to "regular libraries." Link automatically links in every
  28715.  object module in a load library; it does not search for unresolved
  28716.  external references first.
  28717.  
  28718.  The effect of using a load library is exactly the same as if you had
  28719.  entered all the names of the library's object modules as separate
  28720.  object files on the link command line. This feature is useful if you
  28721.  are developing software using many modules and want to avoid having to
  28722.  retype each module on the LINK command line.
  28723.  
  28724.  With the second method, LINK links in only the objects from the
  28725.  library that are required for program execution.
  28726.  
  28727.  Please see documentation on LINK, such as Section 12.1.2 of the
  28728.  Microsoft C 5.1 "CodeView and Utilities Software Development Tools for
  28729.  the MS-DOS Operating System" manual (Page 257) for more information.
  28730.  
  28731.  
  28732.  63. Linker Uses Library Sequence to Resolve External References
  28733.  
  28734.  Product Version(s):
  28735.  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.
  28736.  Flags: MS-DOS                                  | OS/2
  28737.  Last Modified: 26-FEB-1990    ArticleIdent: Q57706
  28738.  ENDUSER |
  28739.  
  28740.  "The MS-DOS Encyclopedia," Pages 407 and 408, states the following:
  28741.  
  28742.     When a public symbol required to resolve an external reference is
  28743.     declared more than once among the object modules in the input
  28744.     libraries, LINK uses the first object module that contains the
  28745.     public symbol. This means that the actual executable code or data
  28746.     associated with a particular external reference can be varied by
  28747.     changing the order in which LINK processes its input libraries...
  28748.  
  28749.     Each individual library is searched repeatedly (from first library
  28750.     to last, in the sequence in which they are input to LINK) until no
  28751.     further external references can be resolved.
  28752.  
  28753.  The following simple case demonstrates the concept:
  28754.  
  28755.     Module MAIN   Library A     Library B1    Library C     Library B2
  28756.     +---------+   +----------+  +----------+  +----------+  +----------+
  28757.     | calls A |   | contains |  | contains |  | contains |  | contains |
  28758.     +---------+   |    A,    |  |    B     |  |    C,    |  |    B     |
  28759.                   | calls  C |  +----------+  | calls  B |  +----------+
  28760.                   +----------+                +----------+
  28761.  
  28762.  The linker determines which copy of Module B to use depending on the
  28763.  library sequence. For example, when you link with the following, the
  28764.  Module B from Library B2 is selected:
  28765.  
  28766.     LINK MAIN,,,A B1 C B2;
  28767.  
  28768.  The linker looks first in Library C and, unable to resolve the
  28769.  reference, proceeds to the next library, B2. If the linker is still
  28770.  unable to resolve the reference, it continues searching at Library A.
  28771.  
  28772.  A slightly more complex case, when Library A contains both Module A
  28773.  and Module B, produces different results, as shown below:
  28774.  
  28775.     Module MAIN   Library A     (remove B1)   Library C     Library B2
  28776.     +---------+   +----------+                +----------+  +----------+
  28777.     | calls A |   | contains |                | contains |  | contains |
  28778.     +---------+   |    A,    |                |    C,    |  |    B     |
  28779.                   | calls  C |                | calls  B |  +----------+
  28780.                   +----------+                +----------+
  28781.                   | contains |
  28782.                   |    B     |
  28783.                   +----------+
  28784.  
  28785.  Link with "LINK MAIN,,,A C B2;". In this case, Module B from Library A
  28786.  is selected.
  28787.  
  28788.  Although the linker always follows the same rules for resolution, it
  28789.  gets more difficult to determine which version of a module will be
  28790.  selected in more complex cases. When feasible, you can avoid this
  28791.  problem by putting your selected versions in an .OBJ instead of an
  28792.  .LIB. The linker uses any .OBJs to resolve references before it
  28793.  uses libraries.
  28794.  
  28795.  For more information, refer to "The MS-DOS Encyclopedia," Article 20:
  28796.  "The Microsoft Object Linker," in the "Object Module Order" section,
  28797.  Pages 703-706.
  28798.  
  28799.  
  28800.  64. Calling Overlaid Functions Through Pointers Not Supported
  28801.  
  28802.  Product Version(s): 1.x 2.x 3.x 4.06 4.07 5.01.21 5.02 5.03
  28803.  Operating System:   MS-DOS
  28804.  Flags: ENDUSER | S_C S_QuickC
  28805.  Last Modified: 30-JAN-1990    ArticleIdent: Q58098
  28806.  
  28807.  LINK does not support using function pointers for calling functions in
  28808.  overlays unless the function is being called from within the same
  28809.  overlay. If an overlaid function is being called from the root or from
  28810.  a different overlay, then the call must not be made through a pointer.
  28811.  
  28812.  LINK cannot support calling overlaid functions indirectly through
  28813.  pointers because the address of the indirect function is determined at
  28814.  load time.
  28815.  
  28816.  In a program with overlays, a normal function call (that is, not a
  28817.  call through a pointer) is recognized by the linker and an interrupt
  28818.  call is placed into the .EXE in place of the function call. When the
  28819.  function is called at run time, the interrupt directs control to the
  28820.  overlay manager. The overlay manager checks whether the right overlay
  28821.  is loaded into memory, loads it if necessary, and calls the function.
  28822.  Because there is a fixup record in the .OBJ for the function call, the
  28823.  linker can set everything up correctly.
  28824.  
  28825.  On the other hand, with a function pointer, the compiler creates a
  28826.  fixup record for the address that the pointer references. However,
  28827.  there is no indication in the fixup record that this address is for a
  28828.  function. Therefore, if you link the function in as an overlay, the
  28829.  linker does not insert a call to the overlay manager and instead does
  28830.  a standard fixup.
  28831.  
  28832.  As a result, if you indirectly call a function located in a not-as-yet
  28833.  loaded overlay, the overlay does not get loaded. Nevertheless, control
  28834.  is still transferred to the address at which the function is thought
  28835.  to reside, which can only mean disaster for the executing program.
  28836.  
  28837.  
  28838.  65. /PAU Linker Option Doesn't Function in Some Versions of LINK
  28839.  
  28840.  Product Version(s): 3.61 3.65 3.69 5.01.20 5.05 | 5.01.20 5.05
  28841.  Operating System:   MS-DOS                      | OS/2
  28842.  Flags: ENDUSER |
  28843.  Last Modified: 21-FEB-1990    ArticleIdent: Q58781
  28844.  
  28845.  The /PAU (PAUSE) linker option tells LINK to pause in the link session
  28846.  and display a message before it writes the executable file to disk,
  28847.  allowing you to insert a new disk on which to store the executable
  28848.  file.
  28849.  
  28850.  In Microsoft LINK.EXE Versions 3.61, 3.65, 3.69, 5.01.20, and 5.05,
  28851.  the /PAU linker option does not pause the link session.
  28852.  
  28853.  Microsoft is researching this problem and will post new information
  28854.  here as it becomes available.
  28855.  
  28856.  In versions where the /PAU linker option functions correctly, LINK
  28857.  displays the following message before it creates the executable file:
  28858.  
  28859.     About to generate .EXE file
  28860.     Change diskette in drive ___ and press <ENTER>
  28861.  
  28862.  LINK resumes processing after the ENTER key is pressed.
  28863.  
  28864.  
  28865.  66. /INC and Overlays Are Not Supported at the Same Time
  28866.  
  28867.  Product Version(s): 5.01.20 5.01.21 5.02 5.03
  28868.  Operating System:   MS-DOS
  28869.  Flags: ENDUSER | docsup
  28870.  Last Modified: 15-MAY-1990    ArticleIdent: Q59279
  28871.  
  28872.  LINK.EXE does not support the use of /INCREMENTAL (or /INC) switch and
  28873.  overlays at the same time. This is because ILINK.EXE, which is invoked
  28874.  by the /INC option, does not support overlays. One of the two
  28875.  operations is ignored.
  28876.  
  28877.  The linker produces a working executable file, but one of the
  28878.  following WARNING messages may be produced:
  28879.  
  28880.     L4013: Overlays: option ignored for segmented-executable file
  28881.     L4014: /INCREMENTAL : Option ignored for realmode executable file
  28882.  
  28883.  If no warning message is produced, the linker takes an unpredictable
  28884.  path. If this is the case, the executable file that is produced could
  28885.  be corrupted and should NOT be relied upon.
  28886.  
  28887.  
  28888.  67. Incomplete EXPORTS List May Cause L2022 and L2029
  28889.  
  28890.  Product Version(s): 3.65
  28891.  Operating System:   MS-DOS
  28892.  Flags: ENDUSER |
  28893.  Last Modified: 12-MAR-1990    ArticleIdent: Q59385
  28894.  
  28895.  Compiling and linking a Windows program and receiving the following
  28896.  two link errors can be caused by an incomplete EXPORTS list:
  28897.  
  28898.     LINK : error L2022: ProcedureName : export undefined
  28899.     LINK : error L2029: 'ProcedureName' : unresolved external
  28900.  
  28901.  Windows programming involves the creation of a .DEF (definitions)
  28902.  file. All Windows procedures to be exported must be listed in this
  28903.  file. The following is an example:
  28904.  
  28905.     EXPORTS     ProcedureName
  28906.  
  28907.  When this list is incomplete, the L2022 error is generated. The L2029
  28908.  error can be generated if the case of the EXPORT line doesn't match
  28909.  the case of the actual function.
  28910.  
  28911.  Listing all procedures to be exported in the .DEF file prevents both
  28912.  of these errors.
  28913.  
  28914.  Note: These errors can also occur with Presentation Manager programs
  28915.  or programs that use DLLs under OS/2.
  28916.  
  28917.  
  28918.  68. Why the /HIGH Switch Is Not Used with High-Level Languages
  28919.  
  28920.  Product Version(s): 3.65
  28921.  Operating System:   MS-DOS
  28922.  Flags: ENDUSER |
  28923.  Last Modified: 15-MAR-1990    ArticleIdent: Q59535
  28924.  
  28925.  The linker option /HIGH is used with assembly language programs to
  28926.  load an .EXE file as high as possible in memory. Without the /HIGH
  28927.  option, LINK places the .EXE file as low as possible.
  28928.  
  28929.  /HIGH is not used with high-level languages because it prohibits the
  28930.  use of dynamic memory allocation by the program. Furthermore, C
  28931.  run-time start-up code specifies /DOSSEG, which forces low load and
  28932.  Microsoft run-time segment layout.
  28933.  
  28934.  When a program is linked with /HIGH, MS-DOS loads the program at the
  28935.  highest possible memory location available, usually 0xFFF0. All memory
  28936.  between the program's segments (which are high) and the program's PSP
  28937.  (which is low) is now considered program RAM, owned by the program.
  28938.  You can no longer allocate or free that memory.
  28939.  
  28940.  Therefore, calls to routines such as malloc() and free() fail. This
  28941.  causes problems for the following reasons:
  28942.  
  28943.  1. Some memory is dynamically allocated during function calls from
  28944.     high-level languages.
  28945.  
  28946.  2. The memory structure required by Microsoft high-level languages for
  28947.     tracking used/freed memory is not available.
  28948.  
  28949.  You can use /HIGH if you write your own start-up code, but your
  28950.  programs cannot call most of the routines from the C run-time library.
  28951.  
  28952.  The only reason /HIGH is still available to the linker is that early
  28953.  versions of Microsoft FORTRAN and Microsoft Pascal generated code that
  28954.  had to be linked with /DSALLOCATE, which relocates all addresses
  28955.  within DGROUP in such a way that the last byte in the group has the
  28956.  offset 0xFFFF. The /HIGH switch is used in conjunction with the
  28957.  /DS(ALLOCATE) switch.
  28958.  
  28959.  For more information, search the knowledge base with the following
  28960.  query:
  28961.  
  28962.     S_LINK and /HIGH and /DS
  28963.  
  28964.  You can also read the section "Using the /HIGH and /DSALLOCATE
  28965.  Switches" on Page 719 ff in the "MS-DOS Encyclopedia."
  28966.  
  28967.  
  28968.  69. OS/2 Module Definition File Syntax
  28969.  
  28970.  Product Version(s): 5.01.21 5.02 5.03 5.05
  28971.  Operating System:   OS/2
  28972.  Flags: ENDUSER | S_C
  28973.  Last Modified: 16-MAR-1990    ArticleIdent: Q59536
  28974.  
  28975.  The following is extracted from Ray Duncan's "Advanced OS/2
  28976.  Programming," Page 737:
  28977.  
  28978.     Module definition (DEF) files are simple ASCII text files that are
  28979.     interpreted by the linker during the construction of an application
  28980.     program, dynlink library, or device driver. The directives in DEF
  28981.     files cause information to be built into the executable file's
  28982.     header, which is later interpreted by the system when the program,
  28983.     library, or driver is loaded.
  28984.  
  28985.     Enter all DEF file directives and keywords in uppercase letters.
  28986.     File, segment, group, and procedure names can be lowercase or
  28987.     uppercase. Lines beginning with a semicolon (;) are treated as
  28988.     comments.
  28989.  
  28990.     Figure E-1. DEF file directives documented in Appendix E
  28991.     --------------------------------------------------------
  28992.  
  28993.     CODE        Assigns characteristics to code segments
  28994.     DATA        Assigns characteristics to data segments
  28995.     DESCRIPTION Embeds text in executable file
  28996.     EXETYPE     Specifies host operating system
  28997.     EXPORTS     Names functions exported for dynamic linking by other
  28998.                 programs
  28999.     HEAPSIZE    Specifies initial size of local heap (C programs only)
  29000.     IMPORTS     Names functions that will be dynamically linked at load
  29001.                 time
  29002.     LIBRARY     Builds dynlink library or device driver
  29003.     NAME        Builds application program
  29004.     OLD         Specifies ordinal compatibility with previous version of
  29005.                 dynlink library
  29006.     PROTMODE    Flags file as executable in protected mode only
  29007.     REALMODE    Allows file to be executed in real mode
  29008.     SEGMENTS    Assigns characteristics to selected segments
  29009.     STACKSIZE   Specifies size of stack used by primary thread
  29010.     STUB        Embeds MS-DOS-compatible program in new executable file
  29011.  
  29012.  For further information, refer to Appendix E, Module Definition File
  29013.  Syntax, in "Advanced OS/2 Programming" or Chapter 19, Using Module-
  29014.  Definition Files, in the "Microsoft FORTRAN CodeView and Utilities
  29015.  User's Guide," packaged with FORTRAN Version 5.00.
  29016.  
  29017.  
  29018.  70. Linker Error L4047 May Be Benign
  29019.  
  29020.  Product Version(s): 5.10    | 5.10
  29021.  Operating System:   MS-DOS  | OS/2
  29022.  Flags: ENDUSER |
  29023.  Last Modified: 18-APR-1990    ArticleIdent: Q59936
  29024.  
  29025.  The following linker error may be a benign error if it occurs with an
  29026.  application that links with the C Version 6.00 start-up code:
  29027.  
  29028.     L4047 - Multiple code segments in module of overlayed program
  29029.             incompatible with /CO
  29030.  
  29031.  This is a new error for LINK Version 5.10 and is to be expected.
  29032.  
  29033.  If an application is built with the C Version 6.00 run-time library,
  29034.  there is a second segment to hold floating-point math routines. This
  29035.  segment (EMULATOR_TEXT) does not have any CodeView information in it.
  29036.  However, from the linker's perspective, the extra segment MAY be an
  29037.  error and it is warning the user of such. In this case, it is a benign
  29038.  warning message.
  29039.  
  29040.  
  29041.  71. NODATA and pwords Parameters Reversed in EXPORT Statement Docs
  29042.  
  29043.  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
  29044.  Operating System:   MS-DOS                      | OS/2
  29045.  Flags: ENDUSER | docerr
  29046.  Last Modified: 25-MAY-1990    ArticleIdent: Q61605
  29047.  
  29048.  The EXPORT statement used in module definition (.DEF) files is
  29049.  incorrectly documented in several places with the last two parameters
  29050.  reversed. The "pwords" parameter should be the last parameter, but it
  29051.  is listed second from the end. The "NODATA" parameter is listed last,
  29052.  but should be second from the end. The correct EXPORT statement syntax
  29053.  is as follows:
  29054.  
  29055.     entryname [=internalname] [@ord[RESIDENTNAME]] [NODATA] [pwords]
  29056.  
  29057.  Note that the "pwords" parameter is listed as "iopl-parmwords" in some
  29058.  of the documentation.
  29059.  
  29060.  The documentation with the incorrect EXPORT statement syntax with
  29061.  reversed parameters is as follows:
  29062.  
  29063.  - The C version 6.00 online help for LINK under the EXPORT statement
  29064.    syntax
  29065.  
  29066.  - On Page 334 of "The Microsoft CodeView and Utilities User's
  29067.    Guide" for version 2.30 in Section 19.9, "The EXPORTS
  29068.    Statement" (shipped with FORTRAN 5.00 and BASIC PDS 7.00)
  29069.  
  29070.  - On Page Update-52 of "The Microsoft CodeView and Utilities
  29071.    Update" for version 2.20 in Section 7.8, "The EXPORTS
  29072.    Statement" (shipped with C 5.10, MASM 5.10, and Pascal 4.00)
  29073.  
  29074.  
  29075.  72. Fatal /nologo and /e Switch Interaction
  29076.  
  29077.  Product Version(s): 1.20   | 1.20
  29078.  Operating System:   MS-DOS | OS/2
  29079.  Flags: ENDUSER | buglist1.20
  29080.  Last Modified: 22-JUN-1990    ArticleIdent: Q62375
  29081.  
  29082.  Using the /nologo switch in conjunction with /e switch can cause ILINK
  29083.  version 1.20 to fail. The problem will occur when an incremental link
  29084.  cannot be performed and the command specified by the /e switch is
  29085.  performed instead. If the /e switch is preceded anywhere on the
  29086.  command line by /nologo, then the link will fail.
  29087.  
  29088.  For example, the following command line
  29089.  
  29090.      ILINK /nologo /e "link hello;" hello.exe
  29091.  
  29092.  where hello.obj exists but hello.exe doesn't, will produce the
  29093.  following messages:
  29094.  
  29095.     Microsoft (R) Segmented-Executable Linker  Version 5.10
  29096.     Copyright (C) Microsoft Corp 1984-1990.  All rights reserved.
  29097.  
  29098.     LINK : fatal error L1089:  : cannot open response file
  29099.     ILINK : warning L4252: file '/e.exe' does not exist
  29100.     ILINK : performing full link
  29101.     ILINK : fatal error L1233: 'link' returned 2
  29102.  
  29103.  Placing the /nologo switch after the /e switch on the command line
  29104.  will alleviate the problem.
  29105.  
  29106.  Microsoft has confirmed this to be a problem with LINK version 1.20.
  29107.  We are researching this problem and will post new information here as
  29108.  it becomes available.
  29109.  
  29110.  
  29111.  73. L4050 Incorrectly Documented in Online Help
  29112.  
  29113.  Product Version(s): 5.10   | 5.10
  29114.  Operating System:   MS-DOS | OS/2
  29115.  Flags: ENDUSER | docerr buglist5.10 S_PWB
  29116.  Last Modified: 24-JUL-1990    ArticleIdent: Q63235
  29117.  
  29118.  When linking a very small program with /EXEPACK, Microsoft LINKer
  29119.  version 5.10 sometimes gives the following error message:
  29120.  
  29121.     LINK: warning L4050: file not suitable for /EXEPACK; relink without
  29122.  
  29123.  The online Help documentation returns the following incorrect
  29124.  information:
  29125.  
  29126.     LINK warning L4050
  29127.  
  29128.     too many public symbols for sorting
  29129.  
  29130.     The linker uses the stack and all available memory in the near
  29131.     heap to sort public symbols for the /MAP option. If the number of
  29132.     public symbols exceeds the space available for them, this warning
  29133.     is issued and the symbols are not sorted in the map file but are
  29134.     listed in an arbitrary order.
  29135.  
  29136.     Reduce the number of symbols.
  29137.  
  29138.  The correct documentation for this error (except the number) is as
  29139.  follows and can be found in the online Help under L1114:
  29140.  
  29141.     Fatal LINK error L1114
  29142.  
  29143.     file not suitable for /EXEPACK; relink without
  29144.  
  29145.     For the linked program, the size of the packed load image plus
  29146.     packing overhead was larger than that of the unpacked load image.
  29147.  
  29148.     Relink without the /EXEPACK option.
  29149.  
  29150.  Because of its noncritical nature, this LINKer error was changed from
  29151.  its previous status of a fatal error to a simple warning in LINK
  29152.  version 5.10. The warning associated with L4050 in earlier versions of
  29153.  the LINKer will rarely appear in LINK 5.10, but if it does, it will
  29154.  have the number L4070.
  29155.  
  29156.  
  29157.  
  29158.  74. Parenthesis in Filename May Cause L1027: Unmatched Parenthesis
  29159.  
  29160.  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
  29161.  Operating System:   MS-DOS                               | OS/2
  29162.  Flags: ENDUSER |
  29163.  Last Modified: 10-JUL-1990    ArticleIdent: Q63624
  29164.  
  29165.  When linking object files into executable programs, the error L1027:
  29166.  "Unmatched left/right parenthesis" may be incorrectly generated for
  29167.  files that contain a parenthesis in the filename. This will only occur
  29168.  when the object module is in the current directory and either of the
  29169.  following conditions is true:
  29170.  
  29171.  1. If the object module being linked has a left parenthesis as the
  29172.     first character in its name, but NOT a right parenthesis as the last
  29173.     character.
  29174.  
  29175.  2. If an object filename has a right parenthesis as the last
  29176.     character in the name, but NOT a left parenthesis as the first.
  29177.  
  29178.  If the object module is NOT in the current directory, then the L1027
  29179.  error will occur only if the second condition above is true.
  29180.  
  29181.  This information applies to all versions of LINK.EXE that support
  29182.  overlays.
  29183.  
  29184.  Normally, parentheses are put around the names of one or more object
  29185.  modules when linking to inform LINK that the enclosed modules are to
  29186.  be in an overlay. Therefore, if a left (or right) parenthesis comes
  29187.  immediately before (or after) the name of an object module, LINK will
  29188.  expect a right (or left) parenthesis immediately after (or before) the
  29189.  name. If the parentheses do not match, a fatal L1027 error will be
  29190.  generated.
  29191.  
  29192.  For example, the following LINK command line causes an "Unmatched left
  29193.  parenthesis" error when the object module ABC.OBJ is in the current
  29194.  directory:
  29195.  
  29196.     link (abc;
  29197.  
  29198.  However, if ABC.OBJ is in a subdirectory, then the parenthesis is
  29199.  embedded in the middle of the path/filename string and no error is
  29200.  generated, as shown below:
  29201.  
  29202.     link temp\(abc;
  29203.  
  29204.  For the same reason, a file ABC).OBJ will NOT give an error if linked
  29205.  with the following line:
  29206.  
  29207.     link abc).obj;
  29208.  
  29209.  On the other hand, leaving off the .OBJ extension will result in the
  29210.  L1027 error:
  29211.  
  29212.     link abc);
  29213.  
  29214.  By the same reasoning, the placement of a left or right parenthesis in
  29215.  the middle of an object filename does not cause an error. The
  29216.  following three LINK lines all work correctly:
  29217.  
  29218.     link a(bc;
  29219.     link a()bc;
  29220.     link a)bc;
  29221.  
  29222.  
  29223.  75. ILINK 1.20 and 1.21 Are Not Backwards Compatible
  29224.  
  29225.  Product Version(s): 1.20 1.21 | 1.20 1.21
  29226.  Operating System:   MS-DOS    | OS/2
  29227.  Flags: ENDUSER |
  29228.  Last Modified: 24-OCT-1990    ArticleIdent: Q65817
  29229.  
  29230.  Using ILINK version 1.20 or 1.21, after doing a full link using a
  29231.  bound linker earlier than version 5.10 or a DOS linker earlier than
  29232.  version 4.10, causes the following message:
  29233.  
  29234.     ILINK : warning L4267: invalid .ILK file
  29235.     ILINK : performing full link
  29236.  
  29237.  If you use the ILINK version that came with the linker you are using,
  29238.  the .ILK file will be recognized correctly. ILINK versions 1.20 and
  29239.  1.21 are not "backwards compatible" and will not work correctly with
  29240.  earlier .ILK files.
  29241.  
  29242.  
  29243.  76. Unexpected DOS Error: 14 Generated by Using /INC
  29244.  
  29245.  Product Version(s): 5.10
  29246.  Operating System:   MS-DOS
  29247.  Flags: ENDUSER | s_quickc s_c
  29248.  Last Modified: 24-OCT-1990    ArticleIdent: Q66055
  29249.  
  29250.  Programs linked with the /INC (Prepare for Incremental Link) switch
  29251.  cause the following error if the program is executed using the
  29252.  Microsoft Windows version 3.00 Run command:
  29253.  
  29254.     Unexpected DOS error: 14.
  29255.  
  29256.  The Run command is located on the File menu in both the Windows
  29257.  Program Manager and the File Manager. If the program is run from a
  29258.  prompt in real DOS or in a DOS session of Windows 3.00, it executes
  29259.  properly.
  29260.  
  29261.  While this seems like a problem with the Microsoft Linker, Windows 3.0
  29262.  is actually at fault here. The use of the /INC switch causes the
  29263.  linker to create a segmented executable. When Windows attempts to run
  29264.  this .exe, it fails to recognize that it is a full screen application
  29265.  (ie: not a windows app) and subsequently tries to execute it as a
  29266.  Windows application. This bug has been entered into the Windows bug
  29267.  database and should be fixed in a future release.
  29268.  
  29269.  Note: This may appear to be a problem with QuickC and/or C version
  29270.  6.00 if the incremental link option is turned on. In fact, it is a
  29271.  linking issue, not a compiler issue.
  29272.  
  29273.  To workaround this problem, turn off the /INC switch.
  29274.  
  29275.  
  29276.  77. Response Filename Cannot Exceed 32 Characters
  29277.  
  29278.  Product Version(s): 5.01.21 5.03 5.05 | 5.01.21 5.03 5.05
  29279.  Operating System:   MS-DOS            | OS/2
  29280.  Flags: ENDUSER | buglist5.01.21 buglist5.03 buglist5.05 fixlist5.10
  29281.  Last Modified: 12-NOV-1990    ArticleIdent: Q66698
  29282.  
  29283.  When using a complete path specification for a response file with
  29284.  LINK.EXE versions 5.01.21, 5.03, and 5.05, there is a limit of 32
  29285.  characters that cannot be exceeded. The following example illustrates
  29286.  this:
  29287.  
  29288.     LINK @d:\c600\files\project\test\myfile.lnk
  29289.  
  29290.  This will fail with the following error:
  29291.  
  29292.     LINK : Fatal error L1089 : D:\C600\FILES\PROJECT\TEST\MYFIL :
  29293.          cannot open response file
  29294.  
  29295.  In LINK version 5.10, this limit has been increased to 255 characters.
  29296.  
  29297.  
  29298.  78. Linker Does Not Search Specified Drive for Libraries
  29299.  
  29300.  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
  29301.  Operating System:   MS-DOS                       | OS/2
  29302.  Flags: ENDUSER | buglist5.01.21 buglist5.03 buglist5.05 buglist5.10 buglist5.
  29303.  Last Modified: 12-NOV-1990    ArticleIdent: Q66699
  29304.  
  29305.  A library name can be embedded into an .OBJ module for the linker to
  29306.  search to resolve external references. This library name can either be
  29307.  the library name itself or the full path to the library. In the case
  29308.  of the full path to the library, the linker cannot handle a drive
  29309.  specifier.
  29310.  
  29311.  For example, with Microsoft C, the #pragma comment command is used to
  29312.  specify the library. If the following line is used
  29313.  
  29314.     #pragma comment (lib, "c:\C600\LIB\graphics.lib")
  29315.  
  29316.  the compiler will add a COMENT record to the .OBJ instructing the
  29317.  linker to search the C600\LIB subdirectory on drive C for the
  29318.  GRAPHICS.LIB library.
  29319.  
  29320.  The problem is that the linker will not search drive C but will
  29321.  instead search the default drive. When the library and/or path is not
  29322.  found, it will prompt for the path to the library. This is an error.
  29323.  
  29324.  Microsoft has confirmed this to be a problem in the Segmented Linker
  29325.  versions 5.01.21, 5.03, 5.05, 5.10, and 5.11. We are researching this
  29326.  problem and will post new information here as it becomes available.
  29327.  
  29328.  
  29329.  79. L2002 When Creating a Dynamic Link Library
  29330.  
  29331.  Product Version(s): 5.10 5.11
  29332.  Operating System:   OS/2
  29333.  Flags: ENDUSER | buglist5.10 buglist5.11
  29334.  Last Modified:  4-DEC-1990    ArticleIdent: Q67004
  29335.  
  29336.  The code sample below produces the following error when compiled and
  29337.  linked with the following switches:
  29338.  
  29339.  cl /c /Gs /Alfu /ML foo.c
  29340.  
  29341.  link foo.obj, foo.dll,,, foo.def;
  29342.  
  29343.  Error
  29344.  -----
  29345.  
  29346.     L2002: fix-up overflow at 2 in segment FOO_TEXT
  29347.      frm seg _DATA, tgt seg _DATA, tgt offset 0
  29348.  
  29349.  This error is produced when creating a dynamic link library and
  29350.  specifying _loadds on function entry (either with the /Au switch or
  29351.  the _loadds keyword). If each segment that comprises the default data
  29352.  segment is of zero length, the linker will return this error. In
  29353.  earlier linkers, the error wasn't generated.
  29354.  
  29355.  The following are three possible workarounds:
  29356.  
  29357.  1. If the function does not contain any static data, compile with the
  29358.     option /Aw (DS not reloaded on function entry) and/or remove the
  29359.     _loadds keyword from the function declaration.
  29360.  
  29361.  2. Turn on stack checking (compile without /Gs option).
  29362.  
  29363.  3. Declare data so at least one of the segments in DGROUP is not zero
  29364.     length.
  29365.  
  29366.     a. For _DATA, declare initialized global or static data.
  29367.  
  29368.     b. For _CONST, declare a constant in the program.
  29369.  
  29370.     c. For _BSS, declare uninitialized static data.
  29371.  
  29372.  Microsoft has confirmed this to be a problem in versions 5.10 and
  29373.  5.11. We are researching this problem and will post new information
  29374.  here as it becomes available.
  29375.  
  29376.  Sample Code
  29377.  -----------
  29378.  
  29379.  void foo(int i)
  29380.  {
  29381.     char c;
  29382.  
  29383.     c=i;
  29384.  }
  29385.  
  29386.  
  29387.  80. NOF Is Default for LINK, Not /F as C "Reference" States
  29388.  
  29389.  Product Version(s): 5.10   | 5.10
  29390.  Operating System:   MS-DOS | OS/2
  29391.  Flags: ENDUSER | docerr S_C
  29392.  Last Modified:  4-JAN-1991    ArticleIdent: Q67085
  29393.  
  29394.  On pages 30 and 31 of the "Microsoft C Reference" manual shipped with
  29395.  C versions 6.00 and 6.00a, there are contradictory references to the
  29396.  far-call translation options available for LINK. On page 30 under the
  29397.  /F[ARCALLTRANSLATION] option, far-call translations are listed as
  29398.  being "turned on by default." On the other hand, on page 31 under the
  29399.  /NOF[ARCALLTRANSLATION] option, far-calls are listed as being "off by
  29400.  default."
  29401.  
  29402.  The statement on page 30 is the one that is incorrect because the
  29403.  correct default for far-call translations is "off." Far calls are done
  29404.  only when /F is explicitly specified to LINK.
  29405.  
  29406.  Note that when the CL command is used to invoke LINK, CL itself is
  29407.  responsible for passing the /F option to the linker.
  29408.  
  29409.  
  29410.  81. EXE Checksum Incorrect If linked with /CO or /E
  29411.  
  29412.  Product Version(s): 3.xx 4.0x 4.10 5.0x 5.10 5.13 | 5.0x 5.10 5.13
  29413.  Operating System:   MS-DOS                        | OS/2
  29414.  Flags: ENDUSER |
  29415.  Last Modified:  6-FEB-1991    ArticleIdent: Q67795
  29416.  
  29417.  According to "The MS-DOS Encyclopedia," a DOS .EXE file contains a
  29418.  checksum value in the .EXE file header. This checksum value should
  29419.  allow the summation of all words in the .EXE file to equal FFFFh.
  29420.  However, if you use the /Exepack or the /COdeview options when linking
  29421.  a program, the checksum value will not be calculated correctly.
  29422.  Current versions of MS-DOS ignore this checksum so this will not cause
  29423.  any noticeable problems.
  29424.  
  29425.  Sample Code:
  29426.  ------------
  29427.  
  29428.  #include <stdio.h>
  29429.  #include <stdlib.h>
  29430.  
  29431.  main (int argc, char * argv[])
  29432.  {
  29433.     FILE * fp;
  29434.     unsigned int nxt= 0, sum= 0;
  29435.     unsigned char bl, bh;
  29436.  
  29437.     if (argc != 2)
  29438.        exit (-1);
  29439.     if ((fp= fopen (argv[1], "rb"))== NULL)
  29440.        exit (-1);
  29441.     while (! feof(fp))
  29442.     {
  29443.        bl= fgetc (fp);
  29444.        if (! feof(fp))
  29445.           bh= fgetc (fp);
  29446.        else
  29447.           {
  29448.           bl= 0;
  29449.           bh= 0;
  29450.           }
  29451.        sum= sum+ nxt;
  29452.        nxt= (unsigned int) bh* 256U+ (unsigned int) bl;
  29453.     }
  29454.     nxt&= 0xFF;
  29455.     sum+= nxt;
  29456.     printf ("sum = %X\n", sum);
  29457.  }
  29458.  
  29459.  
  29460.  82. L1008: "Segment Limit Too High" May Be Caused by Missing Colon
  29461.  
  29462.  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
  29463.  Operating System:   MS-DOS                               | OS/2
  29464.  Flags: ENDUSER |
  29465.  Last Modified: 17-DEC-1990    ArticleIdent: Q46733
  29466.  
  29467.  When linking, the following error may be caused by incorrectly
  29468.  specifying the parameters for the /SE switch on the link command line
  29469.  with the colon:
  29470.  
  29471.     LINK : fatal error L1008: SE: segment limit set too high
  29472.  
  29473.  To generate the error, link using the /SE switch, then insert a space
  29474.  and the number of segments for the linker to use, such as the
  29475.  following:
  29476.  
  29477.     LINK /SE 1024
  29478.  
  29479.  The correct syntax for the /SE option is with a colon separating the
  29480.  switch from the numeric argument as follows:
  29481.  
  29482.     LINK /SE:1024
  29483.  
  29484.  
  29485.  83. The Purpose of Module Definition Files
  29486.  
  29487.  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
  29488.  Operating System:   MS-DOS                           | OS/2
  29489.  Flags: ENDUSER |
  29490.  Last Modified: 17-DEC-1990    ArticleIdent: Q27134
  29491.  
  29492.  Module-definition files (.DEF) are used by LINK when building Windows
  29493.  and OS/2 programs and dynamic-link libraries (DLLs). A .DEF file
  29494.  describes the name, size, format, functions, and segments of an
  29495.  application or DLL.
  29496.  
  29497.  A module-definition file contains one or more module statements. Each
  29498.  module statement defines an attribute of the executable file. The
  29499.  module statements and the attributes they define are listed below:
  29500.  
  29501.  Statement         Attribute
  29502.  ---------         ---------
  29503.  
  29504.  NAME              Name and type of application
  29505.  LIBRARY           Name of dynamic-link library
  29506.  DESCRIPTION       One-line description of the module
  29507.  CODE              Default attributes for code segments
  29508.  DATA              Default attributes for data segments
  29509.  SEGMENTS          Attributes for specific segments
  29510.  STACKSIZE         Local-stack size, in bytes
  29511.  EXPORTS           Exported functions
  29512.  IMPORTS           Imported functions
  29513.  STUB              Adds a DOS Version 3.x executable file to the beginning
  29514.                    of the module, usually to terminate the program when
  29515.                    run in real mode
  29516.  HEAPSIZE          Local-heap size, in bytes
  29517.  PROTMODE          Specifies that the module runs only in OS/2 protected
  29518.                    mode
  29519.  REALMODE          Specifies that the module is for real-mode Windows.
  29520.  OLD               Preserves export ordinal information from a previous
  29521.                    version of the library
  29522.  
  29523.  The following rules govern the use of these statements in a module-
  29524.  definitions file:
  29525.  
  29526.  1. If you use either a NAME or a LIBRARY statement, it must precede
  29527.     all other statements in the module-definition file.
  29528.  
  29529.  2. You can include source-level comments in the module-definition
  29530.     file, by beginning a line with a semicolon (;). The OS/2 utilities
  29531.     ignore each such comment line.
  29532.  
  29533.  3. Module-definition keywords (such as NAME, LIBRARY, and SEGMENTS)
  29534.     must be entered in uppercase letters.
  29535.  
  29536.  For more information, refer to the utility reference or online help
  29537.  that accompanied your particular compiler or assembler.
  29538.  
  29539.  
  29540.  84. Working Around Link Error "L1064: Out of Memory"
  29541.  
  29542.  Product Version(s): 5.03 5.05 5.10 5.13 | 5.03 5.05 5.10 5.13
  29543.  Operating System:   MS-DOS              | OS/2
  29544.  Flags: ENDUSER |
  29545.  Last Modified: 17-DEC-1990    ArticleIdent: Q45718
  29546.  
  29547.  The linker error "L1064: Out Of Memory" is new with LINK version 5.03,
  29548.  which was first shipped to individuals using IMSL libraries with
  29549.  FORTRAN 4.10, and was then shipped with FORTRAN 5.00. The description
  29550.  of the error is as follows (from the "Microsoft FORTRAN, Microsoft
  29551.  CodeView and Utilities User's Guide"):
  29552.  
  29553.     The linker was not able to allocate enough memory from the
  29554.     operating system to link the program. On OS/2 try increasing the
  29555.     swap space. Otherwise, reduce the size of the program in terms of
  29556.     code, data, and symbols. On OS/2, consider splitting the program
  29557.     into dynalink libraries.
  29558.  
  29559.  In DOS, the only ways to work around the error are the following:
  29560.  
  29561.  1. Remove any memory-resident software or device drivers that may be
  29562.     limiting the available memory of the machine.
  29563.  
  29564.  2. Reduce the program size, as described above.
  29565.  
  29566.  In OS/2, the easiest way to work around the error is to increase the
  29567.  swap space, as follows:
  29568.  
  29569.  1. Close other screen groups and remove other processes from
  29570.     memory to free up both RAM and swap space on the swap drive.
  29571.  
  29572.  2. Create more free disk space on the drive that is pointed to by
  29573.     the SWAPPATH setting in the CONFIG.SYS file. (Delete or move files,
  29574.     or change the setting to a drive with more free space.)
  29575.  
  29576.  3. Possibly DECREASE the swap value set by the SWAPPATH variable (do
  29577.     this with caution -- read below).
  29578.  
  29579.  Explanation of the SWAPPATH Setting in CONFIG.SYS
  29580.  -------------------------------------------------
  29581.  
  29582.  Swapping must be enabled via the MEMMAN setting in CONFIG.SYS for the
  29583.  SWAPPATH setting to be acknowledged at all (usually "MEMMAN=SWAP" or
  29584.  "MEMMAN=SWAP,MOVE").
  29585.  
  29586.  The default setting for SWAPPATH after setting up OS/2 is usually as
  29587.  follows:
  29588.  
  29589.     SWAPPATH=C:\OS2\SYSTEM 512
  29590.  
  29591.  The drive setting indicates the drive and directory where the space
  29592.  for the swapper file will be allocated. If no SWAPPATH variable is
  29593.  set, the swapper file is allocated in the root directory on the boot
  29594.  drive. The number that follows indicates the amount of free space
  29595.  which must be left on this drive when the swapper file has grown to
  29596.  its maximum size. (This number, by itself, says nothing about the
  29597.  maximum size of the swapper file.) Given the settings above, the
  29598.  maximum size of the swapper file can be easily calculated by the
  29599.  following:
  29600.  
  29601.     (free space on Drive C) - (SWAPPATH value) = max. swap file size
  29602.  
  29603.  Therefore, increasing the SWAPPATH value DECREASES the amount of space
  29604.  available for the swapper file.
  29605.  
  29606.  The swapper value can be decreased, and the system will allow values
  29607.  down to 0 (zero). However, because OS/2 does time-slicing between
  29608.  processes and may need to write to the disk in question, decreasing
  29609.  the swapper value below 512K (the system default) is not recommended.
  29610.  This workaround should be used only if you have the value set to
  29611.  greater than 512K (the range of valid values is from 0 to 32,767). If
  29612.  this is the case, set the SWAPPATH value to 512 and reboot the
  29613.  machine. If this method does not solve the problem, you must clear
  29614.  space on the hard disk by deleting or moving files.
  29615.  
  29616.  
  29617.  85. Patches Available for Running Utilities Under Novell NetWare
  29618.  
  29619.  Product Version(s): 5.10
  29620.  Operating System:   MS-DOS
  29621.  Flags: ENDUSER | appnote SC0381.ARC s_codeview s_pwb s_c
  29622.  Last Modified:  6-FEB-1991    ArticleIdent: Q68659
  29623.  
  29624.  When LINK version 5.10 is run under a Novell network, LINK may fail
  29625.  with the following error:
  29626.  
  29627.     L1085: cannot open temporary file
  29628.  
  29629.  In addition, the C version 6.00 Setup program (SETUP.EXE), the
  29630.  Programmer's WorkBench (PWB) for DOS versions 1.00 and 1.10, and
  29631.  real-mode CodeView (CV.EXE) versions 3.00, 3.10, and 3.11 may all hang
  29632.  when run under some Novell NetWare software.
  29633.  
  29634.  These problems are directly related to the network software, but may
  29635.  be corrected with a set of patch files available from Microsoft as an
  29636.  application note titled "Network Patches for Utilities" (SC0381).
  29637.  Application notes can be obtained by calling Microsoft Product Support
  29638.  Services at (206) 637-7096.
  29639.  
  29640.  The "Network Patches for Utilities" application note can also be found
  29641.  in the Software/Data Library by searching on the keyword SC0381, the Q
  29642.  number of this article, or S12898. SC0381 was archived using the
  29643.  PKware file-compression utility.
  29644.  
  29645.  The following is the complete text of the application note, which
  29646.  includes the details of the problems mentioned above:
  29647.  
  29648.  ======================================================================
  29649.                      Network Patches for Utilities
  29650.  ======================================================================
  29651.  
  29652.  The enclosed Network Patches for Microsoft Utilities disk contains the
  29653.  following five files:
  29654.  
  29655.     README.DOC
  29656.     CVPATCH.EXE
  29657.     PWBPATCH.EXE
  29658.     SETUPFIX.EXE
  29659.     LINK.EXE
  29660.  
  29661.  These files solve conflicts with certain network setups. Please be
  29662.  sure to make backup copies of the original files.
  29663.  
  29664.  Network Patch Files
  29665.  -------------------
  29666.  
  29667.  When run under certain network software, some Microsoft utilities may
  29668.  hang. The enclosed patch files are designed to correct these problems
  29669.  for CodeView versions 3.00, 3.10, and 3.11; the Programmer's WorkBench
  29670.  (PWB) versions 1.00 and 1.10; and the C 6.00 Setup program.
  29671.  
  29672.  To install the patches, first copy the patch files (PWBPATCH.EXE,
  29673.  CVPATCH.EXE, and SETUPFIX.EXE) to the directories where you have
  29674.  installed PWB, CodeView, and Setup, respectively. Each patch assumes
  29675.  that the utility file it is to patch is in the same directory.
  29676.  
  29677.  Run SETUPFIX.EXE to patch SETUP.EXE. The original file will be saved
  29678.  as SETUP.BAK. Run CVPATCH.EXE to patch CV.EXE. The original file will
  29679.  be saved as CV.BAK. Run PWBPATCH.EXE to patch PWBED.EXE. The original
  29680.  file will be saved as PWBED.BAK. The patched utilities should run free
  29681.  of network interference.
  29682.  
  29683.  Microsoft LINK Version 5.13
  29684.  ---------------------------
  29685.  
  29686.  LINK version 5.13 includes code to work around another problem that
  29687.  sometimes occurs when running on a network. On large projects, the
  29688.  linker needs to open some temporary files to work around DOS memory
  29689.  limitations. LINK version 5.10 (supplied with C 6.00) will sometimes
  29690.  fail in its attempts to open a temporary file when run under certain
  29691.  network software.
  29692.  
  29693.  The problem actually lies in the network software, not the linker.
  29694.  When the network is loaded, the return value from an open call
  29695.  sometimes gets corrupted. When the call fails, it is because an "Out
  29696.  of handles" error (EMFILE) is returned as a "No such file or
  29697.  directory" error (ENOENT). If this occurs, LINK 5.10 halts with an
  29698.  "L1085: cannot open temporary file" error.
  29699.  
  29700.  LINK 5.13 includes a change to correct for the above situation (even
  29701.  though the problem is in the network software). When LINK version 5.13
  29702.  receives an ENOENT error on a failed open call, it will still try to
  29703.  free some file handles and reopen the temporary file, regardless of
  29704.  the error returned.
  29705.  
  29706.  To make the correction, locate LINK version 5.10 and replace it with
  29707.  LINK version 5.13 from the enclosed disk. Again, be sure to save a
  29708.  backup copy of the original file (LINK 5.10).
  29709.  
  29710.  
  29711.  86. L2025 LINK Error