home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft_Programmers_Library.7z / MPL / fortran / frtkno.txt < prev    next >
Encoding:
Text File  |  2013-11-08  |  1.7 MB  |  51,179 lines

Text Truncated. Only the first 1MB is shown below. Download the file for the complete contents.
  1.  Microsoft FORTRAN Compiler
  2.  =============================================================================
  3.  
  4.  
  5.  1. Graphics for FORTRAN
  6.  
  7.  Product Version(s): 3.3x 4.00 4.01 4.10 5.00
  8.  Operating System:   MS-DOS
  9.  Flags: ENDUSER | B_QuickBAS
  10.  Last Modified: 29-AUG-1989    ArticleIdent: Q26943
  11.  
  12.  Question:
  13.  
  14.  I would like to produce graphics output with my FORTRAN programs. Can
  15.  you recommend any graphics packages and/or libraries that I can use
  16.  with FORTRAN?
  17.  
  18.  Response:
  19.  
  20.  Note: FORTRAN Version 5.00 has support for graphics. The following
  21.  response includes only FORTRAN 4.10 and earlier.
  22.  
  23.  We do not currently provide graphics libraries for FORTRAN. However,
  24.  since FORTRAN supports interlanguage calling between our other
  25.  languages, we suggest you try our new QuickC compiler package. QuickC
  26.  offers a run-time library of over 300 functions, including graphics
  27.  routines and cursor control.
  28.  
  29.  The graphics package supports CGA, EGA, and VGA. Other QuickC run-time
  30.  facilities include random number generation, string manipulation, and
  31.  DOS function calling. By using QuickC, you not only have access to the
  32.  run-time library package, you also have the luxury of a whole new
  33.  language to program with. QuickC provides an integrated programming
  34.  environment complete with editor, compiler, and a source-level
  35.  debugger. With QuickC, you can write routines that can be called from
  36.  FORTRAN or write programs that can call your FORTRAN subroutines.
  37.  QuickC can provide the kind of flexibility that is not easily
  38.  duplicated in FORTRAN.
  39.  
  40.  Our QuickBASIC compiler package also offers graphics support. The
  41.  facilities provided mirror the ones available in QuickC but in a
  42.  format that is consistent with the BASIC language.
  43.  
  44.  You can also call assembly-language routines written by you or
  45.  third-party vendors. The bluebook of assembly-language routines for
  46.  the IBM PC and XT by Christopher L. Morgan contains graphics and
  47.  cursor positioning routines that may be called by your program.
  48.  However, it should be noted that these routines were written
  49.  specifically for the IBM and may have to be altered somewhat to run on
  50.  IBM compatibles.
  51.  
  52.  Another option is to use the ANSI escape sequences to affect cursor
  53.  movement and screen clearing. These have limited uses in producing
  54.  graphics routines. Contact Microsoft Product Support Services for more
  55.  information on ANSI escape sequences by calling (206) 454-2030.
  56.  
  57.  In addition to these, a "Language Support Directory" is provided with
  58.  each copy of FORTRAN. This booklet lists several vendors who provide
  59.  graphics libraries (and other libraries such as communications
  60.  packages) compatible with FORTRAN.
  61.  
  62.  
  63.  2. The Following Code Caused Error F2124 Code Generation Error
  64.  
  65.  Product Version(s): 4.01
  66.  Operating System:   MS-DOS
  67.  Flags: ENDUSER | buglist4.01 fixlist5.0
  68.  Last Modified: 14-JUL-1989    ArticleIdent: Q26944
  69.  
  70.  Problem:
  71.     The following code will produce error F2124, code generation error:
  72.  
  73.          SUBROUTINE SUB
  74.  C       IMPLICIT REAL*8 (A-H,O-Y)
  75.          COMPLEX*16 SI,IB0,IB0P,IB1,IB1P,IBES0(3002),IBES1(3002)
  76.          COMMON /CMN2/IBES0,IBES1,KBES0
  77.  C
  78.          IB0=0.5D1*IBES0(L1)
  79.          IB0P=0.25D1*(IBES0(L0)+SI*IBES0(L1)+IBES0(L2))
  80.          IB1=0.5D1*IBES1(L1)
  81.          IB1P=0.25D1*(IBES1(L0)+SI*IBSE1(L1)+IBES1(L2))
  82.  C
  83.          RETURN
  84.          END
  85.  
  86.  Response:
  87.     This is a known problem in Version 4.01.
  88.     Microsoft is researching this problem and will post new information
  89.  as it becomes available.
  90.     The workaround is to use the /Od switch or comment out the common
  91.  statement.
  92.  
  93.  
  94.  3. FORTRAN: Internal Compiler Error: mactab.c 1.34, Line 662
  95.  
  96.  Product Version(s): 4.01
  97.  Operating System:   MS-DOS
  98.  Flags: ENDUSER | buglist4.01 buglist4.10 fixlist5.00
  99.  Last Modified: 16-JUN-1989    ArticleIdent: Q26945
  100.  
  101.  The code below generates the following internal compiler error:
  102.  
  103.  code.for
  104.  code.for(15) : fatal error F1001: Internal Compiler Error
  105.                  (compiler file '@(#)mactab.c:1.34', line 662)
  106.                  Contact Microsoft Technical Support
  107.  
  108.  The code is as follows:
  109.  
  110.          SUBROUTINE SUB
  111.          COMPLEX*16 SI,IB0,IB0P,IB1,IB1P,B1,B2,IBES0(3002),IBES1(3002)
  112.          COMMON /CMN2/IBES0,IBES1,KBES0
  113.  C
  114.          IB0=0.5D1*IBES0(L1)
  115.          B1=IBES0(L0)+SI*IBES0(L1)+IBES0(L2)
  116.          IB0P=0.25D1*B1
  117.          IB1=0.5D1*IBES1(L1)
  118.          B2=IBES1(L0)+SI*IBSE1(L1)+IBES1(L2)
  119.          IB1P=0.25D1*B2
  120.  C
  121.          RETURN
  122.          END
  123.  
  124.  The workaround is to disable optimization with the /Od switch or to
  125.  remove the common block statement.
  126.  
  127.  Microsoft has confirmed this to be a problem in Versions 4.01 and
  128.  4.10. This problem was corrected in Version 5.00.
  129.  
  130.  
  131.  4. FORTRAN: Internal Compiler Error: p3io.c 193, Line 813
  132.  
  133.  Product Version(s): 4.01 4.10 | 4.10
  134.  Operating System:   MS-DOS    | OS/2
  135.  Flags: ENDUSER | buglist4.00 buglist4.01 buglist4.10 fixlist5.00
  136.  Last Modified: 16-JUN-1989    ArticleIdent: Q26968
  137.  
  138.  The code below causes the following internal compiler error, but gives
  139.  no line number for the source code that caused the error:
  140.  
  141.  fatal error F1001: Internal Compiler Error
  142.                  (compiler file '@(#)p3io.c:1.93', line 813)
  143.                  Contact Microsoft Technical Support
  144.  
  145.  Function names are global and do not need to be passed to other
  146.  functions. Microsoft has confirmed this to be a problem with Versions
  147.  4.01 and 4.10 of the FORTRAN compiler. This problem was corrected in
  148.  Version 5.00.
  149.  
  150.  There are two workarounds, as follows:
  151.  
  152.  1. In the first workaround, do the following:
  153.  
  154.     a. Remove "fx" when calling "simp()".
  155.  
  156.     b. Remove "f" in the simp() function declaration.
  157.  
  158.     c. Rename the call to "fx()" in simp() from "f()" to fx().
  159.  
  160.  2. In the second workaround, comment out the print statement.
  161.  
  162.  The code is as follows:
  163.  
  164.  program int (intput,output)
  165.      integer n
  166.      real a,b,simp
  167.      external fx
  168.      read *,a,b,n
  169.      print *,'int = ',simp (a,b,n,fx)
  170.      end
  171.  
  172.      real function fx (x)
  173.      real x
  174.      fx=x*x
  175.      end
  176.  
  177.      real function simp(a,b,n,f)
  178.      integer j,n
  179.      real a,b,c,h,sum
  180.      c=2.0
  181.          do 5 j=1,2*n-1
  182.           c=6.0 - c
  183.           sum=sum+c*f(a+j*h)
  184.  5        continue
  185.      simp=sum*h/3
  186.      end
  187.  
  188.  
  189.  5. Blank Character Before "O"
  190.  
  191.  Product Version(s): 3.31
  192.  Operating System:   MS-DOS
  193.  Flags: ENDUSER | TAR54911 docerr
  194.  Last Modified: 19-SEP-1988    ArticleIdent: Q11753
  195.  
  196.  Problem:
  197.  
  198.  The following program on Page 110 of the "Microsoft FORTRAN Compiler
  199.  Reference" manual does not work properly; the first character of the
  200.  write statement is lost:
  201.  
  202.     program wrt
  203.     character*8 fname
  204.     write(*,'(A\)') 'Output filename?:'
  205.     read(*,'(A)') fname
  206.     end
  207.  
  208.  Response:
  209.  
  210.  The document is incorrect. The example should be corrected by
  211.  inserting a blank character before the "O" in "Output filename?" to
  212.  reflect the correct behavior.
  213.  
  214.  It is important to remember that the first character of an output
  215.  statement that uses unit 0, unit *, or the files PRN, LPT1, or CON is
  216.  not printed but instead is interpreted as a carriage control
  217.  character.
  218.  
  219.  
  220.  6. No Error when Giving INTEGER*1 an Out-of-Range Value
  221.  
  222.  Product Version(s): 4.01
  223.  Operating System:   MS-DOS
  224.  Flags: ENDUSER | buglist4.01
  225.  Last Modified:  1-JUN-1988    ArticleIdent: Q26969
  226.  
  227.     When an INTEGER*1 item in the range -127 to 127 is assigned a value
  228.  that exceeds the legal size-limits, no error message is returned.
  229.  Execution continues, but with unpredictable results. The error message
  230.  should be "F6100: INTEGER overflow on input."
  231.     This is a known problem in Version 4.01.
  232.     Microsoft is researching this problem and will post new information
  233.  as it becomes available.
  234.  
  235.  
  236.  7. Random Number Generation in FORTRAN
  237.  
  238.  Product Version(s): 4.00 4.01 4.10 5.00
  239.  Operating System:   MS-DOS
  240.  Flags: ENDUSER |
  241.  Last Modified: 11-JUL-1990    ArticleIdent: Q27211
  242.  
  243.  A random number generator was added with Microsoft FORTRAN version
  244.  5.00. It is documented on Pages 272-273 of the "Microsoft FORTRAN
  245.  Reference" for version 5.00.
  246.  
  247.  There is no function for random number generation in previous versions
  248.  of Microsoft FORTRAN. However, there are at least two ways to generate
  249.  a random number with FORTRAN versions 4.00, 4.01, and 4.10.
  250.  
  251.  The sample program DEMORAN.FOR on the Utilities and Source Code Disk
  252.  (Disk 3 of 6) for versions 4.00 and 4.10 and on the Setup Disk for
  253.  version 4.10 demonstrates a uniform random-number generator. It is
  254.  documented in the comments at the beginning of the file.
  255.  
  256.  Another way to get a random number is to make use of the
  257.  interlanguage capability of Microsoft FORTRAN. A call to QuickC is an
  258.  easy way to get access to Rand and other C run-time library routines
  259.  (as well as to the QuickC compiler, editor, and debugger, and other
  260.  features, such as graphics routines).
  261.  
  262.  
  263.  8. Fatal Error F1910 Unrecognized Option
  264.  
  265.  Product Version(s): 4.01
  266.  Operating System:   MS-DOS
  267.  Flags: ENDUSER |
  268.  Last Modified: 21-JUL-1988    ArticleIdent: Q27129
  269.  
  270.     The most common reasons for fatal error F1910, "unrecognized
  271.  option," are an inability to open temporary files or an incorrect
  272.  version of COMMAND.COM. Verify that "VER" and "COMMAND" both return
  273.  the same version. If "VER" and "COMMAND" both return the same version,
  274.  the error is caused by a problem with opening temporary files. One of
  275.  the following could be the cause of this problem:
  276.  
  277.     1. The temporary variable is set incorrectly. The TMP variable must
  278.  be set as follows:
  279.  
  280.     SET TMP=c:\myfullpath\mydir
  281.  
  282.     The line can have no extra spaces, and there must be a carriage
  283.  return immediately following the last character. Retype this line at
  284.  the DOS prompt if you are unsure about its syntax. The specified
  285.  subdirectory must exist in the path as given.
  286.     2. There is not enough room on the disk to store temporary files.
  287.     3. There are not enough file handles to open temporary files. Make
  288.  sure that the following two lines are in your CONFIG.SYS and that all
  289.  terminate-and-stay-resident (TSR) programs are removed from the
  290.  system:
  291.  
  292.     files=20
  293.     buffers=20
  294.  
  295.  
  296.  9. Incorrect Floating Point Representation
  297.  
  298.  Product Version(s): 3.31
  299.  Operating System:   MS-DOS
  300.  Flags: ENDUSER | TAR55281 buglist3.31 fixlist4.00
  301.  Last Modified: 15-APR-1988    ArticleIdent: Q11835
  302.  
  303.  Problem:
  304.     The following program gives the result 0,0 instead of 0,6:
  305.  
  306.     $storage:2
  307.     program asst
  308.     real coord(2)
  309.     integer acc(2)
  310.     integer i
  311.     i=2
  312.     coord(i)=acc(i)
  313.     acc(i)=acc(i)+6
  314.     write(*,*) acc
  315.     end
  316.  
  317.  Response:
  318.     Microsoft confirmed this to be a problem in Version 3.31 of the
  319.  FORTRAN compiler. The problem was corrected in Version 4.00.
  320.     A workaround is to add the $NOFLOATCALLS metacommand.
  321.  
  322.  
  323.  10. FORTRAN Setup on One 5.25" and One 3.5" Floppy Drive
  324.  
  325.  Product Version(s): 4.01
  326.  Operating System:   MS-DOS
  327.  Flags: ENDUSER |
  328.  Last Modified:  8-MAR-1988    ArticleIdent: Q27501
  329.  
  330.  Question:
  331.     I want to set up FORTRAN on my two-floppy system, but I have one
  332.  drive that is 5.25 inch and one that is 3.5 inch. How can I do this?
  333.  
  334.  Response:
  335.     Do not use the setup program. Instead, choose the disk size on
  336.  which you wish to install FORTRAN. Then refer to the "Microsoft
  337.  FORTRAN Compiler User's Guide." Table 2.1 on Pages 22-23 shows the
  338.  disk organization to follow for 5.25 inch disks and Table 2.2 on Pages
  339.  26-27 shows the disk organization to follow for 3.5 inch disks. Copy
  340.  the files according to the suggested configuration for your chosen
  341.  drive. The other drive will hold your source disk.
  342.     You will need to build the libraries yourself. Use the BUILD1.BAT
  343.  utility and follow the guidelines in the README.DOC file.
  344.     When running the FORTRAN compiler, expect to see the warning
  345.  message "Command line warning D4005 : could not execute 'f2.exe';
  346.  please insert diskette and press any key." This is an expected
  347.  response when running from a floppy setup. Swap disks at this point
  348.  and continue compiling.
  349.  
  350.  
  351.  11. Compatibility with an 80387 Coprocessor
  352.  
  353.  Product Version(s): 4.01
  354.  Operating System:   MS-DOS
  355.  Flags: ENDUSER |
  356.  Last Modified:  9-MAR-1988    ArticleIdent: Q27502
  357.  
  358.  Question:
  359.     Will the Microsoft FORTRAN compiler work with an 80387 math
  360.  coprocessor?
  361.  
  362.  Response:
  363.     You can use the coprocessor with all of our programming languages,
  364.  but you can take advantage of it only up to the limit of the 80287
  365.  instruction set.
  366.  
  367.  
  368.  12. Cannot Trace into Program with Include File
  369.  
  370.  Product Version(s): 4.00 4.01 4.10
  371.  Operating System:   MS-DOS
  372.  Flags: ENDUSER |
  373.  Last Modified: 25-OCT-1988    ArticleIdent: Q27551
  374.  
  375.  Problem:
  376.  
  377.  I have an include file that contains the following declaration:
  378.  
  379.      INTEGER*2 I,J
  380.  
  381.  When I trace into this program using CodeView, the entire program
  382.  executes and I cannot set any break points. I am compiling the code
  383.  with the following switches:
  384.  
  385.     /Zi
  386.     /Od
  387.     /FPi
  388.     /4Yb.
  389.  
  390.  Response:
  391.  
  392.  The problem is that the switch "/4Yb" creates its own line
  393.  information, which conflicts with the "/Zi" CodeView information.
  394.  
  395.  To work around this problem, do not to use the "/4Yb" switch when
  396.  viewing under CodeView.
  397.  
  398.  
  399.  13. How Many Files Can You Access?
  400.  
  401.  Product Version(s): 3.20 3.30 3.31 4.00 4.01 4.10 5.00 | 4.10 5.00
  402.  Operating System:   MS-DOS | OS/2
  403.  Flags: ENDUSER |
  404.  Last Modified: 24-JUL-1990    ArticleIdent: Q12086
  405.  
  406.  The maximum number of files that you can open using versions of
  407.  Microsoft FORTRAN prior to version 5.00 is 15. This maximum number
  408.  of files is a FORTRAN limitation.
  409.  
  410.  Query on the words FILE and LIMIT and FORTRAN for more information
  411.  about increasing this limit with FORTRAN 5.00.
  412.  
  413.  There is no limit on the number of files that you can open and close
  414.  during the run of a program. The limit applies only to the number of
  415.  files that can be open at the same time.
  416.  
  417.  This maximum number of open files is affected by the "FILES=" variable
  418.  set in your CONFIG.SYS file. If you set the "FILES=" variable to less
  419.  than 20, e.g. "FILES=15", then the maximum number of open files will
  420.  decrease. FORTRAN opens five files itself: standard input, standard
  421.  output, standard printer, standard error, and standard auxiliary.
  422.  Since 5 of the 20 possible file handles are used by FORTRAN, that
  423.  leaves your program 15.
  424.  
  425.  A simple explanation of how many files can be opened is found in IBM's
  426.  "Disk Operating System Version 3.10 Reference" Pages 4-19 through 4-21
  427.  "FCBS (File Control Block) Command" and Pages 4-22 through 4-23 "FILES
  428.  Command", in particular Page 4-23 in the section called "Number of
  429.  Files Opened".
  430.  
  431.  For more technical details on file handles, see IBM's "Disk Operating
  432.  System Technical Reference" for Version 3.10, Chapter 4 "File
  433.  Management Notes". See especially the following sections: "Handle
  434.  Function Calls" (Pages 4-6 through 4-7), "Special File Handles" (Page
  435.  4-8), "Number of Open Files Allowed" (Page 4-12), and "Restrictions on
  436.  Handle Usage" (Page 4-13).
  437.  
  438.  
  439.  14. INQUIRE Does Not Look Along APPEND File List
  440.  
  441.  Product Version(s): 4.00 4.01
  442.  Operating System:   MS-DOS
  443.  Flags: ENDUSER | buglist4.00 buglist4.01 fixlist4.10
  444.  Last Modified: 27-JUN-1988    ArticleIdent: Q27660
  445.  
  446.     The following program requires a file named A.A. The DOS command
  447.  APPEND should allow you to list the directories in which you have
  448.  files; thus, you do not have to specify the fully qualified path name
  449.  of the file in your program. However, the INQUIRE statement does not
  450.  seem to be searching this APPEND list.
  451.  
  452.           CHARACTER*20 FNAME
  453.           LOGICAL FOUND
  454.           DATA FNAME/'A.A'/
  455.     C
  456.           FOUND=.FALSE.
  457.           INQUIRE (FILE=FNAME,EXIST=FOUND)
  458.           WRITE(*,*) ' FILE= ',FNAME,'   EXIST= ',FOUND
  459.     6     CONTINUE
  460.           STOP
  461.           END
  462.  
  463.     Microsoft has confirmed this to be a problem with the FORTRAN
  464.  Compiler Versions 4.00 and 4.01.
  465.     Microsoft is researching this problem and will post new information
  466.  as it becomes available.
  467.  
  468.  
  469.  15. INQUIRE Statement Filename Length
  470.  
  471.  Product Version(s): 3.30
  472.  Operating System:   MS-DOS
  473.  Flags: ENDUSER | TAR57139 docerr
  474.  Last Modified: 13-JAN-1989    ArticleIdent: Q12130
  475.  
  476.  Page 105 of the "Microsoft FORTRAN Compiler Language Reference" should
  477.  state the following:
  478.  
  479.  The INQUIRE statement does not handle filenames longer than 31
  480.  characters.
  481.  
  482.  
  483.  16. File I/O Errors
  484.  
  485.  Product Version(s): 3.30
  486.  Operating System:   MS-DOS
  487.  Flags: ENDUSER | TAR57193 docerr
  488.  Last Modified:  7-SEP-1988    ArticleIdent: Q12129
  489.  
  490.  On Page 252 of the "Microsoft FORTRAN Compiler User's Guide," the File
  491.  I/O Errors should read as follows:
  492.  
  493.  1270 Console I/O error
  494.  1271 User tried to rewind CON (i.e. the terminal) or USER
  495.  1272 File I/O error after previous error
  496.  
  497.  
  498.  17. FL Environment Variable Appears to Fail
  499.  
  500.  Product Version(s): 4.10   | 4.10
  501.  Operating System:   MS-DOS | OS/2
  502.  Flags: ENDUSER | docerr langerr
  503.  Last Modified: 18-AUG-1988    ArticleIdent: Q27557
  504.  
  505.     If you set the FL environment variable exactly the way it is set in
  506.  the two examples on Pages 10 and 12 of the "FORTRAN 4.10 Update," it
  507.  will not affect compiling.
  508.     The examples on Pages 10 and 12 of the update are incorrect; spaces
  509.  are not allowed around the equal sign. The corrected example should
  510.  state "SET FL=/Lr" with no spaces around the equal sign. However,
  511.  spaces should be used between consecutive options.
  512.  "SET FL=/Lr /FPi /Od" is correct.
  513.     The /LINK option also must be given in all lowercase letters, as
  514.  /link (the FL command line is case sensitive). Please note that the /I
  515.  option also is incorrect; the correct option should be /INF.
  516.  
  517.  
  518.  18. Using the C 5.0 Preprocessor
  519.  
  520.  Product Version(s): 4.01 4.10
  521.  Operating System:   MS-DOS
  522.  Flags: ENDUSER |
  523.  Last Modified: 12-MAY-1988    ArticleIdent: Q29595
  524.  
  525.  Problem:
  526.     I am using the C 5.0 preprocessor before invoking the FL command to
  527.  define long names (around 30 char) to something shorter for use in
  528.  FORTRAN. However, the preprocessor is inserting blanks before comment
  529.  lines; thus they are no longer comments in the eyes of the FORTRAN
  530.  compiler. The manuals say it is legal to use the preprocessor. What is
  531.  happening to the code?
  532.  
  533.  Response:
  534.     The procedure you describe will not work. The C preprocessor is not
  535.  a text processor and will not do what you are trying accomplish. The
  536.  following are two alternate methods:
  537.  
  538.     1. Use the ALIAS keyword. For example:
  539.  
  540.          interface to subroutine _clearscreen[C, ALIAS =
  541.   '_cls'] (area)
  542.  
  543.          /*  The underscore must be there in both places.  */
  544.  
  545.     2. Use the $NOTRUNCATE metacommand to set variable names to 31
  546.  significant characters.
  547.  
  548.  
  549.  19. Internal Compiler Error: grammar.c, Line 91 and FORTRAN 4.10
  550.  
  551.  Product Version(s): 4.00 4.01 4.10
  552.  Operating System:   MS-DOS
  553.  Flags: ENDUSER | buglist4.10 fixlist5.00
  554.  Last Modified: 24-JUL-1990    ArticleIdent: Q27559
  555.  
  556.  Problem:
  557.  
  558.  The code below produces the following error:
  559.  
  560.  COMPERR.FOR(9) : fatal error F1001: Internal Compiler Error
  561.                  (compiler file '../grammar.c', line 91)
  562.                  Contact Microsoft Technical Support
  563.  
  564.  Microsoft has confirmed this to be a problem with the FORTRAN compiler
  565.  Version 4.10. This problem was corrected in Version 5.00.
  566.  
  567.  If you are using Version 4.10, the only workaround is to disable loop
  568.  optimization by using /Od or /Odct.
  569.  
  570.  The code is as follows:
  571.  
  572.          SUBROUTINE CPII1(ID,JD,IXS,IXE,IYS,IYE,JERR)
  573.          IMPLICIT INTEGER*2 (I-N)
  574.          DIMENSION ID(IXS:IXE,IYS:IYE),JD(IXS:IXE,IYS:IYE)
  575.          DO 100 IL=IYS,IYE
  576.          DO 100 KM=IXS,IXE
  577.          JD(KM,IL)=ID(KM,IL)
  578.    100   CONTINUE
  579.          RETURN
  580.          END
  581.  C----------------------------------------------------------------------
  582.          SUBROUTINE BKCUT2(ID,IBK16,IBK8,IFX,IFY,IBX,IBY,IB,IABK,JERR)
  583.          IMPLICIT INTEGER*2 (I-N)
  584.          DIMENSION ID(IFX,IFY),IBK16(IFX/IBX,IFY/IBY),
  585.       A            IBK8(IFX/IBX,IFY/IBY,IB,IB)
  586.  
  587.          DO 1000 KM=1,IFX/IBX
  588.          DO 1000 IL=1,IFY/IBY
  589.  
  590.          DO 900 KM1=1,IB
  591.          DO 900 IL1=1,IB
  592.          IF(IBK8(KM,IL,KM1,IL1).EQ.0) GO TO 900
  593.          DO 800 KM2=1,IBX/IB
  594.          DO 800 IL2=1,IBY/IB
  595.  
  596.          IKP=(KM-1)*IBX+(KM1-1)*(IBX/IB)+KM2
  597.          ILP=(IL-1)*IBY+(IL1-1)*(IBY/IB)+IL2
  598.          ID(IKP,ILP)=IABK
  599.  
  600.    800   CONTINUE
  601.    900   CONTINUE
  602.   1000   CONTINUE
  603.          RETURN
  604.          END
  605.  
  606.  
  607.  20. Must Should Be May
  608.  
  609.  Product Version(s): 4.00
  610.  Operating System:   MS-DOS
  611.  Flags: ENDUSER | docerr
  612.  Last Modified: 13-JAN-1989    ArticleIdent: Q19786
  613.  
  614.  On Page 9 of the "Microsoft FORTRAN 4.00 Quick Reference Guide," note
  615.  3, the word "must" should be changed to "may."
  616.  
  617.  
  618.  21. Floating-Point Exception Handling
  619.  
  620.  Product Version(s): 4.00 4.01 4.10 | 4.10
  621.  Operating System:   MS-DOS         | OS/2
  622.  Flags: ENDUSER |  coprocessor 8087 80187 80287 80387
  623.  Last Modified: 30-SEP-1988    ArticleIdent: Q19807
  624.  
  625.  Question:
  626.  
  627.  How can I clear the status word? Can I set it to any value I want?
  628.  Page 359 of the "Microsoft FORTRAN User's Guide", Appendix D states
  629.  that the status word remains set until the user clears it.
  630.  
  631.  Response:
  632.  
  633.  The following is a routine named "clrstat", which will allow
  634.  you to clear the status word. Use this routine at your own
  635.  risk, i.e., we do not support this routine.
  636.  
  637.  In both Versions 3.31 and 4.00, you cannot change the status word.
  638.  Once it is set to a value (perhaps by a divide-by-zero error), the
  639.  status remains at that value. Even by using assembly language, you
  640.  only are allowed to clear the status word; you cannot set it to a
  641.  specific value.
  642.  
  643.  The math run time does not allow you to clear the status due to the
  644.  coupling of the invalid exception and NDP stack overflow conditions on
  645.  the chip; the same exception is raised for both conditions. The
  646.  clearing of the status word is prohibited because, due to the order in
  647.  which the evaluation is done, you can inadvertently clear an invalid
  648.  exception before the exception handler can access it.
  649.  
  650.  The following is a short FORTRAN program that first generates a
  651.  divide-by-zero error, then does a valid calculation, followed by an
  652.  assembly-language subroutine that only clears the status word:
  653.  
  654.     integer*2 sswrqq
  655.     call lcwrqq (4927)
  656.     call val1 (x,y) 100 continue
  657.     z = x/y
  658.     irep = sswrqq()
  659.     write (*,*) 'status=',irep
  660.     if (irep .eq. 4) then
  661.     write (*,*) 'divide by zero'
  662.     call clrstat
  663.     endif
  664.     if (irep .eq. 0) stop
  665.     call val2 (x,y)
  666.     go to 100
  667.     end
  668.     subroutine val1 (x,y)
  669.     x = 1.0
  670.     y = 0.0
  671.     end
  672.     subroutine val2 (x,y)
  673.     x = 5.0
  674.     y = 2.0
  675.     end
  676.  
  677.     TITLE clrstat
  678.  
  679.     .8087 CLRSTAT_TEXT SEGMENT BYTE PUBLIC 'CODE' CLRSTAT_TEXT ENDS
  680.     ASSUME CS: CLRSTAT_TEXT EXTRN __acrtused:ABS CLRSTAT_TEXT SEGMENT
  681.     PUBLIC CLRSTA CLRSTA PROC FAR
  682.     push bp
  683.     mov bp,sp
  684.     fclex
  685.     fwait
  686.     pop bp
  687.     ret CLRSTA ENDP CLRSTAT_TEXT ENDS END
  688.  
  689.  
  690.  22. Internal Compiler Error: loop.c 1.87, Line 836
  691.  
  692.  Product Version(s): 4.00
  693.  Operating System:   MS-DOS
  694.  Flags: ENDUSER | buglist4.00 fixlist4.01
  695.  Last Modified:  1-JUN-1988    ArticleIdent: Q19941
  696.  
  697.  Problem:
  698.     I am getting an internal compiler error on loop.c:1.87 Line 836.
  699.  
  700.  Response:
  701.     This is a known problem in Version 4.00.
  702.     This problem was corrected in Version 4.01.
  703.     An error in loop.c probably indicates that the problem involves
  704.  loop optimization. You may be able to work around the problem by
  705.  separately compiling the routine specifying either -Od (optimization
  706.  disabled) or -Odct (no loop optimization, but still perform common
  707.  subexpression elimination and optimization for time) options.
  708.  
  709.  
  710.  23. Compaq 386 Floating Point Error
  711.  
  712.  Product Version(s): 4.00
  713.  Operating System:   MS-DOS
  714.  Flags: ENDUSER |
  715.  Last Modified:  4-MAR-1988    ArticleIdent: Q19948
  716.  
  717.  Problem:
  718.     When running in real mode and using a 80287, a floating
  719.  point exception occurs (such as divide by zero) and the CX
  720.  register is destroyed.
  721.  
  722.  Response:
  723.     The problem can occur with any product that accesses the
  724.  80287 directly. Compaq is aware of the problem and has a
  725.  solution available. If you are having such a problem,
  726.  contact the Compaq hotline directly for more information.
  727.     In FORTRAN, the problem may show itself by a program
  728.  hanging in an infinite loop or (even worse) having loops
  729.  terminate early. If you are using FORTRAN Version 4.0, you
  730.  may be able to avert the problem by recompiling to disable
  731.  loop optimization (either -Od or -Odct).
  732.     Note that if you try to demonstrate this problem with
  733.  CodeView, you cannot simply go to the offending instruction
  734.  and then single step; you will not see the problem. You
  735.  must set a breakpoint several instructions past the "bad"
  736.  instruction.
  737.     If you are using FORTRAN or C, you can determine if they
  738.  have the problem by one of two methods:
  739.  
  740.     1. Re-compile with -FPa compiler option. If doing this
  741.  action allows your program to run, contact COMPAQ.
  742.     2. Mask (disable) the floating point exceptions. This is
  743.  not the solution of choice since there are certain
  744.  exceptions (denormal and invalid) that you are not
  745.  permitted to mask.
  746.  
  747.  
  748.  24. Run-Time Error F6419
  749.  
  750.  Product Version(s): 4.00
  751.  Operating System:   MS-DOS
  752.  Flags: ENDUSER |
  753.  Last Modified:  8-DEC-1987    ArticleIdent: Q19942
  754.  
  755.  Problem:
  756.     I am getting an error F6419: illegal structure for
  757.  unformatted file.
  758.  
  759.  Response:
  760.     There are two likely possibilities for this error
  761.  message:
  762.  
  763.     1. Examine the OPEN statement for the file. You may have
  764.  tried to do an unformatted READ on a formatted file. Since
  765.  formatted files do not contain the length information that
  766.  is required in unformatted files, this error would occur.
  767.     2. Do not assume that since the notion of a file being
  768.  UNFORMATTED is part of the ANSI FORTRAN standard, such
  769.  files created on one machine are transportable to any other
  770.  machine. The contents of such files are nonstandard and
  771.  completely up to the implementor. Any data files that you
  772.  wish to transport between machines should be produced only
  773.  by FORMATTED WRITEs.
  774.  
  775.  
  776.  25. PSP and Command Line Parameters
  777.  
  778.  Product Version(s): 4.00
  779.  Operating System:   MS-DOS
  780.  Flags: ENDUSER |
  781.  Last Modified:  7-DEC-1987    ArticleIdent: Q20073
  782.  
  783.  Question:
  784.     When running a FORTRAN program, are the command line
  785.  parameters in the PSP (Program Segment Prefix) left intact?
  786.  In other words, could the command line parameters be
  787.  retrieved from the PSP by an Assembler subroutine that is
  788.  called by an Assembler program or a FORTRAN program?
  789.  
  790.  Response:
  791.     Yes, the command line is left intact, and the parameters
  792.  can be obtained from an Assembler program or a FORTRAN
  793.  program.
  794.     The parameters can be obtained by calculating where the
  795.  PSP is in memory from your program. The PSP is generally
  796.  256 bytes lower in memory than the first code segment.
  797.  
  798.  
  799.  26. Resulting Type from Expression Using Both Integers and Reals
  800.  
  801.  Product Version(s): 4.00 4.01 4.10
  802.  Operating System:   MS-DOS
  803.  Flags: ENDUSER |
  804.  Last Modified: 15-MAR-1988    ArticleIdent: Q27611
  805.  
  806.  Problem:
  807.     My program contains expressions that use different combinations of
  808.  REALs and INTEGERs in the following form:
  809.  
  810.  <REAL variable> = <REAL or INTEGER> ** <REAL> / <REAL or INTEGER>
  811.  
  812.     In each case, the correct result should be a REAL, but with some
  813.  combinations the expression seems to be evaluated as an INTEGER
  814.  (fractional portion is truncated) before it is assigned to a variable
  815.  of type REAL.
  816.  
  817.         INTEGER*4 S2
  818.         REAL*4 FACT(10)
  819.         DATA S2/140/
  820.         M = 7
  821.         FACT(1) = 7.0 ** 2.0 / 140.0
  822.         FACT(2) = M ** 2.0 / 140.0
  823.         FACT(3) = 7.0 ** 2.0 / S2
  824.         FACT(4) = 7 ** 2.0 / 140.0
  825.         FACT(5) = 7.0 **2.0 / 140
  826.         FACT(6) = 7 ** 2.0 / 140
  827.  C the above is incorrectly evaluated as an integer.
  828.         FACT(7) = M ** 2.0 / S2
  829.  C above also incorrectly evaluated as an integer.
  830.         WRITE (*,10) M
  831.         WRITE (*,20) S2
  832.         WRITE (*,*)
  833.         WRITE (*,30) FACT(1)
  834.         WRITE (*,*)
  835.         WRITE (*,40) FACT(2)
  836.         WRITE (*,*)
  837.         WRITE (*,50) FACT(3)
  838.         WRITE (*,*)
  839.         WRITE (*,60) FACT(4)
  840.         WRITE (*,*)
  841.         WRITE (*,70) FACT(5)
  842.         WRITE (*,*)
  843.         WRITE (*,80) FACT(6)
  844.         WRITE (*,*)
  845.         WRITE (*,90) FACT(7)
  846.  10     FORMAT (1X, 'M                  = ', I6)
  847.  20     FORMAT (1X, 'S2                 = ', I6)
  848.  30     FORMAT (1X, '7.0 ** 2.0 / 140.0 = ', G15.7)
  849.  40     FORMAT (1X, 'M ** 2.0 / 140.0   = ', G15.7)
  850.  50     FORMAT (1X, '7.0 ** 2.0 / S2    = ', G15.7)
  851.  60     FORMAT (1X, '7 ** 2.0 / 140.0   = ', G15.7)
  852.  70     FORMAT (1X, '7.0 ** 2.0 / 140   = ', G15.7)
  853.  80     FORMAT (1X, '7 ** 2.0 / 140     = ', G15.7)
  854.  90     FORMAT (1X, 'M ** 2.0 / S2      = ', G15.7)
  855.         STOP
  856.         END
  857.  
  858.  \.BODYTEXT
  859.  Response:
  860.     Microsoft has confirmed this to be a problem with the FORTRAN
  861.  Compiler Versions 4.x. A workaround would be to convert any non-REALs
  862.  to REALs with the intrinsic function "REAL()" to insure a REAL result.
  863.  
  864.  
  865.  27. Default Option Is /Oaclt Not /Ox
  866.  
  867.  Product Version(s): 4.00 4.01 4.10 | 4.10
  868.  Operating System:   MS-DOS         | OS/2
  869.  Flags: ENDUSER | docerr
  870.  Last Modified: 13-JAN-1989    ArticleIdent: Q28924
  871.  
  872.  Page 97 of the "Microsoft FORTRAN Optimizing Compiler User's Guide"
  873.  for Versions 4.00, 4.01, and 4.10 contains documentation errors.
  874.  
  875.  In Section 3.3.15, the table near the bottom of the page incorrectly
  876.  states the following:
  877.  
  878.  Character       Optimizing Procedure
  879.  
  880.  x            Full optimization; favors execution time (default)
  881.  t            equivalent to x
  882.  .
  883.  .
  884.  
  885.  The default optimization option is /Oaclt /Gs which is equivalent to
  886.  /Ox. Alias checking is relaxed by default. The only way to enable
  887.  Alias checking, is to first turn off all optimization and then turn
  888.  the specific switches back on.
  889.  
  890.  An example of turning alias checking on, when all other default
  891.  optimization remains on, is /Odclt. Also, /Ot is not equivalent to
  892.  /Ox, but is a subset of /Ox. The table should read as follows:
  893.  
  894.  Character Optimizing Procedure
  895.  
  896.  x               Full optimization; equivalent to /Oaclt /Gs
  897.  t               favors execution time
  898.  .
  899.  .
  900.  
  901.  
  902.  28. Error Running Library Manager
  903.  
  904.  Product Version(s): 4.00 4.01
  905.  Operating System:   MS-DOS
  906.  Flags: ENDUSER |
  907.  Last Modified: 12-MAY-1988    ArticleIdent: Q20053
  908.  
  909.  Question:
  910.     What should I do when I get "error trying to run library manager"?
  911.  
  912.  Response:
  913.     You should do the following:
  914.  
  915.     1. Make sure the directory LIB.EXE is in your PATH.
  916.     2. If you still get the error message, then rename your
  917.  AUTOEXEC.BAT file, reboot, and set PATH= to the directory LIB.EXE is
  918.  in. Booting without an AUTOEXEC.BAT file will empty your environment.
  919.  Setup should not be sensitive to how much is in your environment.
  920.  However, we have found that emptying the environment causes the
  921.  problem to disappear. Microsoft is aware of this problem and will post
  922.  new information as it becomes available.
  923.     3. If you continue to get the error message, terminate-and-stay
  924.  resident programs may interfere with Setup, so check to see if you
  925.  have any installed, and if you do, remove them.
  926.     4. If methods 1, 2, and 3 above fail to solve the problem, the
  927.  workaround is to build the libraries manually. If you have FORTRAN
  928.  Version 4.01, you can use BUILD1.BAT. Information for this is in the
  929.  README.DOC file. If you have Version 4.00 or Version 4.01, you can
  930.  build them by running Setup with the /n option ("Setup /n"). The /n
  931.  option allows you to run through Setup without Setup performing any
  932.  installations. The /n option is meant to be used to familiarize you
  933.  with the installation procedure. Since the /n option does not do any
  934.  installations, it does not need to find LIB.EXE; the /n option runs
  935.  its course and tells you what it is doing as it goes. Therefore, you
  936.  can copy the commands the /n option uses to build the libraries, and
  937.  then manually use LIB.EXE to delete and combine the appropriate
  938.  modules to build your library.
  939.  
  940.  
  941.  29. How FORTRAN Stores Two-Dimensional Arrays in Memory
  942.  
  943.  Product Version(s): 4.0 4.01 4.1 | 4.10
  944.  Operating System:   MS-DOS       | OS/2
  945.  Flags: ENDUSER |
  946.  Last Modified: 19-APR-1988    ArticleIdent: Q27780
  947.  
  948.  Question:
  949.     How does FORTRAN store a two-dimensional array in memory? I know
  950.  that C actually stores two-dimensional arrays as one-dimensional row
  951.  arrays. Does FORTRAN use the same convention for array storage?
  952.  
  953.  Response:
  954.     No, FORTRAN is different from languages such as C and Pascal in
  955.  this respect. Although array elements are referenced in row major
  956.  notation, i.e., (row, column), just as in C or Pascal, FORTRAN stores
  957.  two-dimensional arrays as one-dimensional column arrays.
  958.     For example, in C, a two-dimensional array with three rows and four
  959.  columns will be stored in memory in the following sequence:
  960.  
  961.    (1,1),(1,2),(1,3),(1,4),(2,1),(2,2),(2,3),(2,4),(3,1),(3,2),(3,3),(3,4)
  962.  
  963.     However, FORTRAN will store the same array in the following
  964.  sequence:
  965.  
  966.    (1,1),(2,1),(3,1),(1,2),(2,2),(3,2),(1,3),(2,3),(3,3),(1,4),(2,4),(3,4)
  967.  
  968.  
  969.  30. Reference in Substring
  970.  
  971.  Product Version(s): 4.00
  972.  Operating System:   MS-DOS
  973.  Flags: ENDUSER | buglist4.00 fixlist4.01
  974.  Last Modified:  1-JUN-1988    ArticleIdent: Q22142
  975.  
  976.     In the following program, the first call to SWRITE contains a
  977.  substring reference where the upper bound is a function reference (the
  978.  answer generated from this call should be the same as the one
  979.  generated by the second call; both should be 16):
  980.  
  981.        CHARACTER*80 A
  982.        A='THIS IS A STRING'
  983.        CALL SWRITE( A(1:LLEN(A)) )
  984.        L=LLEN(A)
  985.        CALL SWRITE( A(1:L) )
  986.        END
  987.        INTEGER FUNCTION LLEN(A)
  988.        CHARACTER*(*) A
  989.        llen=16
  990.        END
  991.        SUBROUTINE SWRITE(A)
  992.        CHARACTER*(*) A
  993.        PRINT*,LEN(A)
  994.        RETURN
  995.        END
  996.  
  997.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  998.  FORTRAN compiler. This problem was corrected in Version 4.01.
  999.  
  1000.     The LEN(A) is what is being sent to the first SWRITE, not the
  1001.  LLEN(A). You can work around this by doing what was done for the
  1002.  second call, as follows:
  1003.  
  1004.     1. Evaluate the function.
  1005.     2. Store it in an INTEGER temporary.
  1006.     3. Use the temporary in the substring expression.
  1007.  
  1008.  
  1009.  31. Error on READ
  1010.  
  1011.  Product Version(s): 4.00
  1012.  Operating System:   MS-DOS
  1013.  Flags: ENDUSER | buglist4.00 fixlist4.01
  1014.  Last Modified:  1-JUN-1988    ArticleIdent: Q22158
  1015.  
  1016.     The following program produces run-time error "F6205: READ (dat)--
  1017.  Edit descriptor expected for CHARACTER." The data file "dat" contains
  1018.  ASCII 11.
  1019.  
  1020.     dimension a(2)
  1021.     open(unit=1,file='dat')
  1022.     read(1,'(A1,F1.0)') a
  1023.     write(*,*) a(1) a(2)
  1024.     end
  1025.  
  1026.     By substituting another "A1" for the "F1.0" or conversely, using
  1027.  two "F1.0" formats, the program works properly. Also, the program
  1028.  works properly under Version 3.31.
  1029.     Microsoft confirmed this to be a problem in Version 4.00 of the
  1030.  FORTRAN Compiler. The problem was corrected in Version 4.01.
  1031.  
  1032.     The error will only happen if, in the middle of an array READ, the
  1033.  FORMAT specifier indicates that the next element of the array to be
  1034.  read is of a different type (REAL in this case) than the previous one.
  1035.     There are ways to work around this, using a combination of implied
  1036.  DO lists and (if necessary) single array elements as arguments to the
  1037.  READ.
  1038.     For example, if the READ statement had used the same argument list
  1039.  as did the WRITE, i.e., a(1), a(2), the program would have worked
  1040.  normally.
  1041.  
  1042.  
  1043.  32. Rounding Errors
  1044.  
  1045.  Product Version(s): 4.00
  1046.  Operating System:   MS-DOS
  1047.  Flags: ENDUSER | buglist4.00 fixlist4.01
  1048.  Last Modified:  1-JUN-1988    ArticleIdent: Q22162
  1049.  
  1050.  Question:
  1051.     Two rounding errors occur in Version 4.00. Is it possible to get
  1052.  more information on these errors?
  1053.  
  1054.  Response:
  1055.     The following program demonstrates the two rounding errors:
  1056.  
  1057.          x = .01
  1058.          write (*,'(1x,''x='',f5.0)') x
  1059.          x = .01
  1060.          write (*,'(1x,''x='',f9.2)') x
  1061.          end
  1062.  
  1063.  x=   9.         [This demonstrates Error 1]
  1064.  x=      .00     [This demonstrates Error 2]
  1065.  
  1066.     Microsoft confirmed this to be a problem in Version 4.00 of the
  1067.  compiler. This problem was corrected in Version 4.01.
  1068.     The following is a discussion of the two error messages:
  1069.  
  1070.     1. Error 1:
  1071.     Any WRITE of a quantity less than 1.0 with a FORMAT of the form
  1072.  Fn.0 may produce unexpected results. Some quantities (usually the
  1073.  larger magnitude powers of 2 such as .5, .25, and .125) will produce
  1074.  the expected 0., but most (including the powers of 2 such as .0625 and
  1075.  .03125) will not.
  1076.     2. Error 2:
  1077.     This error is a very specific case and may, in fact, only affect
  1078.  FORMATs of form Fn.2 attempting to put out the quantity .01 (which is
  1079.  represented internally as .0099999).
  1080.  
  1081.  
  1082.  33. Optimization Problem
  1083.  
  1084.  Product Version(s): 4.00
  1085.  Operating System:   MS-DOS
  1086.  Flags: ENDUSER | buglist4.00 fixlist4.01
  1087.  Last Modified:  1-JUN-1988    ArticleIdent: Q22163
  1088.  
  1089.     This problem concerns moving blocks of code to improve program
  1090.  efficiency (code motion). In this program, the block includes the
  1091.  three statements starting at statement number 10 and ending at the IF
  1092.  statement.
  1093.     Compiled with the default ($STORAGE:4), the program works properly
  1094.  but no code motion takes place (even though the compiler will always
  1095.  try to do code motion unless -Od or -Zi is used). If -4I2 or
  1096.  $STORAGE:2 is used, the block is moved just before the 9999 continue
  1097.  statement.
  1098.     The -4I2 version does not work because the compiler failed to
  1099.  generate a JMP to the code that it moved.
  1100.  
  1101.     The following program:
  1102.  
  1103.        WRITE (*,*) 'THIS IS SUPPOSED TO PRINT OUT FIRST'
  1104.        IQ=1
  1105.     10 CALL SUB1(IQ)
  1106.        WRITE(*,*) 'THIS IS SUPPOSED TO PRINT OUT SECOND'
  1107.        IF (IQ.EQ.0) GOTO 9999
  1108.        WRITE (*,*) 'THIS SHOULD NOT PRINT AT ALL'
  1109.        GOTO 10
  1110.   9999 continue
  1111.        END
  1112.        subroutine sub1 (j)
  1113.        j = 0
  1114.        end
  1115.  
  1116.  Should print out the following two lines:
  1117.  
  1118.  THIS IS SUPPOSED TO PRINT OUT FIRST
  1119.  THIS IS SUPPOSED TO PRINT OUT SECOND
  1120.  
  1121.  If it is compiled with -4I2, it prints the following:
  1122.  
  1123.  THIS IS SUPPOSED TO PRINT OUT FIRST
  1124.  THIS SHOULD NOT PRINT AT ALL
  1125.  THIS IS SUPPOSED TO PRINT OUT SECOND
  1126.  
  1127.     This is a known problem in Version 4.00.
  1128.     This problem was corrected in Version 4.01.
  1129.  
  1130.  
  1131.  34. Example on Page 86, 87 of Programming Guide Is Incorrect
  1132.  
  1133.  Product Version(s): 4.01
  1134.  Operating System:   MS-DOS
  1135.  Flags: ENDUSER | docerr
  1136.  Last Modified:  7-SEP-1988    ArticleIdent: Q27662
  1137.  
  1138.  Question:
  1139.  
  1140.  I typed in the FORTRAN assembler mixed-language programming example on
  1141.  Pages 86 and 87 of the "Microsoft Macro Assembler 5.00 Mixed-Language
  1142.  Programming Guide." When I compiled, I received more than seven
  1143.  errors. Why won't this program compile?
  1144.  
  1145.  Response:
  1146.  
  1147.  This program will not work as documented because the FORTRAN example
  1148.  is erroneous; there were two major sections omitted. First, the
  1149.  keyword FUNCTION is omitted; secondly, POWER2 must be be declared in
  1150.  the main body.
  1151.  
  1152.  The assembler routine is correct. The following example will compile
  1153.  and link correctly with the assembler routine:
  1154.  
  1155.  C   File name ftest.for
  1156.        INTERFACE TO INTEGER*2 FUNCTION POWER2(a, b)
  1157.        INTEGER*2 A, B
  1158.        END
  1159.  C
  1160.        INTEGER*2 A, B, POWER2
  1161.        A = 3
  1162.        B = 5
  1163.        WRITE(*, *) '3 * 2 to the power of 5 = ', POWER2(A, B)
  1164.        END
  1165.  
  1166.  After creating two OBJs, link them together with the MASM linker. The
  1167.  following is an example:
  1168.  
  1169.  link ftest.obj + mtest.obj;
  1170.  
  1171.  
  1172.  35. INCLUDE Files Incorrect
  1173.  
  1174.  Product Version(s): 4.00a
  1175.  Operating System:   MS-DOS
  1176.  Flags: ENDUSER | buglist4.00
  1177.  Last Modified: 18-AUG-1988    ArticleIdent: Q22171
  1178.  
  1179.  Problem:
  1180.     The program below compiles normally if all the INCLUDE files exist
  1181.  in the same directory; however, it fails to compile if the files to be
  1182.  included exist in a subdirectory.
  1183.     The following is a program test of this problem:
  1184.  
  1185.  C TEST.FOR tests the include limits of 4.00
  1186.  
  1187.  $INCLUDE:'CCALLS.FIL'
  1188.  
  1189.          PROGRAM TEST
  1190.  
  1191.          CHARACTER*10    NAME
  1192.  $INCLUDE:'PLAN.CFD'
  1193.  $INCLUDE:'DIRECT.CFD'
  1194.  $INCLUDE:'CLIENT.CFD'
  1195.  $INCLUDE:'COLORS.CFD'
  1196.  $INCLUDE:'EMPMAS.CFD'
  1197.  $INCLUDE:'EMPLDF.CFD'
  1198.  $INCLUDE:'EMPLDD.CFD'
  1199.  $INCLUDE:'JUFFSA.CFD'
  1200.  $INCLUDE:'JOUEMP.CFD'
  1201.  $INCLUDE:'PLNTBL.CFD'
  1202.  $INCLUDE:'COLVAR.ASN'
  1203.  
  1204.          END
  1205.  
  1206.  Microsoft (R) FORTRAN Optimizing Compiler Version 4.00A
  1207.  Copyright (c) Microsoft Corp 1987. All rights reserved.
  1208.  
  1209.  test.for
  1210.  P1 : ` f1.exe -il D:012356 -f test.for -pc \:/ -ef C:\BIN\f1.err -Q 24242 -A
  1211.  lfd -4I 4 -Gs -Iinclude/ -I ./ -W 1  '
  1212.  compiling ccalls.fil
  1213.  compiling plan.cfd
  1214.  compiling direct.cfd
  1215.  compiling client.cfd
  1216.  compiling colors.cfd
  1217.  compiling empmas.cfd
  1218.  compiling emplfd.cfd
  1219.  compiling empldd.cfd
  1220.  compiling juffsa.cfd
  1221.  test.for(16) : fatal error F1909: : %s : include file nested too deeply
  1222.   : include file nested too deeply
  1223.  
  1224.  Response:
  1225.     The error message itself is not being produced correctly. You can
  1226.  work around this problem by placing the INCLUDE files in the same
  1227.  directory as the source file.
  1228.     Microsoft has confirmed this to be a problem in Version 4.00. We
  1229.  are researching this problem and will post new information as it
  1230.  becomes available.
  1231.  
  1232.  
  1233.  36. Linking With 3.20/3.30 Modules
  1234.  
  1235.  Product Version(s): 4.00A
  1236.  Operating System:   MS-DOS
  1237.  Flags: ENDUSER |
  1238.  Last Modified:  5-MAY-1988    ArticleIdent: Q22172
  1239.  
  1240.  Question:
  1241.     When linking with the 3.20/3.30 compatible library (large model, 87
  1242.  support), I receive a message from LINK that it needs the LLIBFORE
  1243.  library. I am not specifying any FP switches at link time.
  1244.     What causes this? Could this happen if my 3.20/3.30 modules were
  1245.  compiled with $NOFLOATCALLS?
  1246.  
  1247.  Response:
  1248.     This should only occur if you are set up to link to LLIBFOR7.LIB.
  1249.     About twelve of the modules in Version 4.00 of FORTRAN.LIB have
  1250.  library search directives for LLIBFORE.LIB embedded in them. The
  1251.  linker will ask for LLIBFORE when the 3.20/3.30 routines call a
  1252.  library routine that has not already been loaded to satisfy a request
  1253.  from the main (Version 4.00) program.
  1254.     To workaround this, use the FL directive-link to alter the library
  1255.  search order.
  1256.     The following FL will compile and link without asking for
  1257.  LLIBFORE.LIB:
  1258.  
  1259.     FL V40.FOR -link MYLIB FORTRAN
  1260.  
  1261.     Since the Version 4.00 library contains the appropriate Version 3.x
  1262.  math library, it does not matter if $FLOATCALLS is used in the Version
  1263.  3.x routines.
  1264.  
  1265.  
  1266.  37. Text Beyond 72 Columns
  1267.  
  1268.  Product Version(s): 4.00A
  1269.  Operating System:   MS-DOS
  1270.  Flags: ENDUSER |
  1271.  Last Modified:  5-MAY-1988    ArticleIdent: Q22178
  1272.  
  1273.  Problem:
  1274.     If text goes beyond 72 columns, FORTRAN Version 4.00 does not issue
  1275.  any kind of diagnostics. It generates code (which is incorrect code,
  1276.  because some of it is not submitted to the language translator). All
  1277.  of the other compilers on the market issue diagnostics.
  1278.  
  1279.  Response:
  1280.     You are partially correct. Unless truncation of the line to 72
  1281.  characters causes a syntax error, Version 4.00 does not issue any
  1282.  error message. This is program design for the product.
  1283.     Because the FORTRAN standard mandates that only the first 72
  1284.  columns be used for source code, a substantial body of mainframe
  1285.  FORTRAN code has been generated that relies on that fact and uses the
  1286.  remaining columns (generally 73-80) for other purposes (most commonly
  1287.  for sequencing information).
  1288.     If the presence of characters beyond column 72 was flagged as a
  1289.  warning, and you were porting programs with sequencing information in
  1290.  columns 73-80, you would receive such a warning for every line. The
  1291.  listing file format provided by Version 4.00 of the Microsoft FORTRAN
  1292.  Optimizing Compiler will list the content of the first 72 characters
  1293.  of the source line and indicate the presence of additional characters
  1294.  beyond column 72 by adding a "#" just before the line number, e.g.
  1295.  line 10 in the following fragment of a .LST file:
  1296.  
  1297.    Line    Source    Microsoft FORTRAN Optimizing Compiler Version
  1298.    Number  Line      4.00
  1299.  
  1300.        1   c
  1301.        2   c
  1302.        3   c
  1303.        4   c
  1304.        5   c
  1305.        6
  1306.        7          program test
  1307.        8          open(3,file='xxxx.dat',status='old')
  1308.        9          rewind 3
  1309.       10          read(3,10)i1,i2,i3,i11,i12,i21,i22,i23,i24,
  1310.                   i25,i26,i27,i28,i29
  1311.       11  10      format(5i3,13i1)
  1312.       12          write(*,*)i1,' ',i2,' ',i3
  1313.       13          write(*,*)i11,' ',i12
  1314.       14          write(*,*)i21,i22,i23,i24,i25,i26,i27,i28,i29,
  1315.                   i30,i31,i32,i33
  1316.       15          end
  1317.  
  1318.     Please note that the variable i31 became variable i3, which causes
  1319.  incorrect output from this program.
  1320.     Neither of the two other microcomputer FORTRAN compilers that we
  1321.  tried directly diagnosed the presence of characters beyond column 72.
  1322.  
  1323.  
  1324.  38. FORTRAN and C Compatability in Protect Mode
  1325.  
  1326.  Product Version(s): 4.10
  1327.  Operating System:   MS-DOS
  1328.  Flags: ENDUSER |
  1329.  Last Modified: 17-MAR-1988    ArticleIdent: Q27843
  1330.  
  1331.  Question:
  1332.     How do I link my FORTRAN and C modules when I have built my FORTRAN
  1333.  libraries with C compatibility? I link as follows:
  1334.  
  1335.  LINK objs,,,LLIBCEP.LIB LLIBFEP.LIB DOSCALLS.LIB /NOE /NOD;
  1336.  
  1337.  Response:
  1338.     It is not necessary to use F4COMPAT.BAT for protect mode programs.
  1339.  Any of the three math packages can be used as long as they are
  1340.  consistent between the languages. The C library must be the first
  1341.  library, the FORTRAN library and DOSCALLS.LIB must be linked
  1342.  explicitly, and the switches /NOE and /NOD must be used. The /NOE
  1343.  switch is used to prevent symbols from being defined more than once
  1344.  (error L2025). The /NOD switch turns off the default library search so
  1345.  that the order of these libraries can be given explicitly. For
  1346.  information on linking real mode programs, please refer to the C 5.00
  1347.  README.DOC section entitled "Linking Mixed-Language Programs."
  1348.  
  1349.  
  1350.  39. Device Full Error
  1351.  
  1352.  Product Version(s): 4.00
  1353.  Operating System:   MS-DOS
  1354.  Flags: ENDUSER | buglist4.00 fixlist4.01
  1355.  Last Modified: 27-MAY-1988    ArticleIdent: Q22177
  1356.  
  1357.  Problem:
  1358.     There seems to be a problem using OPEN or CLOSE on a logical unit
  1359.  where you have had an error 6422 ("no space left on device") that is
  1360.  caught in a WRITE statement. Any attempt to CLOSE or OPEN the same
  1361.  logical unit will give the same error. The example that I have opens a
  1362.  file on an almost full disk, writes until it produces the above error,
  1363.  and then attempts to CLOSE the file.
  1364.  
  1365.  Response:
  1366.     This is a known problem in Version 4.00. It was corrected in
  1367.  Version 4.01.
  1368.     The program tries to recover from the "no space" condition by using
  1369.  the STATUS='DELETE' specifier to delete the file.
  1370.     The error is not being cleared because when a CLOSE is done, the
  1371.  file's last buffer is being flushed before a check is done to see
  1372.  whether you specified that the file be deleted. There is no
  1373.  workaround.
  1374.  
  1375.  
  1376.  40. Error in Rounding Code
  1377.  
  1378.  Product Version(s): 4.00
  1379.  Operating System:   MS-DOS
  1380.  Flags: ENDUSER | buglist4.00 fixlist4.01
  1381.  Last Modified: 27-MAY-1988    ArticleIdent: Q22143
  1382.  
  1383.  Question:
  1384.     I have encountered an error in the rounding code. Is there a
  1385.  solution available? The following is sample code:
  1386.  
  1387.      real*4 n1
  1388.      character*20 str
  1389.  
  1390.      n1=0.01
  1391.      write(str,12) n1
  1392.      write(*,*) str
  1393.  12  format(f9.2)
  1394.  
  1395.     F9.2 format rounds the number to 0.00.
  1396.  
  1397.  Response:
  1398.     Microsoft confirmed this to be a problem in Version 4.00 of the
  1399.  FORTRAN Compiler. The problem was corrected in Version 4.01.
  1400.     The problem does not occur for all values of n1 (try .02), but will
  1401.  occur whether the WRITE is to an internal or external file.
  1402.  
  1403.  
  1404.  41. Internal Compiler Error: getattrib.c 1.40, Line 162
  1405.  
  1406.  Product Version(s): 4.00a
  1407.  Operating System:   MS-DOS
  1408.  Flags: ENDUSER | ptr900051 bcp1542 buglist4.00
  1409.  Last Modified:  1-JUN-1988    ArticleIdent: Q22227
  1410.  
  1411.  Problem:
  1412.     The following program will produce the assertion error
  1413.  getattrib.c:1.40, line 162:
  1414.  
  1415.     implicit real (A - Z)
  1416.     integer*2    I CHAR
  1417.     integer*2    I SCAN
  1418.     integer*2    OPTION
  1419.     character*01 DRIVE
  1420.     common /valset/ allcharacters,  alphabetic, alphanumeric,
  1421.     &                numeric,    protected,  signed
  1422.     character*1  PROD ARRAY (36)
  1423.     character*36 PROD
  1424.     character*13 PRD KEY
  1425.     character*2  PRD DIV
  1426.     character*1  PRD FIL
  1427.     integer*4    PRD RET
  1428.     equivalence (PROD ARRAY  (1), PROD, PRD KEY, PRD DIV),
  1429.     &            (PROD ARRAY (33),                PRD RET)
  1430.     common /PROD CM/ PROD
  1431.     end
  1432.     subroutine UPDATE
  1433.     implicit real (A - Z)
  1434.     character*14 SET DD
  1435.     character*1  PROD ARRAY (36)
  1436.     character*36 PROD
  1437.     character*13 PRD KEY
  1438.     character*2  PRD DIV
  1439.     character*1  PRD FIL
  1440.     integer*4    PRD RET
  1441.     equivalence (PROD ARRAY  (1), PROD, PRD KEY, PRD DIV),
  1442.     &            (PROD ARRAY (33),                PRD RET)
  1443.     common /PROD CM/ PROD
  1444.     PRD KEY = '.............'
  1445.     PRD FILLER = ' '
  1446.     end
  1447.  
  1448.  Response:
  1449.     This is a known problem in Version 4.00.
  1450.     Microsoft is researching this problem and will post new information
  1451.  as it becomes available.
  1452.     It seems that this problem has to do with EQUIVALENCE between
  1453.  CHARACTER and non-CHARACTER data.
  1454.     Note that the assertion error only happens on an 80286; on an
  1455.  80386, you will receive an "error 2100 : Floating point error : stack
  1456.  underflow", after which the machine will hang. This happens even on a
  1457.  patched DOS Version 3.2.
  1458.  
  1459.  
  1460.  42. Internal Compiler Error: regMD.c 1.74, Line 2156
  1461.  
  1462.  Product Version(s): 4.00a
  1463.  Operating System:   MS-DOS
  1464.  Flags: ENDUSER | ptr900054 bcp1545 buglist4.00 fixlist4.01
  1465.  Last Modified:  1-JUN-1988    ArticleIdent: Q22232
  1466.  
  1467.  Problem:
  1468.     The following program causes a regMD.c:1.74, line 2156 assertion
  1469.  error:
  1470.  
  1471.          u = 1. /
  1472.       +      (xa+ 1. /
  1473.       +      (xa+ 2. /
  1474.       +      (xa+ 3. /
  1475.       +      (xa+ 4. /
  1476.       +      (xa+ 5. /
  1477.       +      (xa+ 6. /
  1478.       +      (xa+ 7. /
  1479.       +      (xa+ 8. /
  1480.       +      (xa+ 9. /
  1481.       +      (xa+ 10. /
  1482.       +      (xa+ 11. /
  1483.       +      (xa+ 12. / xa ))))))))))))
  1484.          end
  1485.  
  1486.  Response:
  1487.     This is a known problem in Version 4.00a of the FORTRAN compiler.
  1488.  It was corrected in Version 4.01.
  1489.     The only workaround is to break the statement into smaller
  1490.  segments.
  1491.  
  1492.  
  1493.  43. Null Pointer Assignment at Compile Time
  1494.  
  1495.  Product Version(s): 4.00a
  1496.  Operating System:   MS-DOS
  1497.  Flags: ENDUSER | ptr900048 bcp1532 ptr900049 bcp1534 buglist4.00a fixlist4.01
  1498.  Last Modified:  1-JUN-1988    ArticleIdent: Q22235
  1499.  
  1500.     The following code gives a "null pointer assignment" error if
  1501.  compiled with -4Yb ($DEBUG):
  1502.  
  1503.     character cfunc,arg
  1504.     arg = 'X'
  1505.     write (*,*) cfunc (arg)
  1506.     end
  1507.     character function cfunc (arg)
  1508.     character arg
  1509.     cfunc = arg
  1510.     end
  1511.  
  1512.     Note that the following program also produces a "null pointer
  1513.  assignment" message during compilation if -4Yb is used:
  1514.  
  1515.     SUBROUTINE MAPINPUT (FILENAME)
  1516.     CHARACTER*(*) FILENAME
  1517.     OPEN (1,FILE=FILENAME)
  1518.     END
  1519.  
  1520.     Microsoft has confirmed this to be a problem in Version 4.00a of
  1521.  the FORTRAN Compiler. This problem was corrected in Version 4.01.
  1522.  
  1523.     In the first example, this occurs because a CHARACTER function is
  1524.  used in a WRITE statement (but only when compiled with -4Yb).
  1525.     The second example produces the same error, probably for the same
  1526.  internal reason, but there is no CHARACTER function this time.
  1527.  Instead, there is a CHARACTER*(*) parameter associated with an I/O
  1528.  statement.
  1529.  
  1530.  
  1531.  44. Concatenation Operator
  1532.  
  1533.  Product Version(s): 4.00a
  1534.  Operating System:   MS-DOS
  1535.  Flags: ENDUSER | ptr900055 bcp1548 buglist4.00 fixlist4.01
  1536.  Last Modified:  1-JUN-1988    ArticleIdent: Q22236
  1537.  
  1538.     The following program should output PQRS2345, but it only outputs
  1539.  PQRS:
  1540.  
  1541.          J=3
  1542.          CALL SUBA(J)
  1543.          END
  1544.  
  1545.          SUBROUTINE SUBA(J)
  1546.          CHARACTER*8 A
  1547.          CHARACTER*4 H
  1548.          COMMON /AAA/H(3)
  1549.          h(1)='ABCD'
  1550.          H(2)='PQRS'
  1551.          H(3)='2345'
  1552.  
  1553.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  1554.  FORTRAN Compiler. It was corrected in Version 4.01.
  1555.     The following statement can be inserted as a workaround:
  1556.  
  1557.          H(J) = H(J)
  1558.          A=H(2)//H(J)
  1559.          WRITE(0,999)A
  1560.  999     FORMAT(' A=',A8)
  1561.          END
  1562.  
  1563.     This problem seems only to affect the second operand of a
  1564.  concatenation if the second operand is a COMMON variable.
  1565.  
  1566.  
  1567.  45. Internal Compiler Errors: ctypes.c, MDmisc.c, expand.c
  1568.  
  1569.  Product Version(s): 4.00
  1570.  Operating System:   MS-DOS
  1571.  Flags: ENDUSER | ptr900056 bcp1549 buglist4.00
  1572.  Last Modified:  2-JUN-1988    ArticleIdent: Q22237
  1573.  
  1574.     The following subroutine will produce four different internal
  1575.  compiler errors, depending on how "k" is typed:
  1576.  
  1577.     subroutine inerr(endprnt)
  1578.     integer endprnt
  1579.  
  1580.     The following errors are produced:
  1581.  
  1582.     1. "Character*4" will produce an error in ctypes.c line 355 if
  1583.  compiled with -4I2, as follows:
  1584.  
  1585.     character*4 k
  1586.  
  1587.     2. "Character*10" will produce an error in ctypes.c line 426 if
  1588.  compiled with -4I2, as follows:
  1589.  
  1590.     character*10 k
  1591.  
  1592.     3. "Character*1" will produce an error in MDmisc.c line 844, as
  1593.  follows:
  1594.  
  1595.     character*1 k
  1596.  
  1597.     4. "Character*2" will produce an error in expand.c line 1350, in
  1598.  the following program:
  1599.  
  1600.               character*2 k
  1601.               lr=1
  1602.               write(endprnt,40)k(lr),k(lr+1),k(lr+2),k(lr+3)
  1603.     40        format(1x,4A10)
  1604.               end
  1605.  
  1606.     This is a known problem in Version 4.00.
  1607.     Microsoft is researching this problem and will post new information
  1608.  as it becomes available.
  1609.     The problem apparently involves the recognition of a CHARACTER
  1610.  function as an argument to a WRITE or an OPEN statement.
  1611.  
  1612.  
  1613.  46. EOF When Value Equals 26 in a Binary file
  1614.  
  1615.  Product Version(s): 4.00
  1616.  Operating System:   MS-DOS
  1617.  Flags: ENDUSER | buglist4.00 fixlist4.01
  1618.  Last Modified:  1-JUN-1988    ArticleIdent: Q22238
  1619.  
  1620.     The program below (deof.for) will get an end-of-file (EOF) if the
  1621.  value read in is equal to 26. This happens only if the variable is
  1622.  integer*1 (integer*2 produces the proper results). It is my
  1623.  understanding that the 26 should not be treated as EOF if it is a
  1624.  binary file.
  1625.     The program is as follows:
  1626.  
  1627.     integer*1 i1,i2
  1628.     open(1,file='def.dat',form='binary')
  1629.     i1=22
  1630.     i2=26
  1631.  
  1632.     write(1) i1
  1633.     write(1) i2
  1634.  
  1635.     rewind (1)
  1636.  
  1637.     read(1) i1
  1638.     write(*,*) i1
  1639.  
  1640.     read(1) i2
  1641.     write(*,*) i2
  1642.  
  1643.     end
  1644.  
  1645.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  1646.  FORTRAN Compiler. It was corrected in Version 4.01.
  1647.  
  1648.     In FORM='BINARY', you should be able to READ anything that you
  1649.  WRITE to a file (if you rewind the file), including CONTROL-Z. The
  1650.  problem is not restricted to INTEGER*1. What determines the failure is
  1651.  that the very last byte written to a file is a CONTROL-Z. When
  1652.  READing, if the run time sees a CONTROL-Z in its buffer, it strips it
  1653.  out. In this program, this causes a premature end-of-file.
  1654.     This program will fail in the same way if you change variable I2 to
  1655.  be INTEGER*2 and give it a value of #1A1A. (Due to byte swapping,
  1656.  INTEGER*2 storage of the value 26 is #1A00. Thus, because the last
  1657.  byte was zero, you did not see it fail.)
  1658.  
  1659.  
  1660.  47. Internal Compiler Error: exhelp.c 1.55, Line 662
  1661.  
  1662.  Product Version(s): 4.00
  1663.  Operating System:   MS-DOS
  1664.  Flags: ENDUSER |
  1665.  Last Modified:  1-JUN-1988    ArticleIdent: Q22240
  1666.  
  1667.  Problem:
  1668.     FORTRAN Version 4.00 generates the following internal compiler
  1669.  error:
  1670.  
  1671.     exphelp.c:1.55, line 662
  1672.  
  1673.  Response:
  1674.     Line 8, "B(I) = REAL(I) - CMPLX(I)", generates the above internal
  1675.  compiler error. B is COMPLEX*16 and I is INTEGER*2. The error goes
  1676.  away if you change the statement to the following:
  1677.  
  1678.     T = CMPLX(I)
  1679.     A(I) = REAL(I) - T
  1680.  
  1681.     The first file (bernard.for) generates the internal error. The
  1682.  second file (bernard2.for) adds the variable T to fix the problem.
  1683.  The following is the first file:
  1684.  
  1685.     program test
  1686.     integer*2 maxamt
  1687.     parameter (maxamt=5)
  1688.     complex*16 b(maxamt)
  1689.     integer*2 i
  1690.  
  1691.     do 1,i=1,maxamt
  1692.       b(i) = real(i) - cmplx(i)
  1693.  1    continue
  1694.     end
  1695.  
  1696.     REAL(I) converts I to REAL*4. CMPLX(I) converts I to COMPLEX*8.
  1697.     The problem can also be worked around by compiling with the -Odclt
  1698.  option.
  1699.  
  1700.  
  1701.  48. END= and Implied-DO READS
  1702.  
  1703.  Product Version(s): 4.00a 4.01
  1704.  Operating System:   MS-DOS
  1705.  Flags: ENDUSER | ptr900058 bcp1554 buglist4.00a buglist4.01
  1706.  Last Modified:  1-JUN-1988    ArticleIdent: Q22244
  1707.  
  1708.     The following program should produce two identical lines:
  1709.  
  1710.          dimension x(15)
  1711.          open (1,form='formatted')
  1712.          write (1,'(i5)') (i,i=1,10)
  1713.          rewind 1
  1714.          i = 0
  1715.  5       continue
  1716.          i = i+1
  1717.          read (1,*,end=10) x(i)
  1718.          go to 5
  1719.  10      continue
  1720.          i = i-1
  1721.          write (*,*) 'From first read, i=',i,':'
  1722.          write (*,'(1x,15f3.0)') (x(j),j=1,i)
  1723.          rewind 1
  1724.          read (1,*,end=20) (x(i),i=1,15)
  1725.  20      continue
  1726.          i = i-1
  1727.          write (*,*) 'From second read, i=',i,':'
  1728.          write (*,'(1x,15f3.0)') (x(j),j=1,i)
  1729.          end
  1730.  
  1731.     The output should be as follows:
  1732.  
  1733.     >From first read, i=         10:
  1734.      1. 2. 3. 4. 5. 6. 7. 8. 9.10.
  1735.     >From second read, i=         10:
  1736.      1. 2. 3. 4. 5. 6. 7. 8. 9.10.
  1737.  
  1738.     However, it looks like the following:
  1739.  
  1740.     >From first read, i=         10:
  1741.      1. 2. 3. 4. 5. 6. 7. 8. 9.10.
  1742.     >From second read, i=         15:
  1743.      1. 2. 3. 4. 5. 6. 7. 8. 9.10. 0. 0. 0. 0. 0.
  1744.  
  1745.     Microsoft is researching this problem and will post new information
  1746.  as it becomes available.
  1747.  
  1748.     This is a known problem in Versions 4.00a and 4.01.
  1749.     This problem will occur on READ statements that use implied-DO loops to
  1750.  read part or all of an array and that use the END= specifier to branch
  1751.  when end-of-file is reached.
  1752.     An inspection of the code reveals that no code is being generated
  1753.  to check for end-of-file when an implied-DO is used.
  1754.  
  1755.  
  1756.  49. Incorrect F2215 Errors
  1757.  
  1758.  Product Version(s): 4.00a
  1759.  Operating System:   MS-DOS
  1760.  Flags: ENDUSER | PTR900060 bcp1569
  1761.  Last Modified: 25-OCT-1988    ArticleIdent: Q22255
  1762.  
  1763.  The following program will generate an incorrect F2215 error
  1764.  ("character lengths differ"):
  1765.  
  1766.        SUBROUTINE PAGE
  1767.        IMPLICIT CHARACTER*1(A-H,J-Z)
  1768.        ENTRY PAGOUT
  1769.        END
  1770.  
  1771.  The compiler is issuing an error that is only appropriate for a
  1772.  function because subroutines have no type associated with them. The
  1773.  workaround for this problem is to avoid using the IMPLICIT CHARACTER
  1774.  statement; use explicit type statements instead.
  1775.  
  1776.  
  1777.  50. Macro Definitions Error
  1778.  
  1779.  Product Version(s): 4.00
  1780.  Operating System:   MS-DOS
  1781.  Flags: ENDUSER | docerr
  1782.  Last Modified: 25-OCT-1988    ArticleIdent: Q22284
  1783.  
  1784.  Question:
  1785.  
  1786.  Is there a documentation error on Page 174 in the "Microsoft
  1787.  FORTRAN Optimizing Compiler User's Guide" for Version 4.00 regarding
  1788.  macro definitions?
  1789.  
  1790.  Response:
  1791.  
  1792.  Yes, the following statement should be changed to indicate that double
  1793.  quotation marks around a macro are required only if the macro
  1794.  definition contains white space and is on the MAKE command line:
  1795.  
  1796.     "To include white space in a macro definition, enclose the entire
  1797.     definition in double quotation marks (" ")"
  1798.  
  1799.  Macro definitions inside a MAKE file should not be enclosed in
  1800.  quotation marks. Therefore, the following example on Page 175 is
  1801.  incorrect:
  1802.  
  1803.     warn="/W0"
  1804.  
  1805.  It should be changed to something such as the following:
  1806.  
  1807.     make warn= "-c -W2" compile
  1808.  
  1809.  
  1810.  51. -Gr Switch Operating Incorrectly
  1811.  
  1812.  Product Version(s): 4.00a
  1813.  Operating System:   MS-DOS
  1814.  Flags: ENDUSER | ptr900063 bcp1585 buglist4.00 fixlist4.01
  1815.  Last Modified:  1-JUN-1988    ArticleIdent: Q22292
  1816.  
  1817.     The -Gr switch is intended to be used when Version 3.20 object
  1818.  files or libraries are mixed with Version 4.00 main programs. Version
  1819.  3.20 object files may use the SI and DI registers without regard to
  1820.  their previous contents, and since Version 4.00 needs to use SI and
  1821.  DI, this switch was added to preserve their contents by pushing them
  1822.  onto the stack prior to subroutine or function calls and restoring
  1823.  them upon return.
  1824.     A problem is caused by the SI and DI registers being pushed after
  1825.  any arguments are pushed, rather than before. The -Gr switch will work
  1826.  if calls to subroutines or functions are made with no arguments, but
  1827.  programs containing subroutines or functions that have one or more
  1828.  arguments will either produce incorrect answers or behave
  1829.  unpredictably.
  1830.     Microsoft has confirmed this problem in Version 4.00 of the FORTRAN
  1831.  Compiler. This problem was corrected in Version 4.01.
  1832.  
  1833.     Here is an example of a program that recreates the problem. The
  1834.  following program:
  1835.  
  1836.          character*5 c,cfunc
  1837.          i = 1
  1838.          x = 2.0
  1839.          c = '34567'
  1840.          call junk (i,x,c)
  1841.          c = cfunc ('abcde')
  1842.          write (*,*) 'Function return value should be ''abcde'', is=',c
  1843.          end
  1844.          subroutine junk (j,y,cx)
  1845.          character cx*5
  1846.          write (*,*) 'First parameter should be 1, is=',j
  1847.          write (*,*) 'Second parameter should be 2.0, is=',y
  1848.          write (*,*) 'Third parameter should be ''34567'', is=',cx
  1849.          end
  1850.          character*(*) function cfunc(c)
  1851.          character*(*) c
  1852.          cfunc = c
  1853.          end
  1854.  
  1855.  should produce the following output:
  1856.  
  1857.     First parameter should be 1, is=          1
  1858.     Second parameter should be 2.0, is=       2.000000
  1859.     Third parameter should be '34567', is=34567
  1860.     Function return value should be 'abcde', is=abcde
  1861.  
  1862.  However, when compiled with -Gr, the output is as follows:
  1863.  
  1864.     First parameter should be 1, is= 1073741824
  1865.     Second parameter should be 2.0, is=   2.700149E-06
  1866.     Third parameter should be '34567', is=\016X>$
  1867.     run-time error F6602: WRITE(CON)
  1868.     - list-directed number bigger than record size
  1869.  
  1870.  
  1871.  52. Internal Compiler Error: omf.c 1.59, Line 185
  1872.  
  1873.  Product Version(s): 4.00a
  1874.  Operating System:   MS-DOS
  1875.  Flags: ENDUSER | ptr900053 bcp1544 buglist4.00 fixlist4.01
  1876.  Last Modified:  1-JUN-1988    ArticleIdent: Q22233
  1877.  
  1878.  Problem:
  1879.     The following program causes an omf.c:1.59, line 185 assertion
  1880.  error if compiled with the -Fc option:
  1881.  
  1882.          dimension jn(8192)
  1883.          write (*,'(4i15)') jn
  1884.          end
  1885.  
  1886.  Response:
  1887.     This is a known problem in Version 4.00a of the FORTRAN compiler.
  1888.  It was corrected in Version 4.01.
  1889.     The pattern here is that it must be a formatted write, and the
  1890.  argument to the WRITE must be part or all of an array that is more
  1891.  than 32K in length.
  1892.  
  1893.  
  1894.  53. Code Generation Errors when Compiling with -4Yb and -Od
  1895.  
  1896.  Product Version(s): 4.00A
  1897.  Operating System:   MS-DOS
  1898.  Flags: ENDUSER | ptr900050 bcp1535 buglist4.00 fixlist4.01
  1899.  Last Modified: 27-MAY-1988    ArticleIdent: Q22225
  1900.  
  1901.     The following program causes multiple code generation errors if
  1902.  compiled with -4Yb and -Od:
  1903.  
  1904.     SUBROUTINE OPED1
  1905.     CHARACTER*70 COMMENT(2)
  1906.     IF (COMMENT(1)(I:I) .EQ. ' ') i = 1
  1907.     IF (ICHAR(COMMENT(1)(I:I)) .NE. 0) i =1
  1908.     END
  1909.  
  1910.  Problem:
  1911.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  1912.  FORTRAN Compiler. It was corrected in Version 4.01.
  1913.     This is probably related to an earlier problem that caused an
  1914.  assertion error in ctypes.c:1.80, line 1594. In fact, this program
  1915.  will cause the same assertion error if the -Od option is not used.
  1916.  Note that the error will not occur unless both of the IF statements
  1917.  are present.
  1918.  
  1919.  
  1920.  54. Compile Error F2328
  1921.  
  1922.  Product Version(s): 4.00A 4.01
  1923.  Operating System:   MS-DOS
  1924.  Flags: ENDUSER | buglist4.00a buglist4.01
  1925.  Last Modified: 27-MAY-1988    ArticleIdent: Q22208
  1926.  
  1927.  Problem:
  1928.     The following subroutine produces compilation error F2328 ("N :
  1929.  already typed"):
  1930.  
  1931.        subroutine x (a,n)
  1932.        real a(n)
  1933.        integer n
  1934.        a(1) = 1.0
  1935.        end
  1936.  
  1937.  Response:
  1938.     This is a known problem in Versions 4.00a and 4.01 of the FORTRAN
  1939.  Compiler.
  1940.     The program is valid, but the compiler reacts as if the presence of
  1941.  N in the REAL declaration statement "declares" N to be type INTEGER.
  1942.  Because N has been "declared" INTEGER, the compiler reports an error
  1943.  when the next statement attempts to declare it.
  1944.     To work around this compiler error, declare all variables used as
  1945.  bounds for adjustable-size arrays before declaring the arrays
  1946.  themselves.
  1947.     Microsoft is researching this problem and will post new information
  1948.  as it becomes available.
  1949.  
  1950.  
  1951.  55. Run-Time Error F6099 Integer Overflow -4Yb -4I2
  1952.  
  1953.  Product Version(s): 4.00 4.01
  1954.  Operating System:   MS-DOS
  1955.  Flags: ENDUSER | ptr900064 bcp1587 buglist4.00 buglist4.01
  1956.  Last Modified:  1-JUN-1988    ArticleIdent: Q22291
  1957.  
  1958.  Problem:
  1959.     The following program produces run-time error F6099 (INTEGER
  1960.  overflow) if it is compiled with -4I2 and -4Yb:
  1961.  
  1962.          dimension j(200,160)
  1963.          do 10 i=1,200
  1964.          write (*,*) 'i=',i
  1965.          do 10 k=1,160
  1966.          write (*,*) 'k=',k
  1967.  10      j(i,k)=0
  1968.          end
  1969.  
  1970.     It writes out i=1 and j=1,2,3...82 and then terminates.
  1971.  
  1972.  Response:
  1973.     This is a known problem in Versions 4.00 and 4.01 of the FORTRAN
  1974.  compiler.
  1975.     The array subscript calculation is being done in INTEGER*2
  1976.  arithmetic, so when you get to j=82, it is attempting to multiply 400
  1977.  (200 elements, 2 bytes each) by 82, which is 32800. However, since
  1978.  $4Yb is in effect, the program gives the error and stops. This also
  1979.  will happen if you explicitly make the array INTEGER*2 and compile
  1980.  with just -4Yb.
  1981.     The workaround is to reduce the size or length of the character
  1982.  array to the point where size (200 elements in this case) times the
  1983.  length (2) is less than 32768 bytes.
  1984.     Microsoft is researching this problem and will post new information
  1985.  as it becomes available.
  1986.  
  1987.  
  1988.  56. Unformatted WRITE Hangs
  1989.  
  1990.  Product Version(s): 4.00A
  1991.  Operating System:   MS-DOS
  1992.  Flags: ENDUSER | ptr900062 bcp1580 buglist4.00 fixlist4.01
  1993.  Last Modified: 27-MAY-1988    ArticleIdent: Q22287
  1994.  
  1995.  Problem:
  1996.     The following program hangs at run time:
  1997.  
  1998.          dimension i(5)
  1999.          data i /1,2,3,4,5/
  2000.          data n /0/
  2001.          open (1,form='unformatted')
  2002.          write (1) (i(j),j=1,n)
  2003.  cx      write (1) (i(j)*1,j=1,n)
  2004.          close (1,status='delete')
  2005.          end
  2006.  
  2007.  Response:
  2008.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2009.  FORTRAN Compiler. It was corrected in Version 4.01.
  2010.     The program hangs because it is trying to write zero elements of
  2011.  the array. It is peculiar to unformatted I/O and happens only if the
  2012.  number of elements to be transferred is zero.
  2013.     If you want to be able to write zero elements, a workaround is to
  2014.  put the array element into an expression. Replacing the existing WRITE
  2015.  with the commented-out WRITE allows the above program to run.
  2016.  
  2017.  
  2018.  57. Purpose of the /Gr Switch
  2019.  
  2020.  Product Version(s): 4.00A
  2021.  Operating System:   MS-DOS
  2022.  Flags: ENDUSER |
  2023.  Last Modified:  1-DEC-1987    ArticleIdent: Q22267
  2024.  
  2025.  Question:
  2026.     We are a little unclear on exactly what the /Gr switch does. Is it just
  2027.  that the object file format is different, or are the object references
  2028.  different?
  2029.  
  2030.  Response:
  2031.     The only effect the /Gr switch has is that, prior to any
  2032.  subroutine/function call, the SI and DI registers are pushed onto the stack,
  2033.  and upon return they are popped. Since Version 3.x routines may use SI and DI
  2034.  for their own purposes, the /Gr switch was added to preserve their Version 4.
  2035.  values across calls.
  2036.  
  2037.  
  2038.  58. NDP Stack Underflow
  2039.  
  2040.  Product Version(s): 4.00A
  2041.  Operating System:   MS-DOS
  2042.  Flags: ENDUSER | ptr900061 bcp1571 buglist4.00 fixlist4.01
  2043.  Last Modified: 27-MAY-1988    ArticleIdent: Q22264
  2044.  
  2045.  Problem:
  2046.     I am receiving the following error message:
  2047.  
  2048.     run-time error M610: MATH
  2049.     - floating-point error: stack underflow
  2050.  
  2051.     I receive the above error message when I run the following program:
  2052.  
  2053.          data x /0.0/
  2054.          y = 0.0
  2055.          if (x .ne. 0.0) y = 1.0
  2056.          z = 1.0
  2057.          write (*,*) y,z
  2058.          end
  2059.  
  2060.  Response:
  2061.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2062.  FORTRAN Compiler. It was corrected in Version 4.01.
  2063.     The optimizer assumes that the constant 1.0 is on the NDP stack, so
  2064.  when it tries to assign 1.0 to Z, it simply does an FSTP
  2065.  (floating-store-pop) instruction. Unfortunately, since 1.0 will be put
  2066.  on the stack only if X is not equal to 0.0, the program fails.
  2067.     The workaround is to compile with -Od.
  2068.  
  2069.  
  2070.  59. Code Generation Error, WRITE Statement
  2071.  
  2072.  Product Version(s): 4.00A
  2073.  Operating System:   MS-DOS
  2074.  Flags: ENDUSER | ptr900059 bcp1568 buglist4.00 fixlist4.01
  2075.  Last Modified: 27-MAY-1988    ArticleIdent: Q22259
  2076.  
  2077.  Problem:
  2078.     The following program produces a code generation error:
  2079.  
  2080.        real bs(3,3),br(3,3),ps(3,3),psp(3),bsp(3),bso(3),rp(3),ro(3)
  2081.            WRITE(6,350)
  2082.       +  aguse(I,J)/customers(J),
  2083.       x  agg(bs(I,J),1.0)+AGG(BR(I,J),1.0),
  2084.       +  AGG(BR(I,J)-PS(I,J),1.0),
  2085.       X  AGG(BS(I,J)+BR(I,J)-PS(I,J),1.0)
  2086.    350 FORMAT(3(1X,A22,F9.1,7F8.2,3X,F8.2))
  2087.          end
  2088.  
  2089.  Response:
  2090.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2091.  FORTRAN compiler. It was corrected in Version 4.01.
  2092.     The problem here apparently involves the expressions used as
  2093.  arguments to the WRITE statement. A possible workaround would be to
  2094.  store the expressions in temporary variables and WRITE those instead.
  2095.  
  2096.  
  2097.  60. Run-Time Error F6419 in Series of READs
  2098.  
  2099.  Product Version(s): 4.00
  2100.  Operating System:   MS-DOS
  2101.  Flags: ENDUSER | buglist4.00 fixlist4.01
  2102.  Last Modified: 27-MAY-1988    ArticleIdent: Q22258
  2103.  
  2104.  Question:
  2105.     I receive run-time error F6419 in the middle of a series of READS.
  2106.  How can I prevent this?
  2107.  
  2108.  Response:
  2109.     This error means "illegal structure for unformatted file." You may
  2110.  be able to prevent the error by raising the BLOCKSIZE of the file.
  2111.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2112.  FORTRAN compiler. It was corrected in Version 4.01.
  2113.  
  2114.  
  2115.  61. Opening COM1/AUX
  2116.  
  2117.  Product Version(s): 4.00A
  2118.  Operating System:   MS-DOS
  2119.  Flags: ENDUSER | ptr90005 bcp1543 buglist4.00 fixlist4.01
  2120.  Last Modified:  1-JUN-1988    ArticleIdent: Q22234
  2121.  
  2122.     The statement "open(3,file='com1')" generates the following error
  2123.  message:
  2124.  
  2125.     Error 6415: OPEN(COM1)
  2126.     -file already exists-
  2127.  
  2128.     The status in this OPEN statement is unknown, but the documentation
  2129.  on the error message indicates that the OPEN statement specified
  2130.  status='new'. If you explicitly specify status='old' in the open
  2131.  statement, then the error is not generated.
  2132.     Microsoft has confirmed this to be a problem with Version 4.00A of
  2133.  the FORTRAN Compiler. This problem was corrected in Version 4.01.
  2134.     Another workaround for this (besides the one mentioned above) is to
  2135.  open file 'LINE', which will access the same place. The difference is
  2136.  that when the run time sees the name 'LINE' it does not check the
  2137.  "STATUS" of the file, but it does check the "STATUS" for COM1.
  2138.  
  2139.  
  2140.  62. Unresolved External: __FHcfsubrd
  2141.  
  2142.  Product Version(s): 4.00A
  2143.  Operating System:   MS-DOS
  2144.  Flags: ENDUSER | ptr900057 bcp1553 buglist4.00 fixlist4.01
  2145.  Last Modified:  1-JUN-1988    ArticleIdent: Q22239
  2146.  
  2147.     The following program produces an resolved external at link time if
  2148.  compiled with -FPc:
  2149.  
  2150.     complex z6,ans
  2151.     ans = 1.0-z6
  2152.     end
  2153.  
  2154.     Microsoft has confirmed this to be a problem in Version 4.00A of
  2155.  the FORTRAN Compiler. This problem was corrected in Version 4.01.
  2156.     There is no simple workaround for this problem except to compile
  2157.  with -FPi.
  2158.  
  2159.  
  2160.  63. GETFONTINFO: Documentation Error in Type Definition
  2161.  
  2162.  Product Version(s): 5.00
  2163.  Operating System:   MS-DOS
  2164.  Flags: ENDUSER | docerr
  2165.  Last Modified: 23-APR-1990    ArticleIdent: Q60842
  2166.  
  2167.  The interface statement for the GETFONTINFO function shown on Page 209
  2168.  of the "Microsoft FORTRAN Advanced Topics" manual incorrectly lists
  2169.  the following line:
  2170.  
  2171.     INTEGER*2 avegwidth          !Average width in pixels
  2172.  
  2173.  The line should read as follows to conform to the definition in the
  2174.  include file FGRAPH.FD:
  2175.  
  2176.     INTEGER*2 avgwidth           !Average width in pixels
  2177.  
  2178.  
  2179.  64. Writing More Than 132 Characters to a Device
  2180.  
  2181.  Product Version(s): 4.00a
  2182.  Operating System:   MS-DOS
  2183.  Flags: ENDUSER | ptr900006 bcp1361 buglist4.00 fixlist4.01
  2184.  Last Modified:  1-JUN-1988    ArticleIdent: Q22283
  2185.  
  2186.     Attempting to WRITE more than 132 characters to a device (CON, PRN,
  2187.  etc.) will cause random characters to be written. The following
  2188.  program demonstrates the problem:
  2189.  
  2190.     i = 12345
  2191.     write (*,'(i150)') i
  2192.     end
  2193.  
  2194.     This involves a problem with the run-time code that handles buffer
  2195.  overflows. The problem only occurs with WRITEs to devices, not files.
  2196.  Note, however, that files created by redirecting CON output also will
  2197.  be affected.
  2198.     A patch has been developed that will work around the problem by
  2199.  allowing the size of the device buffers to be increased. The patch
  2200.  raises the buffer size from 132 to 256 bytes. If you wish to write
  2201.  longer records, you can raise the limit to as high as 32255 bytes.
  2202.     To patch the FORTRAN Version 4.00 libraries to correctly handle
  2203.  records longer than 132 bytes written to devices, perform the
  2204.  following patch, which increases the buffer size from 132 (0084 hex)
  2205.  to 256 (0100 hex):
  2206.  
  2207.     /* patch the large model library first */
  2208.     LIB LLIBFOR *CORE;
  2209.     DEBUG CORE.OBJ
  2210.     E ES:48E
  2211.     00 01   /* replace the bytes 84 and 00 with bytes 00 and 01 */
  2212.     E ES:4C6
  2213.     00 01                  /* must be same two bytes */
  2214.     E ES:1052
  2215.     00 01                 /* must be same two bytes again */
  2216.     W
  2217.     Q
  2218.     LIB LLIBFOR -+CORE;
  2219.  
  2220.     /* now for the medium model library */
  2221.     LIB MLIBFOR *CORE;
  2222.     DEBUG CORE.OBJ
  2223.     E ES:48A
  2224.     00 01    /* replace the bytes 84 and 00 with bytes 00 and 01 */
  2225.     E ES:4C2
  2226.     00 01                    /* must be same two bytes */
  2227.     E ES:E21
  2228.     00 01                    /* must be same two bytes again */
  2229.     W
  2230.     Q
  2231.     LIB MLIBFOR -+CORE;
  2232.  
  2233.     /* done */
  2234.  
  2235.     Please note that you can increase the buffer size up to 32255 (7DFFH,
  2236.  entered as FF 7D). Never enter more than two bytes at any of the above
  2237.  locations.
  2238.     If the first byte to be changed at each address is not 84
  2239.  (hexadecimal), stop and confirm that you entered the correct address.
  2240.    Microsoft has confirmed this to be a problem in Version 4.00 of the
  2241.  FORTRAN compiler. This problem was corrected in Version 4.01.
  2242.  
  2243.  
  2244.  65. CTRL+Z Versus INCLUDE Files
  2245.  
  2246.  Product Version(s): 4.00a
  2247.  Operating System:   MS-DOS
  2248.  Flags: ENDUSER | ptr900067 bcp1603 buglist4.00 fixlist4.01
  2249.  Last Modified: 30-SEP-1988    ArticleIdent: Q22307
  2250.  
  2251.  Problem:
  2252.  
  2253.  My main program is as follows:
  2254.  
  2255.     c
  2256.     c This is the main program
  2257.     c
  2258.     c Now the include file (which has a CTRL+Z as the last character)
  2259.     $INCLUDE:'bcp1603a.for'
  2260.     c Since the CTRL+Z has been echoed from the INCLUDE file
  2261.     c You will not see these comments if you TYPE the .LST file
  2262.             end
  2263.  
  2264.  My INCLUDE file (which has a CTRL+Z as the last character) is as
  2265.  follows:
  2266.  
  2267.     c this is the first line of the include file
  2268.     c
  2269.     c
  2270.     $nofloatcalls
  2271.     c this is the last line of the include file
  2272.  
  2273.  Any attempt to TYPE the resulting .LST file stops at the end of the
  2274.  INCLUDE file.
  2275.  
  2276.  Response:
  2277.  
  2278.  Microsoft has confirmed this to be a problem in Version 4.00 of the
  2279.  FORTRAN compiler. This problem was corrected in Version 4.01.
  2280.  
  2281.  The CTRL+Z character in the INCLUDEd file is being sent to the .LST
  2282.  file and should not be. A workaround to this problem is to use the DOS
  2283.  COPY command (i.e., if file XX ends with a CTRL+Z, the following COPY
  2284.  command will create file YY, which has all the same information
  2285.  without the CTRL+Z character at the end):
  2286.  
  2287.  COPY XX/A YY
  2288.  
  2289.  
  2290.  66. More Than One Unnamed BLOCK DATA
  2291.  
  2292.  Product Version(s): 4.00
  2293.  Operating System:   MS-DOS
  2294.  Flags: ENDUSER | ptr900069 bcp1614 buglist4.00 fixlist4.01
  2295.  Last Modified:  1-JUN-1988    ArticleIdent: Q22351
  2296.  
  2297.     The compiler should give an error for the following program, but it
  2298.  does not:
  2299.  
  2300.     block data
  2301.     end
  2302.     block data
  2303.     end
  2304.  
  2305.     The ANSI X3.9-1978 FORTRAN standard states, "There must not be more
  2306.  than one unnamed BLOCK DATA subprogram in an executable program."
  2307.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2308.  FORTRAN Compiler. This problem was corrected in Version 4.01.
  2309.     This error may result in incorrect data being placed into the
  2310.  labeled COMMON blocks. If you have more than one BLOCK DATA
  2311.  subprogram, the obvious (and correct) solution is to use named BLOCK
  2312.  DATA subprograms: one may be unnamed, but the rest must be named.
  2313.  
  2314.  
  2315.  67. Problem Reading LIB.CMP
  2316.  
  2317.  Product Version(s): 4.00A
  2318.  Operating System:   MS-DOS
  2319.  Flags: ENDUSER | buglist4.00 fixlist4.01
  2320.  Last Modified: 27-MAY-1988    ArticleIdent: Q22339
  2321.  
  2322.     The following program hangs the system:
  2323.  
  2324.     character*5 c
  2325.     open(4,file='LIB.CMP')
  2326.     read(4,'(a)')c
  2327.     end
  2328.  
  2329.     This problem occurs because although LIB is not a device name,
  2330.  "LINE" is. This is another example of the PRN versus PRM problem. The
  2331.  hang occurs because "LINE" is mapped to COM1, so the program hangs
  2332.  while waiting for input.
  2333.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2334.  FORTRAN Compiler. It was corrected in Version 4.01.
  2335.  
  2336.  
  2337.  68. FL -Od *.for Error
  2338.  
  2339.  Product Version(s): 4.00a
  2340.  Operating System:   MS-DOS
  2341.  Flags: ENDUSER | ptr900065 bcp1601 buglist4.00 fixlist4.01
  2342.  Last Modified: 25-OCT-1988    ArticleIdent: Q22338
  2343.  
  2344.  Problem:
  2345.  
  2346.  When several separate source files and one of the following FL
  2347.  commands are used, different errors are received than if the routines
  2348.  are compiled one at a time:
  2349.  
  2350.     FL -Od *.for
  2351.     FL -Od a.for b.for c.for
  2352.  
  2353.  Response:
  2354.  
  2355.  Microsoft has confirmed this to be a problem in Version 4.00 of the
  2356.  FORTRAN compiler. This problem was corrected in Version 4.01.
  2357.  
  2358.  FL is compiling the first of the files correctly, but all subsequent
  2359.  files are being compiled as if they were compiled with the default
  2360.  maximum optimization. If -Od is going to be used, one workaround to
  2361.  this problem is to compile each source file separately.
  2362.  
  2363.  
  2364.  69. Internal Compiler Error: p3io.c, Line 604
  2365.  
  2366.  Product Version(s): 4.00a
  2367.  Operating System:   MS-DOS
  2368.  Flags: ENDUSER | ptr900070 bcp1616 buglist4.00 fixlist4.01
  2369.  Last Modified:  1-JUN-1988    ArticleIdent: Q22332
  2370.  
  2371.  Problem:
  2372.     The following program produces a p3io.c, line 604 assertion error:
  2373.  
  2374.          SUBROUTINE PLSAVE
  2375.          COMMON /PLSAVE/ YOO
  2376.          YOO = YO
  2377.          END
  2378.  
  2379.     If compiled with -Od, it produces the following assertions:
  2380.  
  2381.     omf_ms.c, line 985
  2382.     %Z%%M%:%I%, line 604
  2383.     code.c, line 167
  2384.  
  2385.  Response:
  2386.     This is a known problem in Version 4.00 of the FORTRAN compiler. It
  2387.  was corrected in Version 4.01.
  2388.     Error F2325 is generated under Version 4.01, as it should be.
  2389.     The pattern here seems to be that the SUBROUTINE and COMMON blocks
  2390.  have the same name. A workaround is to rename either the SUBROUTINE or
  2391.  COMMON block.
  2392.  
  2393.  
  2394.  70. "STOP 1" Message
  2395.  
  2396.  Product Version(s): 4.00A
  2397.  Operating System:   MS-DOS
  2398.  Flags: ENDUSER | ptr900068 bcp1612 buglist4.00 fixlist4.01
  2399.  Last Modified: 27-MAY-1988    ArticleIdent: Q22308
  2400.  
  2401.     The following program:
  2402.  
  2403.     stop 1
  2404.     end
  2405.  
  2406.  should print as follows:
  2407.  
  2408.     Return code 1
  2409.  
  2410.     Instead, it prints the following:
  2411.  
  2412.     Return code Pause - 1
  2413.  
  2414.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2415.  FORTRAN Compiler. It was corrected in Version 4.01.
  2416.  
  2417.  
  2418.  71. Compile Time Error F2570
  2419.  
  2420.  Product Version(s): 4.00A
  2421.  Operating System:   MS-DOS
  2422.  Flags: ENDUSER | ptr900066 bcp1602 buglist4.00 fixlist4.01
  2423.  Last Modified: 27-MAY-1988    ArticleIdent: Q22306
  2424.  
  2425.     Compiling the following program:
  2426.  
  2427.     Plyevl(X1) = A1+X1*(A2+X1*(A3+X1*(A4+A5*X1)))
  2428.     B = PLYEVL(-C)
  2429.     END
  2430.  
  2431.  generates the following error:
  2432.  
  2433.     bcp1602.for(2) : error F2570: consecutive arithmetic operators illegal
  2434.  
  2435.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2436.  FORTRAN Compiler. It was corrected in Version 4.01.
  2437.     This problem can be worked around by setting a temporary variable
  2438.  equal to -C and using it as the argument to the statement function.
  2439.  
  2440.  
  2441.  72. Compiling C Program on Page 273 of the User's Guide
  2442.  
  2443.  Product Version(s): 4.00 4.01
  2444.  Operating System:   MS-DOS
  2445.  Flags: ENDUSER | docerr
  2446.  Last Modified:  7-SEP-1988    ArticleIdent: Q22329
  2447.  
  2448.  Problem:
  2449.  
  2450.  I get errors when I try to compile the C program on Page 273 of the
  2451.  "Microsoft FORTRAN Optimizing Compiler User's Guide" (Section 11.3.4).
  2452.  
  2453.  Response:
  2454.  
  2455.  To compile the program, you need to change the second line of the
  2456.  program by removing the semicolon (;). The first three lines should
  2457.  read as follows:
  2458.  
  2459.     long time(long *);
  2460.     long time(tloc)
  2461.     long *tloc;
  2462.  
  2463.  
  2464.  73. Invalid Object Module
  2465.  
  2466.  Product Version(s): 4.x
  2467.  Operating System:   MS-DOS
  2468.  Flags: ENDUSER |
  2469.  Last Modified:  9-JUN-1988    ArticleIdent: Q22314
  2470.  
  2471.  Problem:
  2472.     I compile my module with no errors, but the linker generates the
  2473.  following error message when I link it:
  2474.  
  2475.     "Invalid object module"
  2476.  
  2477.     I have the ".FOR" extension on the end of my file on the FL command
  2478.  line. I also tried using the /Tf switch.
  2479.  
  2480.  Response:
  2481.     You probably are using the wrong version of the linker. You should
  2482.  be using the linker that comes with FORTRAN.
  2483.     To determine which linker you are using, do the following:
  2484.  
  2485.     1. Change to the directory from which you normally compile and link.
  2486.     2. Type "link".
  2487.     3. Change to the directory in which the FORTRAN compiler and linker
  2488.  reside.
  2489.     4. Type "link" again.
  2490.  
  2491.     The copyright message will display a version number. If these
  2492.  version numbers do not match, the linker that you are picking up is
  2493.  not the linker that came with your Microsoft FORTRAN.
  2494.     You are picking up another LINK.EXE on your system. LINK.EXE comes
  2495.  with DOS and other Microsoft language products.
  2496.     To confirm that you are picking up the wrong version, see if the
  2497.  correct LINK.EXE Version is not in your current directory. Also, see
  2498.  if your PATH environment variable is pointing to a directory that
  2499.  contains an older LINK.EXE before it points to the directory that the
  2500.  correct version is in.
  2501.     To work around this problem, do one of the following:
  2502.  
  2503.     1. Rename your old linkers to LINK.OLD.
  2504.     2. Change your path so that the PATH environment variable points
  2505.  to the directory that the correct version of LINK.EXE is in.
  2506.  
  2507.     If this does not correct the problem and you are using the correct
  2508.  LINK.EXE version, please send Microsoft Product Support Services a
  2509.  copy of your source file as a supplement to your technical assistance
  2510.  request.
  2511.  
  2512.  
  2513.  74. BTEST Function with Different Sized Arguments
  2514.  
  2515.  Product Version(s): 4.00a
  2516.  Operating System:   MS-DOS
  2517.  Flags: ENDUSER | ptr900071 bcp1618 buglist4.00 fixlist4.01
  2518.  Last Modified:  1-JUN-1988    ArticleIdent: Q22342
  2519.  
  2520.     The following subroutine will cause unpredictable behavior (hangs,
  2521.  possibly a reboot):
  2522.  
  2523.             integer*2 i2
  2524.             i2 = 10
  2525.             do 100 i4=0,7
  2526.             if (btest(i2,i4)) write (*,*) 'Bit set is=',i4
  2527.     100     continue
  2528.             end
  2529.  
  2530.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2531.  FORTRAN Compiler. This problem was corrected in Version 4.01.
  2532.     This should happen only under the following conditions:
  2533.  
  2534.     1. The first argument's size is INTEGER*2.
  2535.     2. The program is not compiled with -4I2.
  2536.  
  2537.     Apparently, the routine being called to do the test is assuming
  2538.  that the second argument is the same size as the first.
  2539.     A quick way to verify that BTEST will not fail at run time is to
  2540.  look at the code (via -Fc or -Fa). If only four bytes are pushed
  2541.  before the call, it will fail. If six bytes are pushed, it will run.
  2542.  Note that INTEGER*2 BTEST is done by in-line code.
  2543.  
  2544.  
  2545.  75. Run-Time Error F6419 Terminating on 78th Record
  2546.  
  2547.  Product Version(s): 4.00A
  2548.  Operating System:   MS-DOS
  2549.  Flags: ENDUSER | ptr900076 bcp1635 buglist4.00 fixlist4.01
  2550.  Last Modified: 27-MAY-1988    ArticleIdent: Q22380
  2551.  
  2552.  Problem:
  2553.     The following program will terminate on the 78th record with the
  2554.  error message "error F6419: illegal structure for unformatted file":
  2555.  
  2556.        DIMENSION KST(24),SPEED(24),TEMP(24),AFV(24),RFV(24),HLH(2,24),
  2557.       1 UU(24),UR(24)
  2558.        OPEN(8,FILE='bcp1635.dat',STATUS='OLD',FORM='UNFORMATTED')
  2559.        READ(8) ID,IY,IDM,IYM
  2560.        DO 100 N=1,366
  2561.        WRITE(*,150) N
  2562.   150  FORMAT('                         READING DAY ',I3)
  2563.        READ(8) IYEAR,IMONTH,DAY1,KST,SPEED,TEMP,AFV,
  2564.       1 RFV,HLH
  2565.   100  CONTINUE
  2566.        END
  2567.  
  2568.  Response:
  2569.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2570.  FORTRAN compiler. It was corrected in Version 4.01.
  2571.     To work around this problem, if you are creating unformatted files
  2572.  for use as a temporary storage medium, change the FORM= specifier from
  2573.  'UNFORMATTED' to 'BINARY'. The READ and WRITE statements will stay the
  2574.  same.
  2575.     If you have existing unformatted data files (and cannot change
  2576.  them), you may be able to work around the problem by increasing the
  2577.  BLOCKSIZE specifier beyond the minimum 1024 bytes.
  2578.  
  2579.  
  2580.  76. Z Format Problem
  2581.  
  2582.  Product Version(s): 4.00a
  2583.  Operating System:   MS-DOS
  2584.  Flags: ENDUSER | buglist4.00 fixlist4.01
  2585.  Last Modified:  1-JUN-1988    ArticleIdent: Q22340
  2586.  
  2587.     The following program will write too many characters to the
  2588.  monitor:
  2589.  
  2590.             character*10 short
  2591.             character*80 long
  2592.             short = 'abcd'
  2593.             long = 'xyz'
  2594.             write (*,100) short
  2595.             write (*,100) long
  2596.     100     format (1x,z)
  2597.             end
  2598.  
  2599.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2600.  FORTRAN Compiler. This problem was corrected in Version 4.01.
  2601.     The program is operating as expected, but it is a victim of the
  2602.  already known error that random characters will result if more than
  2603.  132 characters are written to the screen.
  2604.     The Z format, when used without the width specification, puts out
  2605.  two hex characters for each byte of the object (i.e., it puts out
  2606.  eight hex characters for an INTEGER*4, 16 for a REAL*8, etc.). In this
  2607.  case, writing out a CHARACTER*80 variable with a Z format means that
  2608.  160 characters will be printed, which demonstrates the problem of
  2609.  writing more than 132 characters to the screen.
  2610.  
  2611.  
  2612.  77. Opening a Scratch File as Unformatted
  2613.  
  2614.  Product Version(s): 4.00a
  2615.  Operating System:   MS-DOS
  2616.  Flags: ENDUSER | docerr
  2617.  Last Modified: 15-DEC-1988    ArticleIdent: Q22344
  2618.  
  2619.  Problem:
  2620.  
  2621.  Using the OPEN statement to connect the preconnected units 0, 5, or 6
  2622.  to a temporary file with form = 'unformatted' generates the following
  2623.  run-time error message:
  2624.  
  2625.  F6202
  2626.  -terminal I/O not consistent with OPEN options
  2627.  
  2628.  The following line of code causes the problem:
  2629.  
  2630.  open(6, form='unformatted')
  2631.  
  2632.  If file= is omitted in an OPEN statement, the compiler creates a
  2633.  temporary file. Therefore, this statement should not generate an error
  2634.  message.
  2635.  
  2636.  Response:
  2637.  
  2638.  This is a documentation issue. Page 102 of the "Microsoft FORTRAN
  2639.  Compiler Language Reference" manual should state that if the FILE=
  2640.  specifier is omitted in an OPEN statement for a unit other than the
  2641.  preconnected units 0, 5, and 6, the compiler creates a temporary file.
  2642.  
  2643.  Because the OPEN statement does not specify a filename, OPEN must
  2644.  decide whether the unit is already connected to a file. If it is not
  2645.  connected, unit 6 is opened as a scratch file. If the unit is
  2646.  connected to a file, then the BLANK specifier is the only allowed
  2647.  specifier.
  2648.  
  2649.  If you had specified open(3, form='unformatted'), a scratch file would
  2650.  have been created; however, units 0, 5, and 6 are preconnected
  2651.  FORM='FORMATTED' files. The error is correctly generated; the run time
  2652.  thinks that you are trying to OPEN 'CON' as an unformatted file.
  2653.  
  2654.  You also can achieve the desired result (a scratch file for unit 6) by
  2655.  using the following:
  2656.  
  2657.  OPEN (6,file='junk',form='unformatted',status='scratch')
  2658.  
  2659.  Renaming the file during the OPEN is crucial.
  2660.  
  2661.  
  2662.  78. "Divide by Zero" Error
  2663.  
  2664.  Product Version(s): 4.00A
  2665.  Operating System:   MS-DOS
  2666.  Flags: ENDUSER | ptr900075 bcp1634 buglist4.00 fixlist4.01
  2667.  Last Modified:  1-JUN-1988    ArticleIdent: Q22415
  2668.  
  2669.     The following subroutine produces "error F2023: divide by zero"
  2670.  during compilation:
  2671.  
  2672.     subroutine sub1(cx)
  2673.     CHARACTER*(*) cx(2)
  2674.     write (*,*) cx
  2675.     end
  2676.  
  2677.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2678.  FORTRAN Compiler. This problem was corrected in Version 4.01.
  2679.     There are two workarounds. The following is one workaround:
  2680.  
  2681.     subroutine sub1(cx)
  2682.     c
  2683.     c Explicitly declare the CHARACTER size
  2684.     c
  2685.     CHARACTER*72 cx(2)
  2686.     write (*,*) cx
  2687.     end
  2688.  
  2689.     The following is another workaround:
  2690.  
  2691.     subroutine sub1(cx)
  2692.     CHARACTER*(*) cx(2)
  2693.     c
  2694.     c  Use an implied-DO WRITE statement
  2695.     c
  2696.     write (*,*) (cx(i),i=1,2)
  2697.     end
  2698.  
  2699.  
  2700.  79. INQUIRE Versus -4I2
  2701.  
  2702.  Product Version(s): 4.00a
  2703.  Operating System:   MS-DOS
  2704.  Flags: ENDUSER | ptr900086 bcp1615 buglist4.00 fixlist4.01
  2705.  Last Modified:  1-JUN-1988    ArticleIdent: Q22426
  2706.  
  2707.     When compiled with -4I2, the following program:
  2708.  
  2709.             CHARACTER*25 fname
  2710.             open (1,file='test1')
  2711.             open (3,file='test3')
  2712.             do 100 i=1,4
  2713.             inquire (unit=i,name=fname)
  2714.             write (*,*) 'unit=',i,' fname=',fname
  2715.     100     continue
  2716.             end
  2717.  
  2718.  should produce the following output:
  2719.  
  2720.     unit=          1 fname=test1
  2721.     unit=          2 fname=UNKNOWN
  2722.     unit=          3 fname=test3
  2723.     unit=          4 fname=UNKNOWN
  2724.  
  2725.  but instead prints as follows:
  2726.  
  2727.     unit=      16138 fname=test1
  2728.  
  2729.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2730.  FORTRAN Compiler. It was corrected in Version 4.01.
  2731.  
  2732.     INQUIRE is using two bytes of stack space whenever one of the
  2733.  specifiers that return a CHARACTER string (such as the NAME=
  2734.  specifier) is given. When you compile with -4I2 and maximum
  2735.  optimization, the resulting corruption of the stack becomes apparent
  2736.  because the SI register is destroyed and, unfortunately in this case,
  2737.  SI is used to store the DO loop index.
  2738.     The following are two workarounds:
  2739.  
  2740.     1. Compile without -4I2.
  2741.     2. Compile with -Odct (no loop optimization).
  2742.  
  2743.  
  2744.  80. Wrong Default of SHARE=
  2745.  
  2746.  Product Version(s): 4.00A
  2747.  Operating System:   MS-DOS
  2748.  Flags: ENDUSER | ptr900087 bcp1588 buglist4.00 fixlist4.01
  2749.  Last Modified:  1-JUN-1988    ArticleIdent: Q22443
  2750.  
  2751.     The following program:
  2752.  
  2753.     character*30 name,mode,share
  2754.     open(1, file ='xxx')
  2755.     inquire (unit=1,mode=mode,name=name, share=share)
  2756.     write (*,*) 'MODE=[',mode,']'
  2757.     write (*,*) 'NAME=[',name,']'
  2758.     write (*,*) 'SHARE=[',share,']'
  2759.     close (1,status='delete')
  2760.     end
  2761.  
  2762.  should produce the following output:
  2763.  
  2764.     MODE=[READWRITE                     ]
  2765.     NAME=[xxx                           ]
  2766.     SHARE=[COMPAT                        ]
  2767.  
  2768.  but actually prints as follows:
  2769.  
  2770.     MODE=[READWRITE                     ]
  2771.     NAME=[xxx                           ]
  2772.     SHARE=[DENYNONE                      ]
  2773.  
  2774.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2775.  FORTRAN Compiler. It was corrected in Version 4.01.
  2776.  
  2777.  
  2778.  81. Compile Time Errors F2503/F2506
  2779.  
  2780.  Product Version(s): 4.00A
  2781.  Operating System:   MS-DOS
  2782.  Flags: ENDUSER | ptr900088 bcp1650 buglist4.00 fixlist4.01
  2783.  Last Modified: 15-MAR-1988    ArticleIdent: Q22444
  2784.  
  2785.  Problem:
  2786.     The following program:
  2787.  
  2788.        CHARACTER CARD(1),C
  2789.        LOGICAL*1 BL,TEST1
  2790.        TEST1(C)=LGE(C,'A').AND.LLE(C,'Z')
  2791.        bl = TEST1(CARD(is))
  2792.        END
  2793.  
  2794.  produces the following compilation errors:
  2795.  
  2796.     bcp1650.for(4) : error F2503: LGE : incorrect use of intrinsic function
  2797.     bcp1650.for(4) : error F2506: cannot convert type to LOGICAL
  2798.  
  2799.  Response:
  2800.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2801.  FORTRAN Compiler. It was corrected in Version 4.01.
  2802.     The workaround for this is to store the value of CARD(IS) in a
  2803.  CHARACTER variable and pass it instead of the array element.
  2804.  
  2805.  
  2806.  82. Unique Serial Number on Registration Card
  2807.  
  2808.  Product Version(s): 4.00 4.01
  2809.  Operating System:   MS-DOS
  2810.  Flags: ENDUSER |
  2811.  Last Modified:  7-DEC-1987    ArticleIdent: Q22420
  2812.  
  2813.  Problem:
  2814.     I am following your instructions to fill out the
  2815.  registration card for your FORTRAN Compiler, but I am
  2816.  unable to access the 16-digit serial number you request. No
  2817.  serial number appears in the right-hand corner.
  2818.  
  2819.  Response:
  2820.     There is no unique serial number for your FORTRAN
  2821.  Compiler (or for any of our compilers). The instructions
  2822.  you are referring to pertain to Microsoft Word users only.
  2823.  You should skip this part of the registration card.
  2824.  
  2825.  
  2826.  83. Compile Time Error F2408
  2827.  
  2828.  Product Version(s): 4.00
  2829.  Operating System:   MS-DOS
  2830.  Flags: ENDUSER | buglist4.00 fixlist4.01
  2831.  Last Modified: 27-MAY-1988    ArticleIdent: Q22422
  2832.  
  2833.  Question:
  2834.     The compiler is erroneously generating error F2408 "too few
  2835.  constants to initialize data" for a data statement that uses an
  2836.  implied DO loop. Is this a reported problem?
  2837.  
  2838.  Response:
  2839.     This is a known problem in Version 4.00. It was corrected in
  2840.  Version 4.01.
  2841.     We have not seen this error message appear erroneously unless other
  2842.  errors precede it. Because cascading errors seem to cause this error
  2843.  to be generated, correcting the previous errors will eliminate this
  2844.  error.
  2845.  
  2846.  
  2847.  84. Optimization Bug in Character Transfer
  2848.  
  2849.  Product Version(s): 4.00A
  2850.  Operating System:   MS-DOS
  2851.  Flags: ENDUSER | ptr900080 bcp1626 buglist4.00 fixlist4.01
  2852.  Last Modified:  1-JUN-1988    ArticleIdent: Q22506
  2853.  
  2854.     The loop optimizer apparently does not recognize that the
  2855.  destination CHARACTER array is being loaded in reverse order. It
  2856.  generates code assuming that it is a straight CHARACTER block
  2857.  transfer.
  2858.     The workaround for this problem is to compile with -Od or -Odct
  2859.  (suppressing loop optimization).
  2860.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2861.  FORTRAN compiler. This problem was corrected in Version 4.01.
  2862.  
  2863.     Here is an example of a program that recreates the problem. The
  2864.  following program:
  2865.  
  2866.        character*1 rd(4),tr(4)
  2867.          data rd /'1','2','3','4'/
  2868.        do 1 i=1,4
  2869.  1     tr(5-i)=rd(i)
  2870.          write (*,*) 'tr=<',tr,'>'
  2871.        end
  2872.  
  2873.  should produce the following output:
  2874.  
  2875.     tr=<4321>
  2876.  
  2877.  but it actually prints as follows:
  2878.  
  2879.     tr=<1>
  2880.  
  2881.  
  2882.  85. COMPLEX Constant Folding Problem
  2883.  
  2884.  Product Version(s): 4.00A
  2885.  Operating System:   MS-DOS
  2886.  Flags: ENDUSER | ptr900081 bcp1633 buglist4.00 fixlist4.01
  2887.  Last Modified: 28-AUG-1990    ArticleIdent: Q22507
  2888.  
  2889.  The answer for "cc" in the program below is incorrect because the
  2890.  compiler does not generate the correct constant for use in the
  2891.  expression. It is generating a (0.0,0.0) when it should be generating
  2892.  a (2.0,0.0).
  2893.  
  2894.  The compiler, in some circumstances, is not properly creating
  2895.  constants that are calculated from an INTEGER (2) times a COMPLEX.
  2896.  
  2897.  There is a workaround for this problem. Do not use INTEGER constants
  2898.  as part of a COMPLEX expression. Changing both INTEGER 2s to REAL 2s
  2899.  will correct the problem.
  2900.  
  2901.  Microsoft has confirmed this to be a problem in version 4.00 of the
  2902.  FORTRAN Compiler. This problem was corrected in version 4.01.
  2903.  
  2904.  The following program is an example of how to re-create the problem.
  2905.  The following program
  2906.  
  2907.        complex ca,cb,cc
  2908.        r = 1.5
  2909.        ca = cmplx(.5,.1)
  2910.        cb = (0.,1.)*2*ca*r
  2911.        cc = (0.,1.)*ca*2*r
  2912.        write (*,*) 'ca=',ca
  2913.        write (*,*) 'cb=',cb
  2914.        write (*,*) 'cc=',cc
  2915.        end
  2916.  
  2917.  should produce the following output:
  2918.  
  2919.     ca=      (5.000000E-01,1.000000E-01)
  2920.     cb=         (-3.000000E-01,1.500000)
  2921.     cc=         (-3.000000E-01,1.500000)
  2922.  
  2923.  However, it actually prints as follows:
  2924.  
  2925.     ca=      (5.000000E-01,1.000000E-01)
  2926.     cb=         (-3.000000E-01,1.500000)
  2927.     cc=      (0.000000E+00,0.000000E+00)
  2928.  
  2929.  
  2930.  86. CHARACTER Functions in WRITE Statements
  2931.  
  2932.  Product Version(s): 4.00
  2933.  Operating System:   MS-DOS
  2934.  Flags: ENDUSER | ptr900083 bcp1638 buglist4.00 fixlist4.01
  2935.  Last Modified:  1-JUN-1988    ArticleIdent: Q22508
  2936.  
  2937.  Problem:
  2938.     The following program:
  2939.  
  2940.     character*10 c
  2941.     i = 1
  2942.     j = 2
  2943.     k = 3
  2944.     l = 4
  2945.     m = 5
  2946.     write(*,*)c(i),c(j),c(k),c(l),c(m)
  2947.     end
  2948.     character*10 function c(ix)
  2949.     character*10 ctemp
  2950.     write (ctemp,'(5x,i5.5)') ix
  2951.     c = ctemp
  2952.     end
  2953.  
  2954.  should produce the following output:
  2955.  
  2956.     00001     00002     00003     00004     00005
  2957.  
  2958.  but actually prints as follows:
  2959.  
  2960.     00001     00002     00003     00001     00001
  2961.  
  2962.  Response:
  2963.     You can work around this problem by storing the function results in
  2964.  temporary CHARACTER*10 variables and then writing them out instead of
  2965.  the functions themselves.
  2966.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2967.  FORTRAN Compiler. This problem was corrected in Version 4.01.
  2968.  
  2969.  
  2970.  87. Compile Time Error F2529
  2971.  
  2972.  Product Version(s): 4.00A
  2973.  Operating System:   MS-DOS
  2974.  Flags: ENDUSER | ptr900082 bcp1637 buglist4.00 fixlist4.01 fixlist4.01a
  2975.  Last Modified: 27-MAY-1988    ArticleIdent: Q22504
  2976.  
  2977.     The following program:
  2978.  
  2979.          character*1 c(5),d
  2980.          logical l,m
  2981.          l(d)=(d.eq.'a'.and.d.ne.'d')
  2982.          i=5
  2983.          m=l(c(i))
  2984.          end
  2985.  
  2986.  produces the following compilation errors:
  2987.  
  2988.  bcp1637.for(19) : error F2529: operands of relation not numeric or character
  2989.  bcp1637.for(19) : error F2529: operands of relation not numeric or character
  2990.  
  2991.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  2992.  FORTRAN Compiler. This problem was corrected in Version 4.01.
  2993.     The program fails due to the use of a CHARACTER array element as an
  2994.  argument to a LOGICAL statement function that is expecting a single
  2995.  character.
  2996.     The workaround is to store c(i) in a temporary CHARACTER variable
  2997.  and pass the temporary to the function.
  2998.  
  2999.  
  3000.  88. Compile Time Error F2734
  3001.  
  3002.  Product Version(s): 4.00A
  3003.  Operating System:   MS-DOS
  3004.  Flags: ENDUSER | ptr900106 bcp1687 buglist4.00 fixlist4.01
  3005.  Last Modified: 27-MAY-1988    ArticleIdent: Q22595
  3006.  
  3007.  Problem:
  3008.     The following program:
  3009.  
  3010.  C
  3011.          OPEN(11,FILE='TMP',RECL=12,ACCESS='DIRECT',FORM='FORMATTED')
  3012.          DO 10 I=1,10
  3013.          WRITE(11,'(I5)',REC=I)I
  3014.  10      CONTINUE
  3015.          DO 20 I=5,15
  3016.          READ(11,'(I5)',END=30,REC=I,IOSTAT=N)M
  3017.          WRITE(*,*)'Read ',m,' from record ', i,'iostat=',n
  3018.  20      CONTINUE
  3019.          WRITE(*,*)'No err detected'
  3020.          CLOSE (11, STATUS='DELETE')
  3021.          STOP
  3022.  30      WRITE(*,*)'End found'
  3023.          CLOSE (11, STATUS='DELETE')
  3024.          END
  3025.  
  3026.  causes the following compilation error:
  3027.  
  3028.     may29.for(21) : error F2734: END= : illegal when REC= present
  3029.  
  3030.  Response:
  3031.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  3032.  FORTRAN compiler. It was corrected in Version 4.01.
  3033.     In Version 4.00, this was expected behavior, conforming to the ANSI
  3034.  X3.9-1978 FORTRAN standard. However, since the run time permits a
  3035.  direct-access file to be accessed sequentially, it would be convenient
  3036.  to be able to detect end-of-file on direct-access files. This is
  3037.  corrected in Version 4.01 of the compiler. The compilation error still
  3038.  will be given if the program is compiled with the -4Ys ($STRICT)
  3039.  option.
  3040.  
  3041.  
  3042.  89. WRITE of CHARACTER*(*) Substring
  3043.  
  3044.  Product Version(s): 4.00A 4.01
  3045.  Operating System:   MS-DOS
  3046.  Flags: ENDUSER | ptr900085 bcp1641 buglist4.00 buglist4.01
  3047.  Last Modified: 27-MAY-1988    ArticleIdent: Q22509
  3048.  
  3049.  Problem:
  3050.     The following program
  3051.  
  3052.     character*20 c
  3053.     c='no time for musicians'
  3054.     call s(c)
  3055.     end
  3056.     subroutine s(c)
  3057.     character*(*) c
  3058.     write(*,*)c(1:10)
  3059.     end
  3060.  
  3061.  should print the following:
  3062.  
  3063.     no time fo
  3064.  
  3065.     However, it actually prints only blanks.
  3066.  
  3067.  Response:
  3068.     This is a known problem in Versions 4.00 and 4.01.
  3069.     The workaround is to declare "c" to be CHARACTER*20 instead of
  3070.  CHARACTER*(*) in the subroutine.
  3071.     Microsoft is researching this problem and will post new information
  3072.  as it becomes available.
  3073.  
  3074.  
  3075.  90. Bad Constant Fold of Loop Invariant
  3076.  
  3077.  Product Version(s): 4.00A
  3078.  Operating System:   MS-DOS
  3079.  Flags: ENDUSER | ptr900079 bcp1632 buglist4.00 fixlist4.01
  3080.  Last Modified:  1-JUN-1988    ArticleIdent: Q22505
  3081.  
  3082.  Problem:
  3083.     The following program:
  3084.  
  3085.          x = 1.
  3086.          y = 1.
  3087.          z = 1.
  3088.          write (*,*) 'all answers should be 10001'
  3089.          do 10 i=1,10000
  3090.          x = x+y/z
  3091.  10      continue
  3092.          print *,x
  3093.          end
  3094.  
  3095.  should print the following:
  3096.  
  3097.     all answers should be 10001
  3098.        10001.000000
  3099.  
  3100.  but actually prints as follows:
  3101.  
  3102.     all answers should be 10001
  3103.          151.197500
  3104.  
  3105.  Response:
  3106.     The .COD file shows that the generated code is trying to calculate
  3107.  the final value of X at the point where the source code shows it being
  3108.  initialized to 1.0. This would be correct; however, in the first
  3109.  step of the calculation, a value is loaded from a temporary that never
  3110.  was initialized. Therefore, what finally is stored in X is
  3111.  <garbage>*10000+1. In this case X=151.1975. This will vary.
  3112.     This problem can be worked around by compiling with -Odclt.
  3113.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  3114.  FORTRAN compiler. This problem was corrected in Version 4.01.
  3115.  
  3116.  
  3117.  91. Compile Time Error F2125
  3118.  
  3119.  Product Version(s): 4.00a
  3120.  Operating System:   MS-DOS
  3121.  Flags: ENDUSER | ptr900084 bcp1640 buglist4.00 fixlist4.01
  3122.  Last Modified:  1-JUN-1988    ArticleIdent: Q22510
  3123.  
  3124.     The following program produces the following error:
  3125.  
  3126.     "bcp1640a.for(4) : error F2125 : BUFF2 : allocation exceeds 64K":
  3127.  
  3128.     INTEGER*4 BUFF2(480)
  3129.     INTEGER*4 BUFF(18000)
  3130.     EQUIVALENCE(BUFF2(1),BUFF(1))
  3131.       end
  3132.  
  3133.     This problem lies with EQUIVALENCEing a huge array (i.e., more than
  3134.  64K) with a "non-huge" array.
  3135.     The problem can be worked around by declaring the huge arrays that
  3136.  are going to be EQUIVALENCEd before declaring the "non-huge" arrays.
  3137.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  3138.  FORTRAN Compiler.
  3139.     This problem was corrected in Version 4.01.
  3140.  
  3141.  
  3142.  92. Errors in ISHFT and ISHL Functions
  3143.  
  3144.  Product Version(s): 4.00A
  3145.  Operating System:   MS-DOS
  3146.  Flags: ENDUSER | ptr900077 bcp1639 buglist4.00 fixlist4.
  3147.  Last Modified:  1-JUN-1988    ArticleIdent: Q22517
  3148.  
  3149.  Problem:
  3150.     The following program:
  3151.  
  3152.        integer*2 inta,itemp
  3153.        inta=#8000
  3154.          call sub (inta)
  3155.        itemp=ishft(inta,-2)
  3156.          write (*,'(1x,a,z4)') 'should be #2000, is=',itemp
  3157.        inta=#8000
  3158.          call sub (inta)
  3159.        itemp=ishl(inta,-2)
  3160.          write (*,'(1x,a,z4)') 'should be #2000, is=',itemp
  3161.  
  3162.        inta=#8000
  3163.        itemp=ishft(inta,-2)
  3164.          write (*,'(1x,a,z4)') 'should be #2000, is=',itemp
  3165.        inta=#8000
  3166.        itemp=ishl(inta,-2)
  3167.          write (*,'(1x,a,z4)') 'should be #2000, is=',itemp
  3168.          end
  3169.          subroutine sub (ix)
  3170.          integer*2 ix
  3171.          end
  3172.  
  3173.  produces the following output:
  3174.  
  3175.     should be #2000, is=E000
  3176.     should be #2000, is=E000
  3177.     should be #2000, is=E000
  3178.     should be #2000, is=E000
  3179.  
  3180.  Response:
  3181.     There are two separate errors in the above example. Both occur
  3182.  because the compiler is converting INTA to be an INTEGER*4 variable.
  3183.  This is causing problems for the ISHFT and ISHL functions, which are
  3184.  logical shift functions. Logical shifting operands to the right should
  3185.  add ("shift in") zero bits to the high-order part of the variable.
  3186.     In the first pair of ISHFT/ISHL calls, the answers are calculated
  3187.  by calls to a library routine. ITEMP cannot be calculated by the
  3188.  compiler because the value of INTA may have been changed in the
  3189.  preceding subroutine call.
  3190.     The errors in these calls occur because during the setup for the
  3191.  calls to the shift routines, INTA is converted from INTEGER*2 to
  3192.  INTEGER*4 from the value of #8000 to #FFFF8000; i.e., the upper word
  3193.  is sign-extended. Subsequently, when the two-bit right shift is done,
  3194.  bits (all of which are set) are shifted into the lower two words.
  3195.     The second pair of answers is calculated during compilation and is
  3196.  incorrect for the same reason: the answers are treated as four-byte
  3197.  integers.
  3198.     To work around this problem, compile with the -4I2 option.
  3199.     This is a confirmed problem in Version 4.00 of the
  3200.  FORTRAN compiler.
  3201.     This problem was corrected in Version 4.01.
  3202.  
  3203.  
  3204.  93. Linker Cannot Find LLIBFOR7.LIB
  3205.  
  3206.  Product Version(s): 4.00 4.01
  3207.  Operating System:   MS-DOS
  3208.  Flags: ENDUSER |
  3209.  Last Modified: 18-OCT-1988    ArticleIdent: Q22588
  3210.  
  3211.  Problem:
  3212.  
  3213.  I do not have a coprocessor on my system, so I built a FORTRAN library
  3214.  with emulator support (LLIBFORE.LIB) using the Setup utility. I am
  3215.  using the Version 3.55 Linker that comes with FORTRAN Version 4.00. I
  3216.  set my LIB environment variable to C:\FORTRAN\LIB, and when I do DIR
  3217.  on this directory, it finds LLIBFORE.LIB. However, when I enter the
  3218.  command "FL DEMO.FOR", the linker generates the following warning
  3219.  message:
  3220.  
  3221.     Warning L4051: LLIBFOR7.LIB: cannot find library
  3222.  
  3223.  Response:
  3224.  
  3225.  When FL compiles a source file, it places the name of a FORTRAN
  3226.  library into the object file that it creates. The library name
  3227.  corresponds to the memory-model and floating-point options that you
  3228.  specify on the FL command line. If you do not specify any memory-model
  3229.  or floating-point options, FL defaults to large-model and coprocessor
  3230.  (8087/80287) support, and therefore places the library name
  3231.  "LLIBFOR7.LIB" in your object module. When you link the object module,
  3232.  the linker looks for a library matching the name embedded in the
  3233.  object file. If it finds the library, it automatically links the
  3234.  library with the object module.
  3235.  
  3236.  Because the command line "FL DEMO.FOR" does not explicitly specify a
  3237.  floating-point option, DEMO.OBJ contains the library name
  3238.  LLIBFOR7.LIB; that is the library name for which the linker looks.
  3239.  Because you did not create a LLIBFOR7.LIB with Setup, the linker
  3240.  returns a warning that it cannot find the library.
  3241.  
  3242.  Therefore, to link your object files with the LLIBFORE.LIB emulator
  3243.  library, you need to specify the floating-point option /FPi or /FPc on
  3244.  the FL command line.
  3245.  
  3246.  For more information regarding the floating-point options, please
  3247.  refer to Page 59 in the user's guide.
  3248.  
  3249.  
  3250.  94. Missing Line in Program Listing
  3251.  
  3252.  Product Version(s): 4.00
  3253.  Operating System:   MS-DOS
  3254.  Flags: ENDUSER | docerr
  3255.  Last Modified:  7-SEP-1988    ArticleIdent: Q22629
  3256.  
  3257.  Problem:
  3258.  
  3259.  There is an error in the program listing on Page 332 of the "Microsoft
  3260.  FORTRAN Compiler Language Reference" manual. Compiling as is will
  3261.  result in a syntax error.
  3262.  
  3263.  Response:
  3264.  
  3265.  There is a missing line in the program listing. Currently, line 19
  3266.  contains the following:
  3267.  
  3268.  + CDATE,IMON,IDAY,IYR
  3269.  
  3270.  There should be a line before it. The following line will correct the
  3271.  syntax error problem.
  3272.  
  3273.  WRITE(*,'(1X,A,I2.2,1H-,I2.2,1H-,I4)')
  3274.  
  3275.  
  3276.  95. Backspacing Past CR/LF on a Buffer Boundary
  3277.  
  3278.  Product Version(s): 4.00a
  3279.  Operating System:   MS-DOS
  3280.  Flags: ENDUSER | ptr900107 bcp1694 buglist4.00 fixlist4.01
  3281.  Last Modified:  1-JUN-1988    ArticleIdent: Q22601
  3282.  
  3283.     The program below demonstrates a boundary condition problem. The
  3284.  program correctly writes 210 five-byte records (three digits plus
  3285.  CR/LF), REWINDs the file, and then proceeds to do a sequence of READ,
  3286.  READ, BACKSPACE operations. This process is successful until the 205th
  3287.  record. The CR/LF pair that follows the 205th record is split between
  3288.  two buffers. When the subsequent BACKSPACE occurs, the run time
  3289.  effectively gets "stuck" on the LF in the 206th record. Raising the
  3290.  BLOCKSIZE may circumvent the problem; however, more likely, it will
  3291.  simply postpone it.
  3292.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  3293.  FORTRAN compiler. This problem was corrected in Version 4.01.
  3294.  
  3295.     The following program:
  3296.  
  3297.          open (1,file='bcp1694.dat')
  3298.          do 100 i=1,210
  3299.            write (1,'(i3)') i
  3300.  100     continue
  3301.          rewind (1)
  3302.          do 200 i=1,210
  3303.          read (1,'(i3)') i1
  3304.          read (1,'(i3)',end=999) ihold
  3305.          backspace 1
  3306.          if (i .ge. 200) write (*,*) 'rec #,curr rec #,next rec #=',
  3307.       +  i,i1,ihold
  3308.  200     continue
  3309.  999     continue
  3310.          close(1,status='delete')
  3311.          end
  3312.  
  3313.  should produce the following output:
  3314.  
  3315.  rec #,curr rec #,next rec #=        200         200         201
  3316.  rec #,curr rec #,next rec #=        201         201         202
  3317.  rec #,curr rec #,next rec #=        202         202         203
  3318.  rec #,curr rec #,next rec #=        203         203         204
  3319.  rec #,curr rec #,next rec #=        204         204         205
  3320.  rec #,curr rec #,next rec #=        205         205         206
  3321.  rec #,curr rec #,next rec #=        206         206         207
  3322.  rec #,curr rec #,next rec #=        207         207         208
  3323.  rec #,curr rec #,next rec #=        208         208         209
  3324.  rec #,curr rec #,next rec #=        209         209         210
  3325.  
  3326.     However, it actually prints the following:
  3327.  
  3328.  rec #,curr rec #,next rec #=        200         200         201
  3329.  rec #,curr rec #,next rec #=        201         201         202
  3330.  rec #,curr rec #,next rec #=        202         202         203
  3331.  rec #,curr rec #,next rec #=        203         203         204
  3332.  rec #,curr rec #,next rec #=        204         204         205
  3333.  rec #,curr rec #,next rec #=        205         205         206
  3334.  rec #,curr rec #,next rec #=        206           0         206
  3335.  rec #,curr rec #,next rec #=        207           0         206
  3336.  rec #,curr rec #,next rec #=        208           0         206
  3337.  rec #,curr rec #,next rec #=        209           0         206
  3338.  rec #,curr rec #,next rec #=        210           0         206
  3339.  
  3340.  
  3341.  96. Using FL with the /NOI Option
  3342.  
  3343.  Product Version(s): 4.00
  3344.  Operating System:   MS-DOS
  3345.  Flags: ENDUSER | docerr
  3346.  Last Modified:  7-SEP-1988    ArticleIdent: Q22761
  3347.  
  3348.  Question:
  3349.  
  3350.  Page 54 in the "Microsoft FORTRAN Optimizing Compiler User's Guide"
  3351.  states that FL always uses the /NOI link option in the linking stage.
  3352.  I have found that this is not always the case. For example, the
  3353.  following command line emits the following /NOI option:
  3354.  
  3355.  FL demo
  3356.  
  3357.  However, the following command line does not:
  3358.  
  3359.  Fl demo.for
  3360.  
  3361.  Is this a documentation error?
  3362.  
  3363.  Response:
  3364.  
  3365.  Yes, this is a documentation error. In the FORTRAN Version 4.00, the
  3366.  /NOI switch only is emitted if only object files are specified on the
  3367.  FL command line. If only source files (.FOR) are specified, or if a
  3368.  mixture of source and object files is specified, the /NOI switch is
  3369.  not generated.
  3370.  
  3371.  
  3372.  97. REC=1 Should Be RECL=1
  3373.  
  3374.  Product Version(s): 4.00 4.01
  3375.  Operating System:   MS-DOS
  3376.  Flags: ENDUSER | docerr
  3377.  Last Modified: 13-JAN-1989    ArticleIdent: Q22788
  3378.  
  3379.  Question:
  3380.  
  3381.  Is there is a documentation error on Page 121 in the "Microsoft
  3382.  FORTRAN Optimizing Compiler Language Reference" manual on the fifth
  3383.  line from the bottom? Should "REC=1" should be changed to "RECL=1"?
  3384.  
  3385.  Response:
  3386.  
  3387.  Yes. "REC=1" should be "RECL=1".
  3388.  
  3389.  
  3390.  98. Run Time Error F6419
  3391.  
  3392.  Product Version(s): 4.00a
  3393.  Operating System:   MS-DOS
  3394.  Flags: ENDUSER | ptr900089 bcp1648 buglist4.00 fixlist4.01
  3395.  Last Modified:  1-JUN-1988    ArticleIdent: Q22719
  3396.  
  3397.     The following program will produce the following error and then may
  3398.  hang the computer:
  3399.  
  3400.     "F6419 :illegal structure"
  3401.  
  3402.        parameter (m = 119, n = 520)
  3403.        integer*1 ia(n),ib(n),ja(m),jb(m)
  3404.        do 11 j = 1,m
  3405.        ja(j) = mod(j,256)
  3406.  11    continue
  3407.        do 10 i = 1,n
  3408.        ia(i) = mod(i,256)
  3409.  10    continue
  3410.        open (33,file = 'ufseq',form='unformatted',blocksize=512)
  3411.        write (33) ja
  3412.        write (33) ia
  3413.        rewind(33)
  3414.  
  3415.        read (33) jb
  3416.        do 21 j = 1,m
  3417.        if (ja(j).ne.jb(j)) goto 51
  3418.  21    continue
  3419.        read (33) ib
  3420.        do 20 i = 1,n
  3421.        if (ia(i).ne.ib(i)) goto 50
  3422.  20    continue
  3423.        stop 'passed'
  3424.  
  3425.  51    write (*,*) ja(i), '.ne.', jb(i)
  3426.        write (*,*) 'j = ',j
  3427.        stop 'failed'
  3428.  50    write (*,*) ia(i), '.ne.', ib(i)
  3429.        write (*,*) 'i = ',i
  3430.        stop 'failed'
  3431.        end
  3432.  
  3433.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  3434.  FORTRAN Compiler. This problem was corrected in Version 4.01.
  3435.     This is one of several possible causes for this error. It is very
  3436.  specific: READing an unformatted file that contains a record whose
  3437.  "trailer-byte" (a byte containing the length of the preceding record)
  3438.  is placed exactly on a buffer boundary (in this case, the 512th byte)
  3439.  will cause the error to occur on that record.
  3440.     Investigating this error also turned up the fact that the F6419
  3441.  error message itself is being truncated. It should read "F6419 :
  3442.  illegal structure for unformatted file". The routine that writes the
  3443.  error message is losing track of where the message ends.
  3444.     Until more is known about the causes for the F6419 error, the
  3445.  workarounds remain as follows:
  3446.  
  3447.     1. Those who use unformatted files within their programs for the
  3448.  purpose of temporary data storage can change the OPEN statement's
  3449.  FORM= specifier for their files from 'UNFORMATTED' to 'BINARY'. The
  3450.  associated READ and WRITE statements need not be changed.
  3451.     2. Those with existing unformatted data files may be able to work
  3452.  around this problem by increasing the size of the file's buffer by
  3453.  using the BLOCKSIZE= specifier on the OPEN statement.
  3454.  
  3455.  
  3456.  99. Zero-Trip Implied-DO in READ
  3457.  
  3458.  Product Version(s): 4.00A
  3459.  Operating System:   MS-DOS
  3460.  Flags: ENDUSER | ptr900101 bcp1680 buglist4.00
  3461.  Last Modified: 27-MAY-1988    ArticleIdent: Q22838
  3462.  
  3463.  Problem:
  3464.     The following program:
  3465.  
  3466.        DIMENSION IX(10)
  3467.        DO 1000 I=1,10
  3468.            IX(I)=I
  3469.   1000 CONTINUE
  3470.  C
  3471.        ISTART=0
  3472.        IEND=-1
  3473.        WRITE(*,8000)(IX(I),I=ISTART,IEND),778
  3474.   8000 FORMAT(8I10)
  3475.        END
  3476.  
  3477.  should produce the following output:
  3478.  
  3479.        778
  3480.  
  3481.     However, it actually prints only blanks.
  3482.  
  3483.  Response:
  3484.     Microsoft is researching this problem and will post new information
  3485.  as it becomes available.
  3486.     The workaround is to avoid using erroneous values for the loop
  3487.  indices.
  3488.  
  3489.  
  3490.  100. Run-Time Error F6600
  3491.  
  3492.  Product Version(s): 4.00A
  3493.  Operating System:   MS-DOS
  3494.  Flags: ENDUSER | ptr900100 bcp1682 buglist4.00 fixlist4.01
  3495.  Last Modified: 27-MAY-1988    ArticleIdent: Q22837
  3496.  
  3497.  Problem:
  3498.     The following program:
  3499.  
  3500.          character str*10
  3501.          call sub1 (str)
  3502.          write (*,*) 'str should be 12345, is=<',str,'>'
  3503.          end
  3504.          subroutine sub1(str)
  3505.          character str*(*)
  3506.          inum = 12345
  3507.          write (str(2:6),'(i5)') inum
  3508.          end
  3509.  
  3510.  should produce the following output:
  3511.  
  3512.     str should be 12345, is=<12345>
  3513.  
  3514.     However, it actually prints the following:
  3515.  
  3516.     run-time error F6600: WRITE(internal)
  3517.     - internal file overflow
  3518.  
  3519.  Response:
  3520.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  3521.  FORTRAN compiler. It was corrected in Version 4.01.
  3522.     The problem can be worked around in the following two ways:
  3523.  
  3524.     1. In the subroutine, declare STR to be of a fixed size instead of
  3525.  CHARACTER*(*).
  3526.     2. In the internal WRITE, use STR instead of the substring of STR.
  3527.  
  3528.  
  3529.  101. EQUIVALENCE of ENTRY Arguments
  3530.  
  3531.  Product Version(s): 4.00A
  3532.  Operating System:   MS-DOS
  3533.  Flags: ENDUSER | ptr900097 bcp1677 buglist4.00 fixlist4.01
  3534.  Last Modified: 27-MAY-1988    ArticleIdent: Q22833
  3535.  
  3536.     The following program should fail with a compilation error that
  3537.  indicates that you cannot EQUIVALENCE a formal argument:
  3538.  
  3539.          subroutine test
  3540.          equivalence (a,c)
  3541.          entry test1 (a,b)
  3542.          c = 1.0
  3543.          end
  3544.  
  3545.     This is a known problem in Version 4.00 of the FORTRAN Compiler.
  3546.  This was corrected in Version 4.01.
  3547.  
  3548.  
  3549.  102. Internal Compiler Error: regMD.c 1.74, Line 1204
  3550.  
  3551.  Product Version(s): 4.00A
  3552.  Operating System:   MS-DOS
  3553.  Flags: ENDUSER | ptr900093 bcp1666 buglist4.00 fixlist4.01
  3554.  Last Modified:  1-JUN-1988    ArticleIdent: Q22827
  3555.  
  3556.     The following program:
  3557.  
  3558.          integer*4 comp(2,10)
  3559.          integer*2 br(10),locx(10),stor(10),flav(10),age(10)
  3560.          do 6 i=1,mpt
  3561.             comp(1,i) = (((10*br(i) + locx(i))*10 + stor(i))*10 +
  3562.       +                    flav(i))*100 + age(i)
  3563.  6          comp(2,i) = i
  3564.          end
  3565.  
  3566.  produces the following assertion error:
  3567.  
  3568.          regMD.c:1.74, line 1204
  3569.  
  3570.     This is a known problem in Version 4.00 of the FORTRAN compiler. It
  3571.  was corrected in Version 4.01.
  3572.     To work around this problem, modify the statement COMP(1,I) = ...,
  3573.  as follows:
  3574.  
  3575.     1. Assign all of the array references to integer variables.
  3576.     2. Use them in place of the array references in the expression.
  3577.  
  3578.  
  3579.  103. -4I2 Compiler Hang
  3580.  
  3581.  Product Version(s): 4.00A
  3582.  Operating System:   MS-DOS
  3583.  Flags: ENDUSER | ptr900092 bcp1665 buglist4.00 fixlist4.01
  3584.  Last Modified: 27-MAY-1988    ArticleIdent: Q22826
  3585.  
  3586.     The following program will hang the compiler if compiled with -4I2:
  3587.  
  3588.     50 MANTIS = DINT (.5D0 + DVAL * DTEN ** (SIGNIF-MAGN))
  3589.        IF (KTEST)  60, 65, 55
  3590.     55 MAGN = MAGN - 1
  3591.        GO TO 50
  3592.     60 MAGN = MAGN + 1
  3593.     65 IF (MAGN .GT. -3 .AND. MAGN .LE. MIN0(WIDTH, SIGNIF+3)) GO TO 70
  3594.     70    IF (MAGN .GE. 1) GO TO 75
  3595.     75       DO 80 I = 1, MAGN
  3596.     80       CONTINUE
  3597.        END
  3598.  
  3599.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  3600.  FORTRAN Compiler. It was corrected in Version 4.01.
  3601.     The workaround is to compile with -Odclt or without -4I2.
  3602.  
  3603.  
  3604.  104. OPENing an OPEN File
  3605.  
  3606.  Product Version(s): 4.00A
  3607.  Operating System:   MS-DOS
  3608.  Flags: ENDUSER | ptr900118 bcp1620 buglist4.00 fixlist4.01
  3609.  Last Modified: 26-MAY-1988    ArticleIdent: Q22818
  3610.  
  3611.  Problem:
  3612.     The following program:
  3613.  
  3614.          character*10 nm
  3615.          open(1, file='xxx')
  3616.          inquire(1, name=nm)
  3617.          write(*,*) nm
  3618.          open(1, BLANK='null')
  3619.          inquire(1, name=nm)
  3620.          write(*,*) nm
  3621.          end
  3622.  
  3623.  should produce the following output:
  3624.  
  3625.  xxx
  3626.  xxx
  3627.  
  3628.     However, it actually prints the following:
  3629.  
  3630.  xxx
  3631.  ZZ004413
  3632.  
  3633.  Response:
  3634.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  3635.  FORTRAN compiler. It was corrected in Version 4.01.
  3636.     The intent of this program is to change the setting of the BLANK
  3637.  specifier on an OPEN file. The run time is CLOSEing the file and then
  3638.  OPENing a scratch file that has the correct BLANK setting instead of
  3639.  just changing the setting of BLANK.
  3640.  
  3641.  
  3642.  105. OPEN(1,FILE= ' ',STATUS=cvar)
  3643.  
  3644.  Product Version(s): 4.00A
  3645.  Operating System:   MS-DOS
  3646.  Flags: ENDUSER | ptr900099 bcp1681 buglist4.00 fixlist4.01
  3647.  Last Modified: 26-MAY-1988    ArticleIdent: Q22836
  3648.  
  3649.  Problem:
  3650.     The following program:
  3651.  
  3652.          character*30 stat
  3653.          stat = 'UNKNOWN'
  3654.          open (1,file=' ',status=stat,iostat=ier)
  3655.          write (*,*) 'iostat should be 0, is=',ier
  3656.          end
  3657.  
  3658.  should produce the following output when given a filename at
  3659.  run time:
  3660.  
  3661.     iostat should be 0, is=          0
  3662.  
  3663.     However, it actually prints the following:
  3664.  
  3665.     iostat should be 0, is=       6304 (illegal status value)
  3666.  
  3667.  Response:
  3668.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  3669.  FORTRAN compiler. It was corrected in Version 4.01.
  3670.     Whether the contents of STAT are uppercase or lowercase is
  3671.  irrelevant: it still does not work. The workaround is to use character
  3672.  constants instead of variables.
  3673.  
  3674.  
  3675.  106. Compile Error F2609
  3676.  
  3677.  Product Version(s): 4.00A
  3678.  Operating System:   MS-DOS
  3679.  Flags: ENDUSER | ptr900121 bcp1713 buglist4.00 fixlist4.01 fixlist4.01a
  3680.  Last Modified: 27-MAY-1988    ArticleIdent: Q22820
  3681.  
  3682.     The following program:
  3683.  
  3684.        SUBROUTINE LNSR(X,N,D,FUNC,ST0,XS)
  3685.        DIMENSION X(N),D(N),XS(N)
  3686.        CALL FUNC(XS,N,FOPT,*100)
  3687.   100  CALL VEC(X,D,N,ST0,X)
  3688.        END
  3689.        SUBROUTINE DLNSR(A0,NP,FU0,SFPD,S,ST0,FUNC,NST,A1,KENT)
  3690.        EXTERNAL FUNC
  3691.        DIMENSION A0(NP),S(NP),A1(NP)
  3692.  2000  CALL LNSR(A0,NP,S,FUNC,ST0,A1)
  3693.        RETURN
  3694.        END
  3695.  
  3696.  will produce the following error when compiled:
  3697.  
  3698.  error F2609: LNSR : formal argument * : actual not alternate-return label
  3699.  
  3700.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  3701.  FORTRAN compiler. This problem was corrected in Version 4.01.
  3702.     The compiler apparently has confused a function passed as an
  3703.  argument for an alternate-return argument. You can work around the
  3704.  error, at least in this case, by moving the subroutine LNSR to the end
  3705.  of the source file.
  3706.  
  3707.  
  3708.  107. Sending a Spawn Command
  3709.  
  3710.  Product Version(s): 4.00 4.01 4.10
  3711.  Operating System:   MS-DOS
  3712.  Flags: ENDUSER |
  3713.  Last Modified: 23-MAY-1988    ArticleIdent: Q29561
  3714.  
  3715.     The following program is an example of using the spawn function to
  3716.  spawn an EXE file that takes no arguments. This example is similiar to
  3717.  the one found on Page 298 of the Version 4.01 "Microsoft FORTRAN
  3718.  Optimizing Compiler User's Guide."
  3719.  
  3720.        interface to integer*2 function spawn
  3721.       + [c, varying, alias:'_spawnlp'](mode)
  3722.        integer*2 mode
  3723.        end
  3724.  
  3725.        integer*2 spawn
  3726.  
  3727.        write(*,*) 'time to start'
  3728.        i = spawn(0, loc('test.exe'c), loc('test'c), int4(0))
  3729.        write(*,*) 'its done now'
  3730.  
  3731.        stop
  3732.        end
  3733.  
  3734.     The following three points are important to notice:
  3735.  
  3736.     1. An alias (mentioned on Page 297) is needed for names over six
  3737.  characters.
  3738.     2. Spawn is declared as integer*2.
  3739.     3. When sending spawn, 'test.exe' and 'test' must be sent together.
  3740.  
  3741.  
  3742.  108. Sending FORTRAN Output to the Printer
  3743.  
  3744.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  3745.  Operating System:   MS-DOS | OS/2
  3746.  Flags: ENDUSER |
  3747.  Last Modified: 31-OCT-1989    ArticleIdent: Q22830
  3748.  
  3749.  Question:
  3750.  
  3751.  How do I output data from my FORTRAN program to the printer?
  3752.  
  3753.  Response:
  3754.  
  3755.  You can access the printer by treating it as a SEQUENTIAL access
  3756.  file with one of the following system names:
  3757.  
  3758.       PRN
  3759.       LPT1
  3760.       LPT2
  3761.       COM1
  3762.  
  3763.  The following example sends output to the printer:
  3764.  
  3765.        OPEN(3,FILE='PRN')
  3766.        WRITE(3,*)'OUTPUT GOES TO THE PRINTER'
  3767.        END
  3768.  
  3769.  The OPEN statement associates UNIT #3 with the system file PRN, and
  3770.  then opens the printer for output. The UNIT does not have to be #3; it
  3771.  can be any UNIT number. The WRITE statement sends output to UNIT #3,
  3772.  which is the printer.
  3773.  
  3774.  For output to LPT2, status='old' must be included or the run-time
  3775.  error "F6415 -file already exists" is generated.
  3776.  
  3777.  It should be noted that the system name you use is dependent upon your
  3778.  particular system, and you may have to experiment to see which one
  3779.  works correctly for you. If you have a serial printer attached to your
  3780.  communications port, you should use the MS-DOS MODE command to tell
  3781.  the operating system to send printer output to the communications port
  3782.  instead of to the regular printer port.
  3783.  
  3784.  
  3785.  109. END=var Not Caught by the Compiler
  3786.  
  3787.  Product Version(s): 4.00a
  3788.  Operating System:   MS-DOS
  3789.  Flags: ENDUSER | ptr900114 bcp1703 buglist4.00
  3790.  Last Modified:  7-NOV-1988    ArticleIdent: Q22832
  3791.  
  3792.  Problem:
  3793.  
  3794.  When the following program runs, it hangs:
  3795.  
  3796.                     total = 0
  3797.                     abc = 200
  3798.                     count = 0
  3799.  
  3800.     100          count = count + 1
  3801.                     read(1,'(i7)',end=abc) value
  3802.                     total = total + value
  3803.                     goto 100
  3804.     200             write(*,*) 'done'
  3805.                     stop ' '
  3806.                     end
  3807.  
  3808.  Response:
  3809.  
  3810.  The program is incorrect. Variable ABC cannot be used as the target of
  3811.  an END=. END= requires a statement number and ONLY a statement number.
  3812.  The program loops because the code for the END= check is not
  3813.  generated. The compiler SHOULD be giving a syntax error for the READ
  3814.  statement.
  3815.  
  3816.  Microsoft has confirmed this to be a problem in Version 4.00. We are
  3817.  researching this problem and will post new information as it becomes
  3818.  available.
  3819.  
  3820.  To solve this problem, correct the syntax.
  3821.  
  3822.  
  3823.  110. BACKSPACE Problem
  3824.  
  3825.  Product Version(s): 4.00a
  3826.  Operating System:   MS-DOS
  3827.  Flags: ENDUSER | ptr900098 bcp1679 buglist4.00 fixlist4.01
  3828.  Last Modified:  1-JUN-1988    ArticleIdent: Q22834
  3829.  
  3830.     In the following program the file is positioned incorrectly,
  3831.  apparently in attempting to reposition from the second record to the
  3832.  first. Since this problem appears to be related to the file buffering,
  3833.  a possible workaround might be to use the BLOCKSIZE= specifier in the
  3834.  OPEN statement to increase the buffer size (which, in this case,
  3835.  allows the program to work correctly).
  3836.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  3837.  FORTRAN compiler. This problem was corrected in Version 4.01.
  3838.  
  3839.     The following program:
  3840.  
  3841.          CHARACTER*80 alpha
  3842.          open (1,file='bcp1679.dat')
  3843.  5       continue
  3844.          read (1,10,end=100) alpha
  3845.  10      format (a80)
  3846.          write (*,20) alpha
  3847.  20      format (1x,a79)
  3848.          backspace 1
  3849.          read (1,10) alpha
  3850.          write (*,20) alpha
  3851.          go to 5
  3852.  100     continue
  3853.          end
  3854.  
  3855.  given the following data file:
  3856.  
  3857.  111111111111111111111111111111111111111111111111111111111111
  3858.  222222222222222222222222222222222222222222222222222222222222
  3859.  333333333333333333333333333333333333333333333333333333333333
  3860.  444444444444444444444444444444444444444444444444444444444444
  3861.  555555555555555555555555555555555555555555555555555555555555
  3862.  666666666666666666666666666666666666666666666666666666666666
  3863.  777777777777777777777777777777777777777777777777777777777777
  3864.  888888888888888888888888888888888888888888888888888888888888
  3865.  999999999999999999999999999999999999999999999999999999999999
  3866.  000000000000000000000000000000000000000000000000000000000000
  3867.  111111111111111111111111111111111111111111111111111111111111
  3868.  222222222222222222222222222222222222222222222222222222222222
  3869.  333333333333333333333333333333333333333333333333333333333333
  3870.  444444444444444444444444444444444444444444444444444444444444
  3871.  555555555555555555555555555555555555555555555555555555555555
  3872.  666666666666666666666666666666666666666666666666666666666666
  3873.  777777777777777777777777777777777777777777777777777777777777
  3874.  888888888888888888888888888888888888888888888888888888888888
  3875.  999999999999999999999999999999999999999999999999999999999999
  3876.  000000000000000000000000000000000000000000000000000000000000
  3877.  111111111111111111111111111111111111111111111111111111111111
  3878.  222222222222222222222222222222222222222222222222222222222222
  3879.  333333333333333333333333333333333333333333333333333333333333
  3880.  444444444444444444444444444444444444444444444444444444444444
  3881.  555555555555555555555555555555555555555555555555555555555555
  3882.  666666666666666666666666666666666666666666666666666666666666
  3883.  777777777777777777777777777777777777777777777777777777777777
  3884.  888888888888888888888888888888888888888888888888888888888888
  3885.  999999999999999999999999999999999999999999999999999999999999
  3886.  000000000000000000000000000000000000000000000000000000000000
  3887.  111111111111111111111111111111111111111111111111111111111111
  3888.  222222222222222222222222222222222222222222222222222222222222
  3889.  333333333333333333333333333333333333333333333333333333333333
  3890.  444444444444444444444444444444444444444444444444444444444444
  3891.  555555555555555555555555555555555555555555555555555555555555
  3892.  666666666666666666666666666666666666666666666666666666666666
  3893.  777777777777777777777777777777777777777777777777777777777777
  3894.  888888888888888888888888888888888888888888888888888888888888
  3895.  999999999999999999999999999999999999999999999999999999999999
  3896.  000000000000000000000000000000000000000000000000000000000000
  3897.  
  3898.  should produce the following output:
  3899.  
  3900.  111111111111111111111111111111111111111111111111111111111111
  3901.  111111111111111111111111111111111111111111111111111111111111
  3902.  222222222222222222222222222222222222222222222222222222222222
  3903.  222222222222222222222222222222222222222222222222222222222222
  3904.  333333333333333333333333333333333333333333333333333333333333
  3905.  333333333333333333333333333333333333333333333333333333333333
  3906.  444444444444444444444444444444444444444444444444444444444444
  3907.  444444444444444444444444444444444444444444444444444444444444
  3908.  555555555555555555555555555555555555555555555555555555555555
  3909.  555555555555555555555555555555555555555555555555555555555555
  3910.  666666666666666666666666666666666666666666666666666666666666
  3911.  666666666666666666666666666666666666666666666666666666666666
  3912.  777777777777777777777777777777777777777777777777777777777777
  3913.  777777777777777777777777777777777777777777777777777777777777
  3914.  888888888888888888888888888888888888888888888888888888888888
  3915.  888888888888888888888888888888888888888888888888888888888888
  3916.  999999999999999999999999999999999999999999999999999999999999
  3917.  999999999999999999999999999999999999999999999999999999999999
  3918.  000000000000000000000000000000000000000000000000000000000000
  3919.  000000000000000000000000000000000000000000000000000000000000
  3920.  111111111111111111111111111111111111111111111111111111111111
  3921.  111111111111111111111111111111111111111111111111111111111111
  3922.  222222222222222222222222222222222222222222222222222222222222
  3923.  222222222222222222222222222222222222222222222222222222222222
  3924.  333333333333333333333333333333333333333333333333333333333333
  3925.  333333333333333333333333333333333333333333333333333333333333
  3926.  444444444444444444444444444444444444444444444444444444444444
  3927.  444444444444444444444444444444444444444444444444444444444444
  3928.  555555555555555555555555555555555555555555555555555555555555
  3929.  555555555555555555555555555555555555555555555555555555555555
  3930.  666666666666666666666666666666666666666666666666666666666666
  3931.  666666666666666666666666666666666666666666666666666666666666
  3932.  777777777777777777777777777777777777777777777777777777777777
  3933.  777777777777777777777777777777777777777777777777777777777777
  3934.  888888888888888888888888888888888888888888888888888888888888
  3935.  888888888888888888888888888888888888888888888888888888888888
  3936.  999999999999999999999999999999999999999999999999999999999999
  3937.  999999999999999999999999999999999999999999999999999999999999
  3938.  000000000000000000000000000000000000000000000000000000000000
  3939.  000000000000000000000000000000000000000000000000000000000000
  3940.  111111111111111111111111111111111111111111111111111111111111
  3941.  111111111111111111111111111111111111111111111111111111111111
  3942.  222222222222222222222222222222222222222222222222222222222222
  3943.  222222222222222222222222222222222222222222222222222222222222
  3944.  333333333333333333333333333333333333333333333333333333333333
  3945.  333333333333333333333333333333333333333333333333333333333333
  3946.  444444444444444444444444444444444444444444444444444444444444
  3947.  444444444444444444444444444444444444444444444444444444444444
  3948.  555555555555555555555555555555555555555555555555555555555555
  3949.  555555555555555555555555555555555555555555555555555555555555
  3950.  666666666666666666666666666666666666666666666666666666666666
  3951.  666666666666666666666666666666666666666666666666666666666666
  3952.  777777777777777777777777777777777777777777777777777777777777
  3953.  777777777777777777777777777777777777777777777777777777777777
  3954.  888888888888888888888888888888888888888888888888888888888888
  3955.  888888888888888888888888888888888888888888888888888888888888
  3956.  999999999999999999999999999999999999999999999999999999999999
  3957.  999999999999999999999999999999999999999999999999999999999999
  3958.  000000000000000000000000000000000000000000000000000000000000
  3959.  000000000000000000000000000000000000000000000000000000000000
  3960.  111111111111111111111111111111111111111111111111111111111111
  3961.  111111111111111111111111111111111111111111111111111111111111
  3962.  222222222222222222222222222222222222222222222222222222222222
  3963.  222222222222222222222222222222222222222222222222222222222222
  3964.  333333333333333333333333333333333333333333333333333333333333
  3965.  333333333333333333333333333333333333333333333333333333333333
  3966.  444444444444444444444444444444444444444444444444444444444444
  3967.  444444444444444444444444444444444444444444444444444444444444
  3968.  555555555555555555555555555555555555555555555555555555555555
  3969.  555555555555555555555555555555555555555555555555555555555555
  3970.  666666666666666666666666666666666666666666666666666666666666
  3971.  666666666666666666666666666666666666666666666666666666666666
  3972.  777777777777777777777777777777777777777777777777777777777777
  3973.  777777777777777777777777777777777777777777777777777777777777
  3974.  888888888888888888888888888888888888888888888888888888888888
  3975.  888888888888888888888888888888888888888888888888888888888888
  3976.  999999999999999999999999999999999999999999999999999999999999
  3977.  999999999999999999999999999999999999999999999999999999999999
  3978.  000000000000000000000000000000000000000000000000000000000000
  3979.  000000000000000000000000000000000000000000000000000000000000
  3980.  
  3981.     However, it actually prints:
  3982.  
  3983.  111111111111111111111111111111111111111111111111111111111111
  3984.  444444444444444444444444444444444444444444444444444444444444
  3985.  555555555555555555555555555555555555555555555555555555555555
  3986.  555555555555555555555555555555555555555555555555555555555555
  3987.  666666666666666666666666666666666666666666666666666666666666
  3988.  666666666666666666666666666666666666666666666666666666666666
  3989.  777777777777777777777777777777777777777777777777777777777777
  3990.  777777777777777777777777777777777777777777777777777777777777
  3991.  888888888888888888888888888888888888888888888888888888888888
  3992.  888888888888888888888888888888888888888888888888888888888888
  3993.  999999999999999999999999999999999999999999999999999999999999
  3994.  999999999999999999999999999999999999999999999999999999999999
  3995.  000000000000000000000000000000000000000000000000000000000000
  3996.  000000000000000000000000000000000000000000000000000000000000
  3997.  
  3998.  
  3999.  111. Direct Access REC= -1
  4000.  
  4001.  Product Version(s): 4.00A
  4002.  Operating System:   MS-DOS
  4003.  Flags: ENDUSER | ptr900105 bcp1691 buglist4.00 fixlist4.01
  4004.  Last Modified: 26-MAY-1988    ArticleIdent: Q22835
  4005.  
  4006.  Problem:
  4007.     The following program:
  4008.  
  4009.          character*8 junk
  4010.          open (1,file='may28.dat',access='direct',recl=8)
  4011.          write (1,rec=1) 'Stuff'
  4012.          close(1)
  4013.          open (1,file='may28.dat',access='direct',recl=8)
  4014.          read (1,rec=  0,iostat=ier) junk
  4015.          write (*,*) 'For rec=  0, iostat should be 6311, and is=',ier
  4016.          read (1,rec= -1,iostat=ier) junk
  4017.          write (*,*) 'For rec= -1, iostat should be 6311, and is=',ier
  4018.          read (1,rec= -2,iostat=ier) junk
  4019.          write (*,*) 'For rec= -2, iostat should be 6311, and is=',ier
  4020.          close (1,status='delete')
  4021.          end
  4022.  
  4023.  should produce the following output:
  4024.  
  4025.     For rec=  0, iostat should be 6311, and is=       6311
  4026.     For rec= -1, iostat should be 6311, and is=       6311
  4027.     For rec= -2, iostat should be 6311, and is=       6311
  4028.  
  4029.     However, it actually prints the following:
  4030.  
  4031.     For rec=  0, iostat should be 6311, and is=       6311
  4032.     For rec= -1, iostat should be 6311, and is=          0
  4033.     For rec= -2, iostat should be 6311, and is=       6311
  4034.  
  4035.  Response:
  4036.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4037.  FORTRAN Compiler. It was corrected in Version 4.01.
  4038.     The run time seems to treat the REC = -1 case exactly the same as
  4039.  if the REC= were not there, i.e., it reads the next record.
  4040.  
  4041.  
  4042.  112. Expressions in IF Statements
  4043.  
  4044.  Product Version(s): 4.00A
  4045.  Operating System:   MS-DOS
  4046.  Flags: ENDUSER | ptr900096 bcp1676 buglist4.00 fixlist4.01
  4047.  Last Modified: 26-MAY-1988    ArticleIdent: Q22831
  4048.  
  4049.  Problem:
  4050.     The following program:
  4051.  
  4052.          xmax = 14.8
  4053.          do 30 i = 1,20
  4054.          if (xmax .le. i*5.) then
  4055.                  write (*,*) 'i should be 3, is=',i
  4056.                  go to 31
  4057.          endif
  4058.  30      continue
  4059.          stop 'error'
  4060.  31      stop
  4061.          end
  4062.  
  4063.  should produce the following output:
  4064.  
  4065.  i should be 3, is=          3
  4066.  Stop - Program terminated.
  4067.  
  4068.     However, it actually prints the following:
  4069.  
  4070.  i should be 3, is=         15
  4071.  Stop - Program terminated.
  4072.  
  4073.  Response:
  4074.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4075.  FORTRAN compiler. It was corrected in Version 4.01.
  4076.     Within the DO loop, the expression i*5. is never calculated. What
  4077.  is being compared against XMAX is i, not i*5; therefore, the loop is
  4078.  terminated after 15 iterations instead of three.
  4079.     There are a number of workarounds, as follows:
  4080.  
  4081.     1. Compile with -Odclt.
  4082.     2. Enclose the expression i*5. in parentheses.
  4083.     3. Set a temporary integer variable equal to i, and use it in place
  4084.  of i within the loop.
  4085.  
  4086.  
  4087.  113. HUGE Arrays on ENTRY Statements
  4088.  
  4089.  Product Version(s): 4.00A 4.01
  4090.  Operating System:   MS-DOS
  4091.  Flags: ENDUSER | ptr900094 bcp1671 buglist4.00 buglist4.01
  4092.  Last Modified: 27-MAY-1988    ArticleIdent: Q22828
  4093.  
  4094.  Problem:
  4095.     The following program:
  4096.  
  4097.          dimension x(20000)
  4098.          do 100 i=1,20000
  4099.            x(i) = i
  4100.  100     continue
  4101.          n = 20000
  4102.          write (*,*) 'in main        ',1,x(1),n,x(n)
  4103.          call sub2ad (x,n)
  4104.          call sub3as (x,n)
  4105.          end
  4106.          subroutine sub2x
  4107.          dimension y(n)
  4108.          entry sub2ad (y,n)
  4109.          write (*,*) 'at entry sub2ad',1,y(1),n,y(n)
  4110.          end
  4111.          subroutine sub3x
  4112.          dimension y(*)
  4113.          entry sub3as (y,n)
  4114.          write (*,*) 'at entry sub3as',1,y(1),20000,y(20000)
  4115.          end
  4116.  
  4117.  should produce the following output:
  4118.  
  4119.  in main                  1        1.000000       20000    20000.000000
  4120.  at entry sub2ad          1        1.000000       20000    20000.000000
  4121.  at entry sub3as          1        1.000000       20000    20000.000000
  4122.  
  4123.     However, it actually prints the following:
  4124.  
  4125.  in main                  1        1.000000       20000    20000.000000
  4126.  at entry sub2ad          1        1.000000       20000     3616.000000
  4127.  at entry sub3as          1        1.000000       20000     3616.000000
  4128.  
  4129.  Response:
  4130.     This is a known problem in Versions 4.00 and 4.01.
  4131.     The only workaround is to declare the arguments in the SUBROUTINE
  4132.  header.
  4133.     Microsoft is researching this problem and will post new information
  4134.  as it becomes available.
  4135.  
  4136.  
  4137.  114. Internal READ from Substring
  4138.  
  4139.  Product Version(s): 4.00a
  4140.  Operating System:   MS-DOS
  4141.  Flags: ENDUSER | ptr900122 bcp1717 buglist4.00 fixlist4.01
  4142.  Last Modified:  1-JUN-1988    ArticleIdent: Q22819
  4143.  
  4144.     The following program:
  4145.  
  4146.     character*15 ln
  4147.     ln = '  1234'
  4148.     n1 = 1
  4149.     n2 = 8
  4150.     read (ln(1:8),'(i10)') ival
  4151.     write (*,*) ' ln(1:8) ival should be 1234, is=',ival
  4152.     read (ln(1:n2),'(i10)') ival
  4153.     write (*,*) ' ln(1:n2) ival should be 1234, is=',ival
  4154.     read (ln(n1:8),'(i10)') ival
  4155.     write (*,*) ' ln(n1:8) ival should be 1234, is=',ival
  4156.     read (ln(n1:n2),'(i10)') ival
  4157.     write (*,*) ' ln(n1:n2) ival should be 1234, is=',ival
  4158.     end
  4159.  
  4160.  should produce the following output:
  4161.  
  4162.     ln(1:8) ival=       1234
  4163.     ln(1:n2) ival=       1234
  4164.     ln(n1:8) ival=       1234
  4165.     ln(n1:n2) ival=       1234
  4166.  
  4167.   however, it actually prints the following:
  4168.  
  4169.     ln(1:8) ival=       1234
  4170.     ln(1:n2) ival=          0
  4171.     ln(n1:8) ival=       1234
  4172.     ln(n1:n2) ival=       1234
  4173.  
  4174.     This is a known problem in Version 4.00.
  4175.     The error seems to occur only when READing from a substring of an
  4176.  internal file where the substring is of the form STR(const:var).
  4177.     This problem was corrected in Version 4.01 of the FORTRAN compiler.
  4178.  
  4179.  
  4180.  115. Type Coercion within Intrinsics
  4181.  
  4182.  Product Version(s): 4.00A
  4183.  Operating System:   MS-DOS
  4184.  Flags: ENDUSER | ptr900143 bcp1743 buglist4.00 fixlist4.01
  4185.  Last Modified: 26-MAY-1988    ArticleIdent: Q22998
  4186.  
  4187.  Problem:
  4188.     The following program:
  4189.  
  4190.          integer*4 pos,pa
  4191.          data n /30000/, pos /60413/, pa /1/
  4192.          m = min0(n,pos-pa+1)
  4193.          write (*,*) 'm=',m
  4194.          write (*,*) 'min0(n,pos-pa+1)=',min0(n,pos-pa+1)
  4195.          end
  4196.  
  4197.  produces the following output if compiled with the option -4I2:
  4198.  
  4199.  m=      -5123
  4200.  min0(n,pos-pa+1)=      30000
  4201.  
  4202.  instead of the following correct output:
  4203.  
  4204.  m=      30000
  4205.  min0(n,pos-pa+1)=      30000
  4206.  
  4207.  Response:
  4208.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4209.  FORTRAN compiler. It was corrected in Version 4.01.
  4210.     The easiest workaround is to compile without using the -4I2 option.
  4211.  
  4212.  
  4213.  116. Run-Time Error M6101
  4214.  
  4215.  Product Version(s): 4.00A
  4216.  Operating System:   MS-DOS
  4217.  Flags: ENDUSER | ptr900133 bcp1742 buglist4.00 fixlist4.01
  4218.  Last Modified: 26-MAY-1988    ArticleIdent: Q22997
  4219.  
  4220.  Problem:
  4221.     The following program:
  4222.  
  4223.          dimension a(0:100), b(0:100)
  4224.          n = 100
  4225.          do 1 i=1,n
  4226.          fi = float(i)
  4227.          arg = fi/3.
  4228.          a(i) = sin(arg) - sin(2.*arg) - sin(5.*arg)
  4229.          b(i) = cos(arg) + cos(2.*arg) + cos(5.*arg)
  4230.  1       continue
  4231.          end
  4232.  
  4233.  produces the following run-time error:
  4234.  
  4235.     run-time error M6101: MATH
  4236.     - floating-point error: invalid
  4237.  
  4238.  Response:
  4239.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4240.  FORTRAN compiler. It was corrected in Version 4.01.
  4241.     You can work around the problem by compiling with -Od or -Odlt.
  4242.  
  4243.  
  4244.  117. Huge .LST Files
  4245.  
  4246.  Product Version(s): 4.00A
  4247.  Operating System:   MS-DOS
  4248.  Flags: ENDUSER | ptr900130 bcp1735 buglist4.00 fixlist4.01
  4249.  Last Modified: 26-MAY-1988    ArticleIdent: Q22993
  4250.  
  4251.  Problem:
  4252.     The following program, compiled with the -Fs option, produces an
  4253.  .LST file that exceeds 260,000 characters in size:
  4254.  
  4255.  $linesize:132
  4256.  $page
  4257.        end
  4258.  
  4259.  Response:
  4260.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4261.  FORTRAN compiler. It was corrected in Version 4.01.
  4262.     The workaround is to use a value of $LINESIZE that is less than or
  4263.  equal to 127 characters.
  4264.  
  4265.  
  4266.  118. Multiple CHAR Parameter Lengths Confused
  4267.  
  4268.  Product Version(s): 4.00A
  4269.  Operating System:   MS-DOS
  4270.  Flags: ENDUSER | ptr900127 bcp1690 buglist4.00 fixlist4.01
  4271.  Last Modified: 26-MAY-1988    ArticleIdent: Q22943
  4272.  
  4273.  Problem:
  4274.     The following program:
  4275.  
  4276.          character*2 y
  4277.          CALL x('a',y('12'),'tyu')
  4278.          END
  4279.          subroutine x(c1,c2,c3)
  4280.          character*(*) c1,c2,c3
  4281.          write (*,*) 'c1 should be a, is =<',c1,'>'
  4282.          write (*,*) 'c2 should be 12, is =<',c2,'>'
  4283.          write (*,*) 'c3 should be tyu, is =<',c3,'>'
  4284.          end
  4285.          character*2 function y (ch)
  4286.          character*(*) ch
  4287.          y = ch
  4288.          end
  4289.  
  4290.  should print the following:
  4291.  
  4292.  c1 should be a, is =<a>
  4293.  c2 should be 12, is =<12>
  4294.  c3 should be tyu, is =<tyu>
  4295.  
  4296.     However, it actually prints the following:
  4297.  
  4298.  c1 should be a, is =<a1>
  4299.  c2 should be 12, is =<1>
  4300.  c3 should be tyu, is =<ty>
  4301.  
  4302.  Response:
  4303.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4304.  FORTRAN compiler. It was corrected in Version 4.01.
  4305.     This error will occur only if more than one CHARACTER argument is
  4306.  passed. There is no workaround.
  4307.  
  4308.  
  4309.  119. Error Message Positions Versus $INCLUDE Files
  4310.  
  4311.  Product Version(s): 4.00a
  4312.  Operating System:   MS-DOS
  4313.  Flags: ENDUSER | ptr900131 bcp1736 buglist4.00a fixlist4.01
  4314.  Last Modified:  1-JUN-1988    ArticleIdent: Q22994
  4315.  
  4316.     The following program:
  4317.  
  4318.     $include:'test'
  4319.             hgjfdhgjkfdhgjkf
  4320.             end
  4321.  
  4322.  has the following $INCLUDE file (test):
  4323.  
  4324.          integer x
  4325.          integer y
  4326.          integer z
  4327.          integer a
  4328.          integer b
  4329.          integer c
  4330.  
  4331.     The program has a syntax error on line 2 of the main program. If
  4332.  option -Fs is used, the error message will appear under line 2 of the
  4333.  $INCLUDE file ("integer y") in the .LST file.
  4334.     This was a confirmed problem in Version 4.00a.
  4335.     This problem was corrected in Version 4.01.
  4336.     There is no workaround.
  4337.  
  4338.  
  4339.  120. Optimization Problem
  4340.  
  4341.  Product Version(s): 4.00A
  4342.  Operating System:   MS-DOS
  4343.  Flags: ENDUSER | ptr900132 bcp1741 buglist4.00 fixlist4.01 fixlist4.01a
  4344.  Last Modified: 26-MAY-1988    ArticleIdent: Q22996
  4345.  
  4346.  Problem:
  4347.     The following program:
  4348.  
  4349.          nmin = 1
  4350.          nmax = 2
  4351.          do 120 i=1,2
  4352.          write (*,*) 'nmin=',nmin
  4353.          do 110 m=nmin,2,nmax
  4354.          write(*,*) 'm,nmin=',m,nmin
  4355.  110     continue
  4356.          nmin =2
  4357.          nmax = nmax+1
  4358.  120     continue
  4359.          end
  4360.  
  4361.  produces the following correct output when compiled with -Od:
  4362.  
  4363.  nmin=          1
  4364.  m,nmin=          1           1
  4365.  nmin=          2
  4366.  m,nmin=          2           2
  4367.  
  4368.     However, when compiled with the default option, the program prints
  4369.  the following:
  4370.  
  4371.  nmin=          2
  4372.  m,nmin=          2           2
  4373.  nmin=          2
  4374.  m,nmin=          2           2
  4375.  
  4376.  Response:
  4377.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4378.  FORTRAN compiler. This problem was corrected in Version 4.01.
  4379.     You can work around this problem by compiling with option -Od or
  4380.  -Odct.
  4381.  
  4382.  
  4383.  121. Integer Overflow Is Not Being Checked
  4384.  
  4385.  Product Version(s): 4.10
  4386.  Operating System:   MS-DOS
  4387.  Flags: ENDUSER |
  4388.  Last Modified: 17-MAR-1988    ArticleIdent: Q27850
  4389.  
  4390.  Problem:
  4391.     The following code will not check for integer overflow correctly.
  4392.  
  4393.         integer*4 d
  4394.         real*4 x
  4395.         d = 13
  4396.         x = 1123.000
  4397.         write(*,1) x/10**d
  4398.         write(*,1) x/10.0**d
  4399.   1     format(f40.20)
  4400.         stop
  4401.  
  4402.  The first write statement will give an incorrect answer because of
  4403.  unchecked integer overflow.
  4404.  
  4405.  Response:
  4406.     Microsoft is researching this problem and will post new information
  4407.  as it becomes available.
  4408.  
  4409.  
  4410.  122. Direct Access File Problem
  4411.  
  4412.  Product Version(s): 4.00A
  4413.  Operating System:   MS-DOS
  4414.  Flags: ENDUSER | ptr900129 bcp1732 buglist4.00 fixlist4.01
  4415.  Last Modified: 26-MAY-1988    ArticleIdent: Q22945
  4416.  
  4417.  Problem:
  4418.     The program below attempts to execute the following steps:
  4419.  
  4420.     1. OPEN a direct access formatted file.
  4421.     2. WRITE to it until an error occurs (which, presumably, will be an
  4422.  error 6422 - no space left on device).
  4423.     3. ReWRITE the first record (with content that differs from what
  4424.  was first put there).
  4425.     4. CLOSE the file, OPEN it as a formatted sequential file, and READ
  4426.  the first record.
  4427.     5. Check to make sure that the first record contains the
  4428.  information put there following the "no space" error.
  4429.  
  4430.     The program is as follows:
  4431.  
  4432.          character*10000 line
  4433.          n = 1
  4434.          open (1,file='test.dat',access='direct',recl=10000,
  4435.       +  form='formatted')
  4436.  100     continue
  4437.          write (1,'(a)',rec=n,err=900,iostat=ier) line
  4438.          n = n+1
  4439.          go to 100
  4440.  900     continue
  4441.          write (1,'(a,i3)',rec=1,err=999) 'Disk full at record=',n-1
  4442.  999     continue
  4443.          close (1)
  4444.          open (1,file='test.dat')
  4445.          read (1,'(A)') line
  4446.          if (line(:9) .eq. 'Disk full') then
  4447.            write (*,*) 'Test passed'
  4448.          else
  4449.            write (*,*) 'Test failed'
  4450.          endif
  4451.          close (1,status='delete')
  4452.          end
  4453.  
  4454.     The following output should be produced:
  4455.  
  4456.     Test passed
  4457.  
  4458.     However, the following actually is printed:
  4459.  
  4460.     Test failed
  4461.  
  4462.  Response:
  4463.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4464.  FORTRAN compiler. It was corrected in Version 4.01.
  4465.     The "Test failed" message is printed because the run time produces
  4466.  an "error F6601 - direct record overflow" when Step 3 above is
  4467.  attempted. The error apparently is caused by a failure to update a
  4468.  buffer pointer following the "no space" error. There is no workaround.
  4469.  
  4470.  
  4471.  123. Inquire by File on Devices
  4472.  
  4473.  Product Version(s): 4.00a
  4474.  Operating System:   MS-DOS
  4475.  Flags: ENDUSER | ptr 900150 bcp 1772 buglist4.00 fixlist4.10
  4476.  Last Modified: 30-SEP-1988    ArticleIdent: Q23118
  4477.  
  4478.  The program below does not produce the correct output.
  4479.  
  4480.  Microsoft has confirmed this to be a problem in Version 4.00. This
  4481.  problem was corrected in Version 4.10.
  4482.  
  4483.  The following program demonstrates the problem:
  4484.  
  4485.          character*10 dev(5)
  4486.          logical test
  4487.          dev(1) = 'com1'
  4488.          dev(2) = 'prn'
  4489.          dev(3) = 'aux'
  4490.          dev(4) = 'nul'
  4491.          dev(5) = 'con'
  4492.          do 100 i=1,5
  4493.            inquire (file=dev(i),exist=test)
  4494.            if (test) write (*,*) 'file ',dev(i),' exists'
  4495.  100     continue
  4496.          end
  4497.  
  4498.  The program should produce the following output; however, it does not
  4499.  print anything:
  4500.  
  4501.  file com1       exists
  4502.  file prn        exists
  4503.  file aux        exists
  4504.  file nul        exists
  4505.  file con        exists
  4506.  
  4507.  
  4508.  124. F1901 Compile Error Caused by Many Equivalences
  4509.  
  4510.  Product Version(s): 4.01 4.10
  4511.  Operating System:   MS-DOS
  4512.  Flags: ENDUSER |
  4513.  Last Modified: 16-JUN-1988    ArticleIdent: Q27986
  4514.  
  4515.     The F1901 "program too large for memory" error message occurs when
  4516.  compiling a FORTRAN program consisting of 55 equivalences. The
  4517.  following partial code demonstrates this problem by equivalencing two
  4518.  arrays.
  4519.     However, since arrays are required to be contiguous in memory, you
  4520.  need only equivalence the first element of the two arrays to
  4521.  accomplish the same effect, thereby avoiding the error.
  4522.     The following code fragment demonstrates this workaround for
  4523.  equivalencing the two arrays in the program below:
  4524.  
  4525.     REAL*8 A(200)
  4526.     REAL*8 B(200)
  4527.     EQUIVALENCE (A(1),B(2))
  4528.     END
  4529.  
  4530.     The other equivalences are not necessary. This problem does not
  4531.  occur with fewer equivalences. Another program shows this problem
  4532.  after 63 equivalences. This problem is also dependent on the size of
  4533.  the program and the code.
  4534.     Microsoft is researching this problem and will post new information
  4535.  as it becomes available.
  4536.  
  4537.     The following code demonstrates the problem:
  4538.  
  4539.        REAL*8    A(200)
  4540.        REAL*8    B(200)
  4541.        EQUIVALENCE
  4542.       +(A( 1),B( 1)),
  4543.       +(A( 2),B( 2)),
  4544.       +(A( 3),B( 3)),
  4545.              .
  4546.              .
  4547.              .
  4548.       +(A(54),B(54)),
  4549.       +(A(55),B(55))
  4550.        END
  4551.  
  4552.  
  4553.  125. FORMAT Can Give Output of Negative Zero
  4554.  
  4555.  Product Version(s): 4.01 4.10 | 4.10
  4556.  Operating System:   MS-DOS    | 4.10
  4557.  Flags: ENDUSER |
  4558.  Last Modified: 19-APR-1988    ArticleIdent: Q27988
  4559.  
  4560.     The following program:
  4561.  
  4562.        REAL*8 RR(6)
  4563.        RR(1)=-0.00004999D0
  4564.        RR(2)=-0.00005000D0
  4565.        RR(3)=-0.00005100D0
  4566.        RR(4)=-0.00000999D0
  4567.        RR(5)=-0.00001000D0
  4568.        RR(6)=-0.00001001D0
  4569.        WRITE(*,911) RR
  4570.  911   FORMAT(/' RR :',6F10.4)
  4571.        END
  4572.  
  4573.  gives the following output:
  4574.  
  4575.  RR :    -.0000   -.0001   -.0001    .0000   -.0000   -.0000
  4576.  
  4577.  with negative zeros as output.
  4578.  
  4579.  Response:
  4580.     Microsoft is researching this problem and will post new information
  4581.  as it becomes available.
  4582.  
  4583.  
  4584.  126. Optimizer Deleting EQUIVALENCEd Variable Assignment
  4585.  
  4586.  Product Version(s): 4.00a
  4587.  Operating System:   MS-DOS
  4588.  Flags: ENDUSER | ptr900138 bcp1751 buglist4.00 fixlist4.01
  4589.  Last Modified:  1-JUN-1988    ArticleIdent: Q23262
  4590.  
  4591.  Problem:
  4592.     The function of the following program is to sum four UNSIGNED
  4593.  two-byte integers (65535, 65534, 65533, and 65532) and place the
  4594.  result in a four-byte integer variable as in the following example:
  4595.  
  4596.          implicit integer*2 (a-z)
  4597.          dimension buf(4),lc2(2)
  4598.          integer*4 lc4,tot4
  4599.          equivalence (lc2,lc4)
  4600.          data buf /-1,-2,-3,-4/
  4601.          lc2(2) = 0
  4602.          do 10 i = 1,4,2
  4603.          lc2(1) = buf(i)
  4604.          tot4 = tot4+lc4
  4605.          lc2(1) = buf(i+1)
  4606.          tot4 = tot4+lc4
  4607.  10      continue
  4608.          write (*,*) 'tot4 should be 262134, is=',tot4
  4609.          end
  4610.  
  4611.     It should produce the following output:
  4612.  
  4613.  tot4 should be 262134, is=     262134
  4614.  
  4615.     However, the following actually is printed:
  4616.  
  4617.  tot4 should be 262134, is=     196600
  4618.  
  4619.  Response:
  4620.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4621.  FORTRAN compiler. This problem was corrected in Version 4.01.
  4622.     The only workaround is to disable optimization by compiling with
  4623.  option -Od.
  4624.  
  4625.  
  4626.  127. Optimization Problem
  4627.  
  4628.  Product Version(s): 4.00A
  4629.  Operating System:   MS-DOS
  4630.  Flags: ENDUSER | ptr900156 bcp1783 buglist4.00
  4631.  Last Modified:  2-MAY-1988    ArticleIdent: Q23264
  4632.  
  4633.  Problem:
  4634.     The following program:
  4635.  
  4636.          integer id(2)
  4637.          alat = 34.55555555
  4638.          call ddms (alat,id)
  4639.          end
  4640.          subroutine ddms (alat,id)
  4641.          integer id(2)
  4642.          real*4 rl(2)
  4643.          rl(1) = alat
  4644.          do 10 k=1,1
  4645.            rll = rl(k)
  4646.            id(k) = rll
  4647.            d = id(k)
  4648.            diff = rll-d
  4649.            write(*,*) 'diff should be 5.555573E-01, is=',diff
  4650.  10      continue
  4651.          end
  4652.  
  4653.  should produce the following output:
  4654.  
  4655.  diff should be 5.555573E-01, is=   5.555573E-01
  4656.  
  4657.     However, it actually prints the following:
  4658.  
  4659.  diff should be 5.555573E-01, is=   0.000000E+00
  4660.  
  4661.  Response:
  4662.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4663.  FORTRAN compiler. This problem was corrected in Version 4.01.
  4664.     The only workaround is to compile with -Od.
  4665.  
  4666.  
  4667.  128. Incorrect Code Deletion
  4668.  
  4669.  Product Version(s): 4.00a
  4670.  Operating System:   MS-DOS
  4671.  Flags: ENDUSER | ptr900153 bcp1778 buglist4.00 fixlist4.01
  4672.  Last Modified:  1-JUN-1988    ArticleIdent: Q23265
  4673.  
  4674.     The following program:
  4675.  
  4676.          integer*4 pytab(300)
  4677.          common /pytab/ pytptr,pytab
  4678.          l1 = 5
  4679.          l2 = 5
  4680.          pytptr = 1
  4681.          dv = 7
  4682.          pytab(pytptr) = dv
  4683.          pytab(pytptr) = ior(ishft(pytab(pytptr),14),l1)
  4684.          pytab(pytptr) = ior(ishft(pytab(pytptr),14),l2)
  4685.          write (*,'(1x,a,z8)') 'answer should be 0x70014005, is=',pytab(1)
  4686.          end
  4687.  
  4688.  should produce the following output:
  4689.  
  4690.  answer should be 0x70014005, is=70014005
  4691.  
  4692.     However, it actually prints the following:
  4693.  
  4694.  answer should be 0x70014005, is=00014005
  4695.  
  4696.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4697.  FORTRAN compiler. This problem was corrected in Version 4.01.
  4698.     You may work around this problem by compiling with -Od or -Odlt
  4699.  (loop optimization but no common subexpression elimination).
  4700.  
  4701.  
  4702.  129. NEAR Attribute in COMMON
  4703.  
  4704.  Product Version(s): 4.00a
  4705.  Operating System:   MS-DOS
  4706.  Flags: ENDUSER | ptr900140 bcp1756 buglist4.00 fixlist4.01
  4707.  Last Modified:  1-JUN-1988    ArticleIdent: Q23266
  4708.  
  4709.     The following program is broken into two files and compiled
  4710.  separately:
  4711.  
  4712.             implicit INTEGER*2 (a-z)
  4713.             common /ccc/ ia,ib,ic
  4714.             ix = 0
  4715.             ia = 5
  4716.             ib = 7
  4717.             write (*,100) 'default data segment=',locfar(ix)
  4718.     100     format (1x,a,z8)
  4719.             write (*,100) 'main program COMMON /ccc/ segment=',
  4720.          +  locfar(ia)
  4721.             call junk
  4722.             write (*,*) ia,' plus ',ib,' should be 12, is=',ic
  4723.             end
  4724.             subroutine junk
  4725.             implicit INTEGER*2 (a-z)
  4726.             common /ccc[near]/ia,ib,ic
  4727.             write (*,100) 'subroutine COMMON /ccc/ segment=',
  4728.          +  locfar(ia)
  4729.     100     format (1x,a,z8)
  4730.             ic = ia+ib
  4731.             end
  4732.  
  4733.  It should produce the following output:
  4734.  
  4735.     default data segment=8CD10842
  4736.     main program COMMON /ccc/ segment=8CD10000
  4737.     subroutine COMMON /ccc/ segment=8CD10000
  4738.               5 plus           7 should be 12, is=         12
  4739.  
  4740.  However, it actually prints the following:
  4741.  
  4742.     default data segment=8CD10842
  4743.     main program COMMON /ccc/ segment=8CD00000
  4744.     subroutine COMMON /ccc/ segment=8CD10000
  4745.               5 plus           7 should be 12, is=          0
  4746.  
  4747.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4748.  FORTRAN compiler. This problem was corrected in Version 4.01.
  4749.  
  4750.     The following are two workarounds:
  4751.  
  4752.     1. Specify all the occurrences of the COMMON block to be NEAR.
  4753.     2. Specify the first occurrence of the COMMON block in each source
  4754.  file to be NEAR.
  4755.  
  4756.  
  4757.  130. C and ALIAS Attributes
  4758.  
  4759.  Product Version(s): 4.00a
  4760.  Operating System:   MS-DOS
  4761.  Flags: ENDUSER | ptr900154 bcp1779 buglist4.00
  4762.  Last Modified: 11-OCT-1988    ArticleIdent: Q23267
  4763.  
  4764.  Question:
  4765.  
  4766.  The following program should enable you to link to the C routine named
  4767.  csub.c, but you will receive an "unresolved external" error when you
  4768.  LINK:
  4769.  
  4770.         interface to integer*2 function isub[alias:'CSUB',c] (y)
  4771.         integer*2 y
  4772.         end
  4773.  
  4774.         integer*2 isub
  4775.         i = isub(j)
  4776.         end
  4777.  
  4778.  Response:
  4779.  
  4780.  When used together, the resulting name should be lowercase and should
  4781.  be preceded by an underscore. Currently, whatever is specified in the
  4782.  ALIAS is EXACTLY what you will find in the generated code. The only
  4783.  workaround is to modify the alias by inserting the underscore
  4784.  character before the name, and changing the name to lowercase letters.
  4785.  
  4786.  
  4787.  131. Bad "Type" Information in .LST File
  4788.  
  4789.  Product Version(s): 4.00a
  4790.  Operating System:   MS-DOS
  4791.  Flags: ENDUSER | ptr900149 bcp1771 buglist4.00 fixlist4.01
  4792.  Last Modified:  1-JUN-1988    ArticleIdent: Q23269
  4793.  
  4794.     The problem program is as follows:
  4795.  
  4796.          logical*1 l
  4797.          l = .true.
  4798.          end
  4799.  
  4800.     This produces the following source listing file, (heading omitted
  4801.  on purpose):
  4802.  
  4803.          1         logical*1 l
  4804.          2         l = .true.
  4805.          3         end
  4806.  
  4807.  main  Local Symbols
  4808.  
  4809.  Name                      Class   Type              Size   Offset
  4810.  
  4811.  L . . . . . . . . . . . . local   LOGICAL*4            1    0000
  4812.  
  4813.  Global Symbols
  4814.  
  4815.  Name                      Class   Type              Size   Offset
  4816.  
  4817.  main. . . . . . . . . . . FSUBRT  ***                ***    0000
  4818.  
  4819.  Code size = 0018 (24)
  4820.  Data size = 0000 (0)
  4821.  Bss size  = 0001 (1)
  4822.  
  4823.  No errors detected
  4824.  
  4825.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4826.  FORTRAN compiler. This problem was corrected in Version 4.01.
  4827.  
  4828.  
  4829.  132. Logical*1 Versus Equivalence
  4830.  
  4831.  Product Version(s): 4.00a
  4832.  Operating System:   MS-DOS
  4833.  Flags: ENDUSER | buglist4.00 fixlist4.01
  4834.  Last Modified:  1-JUN-1988    ArticleIdent: Q23277
  4835.  
  4836.     The following program:
  4837.  
  4838.         logical*1 newflag(5),flag1,flag2,flag3,flag4,flag5
  4839.         common /findex/ flag1,flag2,flag3,flag4,flag5
  4840.         equivalence (newflag,flag1)
  4841.         flag3 = .true.
  4842.         if (flag3) write (*,*) 'flag3 is true'
  4843.         if (newflag(3)) write (*,*) 'newflag(3) is true'
  4844.         write (*,*) newflag(1),flag1
  4845.         write (*,*) newflag(2),flag2
  4846.         write (*,*) newflag(3),flag3
  4847.         write (*,*) newflag(4),flag4
  4848.         write (*,*) newflag(5),flag5
  4849.         flag1 = .true.
  4850.         if (flag1) write (*,*) 'flag1 is true'
  4851.         if (newflag(1)) write (*,*) 'newflag(1) is true'
  4852.         write (*,*) newflag(1),flag1
  4853.         write (*,*) newflag(2),flag2
  4854.         write (*,*) newflag(3),flag3
  4855.         write (*,*) newflag(4),flag4
  4856.         write (*,*) newflag(5),flag5
  4857.         end
  4858.         block data
  4859.         logical*1 newflag(5),flag1,flag2,flag3,flag4,flag5
  4860.         common /findex/ flag1,flag2,flag3,flag4,flag5
  4861.         data flag1,flag2,flag3,flag4,flag5
  4862.       +    /.false.,.false.,.false.,.false.,.false./
  4863.         end
  4864.  
  4865.     should generate the following output:
  4866.  
  4867.     flag3 is true
  4868.     newflag(3) is true
  4869.     F F
  4870.     F F
  4871.     T T
  4872.     F F
  4873.     F F
  4874.     flag1 is true
  4875.     newflag(1) is true
  4876.     T T
  4877.     F F
  4878.     T T
  4879.     F F
  4880.     F F
  4881.  
  4882.     however, the following output is printed:
  4883.  
  4884.     flag3 is true
  4885.     F F
  4886.     F F
  4887.     F T
  4888.     F F
  4889.     T F
  4890.     flag1 is true
  4891.     newflag(1) is true
  4892.     T T
  4893.     F F
  4894.     F T
  4895.     F F
  4896.     T F
  4897.  
  4898.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4899.  FORTRAN compiler. This problem was corrected in Version 4.01.
  4900.  
  4901.     This problem seems only to affect equivalence between LOGICAL*1
  4902.  items. The easiest way to work around this problem is to use LOGICAL*2
  4903.  or LOGICAL*4.
  4904.  
  4905.  
  4906.  133. NINT Functions in Expressions
  4907.  
  4908.  Product Version(s): 4.00a
  4909.  Operating System:   MS-DOS
  4910.  Flags: ENDUSER | ptr900152 bcp1775 buglist4.00a fixlist4.01
  4911.  Last Modified:  1-JUN-1988    ArticleIdent: Q23279
  4912.  
  4913.     The following program:
  4914.  
  4915.     call sub (x,y,z)
  4916.     write (*,*) '2000-240 should be 1760, is=',nint(x)-nint(y*z)
  4917.     end
  4918.     subroutine sub (x,y,z)
  4919.     x = 2000.
  4920.     y = .12
  4921.     z = 2000.
  4922.     end
  4923.  
  4924.     should produce the following message:
  4925.  
  4926.     "2000-240 should be 1760, is=1760".
  4927.  
  4928.     however, it prints as follows:
  4929.  
  4930.     "2000-240 should be 1760, is=-31067048"?
  4931.  
  4932.     This is a confirmed problem with Version 4.00a.
  4933.     This problem was corrected in Version 4.01.
  4934.  
  4935.     After computing NINT(Y*Z), the result of 240 is stored temporarily
  4936.  in the BX and CX registers. Unfortunately, the NINT function uses BX
  4937.  and CX. Therefore, after the calculation of NINT(X), the value that
  4938.  would have been subtracted from NINT(X) has been destroyed.
  4939.     You should be able to work around this problem by storing NINT(X)
  4940.  and NINT(Y*Z) in temporary integer variables and writing the temporary
  4941.  variables.
  4942.  
  4943.  
  4944.  134. Compile Time Error F1035 with $DEBUG
  4945.  
  4946.  Product Version(s): 4.00A
  4947.  Operating System:   MS-DOS
  4948.  Flags: ENDUSER | ptr900139 bcp1753 buglist4.00 fixlist4.01 fixlist4.01a
  4949.  Last Modified: 27-MAY-1988    ArticleIdent: Q23263
  4950.  
  4951.     The following program will produce error message F1035, "Expression
  4952.  is too complex":
  4953.  
  4954.  $DEBUG
  4955.          COMMON Y
  4956.        DIMENSION Y(1000),L(25)
  4957.     75 CALL DATAI(Y(L(1)),Y(L(2)),Y(L(3)),Y(L(4)),Y(L(5)),Y(L(6)),Y(L(7))
  4958.       1,Y(L(8)),Y(L(9)),Y(L(15)),Y(L(16)),Y(L(17)),Y(L(19)),Y(L(23)),Y(L(
  4959.       224)),Y(L(25)),AWELL,
  4960.       &  Y(LCSS),Y(LHSS),
  4961.       &   I0,J0,K0,IK,JK,K5,IP,JP,IQ,JQ,KQ,1,
  4962.       &   DUM1,IDUM1,ADUM1,IDUM2,IDUM3,DUM,IDUM4)
  4963.         END
  4964.  
  4965.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  4966.  FORTRAN compiler. This problem was corrected in Version 4.01.
  4967.  
  4968.     For this error to occur, the $DEBUG must be used and the array Y
  4969.  must not be in DGROUP (the default data segment). In this example, the
  4970.  error disappears if just the COMMON statement is removed, unless the
  4971.  size of Y is increased to the point at which the array is removed from
  4972.  the default data segment for exceeding the "data threshold" defined by
  4973.  the -Gt compiler option. (If omitted, this option is preset to 32767
  4974.  bytes.) Probably the easiest solution is to compile without the $DEBUG
  4975.  option.
  4976.  
  4977.  
  4978.  135. Run-Time Error M6103 with -FPa
  4979.  
  4980.  Product Version(s): 4.00a
  4981.  Operating System:   MS-DOS
  4982.  Flags: ENDUSER | ptr900146 bcp1765 buglist4.00 fixlist4.01
  4983.  Last Modified:  1-JUN-1988    ArticleIdent: Q23276
  4984.  
  4985.     The following program:
  4986.  
  4987.         x = 1234.5678
  4988.         call strngf (x,4,0)
  4989.         end
  4990.         subroutine strngf (x,np,ijust)
  4991.         character is
  4992.         real pwr10(7), pwr210(6)
  4993.         data pwr10 /1.e6,1.e5,1.e4,1.e3,1.e2,1.e1,1.e0/
  4994.         data pwr210 /1.e-1,1.e-2,1.e-3,1.e-4,1.e-5,1.e-6/
  4995.         x2 = abs(x)+(pwr210(np+1)*5.)
  4996.         rem = amod(x2,1.)
  4997.         write (*,'(a,\)') ' answer should be 5677, is='
  4998.         do 20 i=1,np
  4999.           n3 = amod((rem/pwr210(i)),10.)
  5000.           call bout (n3+48)
  5001.  20     continue
  5002.         write (*,*)
  5003.         end
  5004.         subroutine bout (ch)
  5005.         character ch
  5006.         write (*,'(a,\)') ch
  5007.         end
  5008.  
  5009.  should produce the output "answer should be 5677, is=5678". However,
  5010.  it prints the following:
  5011.  
  5012.     answer should be 5677, is=5
  5013.     run-time error M6103: MATH
  5014.     - floating-point error: divide by 0
  5015.  
  5016.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  5017.  FORTRAN compiler. It was corrected in Version 4.01. The workaround is
  5018.  to compile with either -Od or -Odct.
  5019.  
  5020.  
  5021.  136. Piping Not Supported When Using Pause Command in FORTRAN 4.x
  5022.  
  5023.  Product Version(s): 4.x
  5024.  Operating System:   MS-DOS
  5025.  Flags: ENDUSER |
  5026.  Last Modified: 19-APR-1988    ArticleIdent: Q28084
  5027.  
  5028.     Using FORTRAN Version 3.x and the Pause command, I was able to use
  5029.  DOS piping functions. However, when I recompiled under FORTRAN 4.x and
  5030.  ran the program piping in its input, I got a run-time error saying
  5031.  that the end-of-file was encountered when I hit the pause statement.
  5032.  
  5033.  Response:
  5034.     The Pause function is operationally different between FORTRAN 3.x
  5035.  and 4.x. FORTRAN 3.x allowed piping, but Pause command piping is no
  5036.  longer supported using this command in FORTRAN 4.x because of new
  5037.  functionality added to FORTRAN 4.x.
  5038.  
  5039.  
  5040.  137. How To Access the Comm Port or Printer
  5041.  
  5042.  Product Version(s): 4.X  5.0
  5043.  Operating System:   MS-DOS
  5044.  Flags: ENDUSER |
  5045.  Last Modified: 31-OCT-1989    ArticleIdent: Q28134
  5046.  
  5047.     To access the comm port or printer, simply open the device in the
  5048.  following way:
  5049.  
  5050.         OPEN(UNIT=10,FILE='COM1',STATUS='OLD')
  5051.  
  5052.      or
  5053.  
  5054.         OPEN(UNIT=9,FILE='LPT1',STATUS='OLD')
  5055.  
  5056.     One may then write to or read from them as to any other unit.
  5057.  However, they must be treated as sequential files (which is the
  5058.  default). See page 105 of the FORTRAN 4.X Language reference or
  5059.  page 63 of the FORTRAN 5.0 Reference for a description of sequential
  5060.  file access.
  5061.  
  5062.  
  5063.  138. CHARACTER Array Optimization
  5064.  
  5065.  Product Version(s): 4.00a
  5066.  Operating System:   MS-DOS
  5067.  Flags: ENDUSER | ptr900141 bcp1758 buglist4.00 fixlist4.01
  5068.  Last Modified:  1-JUN-1988    ArticleIdent: Q23342
  5069.  
  5070.     The following program:
  5071.  
  5072.             character*30 strs(10),temp
  5073.             strs(1) = 'name1'
  5074.             strs(2) = 'name2'
  5075.             strs(3) = 'name3'
  5076.             strs(4) = 'name4'
  5077.             strs(5) = 'name5'
  5078.             do 10 i =1,5
  5079.             write (*,*) 'name is '//strs(i)
  5080.     10      continue
  5081.             end
  5082.  
  5083.  should produce the following output:
  5084.  
  5085.     name is name1
  5086.     name is name2
  5087.     name is name3
  5088.     name is name4
  5089.     name is name5
  5090.  
  5091.  however, it actually prints the following:
  5092.  
  5093.     name is name5name4name3name2name1+ &
  5094.     name is name5name4name3name2name1+ &
  5095.     name is name5name4name3name2name1+ &
  5096.     name is name5name4name3name2name1+ &
  5097.     name is name5name4name3name2name1+ &
  5098.  
  5099.     This problem was corrected in Version 4.01.
  5100.  
  5101.     This problem can be worked around either by compiling with option
  5102.  -Odclt or by setting a CHARACTER variable equal to the CHARACTER
  5103.  expression and using the variable (rather than the expression) in the
  5104.  WRITE statement.
  5105.  
  5106.  
  5107.  139. Spurious F2408 Errors
  5108.  
  5109.  Product Version(s): 4.00a
  5110.  Operating System:   MS-DOS
  5111.  Flags: ENDUSER | ptr900142 bcp1748 buglist4.00
  5112.  Last Modified:  1-JUN-1988    ArticleIdent: Q23343
  5113.  
  5114.     The following program:
  5115.  
  5116.          INTEGER x(10), y(10)
  5117.          DATA x(1:10) /1/
  5118.          DATA y/10*0/
  5119.          END
  5120.  
  5121.  should produce the following errors when compiled:
  5122.  
  5123.     error F2513: X : not a variable
  5124.     error F2537: X : array subscripts missing
  5125.  
  5126.     however, it actually prints the following:
  5127.  
  5128.      error F2513: X : not a variable
  5129.      error F2537: X : array subscripts missing
  5130.      error F2408: X : DATA : too few constants to initialize item
  5131.      error F2408: Y : DATA : too few constants to initialize item
  5132.  
  5133.     This problem was corrected in Version 4.01.
  5134.     The F2408 errors were occurring as a result of two previous errors.
  5135.  This is called a "cascade" error.
  5136.  
  5137.  
  5138.  140. Code Generation Error
  5139.  
  5140.  Product Version(s): 4.00a
  5141.  Operating System:   MS-DOS
  5142.  Flags: ENDUSER | ptr900136 bcp1745 buglist4.00 fixlist4.01
  5143.  Last Modified:  1-JUN-1988    ArticleIdent: Q23344
  5144.  
  5145.     The following program:
  5146.  
  5147.          complex xx(4)
  5148.          common /elem/p(75,8)
  5149.          a = p(j,5)+1.
  5150.          b = w*p(j,4)*p(j,3)*1.e-12
  5151.          xx(2) = p(j,3)/cmplx(a,b)
  5152.          end
  5153.  
  5154.  generates the following compilation error:
  5155.  
  5156.     a:0056.for(5) : error F2124: CODE GENERATION ERROR
  5157.                     Contact Microsoft Technical Support
  5158.  
  5159.     This problem was corrected in Version 4.01.
  5160.     You can work around this problem by compiling with either the -Od
  5161.  or the -Odl option.
  5162.  
  5163.  
  5164.  141. Compiler Hung by Real Subscript
  5165.  
  5166.  Product Version(s): 4.00a
  5167.  Operating System:   MS-DOS
  5168.  Flags: ENDUSER | ptr900128 bcp1706 buglist4.00 fixlist4.01
  5169.  Last Modified:  1-JUN-1988    ArticleIdent: Q23345
  5170.  
  5171.     The following program will cause the compiler to hang:
  5172.  
  5173.          dimension int(100)
  5174.          common pjint(100)
  5175.          x = 1.0
  5176.          pjint(x) = int(min0(x,21))
  5177.          end
  5178.  
  5179.     This problem was corrected in Version 4.01.
  5180.     This program relies on two features that are not part of the ANSI
  5181.  X3.9-1978 FORTRAN standard: the use of a REAL variable as an array
  5182.  index, and the use of a REAL variable as an argument to an intrinsic
  5183.  function that is expecting only INTEGER arguments. If the $STRICT
  5184.  metacommand or -4Ys switch had been used, both uses would have been
  5185.  flagged as errors. Nevertheless, the program should not hang the
  5186.  compiler.
  5187.     The following is a workaround:
  5188.  
  5189.     1. Calculate the subscript expression for the array INT.
  5190.     2. Store it in a temporary integer variable.
  5191.     3. Use the temporary variable to index the array.
  5192.  
  5193.  
  5194.  142. Error F2350
  5195.  
  5196.  Product Version(s): 4.00a
  5197.  Operating System:   MS-DOS
  5198.  Flags: ENDUSER |
  5199.  Last Modified: 20-OCT-1988    ArticleIdent: Q23346
  5200.  
  5201.  Problem:
  5202.  
  5203.  Consider the following program:
  5204.  
  5205.         program foo
  5206.         call main
  5207.         end
  5208.  
  5209.         subroutine main
  5210.         end
  5211.  
  5212.  The Version 4.00 compiler generates error message "F2530: MAIN :
  5213.  symbol class illegal here". The Version 3.31 compiler compiles this
  5214.  without error. Is this error message consistent with the standard?
  5215.  
  5216.  Response:
  5217.  
  5218.  This is consistent with the ANSI X3.9-1978 FORTRAN standard (see Page
  5219.  14-1). Remember that the entry point "_main" is always defined for the
  5220.  main program. The language reference manual discusses this in detail
  5221.  in Section 3.8 on Page 62, explaining where "main" can and cannot be
  5222.  used.
  5223.  
  5224.  
  5225.  143. Premature EOF on Redirected READs
  5226.  
  5227.  Product Version(s): 4.00a
  5228.  Operating System:   MS-DOS
  5229.  Flags: ENDUSER | ptr900103 bcp1686 buglist4.00 fixlist4.01
  5230.  Last Modified: 16-JUN-1988    ArticleIdent: Q23349
  5231.  
  5232.     If the following program is run with the READ redirected from the
  5233.  console to a file that contains one or more CTRL-Zs at the end, you
  5234.  may receive a premature (or perhaps an immediate) end-of-file message:
  5235.  
  5236.           CHARACTER CHR
  5237.     10    CONTINUE
  5238.           READ(*,'(A)') CHR
  5239.           WRITE(*,'(1X,A)') CHR
  5240.           GOTO 10
  5241.           END
  5242.  
  5243.     The behavior may differ, depending on the length of the redirected
  5244.  file. The problem is occurring because the run time is detecting
  5245.  end-of-file when a BUFFER is read that contains a CTRL-Z, rather than
  5246.  when the CTRL-Z itself is read.
  5247.     This problem was corrected in Version 4.01.
  5248.  
  5249.  
  5250.  144. Internal READ from Substring
  5251.  
  5252.  Product Version(s): 4.00a
  5253.  Operating System:   MS-DOS
  5254.  Flags: ENDUSER | ptr900104 bcp1689 buglist4.00
  5255.  Last Modified: 20-OCT-1988    ArticleIdent: Q23350
  5256.  
  5257.  Problem:
  5258.  
  5259.  The following program
  5260.  
  5261.         character str*10
  5262.         str = '1234567890'
  5263.         call sub1 (str)
  5264.         end
  5265.         subroutine sub1(str)
  5266.         character str*(*)
  5267.         read (str(2:6),'(i5)') inum
  5268.         write (*,*) 'inum should be 23456, is=<',inum,'>'
  5269.         end
  5270.  
  5271.  should produce the following output:
  5272.  
  5273.  inum should be 23456, is=<      23456>
  5274.  
  5275.  However, it actually prints the following:
  5276.  
  5277.  inum should be 23456, is=<          0>
  5278.  
  5279.  Response:
  5280.  
  5281.  Microsoft has confirmed this to be a problem in Version 4.00. This
  5282.  problem was corrected in Version 4.01.
  5283.  
  5284.  This problem is caused by an internal WRITE to a substring of a
  5285.  CHARACTER*(*) parameter. The problem can be worked around in the
  5286.  following two ways:
  5287.  
  5288.  1. In the subroutine, declare STR to be of a fixed size instead of
  5289.     CHARACTER*(*).
  5290.  
  5291.  2. In the internal READ, use STR instead of the substring of STR.
  5292.  
  5293.  This was provided as an extra case for the developers.
  5294.  
  5295.  
  5296.  145. Internal Compiler Error: pgo2.c, Line 229
  5297.  
  5298.  Product Version(s): 4.00A
  5299.  Operating System:   MS-DOS
  5300.  Flags: ENDUSER | ptr900095 bcp1672 buglist4.00a fixlist4.01
  5301.  Last Modified:  1-JUN-1988    ArticleIdent: Q23351
  5302.  
  5303.  Problem:
  5304.     A program containing several ENTRY points, most of which have
  5305.  alternate return arguments, is giving the assertion error "Pgo2.c,
  5306.  line 229" with only the default compiler switches.
  5307.  
  5308.  Response:
  5309.     This is a known problem in Version 4.00a.
  5310.     This problem was corrected in Version 4.01.
  5311.     The program has been reduced from 1100+ to 423 lines. The assertion
  5312.  seems to occur only in conjunction with the "function too big for
  5313.  post-optimizer" message, so most likely that will occur only when
  5314.  memory size is limited (the test was run with 416K available).
  5315.  
  5316.  
  5317.  146. "Symbol Undefined" and Length of FORTRAN Variable Name
  5318.  
  5319.  Product Version(s): 4.X
  5320.  Operating System:   MS-DOS
  5321.  Flags: ENDUSER |
  5322.  Last Modified: 19-APR-1988    ArticleIdent: Q23352
  5323.  
  5324.  Problem:
  5325.     I am debugging a FORTRAN program and am finding that I
  5326.  cannot view any symbols with a name longer than six
  5327.  characters. For instance, using "? longvarname" produces
  5328.  the message "Symbol undefined" in CodeView.
  5329.  
  5330.  Response:
  5331.     Under Microsoft FORTRAN Version 4.0, only the first six
  5332.  characters of a symbol name are recognized by default. If
  5333.  you want the full name to be valid, you must use the
  5334.  $NOTRUNCATE metacommand or compile with the /4Nt switch.
  5335.  Without the metacommand or the switch, CodeView considers
  5336.  the symbol "longvarname" to be "longva". This is why you
  5337.  could not display the expression. (Had you entered
  5338.  "?longva", CodeView would have displayed the symbol
  5339.  correctly.)
  5340.  
  5341.  
  5342.  147. Internal Compiler Error: regMD.c 1.74, Line 1495
  5343.  
  5344.  Product Version(s): 4.00A
  5345.  Operating System:   MS-DOS
  5346.  Flags: ENDUSER | ptr900158 bcp1788 buglist4.00 fixlist4.01
  5347.  Last Modified:  1-JUN-1988    ArticleIdent: Q23356
  5348.  
  5349.  Problem:
  5350.     The following program:
  5351.  
  5352.        COMMON/SIG/R(100,24)
  5353.        REAL*8    R,RA1(24)
  5354.        DO 4301 K=1,24
  5355.   4301 RA1(K)= R(KA, K)
  5356.   4310 K=K+KO
  5357.        IF(K .NE. KZ) GOTO 4310
  5358.        RAD = R(KR,2)
  5359.        END
  5360.  
  5361.  produces the following error when compiled with the default options:
  5362.  
  5363.  bcp1788.for(7) : fatal error F1001: Internal Compiler Error
  5364.                  (compiler file '@(#)regMD.c:1.74', line 1495)
  5365.                  Contact Microsoft Technical Support
  5366.  
  5367.  Response:
  5368.     This is a known problem in Version 4.00.
  5369.     This problem was corrected in Version 4.01.
  5370.     You can correct the problem by compiling with the -Odclt
  5371.  switch. The array must be in COMMON for the error to
  5372.  occur.
  5373.  
  5374.  
  5375.  148. READ from Internal File Substring
  5376.  
  5377.  Product Version(s): 4.00a
  5378.  Operating System:   MS-DOS
  5379.  Flags: ENDUSER | ptr900143 bcp1760 buglist4.00 fixlist4.01
  5380.  Last Modified:  1-JUN-1988    ArticleIdent: Q23360
  5381.  
  5382.     The following program:
  5383.  
  5384.     $debug
  5385.             character*20 strc
  5386.             data itmp1,itmp2,strc /5,3,'1234567890'/
  5387.             read (strc(itmp1:itmp1+itmp2),'(f20.0)') temp
  5388.             write (*,*) 'temp should be 5678.0 and is=',temp
  5389.             end
  5390.  
  5391.  should produce the following output:
  5392.  
  5393.     temp should be 5678.0 and is=    5678.000000
  5394.  
  5395.  however, it actually prints the following:
  5396.  
  5397.     temp should be 5678.0 and is=   0.000000E+00
  5398.  
  5399.     This problem was corrected in Version 4.01.
  5400.     Two workarounds are as follows:
  5401.  
  5402.     1. Compile without $DEBUG.
  5403.     2. Store the integer expression in a variable and use it in the
  5404.  substring.
  5405.  
  5406.  
  5407.  149. FORTRAN Version 4.10 DOS, OS/2 Requirements
  5408.  
  5409.  Product Version(s): 4.10   | 4.10
  5410.  Operating System:   MS-DOS | OS/2
  5411.  Flags: ENDUSER | docerr
  5412.  Last Modified:  7-SEP-1988    ArticleIdent: Q28335
  5413.  
  5414.  Question:
  5415.  
  5416.  Page 1 of the Update (Update-1), of the FORTRAN Version 4.10 insert
  5417.  for "Microsoft FORTRAN Optimizing Compiler User's Guide" states that
  5418.  DOS Version 3.00 (or later) is required. However, the product box
  5419.  states that DOS Version 2.10 (or later) is required. Which is correct?
  5420.  
  5421.  Response:
  5422.  
  5423.  The product box is correct. The Update should state that Microsoft
  5424.  FORTRAN Version 4.10 requires DOS Version 2.10 (or later).
  5425.  
  5426.  
  5427.  150. Block Data Names in Listing
  5428.  
  5429.  Product Version(s): 4.00a
  5430.  Operating System:   MS-DOS
  5431.  Flags: ENDUSER | ptr900155 bcp1780 buglist4.00
  5432.  Last Modified:  1-JUN-1988    ArticleIdent: Q23373
  5433.  
  5434.     Garbled characters are appearing in a list file where, normally,
  5435.  the name of the routine is printed.
  5436.  
  5437.     There is no workaround for this problem. The following program
  5438.  reproduces the problem:
  5439.  
  5440.    Line#  Source Line   Microsoft FORTRAN Optimizing Compiler Version 4.00
  5441.  
  5442.        1        block data
  5443.        2        common /any/x(5)
  5444.        3        data x/1.,2.,3.,4.,5./
  5445.        4        end
  5446.        5        block data foo
  5447.        6        common /bar/ a
  5448.        7        data a /.5/
  5449.        8        end
  5450.  
  5451.  [garbage]  Local Symbols
  5452.  
  5453.  Name                      Class   Type              Size   Offset
  5454.  
  5455.  X . . . . . . . . . . . . ANY     REAL*4              20    0000
  5456.  A . . . . . . . . . . . . BAR     REAL*4               4    0000
  5457.  
  5458.  Global Symbols
  5459.  
  5460.  Name                      Class   Type              Size   Offset
  5461.  
  5462.  ANY . . . . . . . . . . . common  CHAR*20             20    0000
  5463.  BAR . . . . . . . . . . . common  CHAR*4               4    0000
  5464.  
  5465.  Code size = 0000 (0)
  5466.  Data size = 0000 (0)
  5467.  Bss size  = 0000 (0)
  5468.  
  5469.  No errors detected
  5470.  
  5471.  
  5472.  151. Internal Compiler Error: regMD.c 1.74, Line 285
  5473.  
  5474.  Product Version(s): 4.00A
  5475.  Operating System:   MS-DOS
  5476.  Flags: ENDUSER | ptr900159 bcp1794 buglist4.00 fixlist4.01
  5477.  Last Modified:  1-JUN-1988    ArticleIdent: Q23364
  5478.  
  5479.  Problem:
  5480.     The following program:
  5481.  
  5482.          character*1 dirinfo(30,10)
  5483.          integer*4 filesize
  5484.          filesize = ichar(dirinfo(29,i))*65536 +
  5485.       +             ichar(dirinfo(28,i))*256+
  5486.       +             ichar(dirinfo(27,i))
  5487.          end
  5488.  
  5489.  produces the following compilation error if compiled with option -4I2:
  5490.  
  5491.     fatal error F1001: Internal Compiler Error
  5492.     (compiler file '@(#)regMD.c:1.74', line 285)
  5493.       Contact Microsoft Technical Support
  5494.  
  5495.  Response:
  5496.     This is a known problem in Version 4.00.
  5497.     This problem was corrected in Version 4.01.
  5498.     Aside from the fact that this program will cause an assertion
  5499.  error, it will, even after the assertion error is corrected, produce
  5500.  an incorrect answer. The right-hand side of the expression is being
  5501.  evaluated in INTEGER*2 arithmetic; the conversion to the type of the
  5502.  destination variable (INTEGER*4) is done only after the evaluation is
  5503.  complete. Were this program able to run, it would produce a runtime
  5504.  error F6099 : "INTEGER overflow" if compiled with both -4I2 and -4Yb
  5505.  options. There are two ways to work around the problem, as follows:
  5506.  
  5507.     1. Do not compile with the -4I2 option.
  5508.     2. Assign the three ICHAR expressions to temporary INTEGER*4
  5509.  variables and use them to calculate FILESIZE.
  5510.  
  5511.  
  5512.  152. Edit Descriptor File Clash
  5513.  
  5514.  Product Version(s): 4.00a
  5515.  Operating System:   MS-DOS
  5516.  Flags: ENDUSER | ptr900102 bcp1684 buglist4.00
  5517.  Last Modified:  1-JUN-1988    ArticleIdent: Q23348
  5518.  
  5519.     The following program:
  5520.  
  5521.        REAL*8 D1,D2,GV
  5522.        INTEGER K1
  5523.        CHARACTER*4 IDNO(2),IDNM(4)
  5524.        OPEN(11,FILE='bcp1684a.DAT',STATUS='OLD')
  5525.        DO 1 J=1,100
  5526.        READ(11,1000,END=15) IDNO,D1,D2,GV,IDNM,K1
  5527.        WRITE(*,1000) IDNO,D1,D2,GV,IDNM,K1
  5528.      1 CONTINUE
  5529.     15   continue
  5530.          close(11)
  5531.          open(12,file='bcp1684b.dat')
  5532.        DO 2 J=1,100
  5533.        READ(12,1000,END=25,IOSTAT=IOCHCK) IDNO,D1,D2,GV,IDNM,K1
  5534.        IF(IOCHCK.NE.0) WRITE(*,1001)IOCHCK
  5535.        WRITE(*,1000) IDNO,D1,D2,GV,IDNM,K1
  5536.      2 CONTINUE
  5537.   1000 FORMAT(2X,A4,A3,11X,2F10.5,1X,F9.2,4A4,I4)
  5538.   1001 FORMAT(2X,'***IOSTAT= ',I7)
  5539.     25 STOP
  5540.        END
  5541.  
  5542.  should produce the following output:
  5543.  
  5544.    926860             49.35067-124.44583 980979.89QUALICUM           1
  5545.    940575             50.03217-125.26867 981060.64CAMPBELL RIVER     2
  5546.    940675             49.77883-126.04967 980992.53GOLD RIVER         3
  5547.    903177             49.82083-125.60000 980966.15LUPIN MOUNTAIN     4
  5548.    903277             49.88167-125.69500 980989.57FILBERG CREEK      5
  5549.    903377             49.92683-125.64300 980994.35CEDAR CREEK        6
  5550.    903477             49.73750-125.56417 980937.37MOUNT ADRIAN       7
  5551.    903577             49.85417-125.81117 980967.48ELK RIVER          8
  5552.    903677             49.96133-125.53333 980970.64GOOSENECK LAKE     9
  5553.    903777             49.67250-125.53917 980930.34PHILLIPS CREEK    10
  5554.    903877             49.84150-125.91533 980961.07CREST CREEK       11
  5555.    903977             49.98667-125.40450 981012.61ECHO LAKE         12
  5556.    904077             49.57667-125.56383 980918.94MYRA FALLS        13
  5557.    904177             49.74633-126.07050 980999.32GOLD RIVER        14
  5558.    904277             50.02167-125.36667 981030.99MCIVOR LAKE       15
  5559.    904377             49.31333-124.55333 980972.06LITTLE QUALICUM   16
  5560.    904477             49.26000-124.70833 980930.52ARROWSMITH MTN    17
  5561.    904577             49.27167-124.87167 981003.25TSAHAHEH          18
  5562.    904677             49.28500-125.02667 980980.77SPROAT LAKE       19
  5563.    904777             49.28833-125.19667 980970.51TAYLOR ARM        20
  5564.    926860             49.35067-124.44583 980979.89QUALICUM           1
  5565.    940575             50.03217-125.26867 981060.64CAMPBELL RIVER     2
  5566.    940675             49.77883-126.04967 980992.53GOLD RIVER         3
  5567.    903177             49.82083-125.60000 980966.15LUPIN MOUNTAIN     4
  5568.    903277             49.88167-125.69500 980989.57FILBERG CREEK      5
  5569.    903377             49.92683-125.64300 980994.35CEDAR CREEK        6
  5570.    903477             49.73750-125.56417 980937.37MOUNT ADRIAN       7
  5571.    903577             49.85417-125.81117 980967.48ELK RIVER          8
  5572.    903677             49.96133-125.53333 980970.64GOOSENECK LAKE     9
  5573.    903777             49.67250-125.53917 980930.34PHILLIPS CREEK    10
  5574.    903877             49.84150-125.91533 980961.07CREST CREEK       11
  5575.    903977             49.98667-125.40450 981012.61ECHO LAKE         12
  5576.    904077             49.57667-125.56383 980918.94MYRA FALLS        13
  5577.    904177             49.74633-126.07050 980999.32GOLD RIVER        14
  5578.    904277             50.02167-125.36667 981030.99MCIVOR LAKE       15
  5579.    904377             49.31333-124.55333 980972.06LITTLE QUALICUM   16
  5580.    904477             49.26000-124.70833 980930.52ARROWSMITH MTN    17
  5581.    904577             49.27167-124.87167 981003.25TSAHAHEH          18
  5582.    904677             49.28500-125.02667 980980.77SPROAT LAKE       19
  5583.    904777             49.28833-125.19667 980970.51TAYLOR ARM        20
  5584.  Stop - Program terminated.
  5585.  
  5586.  however, it actually prints the following:
  5587.  
  5588.    926860             49.35067-124.44583 980979.89QUALICUM           1
  5589.    940575             50.03217-125.26867 981060.64CAMPBELL RIVER     2
  5590.    940675             49.77883-126.04967 980992.53GOLD RIVER         3
  5591.    903177             49.82083-125.60000 980966.15LUPIN MOUNTAIN     4
  5592.    903277             49.88167-125.69500 980989.57FILBERG CREEK      5
  5593.    903377             49.92683-125.64300 980994.35CEDAR CREEK        6
  5594.    903477             49.73750-125.56417 980937.37MOUNT ADRIAN       7
  5595.    903577             49.85417-125.81117 980967.48ELK RIVER          8
  5596.    903677             49.96133-125.53333 980970.64GOOSENECK LAKE     9
  5597.    903777             49.67250-125.53917 980930.34PHILLIPS CREEK    10
  5598.    903877             49.84150-125.91533 980961.07CREST CREEK       11
  5599.    903977             49.98667-125.40450 981012.61ECHO LAKE         12
  5600.    904077             49.57667-125.56383 980918.94MYRA FALLS        13
  5601.    904177             49.74633-126.07050 980999.32GOLD RIVER        14
  5602.    904277             50.02167-125.36667 981030.99MCIVOR LAKE       15
  5603.    904377             49.31333-124.55333 980972.06LITTLE QUALICUM   16
  5604.    904477             49.26000-124.70833 980930.52ARROWSMITH MTN    17
  5605.    904577             49.27167-124.87167 981003.25TSAHAHEH          18
  5606.    904677             49.28500-125.02667 980980.77SPROAT LAKE       19
  5607.    904777             49.28833-125.19667 980970.51TAYLOR ARM        20
  5608.   ***IOSTAT=    6103
  5609.   26860                4.93507  24.44584 980970.51TAYLOR ARM        20
  5610.   ICUM                  .00000    .00000       .00                   0
  5611.    940575             50.03217-125.26867 981060.64CAMPBELL RIVER     2
  5612.    940675             49.77883-126.04967 980992.53GOLD RIVER         3
  5613.    903177             49.82083-125.60000 980966.15LUPIN MOUNTAIN     4
  5614.    903277             49.88167-125.69500 980989.57FILBERG CREEK      5
  5615.    903377             49.92683-125.64300 980994.35CEDAR CREEK        6
  5616.    903477             49.73750-125.56417 980937.37MOUNT ADRIAN       7
  5617.    903577             49.85417-125.81117 980967.48ELK RIVER          8
  5618.    903677             49.96133-125.53333 980970.64GOOSENECK LAKE     9
  5619.    903777             49.67250-125.53917 980930.34PHILLIPS CREEK    10
  5620.    903877             49.84150-125.91533 980961.07CREST CREEK       11
  5621.    903977             49.98667-125.40450 981012.61ECHO LAKE         12
  5622.    904077             49.57667-125.56383 980918.94MYRA FALLS        13
  5623.    904177             49.74633-126.07050 980999.32GOLD RIVER        14
  5624.    904277             50.02167-125.36667 981030.99MCIVOR LAKE       15
  5625.    904377             49.31333-124.55333 980972.06LITTLE QUALICUM   16
  5626.    904477             49.26000-124.70833 980930.52ARROWSMITH MTN    17
  5627.    904577             49.27167-124.87167 981003.25TSAHAHEH          18
  5628.    904677             49.28500-125.02667 980980.77SPROAT LAKE       19
  5629.    904777             49.28833-125.19667 980970.51TAYLOR ARM        20
  5630.  Stop - Program terminated.
  5631.  
  5632.     By the time the EOF is encountered on the first file, the run time
  5633.  has already "seen" a 2X edit descriptor. The 2X edit descriptor by
  5634.  itself does nothing until a repeatable edit descriptor is seen; it is
  5635.  merely "remembered". Unfortunately, it remembers even after the close
  5636.  of the file.
  5637.     This situation should arise only when EOF is encountered at the
  5638.  same time when a non-repeatable edit descriptor has been READ without
  5639.  having been followed by a repeatable. You can solve this problem by
  5640.  replacing the 2X descriptor with an I2 that READs into a dummy
  5641.  variable.
  5642.  
  5643.  
  5644.  153. Internal Compiler Error: regMD.c 1.79, Line 608
  5645.  
  5646.  Product Version(s): 4.01 4.10 | 4.10
  5647.  Operating System:   MS-DOS    | OS/2
  5648.  Flags: ENDUSER | buglist4.01 buglist4.10 fixlist5.00
  5649.  Last Modified:  6-NOV-1989    ArticleIdent: Q28340
  5650.  
  5651.  The code sample below will generate the following internal compiler
  5652.  error:
  5653.  
  5654.     REGMD.FOR
  5655.     REGMD.FOR(6) : fatal error F1001: Internal Compiler Error
  5656.                     (compiler file '@(#)regMD.c:1.79', line 608)
  5657.                     Contact Microsoft Technical Support
  5658.  
  5659.  Microsoft has confirmed this to be a problem in Versions 4.01 and
  5660.  4.10 of the FORTRAN compiler. This problem was corrected in Version
  5661.  5.00.
  5662.  
  5663.  You can work around the error by breaking up line six with a temporary
  5664.  variable, as in the following code:
  5665.  
  5666.        SUBROUTINE FOO
  5667.        IMPLICIT INTEGER*2 (A-Z)
  5668.        INTEGER*4 LA
  5669.        INTEGER*2 PUROUT,MAX,LOST
  5670.  
  5671.        TMP = MAX*PUROUT*3
  5672.        LA = LOST+TMP
  5673.        RETURN
  5674.        END
  5675.  
  5676.  The following is the code:
  5677.  
  5678.        SUBROUTINE FOO
  5679.        IMPLICIT INTEGER*2 (A-Z)
  5680.        INTEGER*4 LA
  5681.        INTEGER*2 PUROUT,MAX,LOST
  5682.  
  5683.        LA = LOST+MAX*PUROUT*3
  5684.        RETURN
  5685.        END
  5686.  
  5687.  
  5688.  154. Incorrect Error F2352
  5689.  
  5690.  Product Version(s): 4.00a
  5691.  Operating System:   MS-DOS
  5692.  Flags: ENDUSER | ptr900157 bcp1786
  5693.  Last Modified: 20-OCT-1988    ArticleIdent: Q23412
  5694.  
  5695.  Question:
  5696.  
  5697.  Why does the following program produce the following compilation
  5698.  errors?
  5699.  
  5700.         common /xx/ w(10)
  5701.         common y(5)
  5702.         foo(y,w) = y*w
  5703.         end
  5704.  
  5705.         error F2352: Y : formal argument not local variable
  5706.         error F2352: W : formal argument not local variable
  5707.  
  5708.  Response:
  5709.  
  5710.  This behavior is a correct response; the program is syntactically
  5711.  incorrect. According to the ANSI X3.9-1978 FORTRAN standard, you can
  5712.  reuse the statement function's dummy arguments as variable names and
  5713.  COMMON block names in the same program, but you cannot use them as
  5714.  array names (ANSI X3.9-1978 FORTRAN standard, Page 15-4, lines 39-44).
  5715.  
  5716.  
  5717.  155. Internal Compiler Error: sortnode.c, Line 154
  5718.  
  5719.  Product Version(s): 4.00a
  5720.  Operating System:   MS-DOS
  5721.  Flags: ENDUSER | ptr900109 bcp1697 buglist4.00
  5722.  Last Modified:  1-JUN-1988    ArticleIdent: Q23450
  5723.  
  5724.     The program below gives the assertion error message "sortnode.c,
  5725.  line 154":
  5726.  
  5727.          CHARACTER A,B,C,D,E,F,G
  5728.          CHARACTER BIGLIN*60, LSTHAF*30
  5729.          A = 'A'
  5730.          B = 'B'
  5731.          C = 'C'
  5732.          D = 'D'
  5733.          E = 'E'
  5734.          F = 'F'
  5735.          G = 'G'
  5736.          LSTHAF = '123456789012345678901234567890'
  5737.          BIGLIN = ' '//A//'   '//B//'   '//C//
  5738.       +           '   '//D//'   '//E//'   '//F//'   '//
  5739.       +           G//LSTHAF
  5740.          WRITE (*,*) 'BIGLIN=<',BIGLIN,'>'
  5741.          END
  5742.  
  5743.     The workaround for this problem is breaking up the character
  5744.  expression into smaller pieces.
  5745.  
  5746.  
  5747.  156. Null Pointer Assignment Error in PAS2.EXE
  5748.  
  5749.  Product Version(s): 3.31
  5750.  Operating System:   MS-DOS
  5751.  Flags: ENDUSER | buglist3.31
  5752.  Last Modified:  7-NOV-1988    ArticleIdent: Q23483
  5753.  
  5754.  Problem:
  5755.  
  5756.  PAS2.EXE of the compiler seems to run properly, but when it finishes
  5757.  it prints out the error message "Null Pointer Assignment."
  5758.  
  5759.  Response:
  5760.  
  5761.  This behavior indicates that there was an error during the
  5762.  execution of PAS2.EXE.
  5763.  
  5764.  Microsoft has confirmed this to be a problem related to the size of
  5765.  the compiler's stack in Version 3.31. We are researching this problem
  5766.  and will post new information as it becomes available.
  5767.  
  5768.  You should reduce the stack sizes of both FOR1.EXE and PAS2.EXE
  5769.  from 40K down to 20K using the EXEMOD.EXE utility (which is included
  5770.  with the compiler), using the following lines:
  5771.  
  5772.     exemod for1 /stack 5000
  5773.     exemod pas2 /stack 5000
  5774.  
  5775.  For more information about the EXEMOD.EXE utility, refer to the user's
  5776.  guide, Appendix A.10.1, Page 159.
  5777.  
  5778.  
  5779.  157. Use and Misuse of Format(X,\)
  5780.  
  5781.  Product Version(s): 4.00A
  5782.  Operating System:   MS-DOS
  5783.  Flags: ENDUSER |
  5784.  Last Modified:  4-MAY-1988    ArticleIdent: Q23434
  5785.  
  5786.  Question:
  5787.     I am trying to use the "\" after an "X" in a FORMAT statement. I
  5788.  tried the following using the current Version 4.00:
  5789.  
  5790.     write(*,10)
  5791.     10  format(1x,'Enter a number :',10x,\)
  5792.  
  5793.     The 10x still is being ignored in Version 4.00. Are there any plans
  5794.  to change this, or will this be a feature?
  5795.  
  5796.  Response:
  5797.     It is assumed by some that the X edit descriptor produces some
  5798.  output. However, it does not. It positions a pointer that says where
  5799.  the next character is to be (in this case) written.
  5800.     For more information on this, please see lines 4-10 on Page 13-6 of
  5801.  the "ANSI X3.9-1978 FORTRAN standard document."
  5802.     Because nothing further actually is written on this line, the
  5803.  current behavior is correct.
  5804.     If you wish to hang the cursor following the prompt, you can do so
  5805.  by inserting the required number of blanks as the last item in the
  5806.  prompt; within the CHARACTER constant.
  5807.  
  5808.  
  5809.  158. Scratch File on Units 5 and 6
  5810.  
  5811.  Product Version(s): 4.00a
  5812.  Operating System:   MS-DOS
  5813.  Flags: ENDUSER |
  5814.  Last Modified: 30-JAN-1989    ArticleIdent: Q23443
  5815.  
  5816.  Question:
  5817.  
  5818.  I am having trouble with the following program:
  5819.  
  5820.  program t
  5821.  open(5,status='scratch')
  5822.  write(5,*) 'help'
  5823.  end
  5824.  
  5825.  This program writes "help" to the screen. Is this correct
  5826.  behavior?
  5827.  
  5828.  Response:
  5829.  
  5830.  Version 4.00 does not allow any of the pre-connected units (0, 5, and
  5831.  6) to be used as scratch files. Because there are 65531 other unit
  5832.  numbers that could be used as scratch file units, this should not be
  5833.  an inconvenience.
  5834.  
  5835.  
  5836.  159. F6301 Error and Opening Scratch Files with Names
  5837.  
  5838.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  5839.  Operating System:   MS-DOS              | OS/2
  5840.  Flags: ENDUSER | docerr FORTRAN 77
  5841.  Last Modified: 26-JUL-1990    ArticleIdent: Q23465
  5842.  
  5843.  Page 253 of the "Microsoft FORTRAN Optimizing Compiler Language
  5844.  Reference" for versions 4.00, 4.01, and 4.10 and Page 206 of the
  5845.  "Microsoft FORTRAN Reference" for version 5.00 contain a documentation
  5846.  error that states a named file may be opened with STATUS='SCRATCH'.
  5847.  
  5848.  This is contrary to Page 12-19, lines 18 and 19, of the "American
  5849.  National Standard (ANSI) Programming Language FORTRAN" guide, which
  5850.  state "SCRATCH must not be specified with a named file."
  5851.  
  5852.  The compiler correctly generates the following run-time error:
  5853.  
  5854.     F6301 : SCRATCH illegal for named file
  5855.  
  5856.  The following OPEN statement generates the run-time error "F6301:
  5857.  SCRATCH illegal for named file":
  5858.  
  5859.     OPEN(6,FILE='JUNK',STATUS='SCRATCH')
  5860.  
  5861.  The "American National Standard (ANSI) Programming Language FORTRAN"
  5862.  guide states that "SCRATCH must not be specified with a named file."
  5863.  It may seem redundant to have a STATUS "SCRATCH" when the following
  5864.  two statements perform the same function:
  5865.  
  5866.     OPEN (1)
  5867.     OPEN (1,STATUS='SCRATCH')
  5868.  
  5869.  However, specifying"SCRATCH" for a named file provides documentation
  5870.  that the file will be deleted when the program finishes.
  5871.  
  5872.  
  5873.  160. BACKSPACE Versus Blocksize
  5874.  
  5875.  Product Version(s): 4.00A
  5876.  Operating System:   MS-DOS
  5877.  Flags: ENDUSER | bcp1850 buglist4.00
  5878.  Last Modified: 26-MAY-1988    ArticleIdent: Q23538
  5879.  
  5880.  Problem:
  5881.     The following program:
  5882.  
  5883.          dimension x(3000),y(3000),z(3000)
  5884.          ibl = 32256
  5885.          open (1,file='temp.dat')
  5886.          do 100 i=1,3000
  5887.            x(i) = i+10000
  5888.  100     continue
  5889.          write (1,'(3000f6.0)') x
  5890.          do 200 i=1,3000
  5891.            x(i) = i+20000
  5892.  200     continue
  5893.          write (1,'(3000f6.0)') x
  5894.          close (1)
  5895.          open (1,file='temp.dat',blocksize=ibl)
  5896.          read (1,'(3000f6.0)') y
  5897.          backspace 1
  5898.          read (1,'(3000f6.0)') y
  5899.          read (1,'(3000f6.0)') z
  5900.          backspace 1
  5901.          read (1,'(3000f6.0)') z
  5902.          write (*,'(1x,a,10f7.0)') 'y=',(y(i),i=1,5),(y(i),i=2996,3000)
  5903.          write (*,'(1x,a,10f7.0)') 'z=',(z(i),i=1,5),(z(i),i=2996,3000)
  5904.          close (1,status='delete')
  5905.          end
  5906.  
  5907.  should produce the following output:
  5908.  
  5909.  y= 10001. 10002. 10003. 10004. 10005. 12996. 12997. 12998. 12999. 13000.
  5910.  z= 20001. 20002. 20003. 20004. 20005. 22996. 22997. 22998. 22999. 23000.
  5911.  
  5912.     However, it actually prints the following:
  5913.  
  5914.     run-time error F6501: BACKSPACE(temp.dat)
  5915.     - end of file encountered
  5916.  
  5917.  Response:
  5918.     This is a known problem in Version 4.00.
  5919.     There is an error in the run time that causes incorrect positioning
  5920.  when a BACKSPACE is performed on a file whose BLOCKSIZE is greater
  5921.  than 16384 bytes (e.g. 16896 to 32256 bytes). Since the problem will
  5922.  only occur when a BLOCKSIZE greater than 16384 is used, those programs
  5923.  that also use BACKSPACE should use a BLOCKSIZE of 512 to 16384 bytes.
  5924.  
  5925.  
  5926.  161. Subtracting a Complex*8 from a Real Constant
  5927.  
  5928.  Product Version(s): 4.00
  5929.  Operating System:   MS-DOS
  5930.  Flags: ENDUSER | buglist4.00 fixlist4.01
  5931.  Last Modified: 26-MAY-1988    ArticleIdent: Q23581
  5932.  
  5933.  Problem:
  5934.     The following program should produce the output
  5935.  "(5.000000E-01,-5.000000E-01)"; however, the program instead produces
  5936.  the output "(5.000000E-01,5.000000E-01)":
  5937.  
  5938.     COMPLEX*8 A,B
  5939.        A=(0.5,0.5)
  5940.        B=1.0 - A
  5941.        WRITE(*,*)B
  5942.  
  5943.  Response:
  5944.     This is a known problem in Version 4.00.
  5945.     This problem was corrected in FORTRAN Version 4.01.
  5946.     If A and B are COMPLEX*16, the calculation is correct.
  5947.  
  5948.  
  5949.  162. Internal Compiler Error: regMD.c 1.74, Line 285
  5950.  
  5951.  Product Version(s): 4.00
  5952.  Operating System:   MS-DOS
  5953.  Flags: ENDUSER | buglist4.00 fixlist4.01
  5954.  Last Modified:  1-JUN-1988    ArticleIdent: Q23587
  5955.  
  5956.  Problem:
  5957.     The following program gives the assertion error "regMD.c:1.74, line
  5958.  285" when it is compiled with both -FPa and -Od:
  5959.  
  5960.     SUBROUTINE VLNGET(XMIN,XMAX)
  5961.     DIMENSION XMIN(1),XMAX(1)
  5962.     NLI = NINT(XMAX(II)) - NINT(XMIN(II)) + 1
  5963.     END
  5964.  
  5965.  Response:
  5966.     This is a known problem in Version 4.00 of the FORTRAN compiler.
  5967.  The problem was corrected in Version 4.01.
  5968.     The workaround is to avoid the -FPa and -Od option combination.
  5969.  
  5970.  
  5971.  163. F2124 - Code Generation Error with Complex Numbers
  5972.  
  5973.  Product Version(s): 4.00
  5974.  Operating System:   MS-DOS
  5975.  Flags: ENDUSER | buglist4.00 fixlist5.0
  5976.  Last Modified: 14-JUL-1989    ArticleIdent: Q23586
  5977.  
  5978.     The compiler generates error F2124, "code generation error" for the
  5979.  following code:
  5980.  
  5981.     COMPLEX A,B,C
  5982.     D=REAL(CONJG(C)*A*B)
  5983.     END
  5984.  
  5985.     This is a known problem in Version 4.00.
  5986.     If you add the complex variable temp and simplify the expression,
  5987.  as in the following example, then the error is corrected:
  5988.  
  5989.     temp=conjg(c)
  5990.     d=real(temp*a*b)
  5991.  
  5992.     This is similar to an earlier assertion error (mactab.c:1.30,
  5993.  line 647) caused by the following program:
  5994.  
  5995.     complex*16 z1,z2,z3
  5996.     z1=z1*dconjg(z2) *z3
  5997.     end
  5998.  
  5999.     This problem had basically the same workaround, but concerned only
  6000.  COMPLEX*16. Changing the optimization has no effect.
  6001.  
  6002.  
  6003.  164. Internal Compiler Error: regMD.c 1.74, Line 1267
  6004.  
  6005.  Product Version(s): 4.00
  6006.  Operating System:   MS-DOS
  6007.  Flags: ENDUSER | buglist4.00
  6008.  Last Modified: 26-MAY-1988    ArticleIdent: Q23588
  6009.  
  6010.  Problem:
  6011.     The following code generates the regMD.c:1.74, line 1267 error
  6012.  message:
  6013.  
  6014.     SUBROUTINE BIAS(IAE)
  6015.     CHARACTER*1 BUF6(512)
  6016.     DIMENSION IBIAS(64,2)
  6017.     BUF6(1) = CHAR(IBIAS(L,IAE))
  6018.     END
  6019.  
  6020.  Response:
  6021.     This is a known problem in Version 4.00.
  6022.     If you assign IAE to a local variable, the error is corrected.
  6023.     The pattern here seems to be a two-dimensional array reference
  6024.  inside a function (a one-dimensional pattern will not work), where one
  6025.  of the array dimensions is a local variable and the other is an
  6026.  argument.
  6027.  
  6028.  
  6029.  165. Compile Time Error F2215
  6030.  
  6031.  Product Version(s): 4.00
  6032.  Operating System:   MS-DOS
  6033.  Flags: ENDUSER | buglist4.00 fixlist4.01
  6034.  Last Modified: 26-MAY-1988    ArticleIdent: Q23582
  6035.  
  6036.  Problem:
  6037.     The following program generates an incorrect F2215 error
  6038.  ("character lengths differ"):
  6039.  
  6040.          SUBROUTINE PAGE
  6041.          IMPLICIT CHARACTER*1 (A-H,J-Z)
  6042.          ENTRY PAGOUT
  6043.          END
  6044.  
  6045.  Response:
  6046.     Microsoft confirmed this to be a problem in Version 4.00 of the
  6047.  FORTRAN compiler. The problem was corrected in Version 4.01.
  6048.     FORTRAN Version 4.00 issues an error that is only appropriate for a
  6049.  function since subroutines have no associated type.
  6050.     The workaround is to avoid using the IMPLICIT CHARACTER statement,
  6051.  using explicit type statements instead.
  6052.  
  6053.  
  6054.  166. Problem with Expressions as Arguments to WRITE
  6055.  
  6056.  Product Version(s): 4.00
  6057.  Operating System:   MS-DOS
  6058.  Flags: ENDUSER | buglist4.00 fixlist4.01
  6059.  Last Modified:  1-JUN-1988    ArticleIdent: Q23584
  6060.  
  6061.     The following program will produce a code generation error:
  6062.  
  6063.             real bs(3,3),br(3,3),ps(3,3),psp(3),bsp(3),bso(3),rp(3),ro(3)
  6064.                WRITE(6,350)
  6065.          +  aguse(I,J)/customers(J),
  6066.          x  agg(bs(I,J),1.0)+AGG(BR(I,J),1.0),
  6067.          +  AGG(BR(I,J)-PS(I,J),1.0),
  6068.          X  AGG(BS(I,J)+BR(I,J)-PS(I,J),1.0)
  6069.     350    FORMAT(3(1X,A22,F9.1,7F8.2,3X,F8.2))
  6070.             end
  6071.  
  6072.     Microsoft confirmed this to be a problem in Version 4.00 of the
  6073.  FORTRAN compiler. The problem was corrected in Version 4.01.
  6074.     The workaround is to store the expressions in temporary variables
  6075.  and WRITE those temporary variables.
  6076.  
  6077.  
  6078.  167. Loop Optimization Problems
  6079.  
  6080.  Product Version(s): 4.00
  6081.  Operating System:   MS-DOS
  6082.  Flags: ENDUSER | buglist4.00 fixlist4.01
  6083.  Last Modified:  1-JUN-1988    ArticleIdent: Q23585
  6084.  
  6085.     If the following code is compiled with /Odclt or the default, the
  6086.  program does not work properly:
  6087.  
  6088.     $STORAGE:2
  6089.            DO 100 I=1,2
  6090.            J=0
  6091.     50     J=J+1
  6092.            IF(J .GT. 2) GOTO 100
  6093.            WRITE(*,*) 'I,J=',I,J
  6094.            GOTO 50
  6095.     100    CONTINUE
  6096.            END
  6097.  
  6098.     Microsoft confirmed this to be a problem in Version 4.00 of the
  6099.  FORTRAN compiler. This problem was corrected in Version 4.01.
  6100.     If you remove $STORAGE:2, if you compile with /Od (disables
  6101.  optimization), or /Odct, the correct code is generated.
  6102.  
  6103.  
  6104.  168. Error F2317 - Using Equivalence
  6105.  
  6106.  Product Version(s): 4.00
  6107.  Operating System:   MS-DOS
  6108.  Flags: ENDUSER | buglist4.00
  6109.  Last Modified:  1-JUN-1988    ArticleIdent: Q23583
  6110.  
  6111.     Placing real numbers in a common block with an array of CHARACTER*1
  6112.  generates the message "error F2317" and the following example code:
  6113.  
  6114.     REAL*8 EMPEPR, EMPSPR
  6115.     CHARACTER*1 EMPBUF(2091)
  6116.     COMMON /TEST/ EMPEPR, EMPSPR
  6117.     EQUIVALENCE(EMPEPR,EMPBUF(2:9))
  6118.     EQUIVALENCE(EMPSPR,EMPBUF(10:17))
  6119.  
  6120.     There are two problems in the code. They are as follows:
  6121.  
  6122.     1. Because EMPBUF is a CHARACTER*1 array, you cannot expect
  6123.  anything substantial when attempting to extract any substring (except,
  6124.  of course, (1:1)) from a single character variable or array element.
  6125.  In this case, the compiler apparently ignores the substring reference.
  6126.  This means that both variables in the common block are EQUIVALENCEd to
  6127.  the same location, EMPBUF(1). The solution is to change the type of
  6128.  EMPBUF to CHARACTER*2091.
  6129.     2. The other problem arises if the first is solved. The compiler
  6130.  must align numeric variables on even-byte boundaries and the
  6131.  EQUIVALENCE attempts to force it to an odd location. Changing EMPBUF
  6132.  to CHARACTER*2091 and the substrings to (1:8) and (9:16) allows the
  6133.  program to compile without error.
  6134.  
  6135.  
  6136.  169. Internal Compiler Error: p2symtab.c 1.84, Line 918
  6137.  
  6138.  Product Version(s): 4.00
  6139.  Operating System:   MS-DOS
  6140.  Flags: ENDUSER | buglist4.00 fixlist4.01
  6141.  Last Modified: 16-JUN-1988    ArticleIdent: Q23636
  6142.  
  6143.     The following program generates the assertion error
  6144.  "p2symtab.c:1.84, line 918":
  6145.  
  6146.       program basmap
  6147.       character*16 basmap(3)
  6148.       data basmap/ '\EXCLAND.pix\   ','\INCLAND.pix\    ',
  6149.     1  '\WATLAND.pix\   '/
  6150.       call gwrite(basmap(mask))
  6151.  
  6152.     The compiler is not producing an error when the program name is
  6153.  used as an array. This is a violation of the standard; "basmap" cannot
  6154.  be a name of a subroutine, function, or COMMON block in the same
  6155.  source file. Furthermore, it cannot be the same as any local name in
  6156.  the main program (see Ref. ANSI X3.9-1978, Page 14-1).
  6157.     The workaround is to change the program name or to delete the
  6158.  program statement.
  6159.  
  6160.  
  6161.  170. Running Out of Heap Size
  6162.  
  6163.  Product Version(s): 3.31
  6164.  Operating System:   MS-DOS
  6165.  Flags: ENDUSER |
  6166.  Last Modified:  9-MAR-1988    ArticleIdent: Q23691
  6167.  
  6168.  Problem:
  6169.     FORTRAN Version 3.31 is generating the error "? error :
  6170.  out of memory" at compile time.
  6171.  
  6172.  Response:
  6173.     Version 3.31's compiler stack size has increased to 40K,
  6174.  which is too large. The compiler is running out of heap
  6175.  size. For Version 3.31, the following will get around this
  6176.  problem:
  6177.  
  6178.     1. Decrease the size of the compiler stack for F1.EXE to
  6179.  20K or 30K using EXEMOD.
  6180.     2. The program may be too large; break it down into
  6181.  several modules.
  6182.  
  6183.  
  6184.  171. Determining Size of Code and Data
  6185.  
  6186.  Product Version(s): 4.00
  6187.  Operating System:   MS-DOS
  6188.  Flags: ENDUSER |
  6189.  Last Modified:  3-DEC-1987    ArticleIdent: Q23683
  6190.  
  6191.  Question:
  6192.     How do I determine the size of the code and data
  6193.  segments in each module?
  6194.  
  6195.  Response:
  6196.     If you specify the /Fs option to generate a listing
  6197.  (.LST file), the sizes of the code and data appear at the
  6198.  bottom.
  6199.  
  6200.  
  6201.  172. Namelist Support in FORTRAN
  6202.  
  6203.  Product Version(s): 3.x 4.00 4.01 4.10 5.00
  6204.  Operating System:   MS-DOS | 4.10 5.00
  6205.  Flags: ENDUSER |
  6206.  Last Modified: 18-OCT-1989    ArticleIdent: Q23696
  6207.  
  6208.  Question:
  6209.     Does FORTRAN Version 4.10 (and prior versions) support namelist?
  6210.  
  6211.  Response:
  6212.     No; namelist is an I/O statement that is an extension beyond the
  6213.  FORTRAN-77 Standard.
  6214.  
  6215.  Note: NAMELIST support was added with FORTRAN 5.0.
  6216.  
  6217.  
  6218.  173. How to Get Date and Time from FORTRAN
  6219.  
  6220.  Product Version(s): 3.20 3.30 3.31 4.00 4.01 4.10 | 4.10
  6221.  Operating System:   MS-DOS  | OS/2
  6222.  Flags: ENDUSER |
  6223.  Last Modified:  6-JAN-1989    ArticleIdent: Q23682
  6224.  
  6225.  Problem:
  6226.     What do I need to do in order to get FORTRAN to tell me
  6227.  the system date and time?
  6228.  
  6229.  Response:
  6230.     In Version 4.00, you may use the procedures GETTIM and
  6231.  GETDAT to get the time and the date, respectively. In
  6232.  FORTRAN Versions 3.3 and 3.2, use DATTIM.FOR as an example
  6233.  of how to get the date and time via a Pascal interface.
  6234.  
  6235.  
  6236.  174. Unresolved External __FHceadds in FORTRAN 4.10
  6237.  
  6238.  Product Version(s): 4.10   | 4.10
  6239.  Operating System:   MS-DOS | OS/2
  6240.  Flags: ENDUSER | buglist4.10 fixlist5.00
  6241.  Last Modified: 25-FEB-1991    ArticleIdent: Q28436
  6242.  
  6243.  When I compile with the /Od option and link the following program with
  6244.  FORTRAN Version 4.10, I get the following error:
  6245.  
  6246.      Link : error 2029: Unresolved externals:  __FHceadds
  6247.  
  6248.  The program is as follows:
  6249.  
  6250.         DIMENSION D(8192)
  6251.         COMPLEX Y
  6252.  120    D(NMX-N)=(RN/Y)-(1./(D(NMX-N+1)+RN/Y))
  6253.         END
  6254.  
  6255.  The program will run, but it stops with a Floating Point Error.
  6256.  
  6257.  Response:
  6258.  
  6259.  The main problem is the mixed data types in the expression. If the
  6260.  COMPLEX variable Y is explicitly converted to REAL using the FLOAT
  6261.  type conversion intrinsic function then the program compiles and
  6262.  links.
  6263.  
  6264.  Another aspect of this problem is the size of the array. If it is small
  6265.  enough (less than 32K) to stay in dgroup, then it compiles properly.
  6266.  
  6267.  A less useful workaround is to compile with /Odclt, or to decrease
  6268.  the size of the array. If you are trying to use CodeView, compile with the
  6269.  switches /Zi /Odclt.
  6270.  
  6271.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  6272.  FORTRAN compiler. This problem was corrected in Version 5.00.
  6273.  
  6274.  
  6275.  175. Creating One Megabyte of Code and Data
  6276.  
  6277.  Product Version(s): 3.20 3.30 3.31 4.00
  6278.  Operating System:   MS-DOS
  6279.  Flags: ENDUSER |
  6280.  Last Modified: 20-APR-1988    ArticleIdent: Q23694
  6281.  
  6282.  Question:
  6283.     The product specifications state that I can create one megabyte of
  6284.  code and data. How can I accomplish this?
  6285.  
  6286.  Response:
  6287.     Because DOS limits the size of code and data segments to a maximum
  6288.  of 640K, you must use the Overlay Linker to overlay code. It would
  6289.  also save memory to read data from files rather than to store it all
  6290.  in RAM.
  6291.  
  6292.  
  6293.  176. Internal Compiler Error: ctypes.c 1.80, Line 1594
  6294.  
  6295.  Product Version(s): 4.00
  6296.  Operating System:   MS-DOS
  6297.  Flags: ENDUSER | buglist4.00 fixlist4.01
  6298.  Last Modified:  1-JUN-1988    ArticleIdent: Q23638
  6299.  
  6300.  Problem:
  6301.     An internal compiler error "compiler file '@(#)ctypes.c:1.80', line
  6302.  1594" is generated by the following file:
  6303.  
  6304.  $debug
  6305.          subroutine test
  6306.          character*20    c
  6307.          i =1
  6308.          j=ichar(c(i:i))
  6309.          return
  6310.          end
  6311.  
  6312.     However, if you remove $debug, the program compiles without errors.
  6313.  
  6314.  Response:
  6315.     This is a known problem in Version 4.00 of the FORTRAN compiler.
  6316.  The problem was corrected in Version 4.01.
  6317.  
  6318.  
  6319.  177. Internal Compiler Error: regMD.c 1.74, Line 1267
  6320.  
  6321.  Product Version(s): 4.00
  6322.  Operating System:   MS-DOS
  6323.  Flags: ENDUSER | buglist4.00
  6324.  Last Modified:  1-JUN-1988    ArticleIdent: Q23632
  6325.  
  6326.  Problem:
  6327.     The following code produces the regMD.c:1.74, line 1267 error:
  6328.  
  6329.     CHARACTER MATRIX(256,1)
  6330.     MATRIX(I,J) = ' '
  6331.     END
  6332.  
  6333.  Response:
  6334.     This is a known problem in Version 4.00.
  6335.     This is an extremely specific problem. The following conditions all
  6336.  must be true for failure:
  6337.  
  6338.     1. It must be a Character array.
  6339.     2. It must be two-dimensional (more than two dimensions were not
  6340.  examined).
  6341.     3. The first dimension must be exactly 256.
  6342.  
  6343.     This example does seem different than the previous code which
  6344.  produced this assertion: in this case, both dimensions are local vars.
  6345.  The previous code, in which the array reference consisted of a local
  6346.  var and a parameter, was as follows:
  6347.  
  6348.     SUBROUTINE BIAS(IAE)
  6349.     CHARACTER*1 BUF6(512)
  6350.     DIMENSION IBIAS(64,2)
  6351.     BUF6(1) = CHAR(IBIAS(L,IAE))
  6352.     END
  6353.  
  6354.  
  6355.  178. "File Access Error in File PASIBF.OID" Error 1004
  6356.  
  6357.  Product Version(s): 3.20 3.30 3.31 4.00
  6358.  Operating System:   MS-DOS
  6359.  Flags: ENDUSER |
  6360.  Last Modified: 16-DEC-1987    ArticleIdent: Q23695
  6361.  
  6362.  Question:
  6363.     Why does pass three of the FORTRAN compiler generate the
  6364.  error message "File access error in file PASIBF.OID", error
  6365.  1004?
  6366.  
  6367.  Response:
  6368.     This error occurs because PASIBF.OID was never
  6369.  generated. In pass one, it is necessary to specify that you
  6370.  desire to make a .COD (combined source object) file. This
  6371.  is accomplished in Version 4.00 by using the /Fc switch.
  6372.  When pass three is implemented, it searches for the
  6373.  temporary file PASIBF.OID, which is generated only if you
  6374.  specify in pass one that you want a .COD file.
  6375.  
  6376.  
  6377.  179. P2 Assertion Error with -Gt
  6378.  
  6379.  Product Version(s): 4.00
  6380.  Operating System:   MS-DOS
  6381.  Flags: ENDUSER | buglist4.00
  6382.  Last Modified:  1-JUN-1988    ArticleIdent: Q23639
  6383.  
  6384.     The following program causes a P2 assertion error only if compiled
  6385.  with -Gt:
  6386.  
  6387.      CHARACTER*5 ARROW2(2)
  6388.      INTEGER DIF2C(2600),DIF2OC(2),ZIFFHL(2),ZIFFLH(2),
  6389.     *COUNT(2),CHG1(5)
  6390.      INTEGER*1 KR2(2),PH2(2),PL2(2),WK2(2),YR2(2),QH2(2),QL2(2)
  6391.      WRITE(8,*)
  6392.     +COUNT(J),WK2(J),YR2(J),ARROW2(J),
  6393.     *CHG1(N21),CHG1(N22),CHG1(N23),CHG1(N24),CHG1(N25),CHG1(N26),
  6394.     * CHG1(N27),CHG1(N28),PH2(J),PL2(J),QH2(J),QL2(J),KR2(J),
  6395.     * DIF2C(J),DIF2OC(J),ZIFFHL(J),ZIFFLH(J)
  6396.      END
  6397.  
  6398.     There is no workaround for this problem.
  6399.     Microsoft is researching this problem and will post new information
  6400.  as it becomes available.
  6401.  
  6402.  
  6403.  180. Null Pointer Assignment Error at Compile Time with FORTRAN 4.0
  6404.  
  6405.  Product Version(s): 4.00
  6406.  Operating System:   MS-DOS
  6407.  Flags: ENDUSER | buglist4.00 fixlist4.01
  6408.  Last Modified: 24-JUL-1990    ArticleIdent: Q23635
  6409.  
  6410.  Problem:
  6411.  
  6412.  The FORTRAN Version 4.00 Compiler generates the message "error 2001:
  6413.  Null pointer assignment" at compile time for the following program:
  6414.  
  6415.         character*64 chrfunc
  6416.         write(*,*)chrfunc()
  6417.         end
  6418.  
  6419.  Response:
  6420.  
  6421.  Microsoft has confirmed this to be a problem in Version 4.00 of the
  6422.  FORTRAN compiler. This problem was corrected in Version 4.01.
  6423.  
  6424.  The error 2001 comes from the first pass of the compiler. The error
  6425.  may be related to the presence of a null argument in the function
  6426.  argument list; adding the chrfunc function to return a character
  6427.  string gives back blanks. The problem is not affected by optimization,
  6428.  and apparently only affects character type.
  6429.  
  6430.  
  6431.  181. Internal Compiler Error: exphelp.c 1.55, Line 1102
  6432.  
  6433.  Product Version(s): 4.00
  6434.  Operating System:   MS-DOS
  6435.  Flags: ENDUSER | buglist4.00 fixlist4.01
  6436.  Last Modified:  1-JUN-1988    ArticleIdent: Q23634
  6437.  
  6438.  Problem:
  6439.     The following program gives the assertion error "exphelp.c:1.55,
  6440.  line 1102" if compiled with -Od or -Odl (but not -Odct):
  6441.  
  6442.          REAL*8 EISKEW(6,3), BISKEW(3,6)
  6443.          COMMON /SKEW/   EISKEW
  6444.          EISKEW(I,J) = BISKEW(J,I)
  6445.          END
  6446.  
  6447.  Response:
  6448.     This is a known problem in Version 4.00 of the FORTRAN compiler.
  6449.  The problem was corrected in Version 4.01.
  6450.     The apparent reason for the failure is the assignment of a real*8
  6451.  array element that is not in COMMON to a real*8 array element that is
  6452.  in COMMON.
  6453.     The workaround is to compile -Odct or default.
  6454.  
  6455.  
  6456.  182. Compiler Error Message omf_ms.c:1.108, Line1078
  6457.  
  6458.  Product Version(s): 4.00
  6459.  Operating System:   MS-DOS
  6460.  Flags: ENDUSER | buglist4.00
  6461.  Last Modified: 20-OCT-1988    ArticleIdent: Q23633
  6462.  
  6463.  Problem:
  6464.  
  6465.  The following code generates the omf_ms.c:1.108, line 1078 error
  6466.  message:
  6467.  
  6468.         DIMENSION ALS(10085)
  6469.         DIMENSION D1(2017)
  6470.         COMMON /LB1/ V(36,32), VHI
  6471.         EQUIVALENCE(V(1,1),ALS(1))
  6472.         EQUIVALENCE(ALS(1),D1(1))
  6473.         WRITE(6,210) VHI
  6474.    210  FORMAT(/1H,'POTENT. DIST.  VC=',F8.5)
  6475.         END
  6476.  
  6477.  Response:
  6478.  
  6479.  The problem is corrected if you do one of the following:
  6480.  
  6481.  1. Take V out of COMMON.
  6482.  
  6483.  2. Do not write VHI.
  6484.  
  6485.  3. Leave out the second EQUIVALENCE statement.
  6486.  
  6487.  4. Change the second EQUIVALENCE statement to
  6488.     "EQUIVALENCE(v(1,1),D1(1))".
  6489.  
  6490.  5. Combine the two EQUIVALENCEs into one, such as
  6491.     "EQUIVALENCE(V(1,1),ALS(1),D1(1))".
  6492.  
  6493.  
  6494.  183. Error F1039
  6495.  
  6496.  Product Version(s): 4.00
  6497.  Operating System:   MS-DOS
  6498.  Flags: ENDUSER |
  6499.  Last Modified:  8-DEC-1987    ArticleIdent: Q23692
  6500.  
  6501.  Question:
  6502.     What does it mean when I get error F1039: "unrecoverable
  6503.  heap overflow in Pass3"?
  6504.  
  6505.  Response:
  6506.     This error indicates that the compiler ran out of
  6507.  dynamic memory space. The program may be too large or a
  6508.  subroutine may have too many symbols (thus it is running
  6509.  out of symbol space). This also will happen if your program
  6510.  is large and you are compiling with /Zi and /Od options.
  6511.     Currently, you can get around this problem by doing the
  6512.  following:
  6513.  
  6514.     1. Do not use the /Zi or /Od options with the Fl
  6515.  command.
  6516.     2. Break down the program into various source codes.
  6517.  
  6518.  
  6519.  184. Internal Compiler Error: loop.c 1.87, Line 836
  6520.  
  6521.  Product Version(s): 4.00
  6522.  Operating System:   MS-DOS
  6523.  Flags: ENDUSER | buglist4.00
  6524.  Last Modified:  1-JUN-1988    ArticleIdent: Q23637
  6525.  
  6526.     The following code generates the loop.c:1.87, line 836 internal
  6527.  compiler error message:
  6528.  
  6529.     11      continue
  6530.             if (k1 .ne. k2) goto 20
  6531.             if (k .eq. 0) return
  6532.             if (k .ne. 2) goto 11
  6533.     20      continue
  6534.             end
  6535.  
  6536.     The error message occurs on the last line; if you compile with /Od
  6537.  or /Odct, the error no longer appears.
  6538.  
  6539.     This problem seems to be very specific; any attempt to rearrange
  6540.  the order of the three IF statements allows the program to compile.
  6541.  The pattern seems to be as follows:
  6542.  
  6543.     label-1
  6544.     IF jumping to label-2
  6545.     IF jumping to label-3
  6546.     IF jumping to label-1
  6547.     label-2
  6548.     label-3
  6549.  
  6550.     Please note that the program also will fail if the RETURN is
  6551.  replaced with a GOTO 30 and a 30 Continue is added after 20 Continue.
  6552.  A workaround is to rearrange the order of the IF statements.
  6553.     This is a known problem in Version 4.00.
  6554.     Microsoft is researching this problem and will post new information
  6555.  as it becomes available.
  6556.  
  6557.  
  6558.  185. Fixup Overflow L2002
  6559.  
  6560.  Product Version(s): 3.x 4.00 4.01 4.10 | 4.10
  6561.  Operating System:   MS-DOS             | OS/2
  6562.  Flags: ENDUSER |
  6563.  Last Modified: 21-JUL-1988    ArticleIdent: Q23663
  6564.  
  6565.     When you link your program, you may get the error message "L2002 fixup
  6566.  overflow." The following conditions can cause this error:
  6567.  
  6568.     1. A group is larger than 64K.
  6569.     2. The program contains an intersegment short jump or intersegment
  6570.        short call.
  6571.     3. The name of a data item in the program conflicts with that of a
  6572.        library subroutine included in the link.
  6573.  
  6574.     The most common of the three conditions is the first, i.e., one of
  6575.  the segments is over 64K; generally, it is the default data segment.
  6576.     To work around this problem, move data outside the default data
  6577.  segment. With Versions 4.x, use the /Gt compiler switch.
  6578.     This information is documented beginning on Page 232 of the
  6579.  "Microsoft FORTRAN Optimizing Compiler User's Guide" Versions 4.00,
  6580.  4.01, and 4.10. See the index for more references.
  6581.     For Versions 3.x, place data into named common blocks to move the
  6582.  data out of the default data segment.
  6583.  
  6584.  
  6585.  186. Getting Around Data Segment Limit
  6586.  
  6587.  Product Version(s): 3.2 3.3x 4.x
  6588.  Operating System:   MS-DOS
  6589.  Flags: ENDUSER |
  6590.  Last Modified:  9-MAR-1988    ArticleIdent: Q23775
  6591.  
  6592.  Question:
  6593.     How do I get around the 64K data segment limit?
  6594.  
  6595.  Response:
  6596.     You can move arrays and local variables to a named
  6597.  common. You need to allocate data outside of the default
  6598.  data segment. When using a large memory model in Version
  6599.  4.0, use the /Gt option with the Fl command to place into a
  6600.  new segment those data items greater than or equal to the
  6601.  number of bytes specified.
  6602.     FORTRAN Version 4.00 and above can also use the HUGE
  6603.  memory model to allow individual data items (such as arrays
  6604.  and common blocks) to exceed 64K (using compiler option
  6605.  /AH). The HUGE keyword may also be used on individual data
  6606.  items that exceed 64K in LARGE model.
  6607.  
  6608.  
  6609.  187. Stack Overflow Error
  6610.  
  6611.  Product Version(s): 3.20 3.30 3.31 4.00
  6612.  Operating System:   MS-DOS
  6613.  Flags: ENDUSER |
  6614.  Last Modified: 16-DEC-1987    ArticleIdent: Q23776
  6615.  
  6616.  Question:
  6617.     My program is failing with a stack overflow error. How
  6618.  can I get around it?
  6619.  
  6620.  Response:
  6621.     The program requires more stack than is available. You
  6622.  need to increase the size of the stack by using EXEMOD or
  6623.  the /STACK option at link time.
  6624.     If there is not enough space in the default data segment
  6625.  for the stack to grow, users of Versions 3.2, 3.3, and 3.31
  6626.  should do the following:
  6627.  
  6628.     1. Move the arrays and other variables into named common
  6629.  block.
  6630.     2. Use $LARGE metacommands.
  6631.     3. Move format statements into named common block.
  6632.  
  6633.     When using large memory model, Version 4.0 users should
  6634.  use the option /Gt (which defaults to 256 bytes) to place
  6635.  all data items greater or equal to 256 bytes outside the
  6636.  default data segment.
  6637.  
  6638.  
  6639.  188. Internal Compiler Error: regMD.c 1.74, Line 1304
  6640.  
  6641.  Product Version(s): 4.00
  6642.  Operating System:   MS-DOS
  6643.  Flags: ENDUSER | buglist4.00
  6644.  Last Modified:  1-JUN-1988    ArticleIdent: Q23713
  6645.  
  6646.  Problem:
  6647.     The following code generates the compiler internal error message
  6648.  "regMD.c:1.74, line 1304":
  6649.  
  6650.     integer*2 i
  6651.     external i
  6652.     character x*127, y*15
  6653.     common /fred/ y
  6654.     y(17-i(x):)=x
  6655.     end
  6656.  
  6657.     The error is generated on the assignment statement. If I change
  6658.  integer*2 i to integer*4 i (or just delete it), the error is
  6659.  corrected.
  6660.  
  6661.  Response:
  6662.     This is a known problem in Version 4.00.
  6663.     Microsoft is researching this problem and will post new information
  6664.  as it becomes available.
  6665.  
  6666.  
  6667.  189. Internal Compiler Error: grammar.c, Line 91
  6668.  
  6669.  Product Version(s): 4.00   | 4.00
  6670.  Operating System:   MS-DOS | OS/2
  6671.  Flags: ENDUSER | buglist4.00 fixlist4.01
  6672.  Last Modified: 21-JUL-1988    ArticleIdent: Q23708
  6673.  
  6674.     The following code fragment generates a compiler error in
  6675.  grammar.c, line 91:
  6676.  
  6677.           SUBROUTINE R(NROW,NCOL,NLAY,BUFF,IRCH)
  6678.           DIMENSION BUFF(NCOL,NROW,NLAY),IRCH(NCOL,NROW)
  6679.           DO 30 IR=1,NROW
  6680.           DO 30 IC=1,NCOL
  6681.           IL=IRCH(IC,IR)
  6682.           IF(IBD.EQ.1)BUFF(IC,IR,IL)=Q
  6683.     30    CONTINUE
  6684.        END
  6685.  
  6686.     Microsoft has confirmed this to be a problem in Version 4.00. This
  6687.  problem was corrected in Version 4.01.
  6688.     The program gives an internal compiler error that will disappear
  6689.  when compiled with -Odclt. Using -Odclt when compiling is the easiest
  6690.  workaround.
  6691.  
  6692.  
  6693.  190. FORTRAN: Bad Code Generated with /Ot
  6694.  
  6695.  Product Version(s): 4.01 4.10 | 4.10
  6696.  Operating System:   MS-DOS    | OS/2
  6697.  Flags: ENDUSER | buglist4.01 buglist4.10 fixlist5.00
  6698.  Last Modified: 16-JUN-1989    ArticleIdent: Q28653
  6699.  
  6700.  If you compile the following code with the default optimization, /Ot,
  6701.  bad code is generated for the line "DO 19999 Y=N, 1, -1." If this
  6702.  sample is compiled with /Od to disable optimizations, correct code is
  6703.  generated.
  6704.  
  6705.           INTEGER CL
  6706.           PARAMETER(CL=12)
  6707.           INTEGER  X,Y
  6708.           REAL FLD(101,101)
  6709.           CHARACTER   BFR*101, LEVEL*26
  6710.           DATA  LEVEL/'ABCDEFGHIJKLMNOPQRSTUVWXYZ'/
  6711.     101   FORMAT(A1,'FIELD'/)
  6712.     102   FORMAT(' ',A101)
  6713.           DO 10 I=1,101
  6714.             FLD(I,I) = 1.0
  6715.     10    CONTINUE
  6716.           N=101
  6717.  
  6718.           DO 19999 Y=N,1,-1
  6719.  
  6720.           DO 19998 X=1,N
  6721.               IDX=50.0*FLD(X,Y)
  6722.               IF(MOD(IDX,2).NE.0) GO TO 19996
  6723.              CONTINUE
  6724.              IDX=(IDX/2)+1
  6725.              IF((IDX.GE.1).AND.(IDX.LE.26)) GO TO 19992
  6726.              GO TO 19993
  6727.  
  6728.     19992 CONTINUE
  6729.           BFR(X:X)=LEVEL(IDX:IDX)
  6730.           GO TO 19994
  6731.     19993 CONTINUE
  6732.           BFR(X:X)='*'
  6733.     19994 CONTINUE
  6734.           GO TO 19997
  6735.     19996 CONTINUE
  6736.           BFR(X:X)=' '
  6737.     19997 CONTINUE
  6738.     19998 CONTINUE
  6739.           WRITE(*,102) BFR(1:N)
  6740.     19999 CONTINUE
  6741.           RETURN
  6742.           END
  6743.  
  6744.  Microsoft has confirmed this to be a problem in Versions 4.01 and
  6745.  4.10; the problem was corrected in Version 5.00.
  6746.  
  6747.  
  6748.  191. Reading and Writing to I/O Ports
  6749.  
  6750.  Product Version(s): 3.20 3.30 3.31 4.00
  6751.  Operating System:   MS-DOS
  6752.  Flags: ENDUSER |
  6753.  Last Modified: 16-DEC-1987    ArticleIdent: Q23885
  6754.  
  6755.  Question:
  6756.     How can I read from and write to the communication
  6757.  ports?
  6758.  
  6759.  Response:
  6760.     In order to read from or write to the communication
  6761.  ports using FORTRAN, it is necessary to use a special
  6762.  device driver. You may have to write the device driver
  6763.  yourself, in assembly language.
  6764.     To read information from the communication ports also
  6765.  requires an assembly language interrupt handler, which is
  6766.  very complicated. It is necessarily complicated due to the
  6767.  nature of device handshaking, which is required in order to
  6768.  read but not always in order to write.
  6769.  
  6770.  
  6771.  192. Internal Compiler Error: regMD.c 1.79, Line 1507
  6772.  
  6773.  Product Version(s): 4.01 4.10 | 4.10
  6774.  Operating System:   MS-DOS    | OS/2
  6775.  Flags: ENDUSER | buglist4.01 buglist4.10 fixlist5.00
  6776.  Last Modified:  6-NOV-1989    ArticleIdent: Q28659
  6777.  
  6778.  The following internal compiler error is generated by the code
  6779.  given below:
  6780.  
  6781.     regmdc.for(3) : fatal error F1001: Internal Compiler Error
  6782.                     (compiler file '@(#)regMD.c:1.79', line 1507)
  6783.                     Contact Microsoft Technical Support
  6784.  
  6785.  The compiler switch /Odclt turns on all optimization but does not
  6786.  disable alias checking, as demonstrated in the following code:
  6787.  
  6788.        COMMON X(10),A,B
  6789.        J=2
  6790.        DO 40 I=1,B
  6791.        GO TO (10,20,30) , J
  6792.  10    IF(X(I).EQ.A) K=0
  6793.  20    IF(X(I).EQ.A) K=0
  6794.  30    IF(X(I).EQ.A) K=0
  6795.  40    CONTINUE
  6796.        END
  6797.  
  6798.  The workaround is to compile with the compiler switch /Odclt.
  6799.  
  6800.  Microsoft has confirmed this to be a problem in Versions 4.01 and
  6801.  4.10 of the FORTRAN compiler. This problem was corrected in Version
  6802.  5.00.
  6803.  
  6804.  
  6805.  193. FORTRAN Compiler Error D1001: "Could Not Execute F1.EXE"
  6806.  
  6807.  Product Version(s): 4.x
  6808.  Operating System:   MS-DOS
  6809.  Flags: ENDUSER |
  6810.  Last Modified: 16-JUN-1988    ArticleIdent: Q23883
  6811.  
  6812.  Problem:
  6813.     When I compile my program, I get the following message:
  6814.  
  6815.     error D1001: could not execute F1.EXE
  6816.  
  6817.  Response:
  6818.     The specified file containing a compiler pass or the linker is
  6819.  found, but for some reason cannot be executed. Any of the following
  6820.  items can cause this problem:
  6821.  
  6822.     1. The F1.EXE file cannot be found. You may have a
  6823.  terminate-and-stay-resident program that can alter the setting of the
  6824.  environment variable PATH. PATH indicates the location of F1.EXE.
  6825.     2. There is not enough memory.
  6826.     3. You have a bad F1.EXE file with illegal .EXE file format.
  6827.     4. DOS and COMMAND.COM are incompatible. If their version numbers
  6828.  are different, the compiler may not be able to open the intermediate
  6829.  file. This means the COMMAND.COM command processor cannot create the
  6830.  TMP directory for the compiler intermediate file.
  6831.  
  6832.  
  6833.  194. Loop Optimization Does Not Preserve CX When Calling NINT
  6834.  
  6835.  Product Version(s): 4.01 4.10 5.00 | 4.10 5.00
  6836.  Operating System:   MS-DOS         | OS/2
  6837.  Flags: ENDUSER | buglist4.01 buglist4.10 fixlist5.00
  6838.  Last Modified:  7-NOV-1989    ArticleIdent: Q28667
  6839.  
  6840.  Using FORTRAN Versions 4.01 and 4.10 with optimization "On" to compile
  6841.  the simple loop generates bad code, which will give a run-time error.
  6842.  
  6843.  To correct this problem, use /Odct (disables loop optimization) when
  6844.  compiling.
  6845.  
  6846.  Microsoft has confirmed this to be a problem in Versions 4.01 and
  6847.  4.10 of the FORTRAN compiler. This problem was corrected in Version
  6848.  5.00.
  6849.  
  6850.  The following code demonstrates the problem:
  6851.  
  6852.        PROGRAM TEST
  6853.        DIMENSION X(9), NX(9)
  6854.        DATA X/ 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9/
  6855.  
  6856.        DO 100 I=1, 9
  6857.        100 NX( I ) = NINT( X( I ) )
  6858.  
  6859.        STOP
  6860.        END
  6861.  
  6862.  With optimization on, the index becomes corrupted because it is
  6863.  contained in the CX register; the index is really a loop counter. CX
  6864.  is set to nine and is decremented during each pass until it reaches 0
  6865.  (zero).
  6866.  
  6867.  The index for NX is the SI register; for the X array, the DI
  6868.  register is used. When you call the intrinsic function NINT, the CX
  6869.  register is not preserved. It contains a bad value after returning to
  6870.  the main program, which causes the loop to disappear when the main
  6871.  program tries to decrement CX.
  6872.  
  6873.  Note that there are a number of run-time errors that can occur. They
  6874.  are usually math related errors, such as M6101 <invalid operation> and
  6875.  M6201 <domain error>.
  6876.  
  6877.  
  6878.  195. Incorrect INTEGER Parameters in the Source
  6879.  
  6880.  Product Version(s): 4.00
  6881.  Operating System:   MS-DOS
  6882.  Flags: ENDUSER | buglist4.00
  6883.  Last Modified:  1-JUN-1988    ArticleIdent: Q23957
  6884.  
  6885.     INTEGER*2 variables that have been assigned values in a parameter
  6886.  statement sometimes are listed incorrectly in the source listing. The
  6887.  following code is an example:
  6888.  
  6889.     PROGRAM TEST
  6890.       INTEGER*2
  6891.       PARAMETER(I=300)
  6892.       END
  6893.  
  6894.     In the source listing, "I" is listed as having a value of 44.
  6895.     When INTEGER*2 variables are assigned values greater than 256 in a
  6896.  parameter statement, they show up as value mod 256 in the source
  6897.  listing. However, the values are used correctly in the code. This
  6898.  problem will be corrected in the next release.
  6899.  
  6900.  
  6901.  196. Run-Time Error 6500 on File Names Similar to Special Devices
  6902.  
  6903.  Product Version(s): 4.00
  6904.  Operating System:   MS-DOS
  6905.  Flags: ENDUSER | buglist4.00 fixlist4.01
  6906.  Last Modified:  9-JUN-1988    ArticleIdent: Q23906
  6907.  
  6908.     When attempting to READ from file "PRM.DAT", the run-time error
  6909.  F6500, "file not open for reading or file locked" is received.
  6910.     Microsoft confirmed this to be a problem in Version 4.00 of the
  6911.  FORTRAN compiler. This problem was corrected in Version 4.01.
  6912.     The run-time compiler thinks it is dealing with file "PRN". This
  6913.  error affects all of the special devices (AUX, CON, NUL, and PRN).
  6914.  Examples of this problem are as follows:
  6915.  
  6916.     1. READing from "PRM" gives error 6500.
  6917.     2. WRITing to "COL" writes to "CON".
  6918.     3. WRITing to "NUM" produces no output (like NUL).
  6919.  
  6920.     The workaround for this problem is not to use any file names that
  6921.  are similar to any of the special device names, e.g. AUX, CON, NUL,
  6922.  and PRN.
  6923.  
  6924.  
  6925.  197. Integer Versus Character Comparisons
  6926.  
  6927.  Product Version(s): m4.00
  6928.  Operating System:   MS-DOS
  6929.  Flags: ENDUSER |
  6930.  Last Modified: 20-OCT-1988    ArticleIdent: Q23941
  6931.  
  6932.  Problem:
  6933.  
  6934.  While the MS-DOS FORTRAN Optimizing Compiler allows the comparison of
  6935.  Character variables with Integer variables, some care should be taken
  6936.  to perform the proper comparison.
  6937.  
  6938.  As an example, you might expect the following program to produce two
  6939.  ".TRUE." comparisons. In one case, the Character variable is compared
  6940.  against an Integer variable containing a Character constant and, in
  6941.  the second case, an Integer variable contains the ASCII value
  6942.  corresponding to the same character.
  6943.  
  6944.         CHARACTER*4 C4
  6945.         C4 = 'A'
  6946.         I4 = 'A'
  6947.         WRITE (*,'(1X,A,Z8,A,Z8,A)') 'C4 IN HEX=<',C4,'>  I4 IN HEX=<',
  6948.      +  I4,'>'
  6949.         WRITE (*,*) 'C4 .EQ. I4? ',C4 .EQ. I4
  6950.         I4 = #41
  6951.         WRITE (*,'(1X,A,Z8,A,Z8,A)') 'C4 IN HEX=<',C4,'>  I4 IN HEX=<',
  6952.      +  I4,'>'
  6953.         WRITE (*,*) 'C4 .EQ. I4? ',C4 .EQ. I4
  6954.         END
  6955.  
  6956.  Response:
  6957.  
  6958.  That assumption is incorrect, as evidenced by the hexadecimal
  6959.  representation of the value of the I4 variable. The following is the
  6960.  output from the program:
  6961.  
  6962.     C4 IN HEX=<41202020>  I4 IN HEX=<20202041>
  6963.     C4 .EQ. I4? T
  6964.     C4 IN HEX=<41202020>  I4 IN HEX=<00000041>
  6965.     C4 .EQ. I4? F
  6966.  
  6967.  When the Character constant "A" is assigned, the unused three
  6968.  positions remaining in I4 are filled with blank characters
  6969.  (hexadecimal value 20). If the ASCII value equivalent to "A"
  6970.  (hexadecimal value 41) is assigned to I4, the remaining three
  6971.  positions are filled with zeros. Thus, the first comparison will
  6972.  succeed, while the second will fail.
  6973.  
  6974.  Please note that this caution does not apply to comparisons between
  6975.  Character and Integer*1 variables. Because no padding is necessary,
  6976.  the comparisons always will be correct.
  6977.  
  6978.  
  6979.  198. Problem with INCLUDE and LST Files
  6980.  
  6981.  Product Version(s): 4.00
  6982.  Operating System:   MS-DOS
  6983.  Flags: ENDUSER | buglist4.00 fixlist4.01
  6984.  Last Modified: 16-JUN-1988    ArticleIdent: Q24061
  6985.  
  6986.     If you compile a FORTRAN program that contains an INCLUDE file, as
  6987.  in the example below, the $LIST fails to turn listing back on until
  6988.  the symbol table listings at the bottom. The INCLUDE file does not
  6989.  have a CTRL-Z in it.
  6990.     The following is an example:
  6991.  
  6992.     $NOLIST
  6993.                  INTEGER*2 INUM,X,Y
  6994.     $LIST
  6995.  
  6996.     This problem was corrected in Version 4.01.
  6997.  
  6998.  
  6999.  199. Help and Arg Compile "Not an Editor Switch"
  7000.  
  7001.  Product Version(s): 5.00    | 5.00
  7002.  Operating System:   MS-DOS  | OS/2
  7003.  Flags: ENDUSER |
  7004.  Last Modified:  6-DEC-1989    ArticleIdent: Q46262
  7005.  
  7006.  The following messages can be generated when the Microsoft Editor (M)
  7007.  is set to use the Quick configuration:
  7008.  
  7009.     Help is not an editor switch
  7010.     Argcompile is not an editor switch
  7011.  
  7012.  The following two lines must be deleted from the TOOLS.INI file to
  7013.  correct this problem:
  7014.  
  7015.     Argcompile:F5  (delete only the first occurrence of this)
  7016.  
  7017.     Help:F1
  7018.  
  7019.  Argcompile is correctly defined later in the TOOLS.INI file. Help is
  7020.  defined by default.
  7021.  
  7022.  
  7023.  200. $PAGE Metacommand Occasionally Does Not Work
  7024.  
  7025.  Product Version(s): 4.00
  7026.  Operating System:   MS-DOS
  7027.  Flags: ENDUSER | buglist4.00 fixlist4.01
  7028.  Last Modified:  1-JUN-1988    ArticleIdent: Q24172
  7029.  
  7030.     The $PAGE metacommand is supposed to begin a new page in the
  7031.  source-listing file, but occasionally it fails to do so.
  7032.     This problem was corrected in FORTRAN Version 4.01. There is no
  7033.  known workaround.
  7034.  
  7035.  
  7036.  201. Sending a File with a Control Character to the Printer
  7037.  
  7038.  Product Version(s): 3.20 3.30 3.31 4.00
  7039.  Operating System:   MS-DOS
  7040.  Flags: ENDUSER |
  7041.  Last Modified: 20-OCT-1988    ArticleIdent: Q24212
  7042.  
  7043.  Question:
  7044.  
  7045.  When I send a control character to a file, then send that file to the
  7046.  printer, the control character is printed out. How do I get around
  7047.  this situation?
  7048.  
  7049.  Response:
  7050.  
  7051.  Carriage control characters are not used for disk files. Any character
  7052.  you send to a disk file actually appears in the disk file; therefore,
  7053.  the first character appears instead of being used for carriage
  7054.  control.
  7055.  
  7056.  If you want to produce a disk file that causes the printer to form
  7057.  feed when it is printed, you must insert a form feed character into
  7058.  the file itself. The ASCII form feed character is decimal 12, so you
  7059.  can write this into a file. For instance, the following program
  7060.  inserts a form feed character into the disk file "test":
  7061.  
  7062.         open(6,file = 'test', status = 'new')
  7063.         write(6,*) 'hello'
  7064.         write(6,1) char(12)
  7065.     1   format(a1)
  7066.         write(6,*) 'there'
  7067.         end
  7068.  
  7069.  When printed, "hello" will show on the first page of output, the
  7070.  printer will form feed, and "there" will be on the second page of
  7071.  output.
  7072.  
  7073.  
  7074.  202. Compiler Error "Omf_ms.c:1.108, Line 1078"
  7075.  
  7076.  Product Version(s): 4.00
  7077.  Operating System:   MS-DOS
  7078.  Flags: ENDUSER | buglist4.00 fixlist4.
  7079.  Last Modified: 31-MAY-1988    ArticleIdent: Q24287
  7080.  
  7081.     The following code produces the error "omf_ms.c:1.108, line 1078",
  7082.  if compiled without option -Od. If compiled with option -Od, the code
  7083.  produces this error as well as "error omf_ms.c:1.108 line 2458". Thus,
  7084.  the -Od option adds to the problem. The following is the code:
  7085.  
  7086.     INTERFACE TO SUBROUTINE A
  7087.  
  7088.     END
  7089.     INTERFACE TO SUBROUTINE B(X)
  7090.     EXTERNAL X
  7091.     END
  7092.     CALL A
  7093.     CALL B(A)
  7094.     END
  7095.  
  7096.     This is a confirmed problem in Version 4.00 of the compiler. This
  7097.  problem was corrected in Version 4.01.
  7098.  
  7099.  
  7100.  203. Internal Compiler Error: mactab.c 1.30, Line 647
  7101.  
  7102.  Product Version(s): 4.00
  7103.  Operating System:   MS-DOS
  7104.  Flags: ENDUSER | buglist4.00
  7105.  Last Modified:  1-JUN-1988    ArticleIdent: Q24214
  7106.  
  7107.  Problem:
  7108.     The following code generates the internal compiler error
  7109.  mactab.c:1.30, line 647:
  7110.  
  7111.     complex*16 z1,z2,z3
  7112.     z1=z1*dconjg(z2) *z3
  7113.     end
  7114.  
  7115.     If you use a temporary variable to hold the result of the function,
  7116.  the error is corrected (the intrinsic function dconjg returns the
  7117.  conjugate of a complex16 number).
  7118.  
  7119.  Response:
  7120.     This is a known problem in Version 4.00.
  7121.     The only workaround is to not use COMPLEX*16. Using COMPLEX*8
  7122.  causes no error.
  7123.  
  7124.  
  7125.  204. Error F1043
  7126.  
  7127.  Product Version(s): 4.00
  7128.  Operating System:   MS-DOS
  7129.  Flags: ENDUSER |
  7130.  Last Modified: 29-SEP-1988    ArticleIdent: Q24213
  7131.  
  7132.  Problem:
  7133.  
  7134.  When I run the compiler, it generates "error F1043: cannot open
  7135.  compiler intermediate file".
  7136.  
  7137.  Response:
  7138.  
  7139.  The compiler was unable to open an intermediate file. There are two
  7140.  possible causes, as follows:
  7141.  
  7142.  1. The environment variable TMP was set to a nonexistent
  7143.     directory. Try not setting TMP at all, or setting TMP to an
  7144.     existing directory, as follows:
  7145.  
  7146.     tmp=[drive:existent directory]     ;no spaces after tmp
  7147.  
  7148.  2. There is not enough space on the hard disk or you have
  7149.     a terminate-and-stay-resident program loaded in memory.
  7150.  
  7151.  
  7152.  205. Compile Time Error F1901
  7153.  
  7154.  Product Version(s): 4.00
  7155.  Operating System:   MS-DOS
  7156.  Flags: ENDUSER |
  7157.  Last Modified: 20-OCT-1988    ArticleIdent: Q24383
  7158.  
  7159.  Question:
  7160.  
  7161.  Why did I receive F1901 compiler error: "program too large for
  7162.  memory"?
  7163.  
  7164.  Response:
  7165.  
  7166.  One reason why you received this error message may be that the FORTRAN
  7167.  program is too large for memory and needs to be broken into smaller
  7168.  subprograms, then linked together.
  7169.  
  7170.  Also, the message may be due to multiple definitions of the program
  7171.  name. The following is an example:
  7172.  
  7173.         Program TEST
  7174.         Common /TEST/
  7175.  
  7176.  Finally, the message may be due to the way FORTRAN keeps track of
  7177.  variables that are not explicitly given a type. FORTRAN allows you to
  7178.  have variable declarations anywhere in the declaration block and
  7179.  variables can have a default type. Variables starting with I-N are
  7180.  assumed to be integer; the others are assumed to be real variables.
  7181.  The following is an example:
  7182.  
  7183.         DIMENSION X(10),I(20)
  7184.         EQUIVALENCE (X(1),I(1))
  7185.  
  7186.  Unless the X and I arrays are explicitly given a type, the compiler
  7187.  must remember what type they are until the end of the declaration
  7188.  block. It is this necessity of saving the type information that can
  7189.  cause you to run out of memory. Those programs that receive this error
  7190.  (from the first pass of the compiler) should compile normally if the
  7191.  arrays are explicitly typed. The previous example would then be as
  7192.  follows:
  7193.  
  7194.         REAL X(10)
  7195.         INTEGER I(20)
  7196.         EQUIVALENCE (X(1),I(1))
  7197.  
  7198.  Some guidelines to lessen the chance of getting a "program too big"
  7199.  error are the following:
  7200.  
  7201.  1. Explicitly type arrays (especially those used in EQUIVALENCE
  7202.     statements).
  7203.  
  7204.  2. Concerning array bounds (10, 20, and 1 in the examples), use as few
  7205.     unique values as possible and mention the most frequently used
  7206.     bounds as soon as possible.
  7207.  
  7208.  3. The following program organization is recommended:
  7209.  
  7210.        type statements
  7211.        EXTERNAL statements
  7212.        DIMENSION statements
  7213.        COMMON statements
  7214.        EQUIVALENCE statements
  7215.        DATA statements
  7216.  
  7217.  
  7218.  206. Using FORTRAN 3.13 or 3.2 with an 80286 AT-class machine
  7219.  
  7220.  Product Version(s): 3.13 3.20
  7221.  Operating System:   MS-DOS
  7222.  Flags: ENDUSER |
  7223.  Last Modified:  6-DEC-1989    ArticleIdent: Q24418
  7224.  
  7225.  Problem:
  7226.  
  7227.  My FORTRAN Versions 3.13 and 3.20 programs work properly on an IBM-XT,
  7228.  but when I run the programs on an AT or AT clone, all zeros are
  7229.  generated.
  7230.  
  7231.  Response:
  7232.  
  7233.  If you do not have the 80287 numeric coprocessor with your 80286, you
  7234.  can experience problems with floating-point calculations.
  7235.  
  7236.  For Version 3.20, the following corrects this problem. If you do not
  7237.  have a coprocessor and you link with the default MATH library
  7238.  (MATH.LIB), you must explicitly tell MATH.LIB that there is no
  7239.  coprocessor by issuing the following command in DOS before running the
  7240.  program:
  7241.  
  7242.     SET NO87=8087 Suppressed
  7243.  
  7244.  This command forces the use of the floating-point emulation software.
  7245.  This action is necessary because an AT with no coprocessor fools
  7246.  MATH.LIB into thinking that there is a coprocessor present. This
  7247.  behavior causes the MATH.LIB to return incorrect results.
  7248.  
  7249.  Additional information about this SET command is available in the
  7250.  README.DOC file on the MS-DOS FORTRAN distribution disk.
  7251.  
  7252.  You do not need to use this SET command if you do the following:
  7253.  
  7254.  1. Link with ALTMATH.LIB or DECMATH.LIB, which do not use or look for
  7255.     the coprocessor.
  7256.  
  7257.  2. Use the modified Version 3.20 with math libraries enclosed.
  7258.  
  7259.  FORTRAN Version 3.13 does not recognize the NO87 environment variable;
  7260.  therefore, if you use this version, you must link with the enclosed
  7261.  modified library Version 3.13.
  7262.  
  7263.  Note: The patch includes the specially modified math libraries that
  7264.  can operate normally on the 80286 whether or not there is a
  7265.  coprocessor present. With Version 3.20 of Microsoft FORTRAN, use
  7266.  MATH.LIB and 8087.LIB. With Microsoft FORTRAN Version 3.13, use
  7267.  FORTRAN.LEM and FORTRAN.L87.
  7268.  
  7269.  
  7270.  207. $TITLE and $SUBTITLE not taking effect in LST files
  7271.  
  7272.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  7273.  Operating System:   MS-DOS              | OS/2
  7274.  Flags: ENDUSER | buglist4.00 buglist4.01 buglist4.10 fixlist5.00
  7275.  Last Modified:  7-NOV-1989    ArticleIdent: Q24427
  7276.  
  7277.  $TITLE and $SUBTITLE are not taking effect in the LST file.
  7278.  
  7279.  $TITLE:"This is the main" was added to the first line of DEMO.FOR, and
  7280.  $SUBTITLE:"This is the subroutine" was added to the 28th line.
  7281.  However, "This is the main" is not printed at the top of the listing,
  7282.  and "This is the subroutine" is not printed before the subroutine.
  7283.  
  7284.  Microsoft has confirmed this to be a problem in Versions 4.00, 4.01,
  7285.  and 4.10 of the FORTRAN compiler. This problem was corrected in
  7286.  Version 5.00.
  7287.  
  7288.  
  7289.  208. Run-Time Hang from the Use of the EOF Function
  7290.  
  7291.  Product Version(s): 4.00
  7292.  Operating System:   MS-DOS
  7293.  Flags: ENDUSER | buglist4.00 fixlist4.01
  7294.  Last Modified:  1-JUN-1988    ArticleIdent: Q24429
  7295.  
  7296.     The following program will cause your computer to hang when
  7297.  compiled with FORTRAN Version 4.00:
  7298.  
  7299.             LOGICAL X
  7300.             OPEN(1)
  7301.             DO 1 I=1,10000
  7302.             X = EOF(1)
  7303.     1       CONTINUE
  7304.             END
  7305.  
  7306.     Microsoft has confirmed this to be a problem in Version 4.00 of the
  7307.  FORTRAN compiler. It was corrected in Version 4.01.
  7308.     Each call to the EOF intrinsic function costs two bytes from the
  7309.  stack. The program may run properly if the run-time stack size is
  7310.  greater than two times the number of calls to EOF; therefore, a
  7311.  possible workaround is to raise the run-time stack size (via EXEMOD).
  7312.  
  7313.  
  7314.  209. Problem with FX.0
  7315.  
  7316.  Product Version(s): 4.00
  7317.  Operating System:   MS-DOS
  7318.  Flags: ENDUSER | buglist4.00 fixlist4.01
  7319.  Last Modified:  1-JUN-1988    ArticleIdent: Q24428
  7320.  
  7321.     Numbers with a value of less than .1 appear incorrectly when
  7322.  written in F10.0 format, as illustrated in the following code example:
  7323.  
  7324.            A=0.03
  7325.            WRITE(*,10) A
  7326.     10     FORMAT(1X,F10.0)
  7327.            END
  7328.  
  7329.     The output of the program is two.
  7330.     Microsoft confirmed this to be a problem in Version 4.00 of the
  7331.  FORTRAN compiler. The problem was corrected in Version 4.01.
  7332.  
  7333.  
  7334.  210. The Optimizer and Arrays Greater Than 32K
  7335.  
  7336.  Product Version(s): 4.00
  7337.  Operating System:   MS-DOS
  7338.  Flags: ENDUSER | buglist4.00 fixlist4.01
  7339.  Last Modified:  1-JUN-1988    ArticleIdent: Q24426
  7340.  
  7341.     The following program causes an infinite loop (if $STORAGE:2 is
  7342.  included, it loops through only once):
  7343.  
  7344.                INTEGER*2 BIGARY(8000,3),I,J,KOUNT
  7345.                KOUNT=0
  7346.                DO 100 J=1,3
  7347.                  DO 50 I=1,8000
  7348.                    BIGARY(I,J) = 1
  7349.                    KOUNT= KOUNT + 1
  7350.   50             CONTINUE
  7351.                WRITE(*,*)'KOUNT = ', KOUNT
  7352.   100          CONTINUE
  7353.                END
  7354.  
  7355.     Microsoft confirmed this to be a problem in Version 4.00 of the
  7356.  FORTRAN compiler. This problem was corrected in Version 4.01.
  7357.  
  7358.  
  7359.  211. Compile Time Warning F4803 on ENTRY Statement in FUNCTION
  7360.  
  7361.  Product Version(s): 4.00 4.01
  7362.  Operating System:   MS-DOS
  7363.  Flags: ENDUSER | buglist4.00 buglist4.01 fixlist4.10
  7364.  Last Modified:  1-JUN-1988    ArticleIdent: Q24628
  7365.  
  7366.     According to Section 15.7.3 of the ANSI standard, variables
  7367.  corresponding to entry names and the function of the same type should
  7368.  be associated; defining one defines all of them. However, the
  7369.  following program produces the warning message "warning F4803: GRONK :
  7370.  FUNCTION : return variable not set" when compiled:
  7371.  
  7372.     function grot(z,y)
  7373.     grot=z*(z-y)
  7374.     return
  7375.     entry gronk(z,y)
  7376.     grot=z*z+y
  7377.     return
  7378.     end
  7379.  
  7380.     program thing
  7381.     write (*,*) 'The answer is...'
  7382.     write (*,*) gronk(3.5,1.0)
  7383.     end
  7384.  
  7385.     This is a known problem in Versions 4.00 and 4.01 of the FORTRAN
  7386.  compiler. This problem was corrected in Version 4.10.
  7387.     The workaround for Version 4.01 is to define a return variable
  7388.  "gronk".
  7389.  
  7390.  
  7391.  212. Concatenation (//) with the Target Variable on the Right
  7392.  
  7393.  Product Version(s): 4.00 4.10 5.00
  7394.  Operating System:   MS-DOS
  7395.  Flags: ENDUSER |
  7396.  Last Modified: 13-JUL-1990    ArticleIdent: Q24618
  7397.  
  7398.  Problem:
  7399.  
  7400.  Below is a program fragment which appears to generate incorrect
  7401.  results when using a concatenation operator:
  7402.  
  7403.         CHARACTER*20 CH
  7404.         CH = 'B'
  7405.         CH = 'A'//CH       <-- string concatenation
  7406.  
  7407.  CH equals 'AA' after the concatenation operation and not the
  7408.  expected 'AB'.
  7409.  
  7410.  Response:
  7411.  
  7412.  It is strictly against the FORTRAN 77 standard to have the target
  7413.  variable, in this case CH, on the right side of the assignment.
  7414.  
  7415.  Referencing the assignment statement
  7416.  
  7417.     v = e
  7418.  
  7419.  page 10-3, lines 5-6, of the FORTRAN 77 standard states
  7420.  
  7421.     None of the character positions being defined in v may be
  7422.     referenced in e.
  7423.  
  7424.  The character positions defined by CH (v in the ANSI standard) in
  7425.  the code above are also referenced in CH (e in the ANSI standard),
  7426.  making this operation illegal.
  7427.  
  7428.  An additional 32K of memory would have to be allocated for temporary
  7429.  storage to make this a legal operation.
  7430.  
  7431.  
  7432.  213. Problem with Heap Allocator
  7433.  
  7434.  Product Version(s): 3.31
  7435.  Operating System:   MS-DOS
  7436.  Flags: ENDUSER |
  7437.  Last Modified: 24-JUL-1990    ArticleIdent: Q24728
  7438.  
  7439.  Question:
  7440.     Why does FORTRAN Version 3.31 crash at compile time or when generating
  7441.  strange and erroneous error messages?
  7442.  
  7443.  Response:
  7444.     The Version 3.31 compiler stack size has been increased to 40K, and it
  7445.  causes erroneous errors at compile time. You will get one of the following
  7446.  error messages:
  7447.  
  7448.     1. Null Pointer Assignment
  7449.     2. Error : Compiler Invalid Pointer Range
  7450.     3. Will hang on FOR1
  7451.     4. Divide Overflow
  7452.  
  7453.     To work around this problem, decrease the size of the stack for FOR1.EXE t
  7454.  about 20K or 30K using EXEMOD, or specify that the compiler create a listing
  7455.  file.
  7456.  
  7457.  
  7458.  214. Calling Other Programs
  7459.  
  7460.  Product Version(s): all
  7461.  Operating System:   MS-DOS
  7462.  Flags: ENDUSER |
  7463.  Last Modified: 31-AUG-1987    ArticleIdent: Q24736
  7464.  
  7465.  Question:
  7466.     How can I run another program from my FORTRAN program?
  7467.  
  7468.  Response:
  7469.     The method for running another Program from the FORTRAN program varies for
  7470.  different FORTRAN versions.
  7471.     For Version 3.3 and 3.31 users, use the library called CEXEC.LIB that has
  7472.  been added for system and spawn support. CEXEC.LIB, a subsidiary of the C
  7473.  library, can be used to run other programs. The CEXEC.LIB library has to be
  7474.  typed in explicitly.
  7475.     For Version 4.0 users, the FORTRAN run-time libraries MLIBFORx.LIB and
  7476.  LLIBFORx.LIB include the system routine and a subset of the spawnlp routine
  7477.  (as well as other routines) from the C library. FORTRAN programs can access
  7478.  these routines in the FORTRAN run-time libraries. The demonstration program
  7479.  DEMOEXEC.FOR, included with the Microsoft FORTRAN Compiler, also gives
  7480.  examples of how to call these routines.
  7481.  
  7482.  
  7483.  215. FORTRAN 4.10 FLOPSET.DOC File, Setup on Floppies
  7484.  
  7485.  Product Version(s): 4.10   | 4.10
  7486.  Operating System:   MS-DOS | OS/2
  7487.  Flags: ENDUSER |
  7488.  Last Modified: 28-APR-1988    ArticleIdent: Q28720
  7489.  
  7490.     The following information concerns the FORTRAN Version 4.10
  7491.  FLOPSET.DOC file:
  7492.  
  7493.  FLOPSET.DOC -- Removable Disk Setup Information
  7494.  (C) Copyright Microsoft Corporation, 1987
  7495.  
  7496.     The following information replaces Sections 2.4.4 and 2.4.5 of the
  7497.  Microsoft(R) FORTRAN Optimizing Compiler User's Guide.
  7498.  
  7499.  Installing on a 5 1/4-Inch Disk System
  7500.     Before you install the compiler on a 5 1/4-inch disk system, you
  7501.  should format at least eight blank disks. SETUP uses seven blank disks
  7502.  for the compiler software and libraries. In addition, you should copy
  7503.  source programs, including the DEMO.FOR demonstration program, to the
  7504.  eighth blank disk. Table 2.1 shows how SETUP organizes your 5 1/4-inch
  7505.  disks.
  7506.      If you request compatibility with Versions 3.20 and 3.30 of
  7507.  Microsoft FORTRAN, SETUP requires a ninth blank disk (which becomes
  7508.  the Compatibility disk), to which it copies the compatibility library,
  7509.  FORTRAN.LIB. This disk can be either a formatted blank disk or a disk
  7510.  with earlier-version object files that you want to link. Be sure to
  7511.  label the disk before using it with SETUP.
  7512.  
  7513.  Installing on a 3 1/2-Inch Disk System
  7514.     Before you install the compiler on a 3 1/2-inch disk system, format
  7515.  at least five blank disks. SETUP uses four blank disks for the
  7516.  compiler software and libraries. In addition, you should copy source
  7517.  programs, including the DEMO.FOR demonstration program, to the fifth
  7518.  blank disk. Table 2.2 shows how SETUP organizes your 3 1/2-inch disks.
  7519.  
  7520.  Table 2.1
  7521.  Organization for 5 1/4-Inch Disks
  7522.  --------------------------------------------------------------------------
  7523.  Disk Name           Files           File Contents
  7524.  --------------------------------------------------------------------------
  7525.  Driver              FL.EXE          Executable file for the FL command
  7526.                      FL.ERR          Error-message file for the FL command
  7527.                      FL.HLP          FL command help file
  7528.                      F1.EXE          Pass 1 of the compiler
  7529.                      F1.ERR          Error-message file for Pass 1 of the
  7530.                                      compiler
  7531.  Compiler 1          F2.EXE          Pass 2 of the compiler
  7532.                      F23.ERR         Error-message file for Passes 2 and 3
  7533.                                      of the compiler
  7534.  Compiler 2          F3.EXE          Pass 3 of the compiler
  7535.                      F3S.EXE         Alternate Pass 3 of the compiler. This
  7536.                                      pass is used if optimization is dis-
  7537.                                      abled during compiling. (See Section
  7538.                                      3.3.15, "Optimizing," of the User's
  7539.                                      Guide for more information.)
  7540.                      F23.ERR         Error-message file for Passes 2 and 3
  7541.                                      of the compiler
  7542.  Link                LINK.EXE        Executable file for the linker
  7543.                      xLIBFORx.LIB    Library created by SETUP
  7544.  Utility             LIB.EXE         Executable file for the LIB utility
  7545.                      MAKE.EXE        Executable file for the MAKE utility
  7546.                      EXEPACK.EXE     Executable file for the EXEPACK utility
  7547.                      EXEMOD.EXE      Executable file for the EXEMOD utility
  7548.                      ERROUT.EXE      Executable file for the ERROUT utility
  7549.                      SETENV.EXE      Executable file for the SETENV utility
  7550.  Debug               CV.EXE          Executable file for the Microsoft
  7551.                                      CodeView(R) debugger for MS-DOS
  7552.                      CV.HLP          Help file for the CodeView debugger
  7553.                                      for MS-DOS(R)
  7554.                      CVPACK.EXE      Executable file for the CVPACK utility
  7555.  Scratch             LIB.EXE         Executable file for the LIB utility,
  7556.                                      which is used to help build the
  7557.                                      run-time library. SETUP installs
  7558.                                      this file on this disk.
  7559.                      Intermediate    Present while SETUP is running;
  7560.                      versions of     deleted from the disk when SETUP
  7561.                      libraries       finishes normally
  7562.  ----------------------------------------------------------------------------
  7563.  
  7564.  Table 2.2
  7565.  Organization for 3 1/2-Inch Disks
  7566.  ----------------------------------------------------------------------------
  7567.  Disk Name           Files           File Contents
  7568.  ----------------------------------------------------------------------------
  7569.  Driver/Compiler     FL.EXE          Executable file for the FL command
  7570.                      FL.ERR          Error-message file for the FL command
  7571.                      FL.HLP          Help file for the FL command
  7572.                      F1.EXE          Pass 1 of the compiler
  7573.                      F1.ERR          Error-message file for Pass 1 of the
  7574.                                      compiler
  7575.                      F2.EXE          Pass 2 of the compiler
  7576.                      F23.ERR         Error-message file for Passes 2 and 3
  7577.                                      of the compiler
  7578.                      F3.EXE          Pass 3 of the compiler
  7579.  Link                F3S.EXE         Alternate Pass 3 of the compiler. This
  7580.                                      pass is used if optimization is dis-
  7581.                                      abled during compiling. (See Section
  7582.                                      3.3.15, "Optimizing," of the User's
  7583.                                      Guide for more information.)
  7584.                      F23.ERR         Error-message file for Passes 2 and 3
  7585.                                      of the compiler
  7586.                      LINK.EXE        Executable file for the linker
  7587.                      xLIBFORx.LIB    Library created by SETUP
  7588.  Utility             LIB.EXE         Executable file for the LIB utility
  7589.                      MAKE.EXE        Executable file for the MAKE utility
  7590.                      EXEPACK.EXE     Executable file for the EXEPACK utility
  7591.                      EXEMOD.EXE      Executable file for the EXEMOD utility
  7592.                      ERROUT.EXE      Executable file for the ERROUT utility
  7593.                      SETENV.EXE      Executable file for the SETENV utility
  7594.                      CV.EXE          Executable file for the Microsoft
  7595.                                      CodeView debugger for MS-DOS
  7596.                      CV.HLP          Help file for the CodeView debugger
  7597.                                      for MS-DOS
  7598.                      CVPACK.EXE      Executable file for the CVPACK utility
  7599.  Scratch             LIB.EXE         Executable file for the LIB utility,
  7600.                                      which is used to help build the
  7601.                                      run-time library. SETUP installs
  7602.                                      LIB.EXE on this disk.
  7603.                      Intermediate    Present while SETUP is running;
  7604.                      versions of     deleted from the disk if SETUP
  7605.                      libraries       finishes normally
  7606.  -----------------------------------------------------------------------------
  7607.  
  7608.  
  7609.  216. Error F6601: Direct Record Overflow on Rewind
  7610.  
  7611.  Product Version(s): 4.01
  7612.  Operating System:   MS-DOS
  7613.  Flags: ENDUSER | buglist4.01
  7614.  Last Modified:  1-JUN-1988    ArticleIdent: Q25009
  7615.  
  7616.     The following source code will generate run-time error F6601:
  7617.  
  7618.     open(file='test',access='direct',recl=50,status='unknown')
  7619.     write(5,rec=4) 'hello'
  7620.     endfile 5
  7621.     rewind(5)
  7622.     end
  7623.  
  7624.     This is a known problem in Version 4.01.
  7625.     Microsoft is researching this problem and will post new information
  7626.  as it becomes available.
  7627.  
  7628.  
  7629.  217. Appending to CTRL-Z-Terminated File
  7630.  
  7631.  Product Version(s): 4.01
  7632.  Operating System:   MS-DOS
  7633.  Flags: ENDUSER | buglist4.01 fixlist4.10
  7634.  Last Modified: 31-MAY-1988    ArticleIdent: Q25010
  7635.  
  7636.  Problem:
  7637.     Attempting to append to a CTRL-Z-terminated file causes the file
  7638.  pointer to be positioned in an incorrect record. The typical symptom
  7639.  associated with this problem is that the first character of a file
  7640.  will be duplicated when the file is appended to.
  7641.     For example, a CTRL-Z-terminated file which contains the characters
  7642.  ABC will appear as AABCDEF when DEF is appended to it.
  7643.  
  7644.  Response:
  7645.     Microsoft has confirmed this to be a problem in Version 4.01 of the
  7646.  FORTRAN compiler.
  7647.     This problem was corrected in Version 4.10.
  7648.  
  7649.  
  7650.  218. Programs Executed by PAUSE Statements
  7651.  
  7652.  Product Version(s): 4.01
  7653.  Operating System:   MS-DOS
  7654.  Flags: ENDUSER | buglist4.01
  7655.  Last Modified:  1-JUN-1988    ArticleIdent: Q25110
  7656.  
  7657.  Problem:
  7658.     When my program executes a second program following a PAUSE
  7659.  statement, input to the second program cannot be redirected from a
  7660.  file. For example, if the following program named fort1.for:
  7661.  
  7662.         pause
  7663.         end
  7664.  
  7665.  executes the following program named fort2.for:
  7666.  
  7667.         read(*,*) i,j
  7668.         read(*,*) k,l
  7669.         write(*,*) 'i,j,k,l=',i,j,k,l
  7670.         end
  7671.  
  7672.  and I want to obtain input for fort2.for from a file named fort2.dat,
  7673.  the following sequence of steps causes an end-of-file error:
  7674.  
  7675.         fort1
  7676.               pause - Please enter a blank line (to continue) or DOS
  7677.                       COMMAND
  7678.         fortr2 < fort2.dat
  7679.  
  7680.  Response:
  7681.     This error occurs because the child program, fort2, inherits file
  7682.  handle attributes from the parent program, fort1. Because you did not
  7683.  specify redirection for fort1, the run-time system assumes that fort2
  7684.  also does not use redirection.
  7685.     The workaround is to create a data file containing the command line
  7686.  that redirects input to the child program. For the above example,
  7687.  construct a data file named fix.dat containing the following
  7688.  statement:
  7689.  
  7690.     fort2 < fort2.dat
  7691.  
  7692.     Use this new data file as input when running the parent program.
  7693.  For the example above, run fort1 using following command line:
  7694.  
  7695.      fort1 < fix.dat
  7696.  
  7697.     This command line causes the PAUSE command to take its input from
  7698.  fix.dat and causes fort2 to recognize that its input has been
  7699.  redirected. This allows fort2 to take its input from fort2.dat.
  7700.     This is a known problem in Version 4.01.
  7701.     This feature is under review and will be considered for inclusion
  7702.  in a future release.
  7703.  
  7704.  
  7705.  219. FORTRAN 4.10 README.DOC: Requesting Assistance from Microsoft
  7706.  
  7707.  Product Version(s): 4.10   | 4.10
  7708.  Operating System:   MS-DOS | OS/2
  7709.  Flags: PSSONLY | ENDUSER
  7710.  Last Modified: 30-OCT-1990    ArticleIdent: Q28721
  7711.  
  7712.  The following section of the FORTRAN README.DOC file provides
  7713.  information regarding reporting problems with the compiler.
  7714.  
  7715.  README.DOC -- (C) Copyright Microsoft Corporation, 1987, 1988
  7716.  Microsoft(R) FORTRAN Optimizing Compiler Version 4.10
  7717.  
  7718.  This document contains information about Version 4.10 of the
  7719.  Microsoft(R) FORTRAN Optimizing Compiler and libraries. Microsoft
  7720.  updates its documentation when it is reprinted, so you may find that
  7721.  some of the information in this file has already been included in your
  7722.  manuals.
  7723.  
  7724.  NOTE
  7725.  
  7726.  Microsoft CodeView(R) and the utilities have a separate readme
  7727.  file, CVREADME.DOC, on the CodeView for MS-DOS disk.
  7728.  
  7729.  REQUESTING ASSISTANCE FROM MICROSOFT -- (206) 454-2030
  7730.  
  7731.  When reporting problems with the compiler, please provide Microsoft
  7732.  Corporation with the following information to help in tracking down
  7733.  the problem:
  7734.  
  7735.     *   The compiler version number (from the logo that appears on the
  7736.         screen when you invoke the compiler using the FL command).
  7737.  
  7738.     *   The version of DOS you are running (use the VER command in DOS).
  7739.  
  7740.     *   Your system configuration (the machine, total memory, and total free
  7741.         memory at compiler execution time).
  7742.  
  7743.     *   The command line used in the compilation.
  7744.  
  7745.     *   All object files/libraries used to link, if necessary. You need
  7746.         not provide standard object files/libraries, but please state which
  7747.         ones you are using.
  7748.  
  7749.  Having this information will help solve your problem quickly.
  7750.  
  7751.  
  7752.  220. Converting Decimal Floating Point to IEEE Format
  7753.  
  7754.  Product Version(s): 4.01
  7755.  Operating System:   MS-DOS
  7756.  Flags: ENDUSER |
  7757.  Last Modified: 16-OCT-1987    ArticleIdent: Q25112
  7758.  
  7759.  Question:
  7760.     A program I compiled with Version 4.01 reads data files by a program
  7761.  compiled with Version 3.2 and decmath.lib. However, Version 4.01 no longer
  7762.  supports decmath.lib. Is there any way for me to read the data file?
  7763.  
  7764.  Response:
  7765.     Since you know the ordering of the variables in the files, you can convert
  7766.  the file by doing the following:
  7767.  
  7768.     1. Using a Version 3.2 program compiled with $decmath, read the old data
  7769.  file, and write a new file using formatted writes.
  7770.     2. Using a Version 4.01 program or a Version 3.2 program compiled without
  7771.  $decmath, read the new formatted file, and write a new unformatted (or binary
  7772.  whichever was used) file.
  7773.  
  7774.  
  7775.  221. Optimization Problem
  7776.  
  7777.  Product Version(s): 4.01
  7778.  Operating System:   MS-DOS
  7779.  Flags: ENDUSER | buglist4.01
  7780.  Last Modified:  7-OCT-1988    ArticleIdent: Q25113
  7781.  
  7782.  Problem:
  7783.  
  7784.  In the program fragment below, no code is generated for the assignment
  7785.  hibyt=hold. This problem does not occur if optimization is turned off
  7786.  or if line 36 is moved between lines 33 or 34. The statements are as
  7787.  follows:
  7788.  
  7789.     33  lowbyt=hold
  7790.     34  lowbyt=iand(lowbyt,lowmsk)
  7791.     35  call output(datprt,lowbyt)
  7792.     36  hibyt=hold
  7793.     37  hibyt=ishift(iand(hibyt,himsk),shift)
  7794.     38  call output(datprt,hibyt)
  7795.  
  7796.  Response:
  7797.  
  7798.  Microsoft has confirmed this to be a problem in Version 4.01. We are
  7799.  researching this problem and will post new information as it becomes
  7800.  available.
  7801.  
  7802.  
  7803.  222. "Invalid Object Module" Error
  7804.  
  7805.  Product Version(s): 4.01
  7806.  Operating System:   MS-DOS
  7807.  Flags: ENDUSER | buglist4.01
  7808.  Last Modified:  1-JUN-1988    ArticleIdent: Q25114
  7809.  
  7810.  Problem:
  7811.     When the following code is compiled with default options, the error
  7812.  "invalid object module at link time" is generated.
  7813.  
  7814.     character*128 string
  7815.     dimension string(640)
  7816.     data string/640*'help'/
  7817.     string(1)='bug'
  7818.     end
  7819.  
  7820.     The error is not generated when the last three lines are rewritten
  7821.  as follows:
  7822.  
  7823.      do 10 i=1,640
  7824.        string(i)='help'
  7825.  10  continue
  7826.      string(1)='bug'
  7827.      end
  7828.  
  7829.  Response:
  7830.     This is a known problem in Version 4.01 of the FORTRAN compiler.
  7831.     The error will exhibit itself if you try to initialize more than
  7832.  one CHARACTER array element with a size greater than 127 bytes.
  7833.     This problem can be worked around by reducing CHARACTER size below
  7834.  128 or initialize the array by using assignment statements.
  7835.  
  7836.  
  7837.  223. Large Arrays and Entry Statements
  7838.  
  7839.  Product Version(s): 4.01
  7840.  Operating System:   MS-DOS
  7841.  Flags: ENDUSER | buglist4.01
  7842.  Last Modified:  1-JUN-1988    ArticleIdent: Q25115
  7843.  
  7844.     After returning from the initial subroutine call and reentering
  7845.  through ENTRY statements, "incorrect address" is passed for the
  7846.  following code:
  7847.  
  7848.      real*4 a(20000)
  7849.      common /m1/m
  7850.      m=20000
  7851.      do 10 i=1,m
  7852.       a(i)=i
  7853.  10  continue
  7854.      call sub1(a)
  7855.      call el
  7856.      end
  7857.  
  7858.      subroutine sub1(a)
  7859.      real*4 a(m)
  7860.      common /m1/m
  7861.      write(*,*) a(1), a(m),m
  7862.      return
  7863.      entry el
  7864.      call e2
  7865.      return
  7866.      end
  7867.  
  7868.     This code works correctly if the variable m is not in common.
  7869.     This is a known problem in Version 4.01.
  7870.     Microsoft is researching this problem and will post new information
  7871.  as it becomes available.
  7872.  
  7873.  
  7874.  224. Concatenation Results Passed to Function
  7875.  
  7876.  Product Version(s): 4.01
  7877.  Operating System:   MS-DOS
  7878.  Flags: ENDUSER | buglist4.01
  7879.  Last Modified:  1-JUN-1988    ArticleIdent: Q25133
  7880.  
  7881.     The concatenation operation will not pass the proper results to the
  7882.  formal argument when used within a function call. The proper results
  7883.  seem to be followed by part of the copyright message instead of
  7884.  blanks. The following program demonstrates this problem:
  7885.  
  7886.          CHARACTER*80 FUNCTION OKPLT(X)
  7887.          CHARACTER*80 X
  7888.          WRITE(*,'(A)') X
  7889.          OKPLT = X
  7890.          RETURN
  7891.          END
  7892.  C
  7893.          CHARACTER*80 OKPLT
  7894.          CHARACTER*80 DOIT
  7895.          CHARACTER*10 CHARVAR
  7896.          CHARVAR = '1234567890'
  7897.          DOIT = 'TEXT'// CHARVAR // ' TEXT2'
  7898.          WRITE (*,'(A)') DOIT
  7899.          DOIT = OKPLT('TEXT'// CHARVAR // ' TEXT2')
  7900.  C       The above line does not pass the concatenation results
  7901.  C       correctly.
  7902.          WRITE (*,'(A)') DOIT
  7903.          END
  7904.  
  7905.     This is a known problem in Version 4.01.
  7906.     Microsoft is researching this problem and will post new information
  7907.  as it becomes available.
  7908.  
  7909.  
  7910.  225. Loop Optimization
  7911.  
  7912.  Product Version(s): 4.00
  7913.  Operating System:   MS-DOS
  7914.  Flags: ENDUSER | TAR65661 buglist4.01
  7915.  Last Modified:  1-JUN-1988    ArticleIdent: Q25161
  7916.  
  7917.  Problem:
  7918.     The following code will generate an incorrect result when loop
  7919.  optimization is on:
  7920.  
  7921.            n=3
  7922.            nseq=1
  7923.            ns=21
  7924.            do 80 k=1,ns
  7925.            ni=k
  7926.            nbit=0
  7927.    1       nbit=nbit+mod(ni,2)
  7928.            ni=ni/2
  7929.            if(ni.gt.0) go to 1
  7930.            if(nbit.ne.n) go to 80
  7931.            nseq=nseq+1
  7932.    80      continue
  7933.            write(*,*) nseq
  7934.            end
  7935.  
  7936.     In the above example, "nseq" should be 7; instead, it returns 22.
  7937.  
  7938.  Response:
  7939.     This is a known problem in Version 4.01.
  7940.     The only workaround is to turn off loop optimization by recompiling
  7941.  the source with /Odct option.
  7942.     Microsoft is researching the problem and will post new information
  7943.  as it becomes available.
  7944.  
  7945.  
  7946.  226. Problem with Function INT and Optimization
  7947.  
  7948.  Product Version(s): 4.01
  7949.  Operating System:   MS-DOS
  7950.  Flags: ENDUSER | TAR65841 buglist4.01
  7951.  Last Modified:  1-JUN-1988    ArticleIdent: Q25380
  7952.  
  7953.     The intrinsic function INT does not work correctly if optimization
  7954.  is on; it rounds the number off instead of truncating it. The
  7955.  following is a sample code:
  7956.  
  7957.        integer*4 i
  7958.        flt = 128.67
  7959.        i=nint(flt)
  7960.        write(*,*) 'flt,i,nint(flt),int(flt):',flt,i,nint(flt),int(flt)
  7961.        end
  7962.  
  7963.     With the default optimization, the output is the following:
  7964.  
  7965.     flt,i,nint(flt),int(flt):    128.670000     129     129   129
  7966.  
  7967.     The correct output should be:
  7968.  
  7969.     flt,i,nint(flt),int(flt):    128.670000     129     129   128
  7970.  
  7971.     This is a known problem with Version 4.01.
  7972.     Microsoft is researching this problem and will post new information
  7973.  as it becomes available.
  7974.     The workaround is to turn off optimization by recompiling the
  7975.  source with /Od option.
  7976.  
  7977.  
  7978.  227. Internal Compiler Error: grammar.c, Line 91 and FORTRAN 4.01
  7979.  
  7980.  Product Version(s): 4.01
  7981.  Operating System:   MS-DOS
  7982.  Flags: ENDUSER | buglist4.01 fixlist4.10
  7983.  Last Modified: 24-JUL-1990    ArticleIdent: Q25429
  7984.  
  7985.  Problem:
  7986.     The following program generates "fatal error F1001: Internal
  7987.  Compiler Error in file grammar.c, line 91":
  7988.  
  7989.          PROGRAM GRAMMAR
  7990.          DIMENSION ITIMES(11)
  7991.          DIMENSION ITOT(11,50),IBEG(11,50)
  7992.          COMMON/A2/IHRS,NPAR
  7993.          DATA NTIMES/0/
  7994.          DO 30 I=1,NPAR
  7995.          IF(ITOT(I,ITIMES(I)).LT.IHRS)THEN
  7996.             IBEG(I,ITIMES(I))=0
  7997.          ELSE
  7998.             ITIMES(I)=ITIMES(I)+1
  7999.          ENDIF
  8000.   30     IF(ITIMES(I).GT.NTIMES)NTIMES=ITIMES(I)
  8001.          RETURN
  8002.          END
  8003.  
  8004.  Response:
  8005.     Microsoft has confirmed this to be a problem with Version 4.01 of
  8006.  the FORTRAN compiler. This problem was corrected in Version 4.10.
  8007.     The workaround is to either turn off loop optimization with the /Od
  8008.  or /Odct, or to ensure floating point variable storage with the /Op
  8009.  switch.
  8010.  
  8011.  
  8012.  228. Repeated Use of BACKSPACE Causes Run-Time Error F6501
  8013.  
  8014.  Product Version(s): 4.01
  8015.  Operating System:   MS-DOS
  8016.  Flags: ENDUSER | buglist4.01
  8017.  Last Modified:  1-JUN-1988    ArticleIdent: Q25432
  8018.  
  8019.  Problem:
  8020.     The following program and data file cause run-time error F6501 "End
  8021.  of File Encountered":
  8022.  
  8023.     $storage:2
  8024.     $debug
  8025.             character*80 rtnstr
  8026.             integer fun/3/
  8027.             open(fun,file='test.dat')
  8028.             read(fun,1000) rtnstr
  8029.     1000  format(A)
  8030.             backspace fun
  8031.             backspace fun
  8032.             close(fun)
  8033.             end
  8034.  
  8035.  Response:
  8036.     The error seems to be caused by repeated use of BACKSPACE when the
  8037.  file pointer already is positioned near the beginning of the file. The
  8038.  data file TEST.DAT contains one integer number and no carriage return
  8039.  line feed.
  8040.     The workaround is to set the blocksize to a larger value, as in the
  8041.  following open statement:
  8042.  
  8043.     open(fun,file='test.dat',blocksize=2048)
  8044.  
  8045.     Microsoft is researching this problem and will post new information
  8046.  as it becomes available.
  8047.  
  8048.  
  8049.  229. Problem Evaluating Expressions with Complex Variables
  8050.  
  8051.  Product Version(s): 4.00 4.01
  8052.  Operating System:   MS-DOS
  8053.  Flags: ENDUSER | buglist4.00 buglist4.01
  8054.  Last Modified: 20-OCT-1988    ArticleIdent: Q25452
  8055.  
  8056.  Problem:
  8057.  
  8058.  The following program illustrates a problem with the Versions 4.00 and
  8059.  4.01 FORTRAN compiler regarding the evaluation of complex expressions:
  8060.  
  8061.         program cmplx
  8062.         complex*8 x, z
  8063.  
  8064.         z=(0., 1.)
  8065.         write(*,'(1x,''z=             '', 2(1x, f10.3))') z
  8066.         x = 1.-z
  8067.         write(*,'(1x,''x=1.-z         '',2(1x,f10.3))') x
  8068.         x = 1.+(-z)
  8069.         write(*,'(1x,''x=1.+(-z)      '',2(1x,f10.3))') x
  8070.         x = 1.+(-1.)*z
  8071.         write(*,'(1x,''x=1.+(-1.)*z   '',2(1x,f10.3))') x
  8072.         x = 1.+(0.-1.)*z
  8073.         write(*,'(1x,''x=1.+(0.-1.)*z '',2(1x,f10.3))') x
  8074.         x = 1.-z
  8075.         write(*,'(1x,''x=1.-z         '',2(1x,f10.3))') x
  8076.         end
  8077.  
  8078.  The program was compiled using the default compiler options; however,
  8079.  the option selected does not appear to impact the performance of this
  8080.  program. Also, the use of complex*16 produces the same result.
  8081.  
  8082.  The output under FORTRAN Version 4.00 is the following:
  8083.  
  8084.     z=                    .000      1.000
  8085.     x=1.-z               1.000      1.000
  8086.     x=1.+(-z)            1.000     -1.000
  8087.     x=1.+(-1.)*z         1.000       .000
  8088.     x=1.+(0.-1.)*z       1.000       .000
  8089.     x=1.-z               1.000      1.000
  8090.  
  8091.  The output under FORTRAN Version 4.01 is the following:
  8092.  
  8093.     z=                    .000      1.000
  8094.     x=1.-z               1.000     -1.000
  8095.     x=1.+(-z)            1.000     -1.000
  8096.     x=1.+(-1.)*z         1.000       .000
  8097.     x=1.+(0.-1.)*z       1.000       .000
  8098.     x=1.-z               1.000     -1.000
  8099.  
  8100.  The correct result is the following:
  8101.  
  8102.     z=                    .000      1.000
  8103.     x=1.-z               1.000     -1.000
  8104.     x=1.+(-z)            1.000     -1.000
  8105.     x=1.+(-1.)*z         1.000     -1.000
  8106.     x=1.+(0.-1.)*z       1.000     -1.000
  8107.     x=1.-z               1.000     -1.000
  8108.  
  8109.  Response:
  8110.  
  8111.  Microsoft has confirmed this to be a problem in Versions 4.00 and
  8112.  4.01. We are researching this problem and will post new information as
  8113.  it becomes available.
  8114.  
  8115.  
  8116.  230. Internal Compiler Error: trees.c, Line 1165
  8117.  
  8118.  Product Version(s): 4.00 4.01
  8119.  Operating System:   MS-DOS
  8120.  Flags: ENDUSER | buglist4.00 buglist4.01
  8121.  Last Modified:  1-JUN-1988    ArticleIdent: Q25465
  8122.  
  8123.     The following program:
  8124.  
  8125.     program trees
  8126.     character ch(20)
  8127.     ch() = 'a'
  8128.     end
  8129.  
  8130.  causes the compiler to generate the following error message:
  8131.  
  8132.   trees.for(3) : fatal error F1001: Internal Compiler Error
  8133.             (compiler file '../trees.c', line 1165)
  8134.             Contact Microsoft Technical Support
  8135.  
  8136.     This program was compiled using the default compiler options.
  8137.  However, when options are selected, they do not appear to affect the
  8138.  error.
  8139.     This is a known problem in Versions 4.00 and 4.01.
  8140.     Microsoft is researching this problem and will post new information
  8141.  as it becomes available.
  8142.     The only workaround is to include an array index on Line 3 of the
  8143.  example.
  8144.  
  8145.  
  8146.  231. FORTRAN 4.10 README.DOC: OS/2 Demonstration Program
  8147.  
  8148.  Product Version(s): 4.10    | 4.10
  8149.  Operating System:   MS-DOS  | OS/2
  8150.  Flags: PSSONLY | ENDUSER Doscalls API system
  8151.  Last Modified: 30-OCT-1990    ArticleIdent: Q28796
  8152.  
  8153.     The following information is from the FORTRAN Version 4.10
  8154.  README.DOC file:
  8155.  
  8156.  OS/2 Demonstration Program
  8157.     The program SORTDEMO.FOR on the distribution disks contains
  8158.  examples of how to make OS/2 calls from a FORTRAN program. See the
  8159.  PACKING.LST file for the location of the program.
  8160.  
  8161.  
  8162.  232. FORTRAN 4.10 README.DOC: Common Problems with SETUP
  8163.  
  8164.  Product Version(s): 4.10    | 4.10
  8165.  Operating System:   MS-DOS  | OS/2
  8166.  Flags: PSSONLY | ENDUSER
  8167.  Last Modified: 30-OCT-1990    ArticleIdent: Q28797
  8168.  
  8169.     The following information is from the FORTRAN Version 4.10
  8170.  README.DOC File:
  8171.  
  8172.  Common Problems with SETUP
  8173.     When run to create a library, SETUP may quit with an error message
  8174.  telling you that the LIB program cannot be found or run. Doing one or
  8175.  more of the following steps, in turn, should resolve the problem:
  8176.  
  8177.     1. Ensure that the LIB.EXE program is in one of the directories in
  8178.  the path. If necessary, modify your path and rerun SETUP.
  8179.     2. Remove all terminate and stay resident (TSR) programs from
  8180.  memory and try SETUP again.
  8181.     3. Reduce your system's environment space as much as possible and
  8182.  rerun SETUP.
  8183.  
  8184.  
  8185.  233. FORTRAN 4.10 README.DOC: Floating-Point Operations
  8186.  
  8187.  Product Version(s): 4.10    | 4.10
  8188.  Operating System:   MS-DOS  | OS/2
  8189.  Flags: PSSONLY | ENDUSER
  8190.  Last Modified: 30-OCT-1990    ArticleIdent: Q28798
  8191.  
  8192.     The following information is from the FORTRAN Version 4.10
  8193.  README.DOC file:
  8194.  
  8195.  Floating-Point Operations under PC-DOS 3.20
  8196.     If you are running IBM(R) Personal Computer DOS (PC-DOS) 3.20 and
  8197.  trapping floating-point exceptions in your program, you may find it
  8198.  necessary to patch PC-DOS 3.20 to get proper operation when
  8199.  floating-point exceptions occur. Please refer to the file named
  8200.  README.DOC in the \PATCH subdirectory on the Setup distribution disk
  8201.  for instructions on making this patch.
  8202.  
  8203.  Floating-Point Operations under MS-DOS 3.20
  8204.     This information is important only if your system has ALL of the
  8205.  following characteristics:
  8206.  
  8207.     1. You use MS-DOS Version 3.20.
  8208.     2. You boot from a hard disk drive.
  8209.     3. Your system has a math coprocessor (for instance, an 8087 chip).
  8210.     4. You run programs that use floating-point math.
  8211.  
  8212.     For systems that satisfy all of the preceding conditions, you may
  8213.  be able to eliminate floating-point math problems by installing a
  8214.  small patch in DOS. If you are not sure whether you need the patch,
  8215.  perform the following steps:
  8216.  
  8217.     1. Copy the program PATCH87.EXE (included in this release on Disk
  8218.  1) to the root directory of your hard disk drive.
  8219.     2. Reboot your system from the hard disk and DO NOT PERFORM ANY
  8220.  FLOPPY-DISK OPERATIONS after rebooting. It is very important that you
  8221.  avoid floppy-disk I/O after rebooting, since that will affect the
  8222.  reliability of the diagnostic test that you are about to perform.
  8223.     3. If necessary, use the CD command to move to the root directory
  8224.  of your hard disk drive.
  8225.     4. Run the PATCH87.EXE program by entering this command at the DOS
  8226.  prompt:
  8227.              PATCH87
  8228.  
  8229.     5. The program performs a diagnostic test on your system to
  8230.  determine whether it needs the DOS patch, and, if the patch is needed,
  8231.  whether it can be performed successfully. If the program tells you
  8232.  that you need to install the DOS patch, and that it can be done,
  8233.  follow the procedure described in the next section.
  8234.  
  8235.     NOTE: The floating-point problem has been eliminated in versions of
  8236.  MS-DOS higher than 3.20. This includes MS-DOS Versions 3.21 and 3.30.
  8237.     If you performed the preceding test and determined that you should
  8238.  install the DOS patch on your system, perform the following steps:
  8239.  
  8240.     1. Format a blank floppy disk. (Do NOT use the /s formatting option
  8241.  to transfer system files to the disk.)
  8242.     2. Use the SYS command to copy IO.SYS and MSDOS.SYS from the root
  8243.  directory of your hard disk to the new floppy disk. For instance, if
  8244.  you boot from Drive C:, you would enter the following commands:
  8245.  
  8246.              C:
  8247.              SYS A:
  8248.  
  8249.     3. Use the COPY command to copy COMMAND.COM and SYS.COM to the same
  8250.  floppy disk.
  8251.     4. Use the COPY command to copy the program PATCH87.EXE (included
  8252.  in this release) to the same floppy disk.
  8253.     5. Change the current drive and directory to the floppy disk, by
  8254.  entering the following command:
  8255.  
  8256.              A:
  8257.  
  8258.     6. Install the DOS patch by entering the following command:
  8259.  
  8260.              PATCH87 /F
  8261.  
  8262.     WARNING: If you experience any disk errors during steps 2 through
  8263.  6, do not proceed with step 7. Reboot from your hard disk and repeat
  8264.  the entire process.
  8265.     7. If you have not experienced any errors, use the SYS command to
  8266.  transfer the files IO.SYS and MSDOS.SYS from the floppy disk back to
  8267.  your hard disk. For instance, if the boot directory of your system is
  8268.  the root directory of Drive C:, you would enter the following command
  8269.  at the DOS prompt:
  8270.  
  8271.              A:
  8272.              SYS C:
  8273.  
  8274.     8. The DOS patch has been installed. Reboot the system.
  8275.  
  8276.  
  8277.  234. FORTRAN 4.10 README.DOC: New Versions of LINK.EXE and LIB.EXE
  8278.  
  8279.  Product Version(s): 4.10   | 4.10
  8280.  Operating System:   MS-DOS | OS/2
  8281.  Flags: PSSONLY | ENDUSER
  8282.  Last Modified: 30-OCT-1990    ArticleIdent: Q28799
  8283.  
  8284.     The following information is from the FORTRAN Version 4.10
  8285.  README.DOC file:
  8286.  
  8287.  GENERAL NOTES
  8288.     Version 4.10 of the Microsoft FORTRAN Optimizing Compiler fixes a
  8289.  number of errors in Version 4.01.
  8290.     This section provides additional information about the compiler,
  8291.  how the compiler optimizes programs, and about common problems and
  8292.  their solutions.
  8293.  
  8294.  New Versions of LINK.EXE and LIB.EXE
  8295.     Earlier versions of the linker will not correctly link programs
  8296.  compiled with FORTRAN Version 4.10. Use the Segmented-Executable
  8297.  linker (LINK.EXE) included on the distribution disks, or a later
  8298.  version. You may need to modify the path specified in your
  8299.  AUTOEXEC.BAT file to ensure that the correct version of the linker is
  8300.  used.
  8301.     Also be sure to use the version of the Library Manager, LIB.EXE,
  8302.  included on the distribution disks. You may need to modify your path
  8303.  to make sure the correct version of LIB is used.
  8304.  
  8305.  
  8306.  235. FORTRAN 4.10 README.DOC: Setting Up the Microsoft Editor
  8307.  
  8308.  Product Version(s): 4.10   | 4.10
  8309.  Operating System:   MS-DOS | OS/2
  8310.  Flags: PSSONLY | ENDUSER
  8311.  Last Modified: 30-OCT-1990    ArticleIdent: Q28800
  8312.  
  8313.     The following information is from the FORTRAN Version 4.10
  8314.  README.DOC file:
  8315.  
  8316.  Setting Up the Microsoft Editor
  8317.     The FORTRAN setup program does not install the Microsoft Editor.
  8318.  To install the Microsoft Editor, insert the Microsoft Editor disk and
  8319.  run the MSETUP batch file. To use the MSETUP batch file under
  8320.  protected-mode OS/2, rename MSETUP.BAT to MSETUP.CMD.
  8321.     For more information about the Microsoft Editor, see the Microsoft
  8322.  Editor User's Guide and the CVREADME.DOC file on the CodeView for
  8323.  MS-DOS disk.
  8324.  
  8325.  
  8326.  236. FORTRAN 4.10 README.DOC:Optimizations and End-of-File Checking
  8327.  
  8328.  Product Version(s): 4.10   | 4.10
  8329.  Operating System:   MS-DOS | OS/2
  8330.  Flags: PSSONLY | ENDUSER
  8331.  Last Modified: 30-OCT-1990    ArticleIdent: Q28801
  8332.  
  8333.     The following information is from the FORTRAN Version 4.10
  8334.  README.DOC file:
  8335.  
  8336.  Optimizations and End-of-File Checking
  8337.     With the default optimizations performed by the compiler, a READ
  8338.  statement like
  8339.  
  8340.     READ (1,*,END=100) (X(I), I = 1, 10)
  8341.  
  8342.  may cause problems because end-of-file checking is performed only when
  8343.  the loop is exited, not after each pass through the loop.
  8344.     If you encounter similar problems in a program, compile the program
  8345.  with the /Od option to disable optimizations.
  8346.  
  8347.  
  8348.  237. FORTRAN 4.10 README.DOC: Linking MS FORTRAN and MS C Modules
  8349.  
  8350.  Product Version(s): 4.10   | 4.10
  8351.  Operating System:   MS-DOS | OS/2
  8352.  Flags: PSSONLY | ENDUSER
  8353.  Last Modified: 30-OCT-1990    ArticleIdent: Q28802
  8354.  
  8355.     The following information is from the FORTRAN Version 4.10
  8356.  README.DOC file:
  8357.  
  8358.  Linking Microsoft FORTRAN and Microsoft C Modules
  8359.     If you use SETUP to create a library that is compatible with
  8360.  Microsoft C, then you MUST specify and use the actual Microsoft C
  8361.  Version 4.00 library (either LLIBC.LIB or MLIBC.LIB, depending on the
  8362.  memory model) when you link with the C-compatible FORTRAN library.
  8363.  
  8364.  
  8365.  238. FORTRAN 4.10 README.DOC: Floating-Point Options
  8366.  
  8367.  Product Version(s): 4.10    | 4.10
  8368.  Operating System:   MS-DOS  | OS/2
  8369.  Flags: PSSONLY | ENDUSER
  8370.  Last Modified: 30-OCT-1990    ArticleIdent: Q28803
  8371.  
  8372.     The following information is from the FORTRAN Version 4.10
  8373.  README.DOC file:
  8374.  
  8375.  Library Considerations for Floating-Point Options
  8376.     See Section 8.3.1 of the Microsoft FORTRAN Compiler User's Guide
  8377.  for information about specifying libraries in addition to the default
  8378.  library for the floating-point option that you select on the FL
  8379.  command line.
  8380.  
  8381.  
  8382.  239. FORTRAN 4.10 README.DOC: Internal Compiler Assertions
  8383.  
  8384.  Product Version(s): 4.10    | 4.10
  8385.  Operating System:   MS-DOS  | OS/2
  8386.  Flags: PSSONLY | ENDUSER
  8387.  Last Modified: 30-OCT-1990    ArticleIdent: Q28804
  8388.  
  8389.     The following information is from the FORTRAN Version 4.10
  8390.  README.DOC file:
  8391.  
  8392.  Internal Compiler Assertions
  8393.     In trying to perform optimizations on extremely complex code, the
  8394.  compiler may experience an internal error condition. Sometimes it is
  8395.  possible to work around this problem by disabling the optimization
  8396.  pass of the compiler with the /Od option.
  8397.     In all cases where you experience this type of compiler error,
  8398.  please contact Microsoft Corporation so that corrections can be made
  8399.  for subsequent releases.
  8400.  
  8401.  
  8402.  240. FORTRAN 4.10 README.DOC: Stack Size in OS/2 Programs
  8403.  
  8404.  Product Version(s): 4.10    | 4.10
  8405.  Operating System:   MS-DOS  | OS/2
  8406.  Flags: PSSONLY | ENDUSER
  8407.  Last Modified: 30-OCT-1990    ArticleIdent: Q28805
  8408.  
  8409.     The following information is from the FORTRAN Version 4.10
  8410.  README.DOC file:
  8411.  
  8412.  Stack Size in OS/2 Programs
  8413.     Any FORTRAN program running in protected-mode should have at least
  8414.  2K of free stack space at the beginning of an operating system call.
  8415.  Because the FORTRAN program itself uses some of the stack before the
  8416.  system call, the default stack size of 2K may not be adequate. You
  8417.  should increase the stack size of your program to ensure sufficient
  8418.  free stack space for operating system calls. Use the /F driver option
  8419.  or the /ST linker option to increase the stack size. A stack size of
  8420.  3K to 4K should be sufficient in most cases.
  8421.     NOTE: All programs running in protected-mode make operating system
  8422.  calls through the run-time system and should use a stack size of 3K to
  8423.  4K.
  8424.  
  8425.  
  8426.  241. MS-DOS Device Names
  8427.  
  8428.  Product Version(s): 3.20
  8429.  Operating System:   MS-DOS
  8430.  Flags: ENDUSER |
  8431.  Last Modified: 12-MAY-1988    ArticleIdent: Q10200
  8432.  
  8433.  Question:
  8434.     DOS treats file names such as CON and ERR as device names when the
  8435.  DOS2FOR library is used.
  8436.     Can DOS treat any file name as a device?
  8437.  
  8438.  Response:
  8439.     The association of the name ERR to the DOS device handle "stderr"
  8440.  is done by FORTRAN (i.e., DOS2FOR, not DOS itself).
  8441.     There is no FORTRAN command, subroutine, or function to determine
  8442.  whether or not a given name is the name of a DOS device. It is
  8443.  possible to make this determination in an assembly language subroutine
  8444.  by doing the following:
  8445.  
  8446.     1. Open a handle using the file name
  8447.     2. Perform an IOCTL call on that handle
  8448.  
  8449.  
  8450.  242. FORTRAN 4.10 README.DOC: Iteration Counts for DO Loops
  8451.  
  8452.  Product Version(s): 4.10   | 4.10
  8453.  Operating System:   MS-DOS | OS/2
  8454.  Flags: PSSONLY | ENDUSER
  8455.  Last Modified: 30-OCT-1990    ArticleIdent: Q28806
  8456.  
  8457.     The following information is from the FORTRAN Version 4.10
  8458.  README.DOC file:
  8459.  
  8460.  Iteration Counts for DO Loops
  8461.     As explained in Section 5.3.13 of the Microsoft FORTRAN Optimizing
  8462.  Compiler Language Reference, the following formula is used to compute
  8463.  the iteration count for a DO loop:
  8464.  
  8465.       MAX(INT((stop - start +inc)/inc), 0)
  8466.  
  8467.     Note that the iteration count is computed in two-byte precision,
  8468.  the default for integers. If the iteration count overflows this
  8469.  precision, the results are unpredictable. The following is an example
  8470.  of code that causes this problem:
  8471.  
  8472.       IMPLICIT INTEGER*2 (A-Z)
  8473.       IEND = 32000
  8474.       ISTEP = 12000
  8475.       DO 10 I=0,IEND,ISTEP
  8476.         WRITE (*,*) 'I=',I
  8477.  10   CONTINUE
  8478.       END
  8479.  
  8480.  
  8481.  243. .LST Files and Parameter Statement
  8482.  
  8483.  Product Version(s): 3.20
  8484.  Operating System:   MS-DOS
  8485.  Flags: ENDUSER |
  8486.  Last Modified: 12-MAY-1988    ArticleIdent: Q10376
  8487.  
  8488.  Problem:
  8489.     .LST files do not list the data type of identifiers used in
  8490.  parameter definitions.
  8491.  
  8492.  Response:
  8493.     This problem was corrected in Version 3.30.
  8494.  
  8495.  
  8496.  244. FORTRAN 4.10 README.DOC: Path Specifications for the Linker
  8497.  
  8498.  Product Version(s): 4.10   | 4.10
  8499.  Operating System:   MS-DOS | OS/2
  8500.  Flags: PSSONLY | ENDUSER
  8501.  Last Modified: 30-OCT-1990    ArticleIdent: Q28807
  8502.  
  8503.     The following information is from the FORTRAN Version 4.10
  8504.  README.DOC file:
  8505.  
  8506.  Path Specifications for the Linker
  8507.     Please make sure that the linker that comes with the Microsoft
  8508.  FORTRAN Optimizing Compiler Version 4.10 is the first linker in your
  8509.  path specification.
  8510.  
  8511.  
  8512.  245. Source File Named "ERR.FOR"
  8513.  
  8514.  Product Version(s): 3.20
  8515.  Operating System:   MS-DOS
  8516.  Flags: enduser |
  8517.  Last Modified:  9-MAR-1988    ArticleIdent: Q10411
  8518.  
  8519.  Problem:
  8520.     A source file with the name "ERR.FOR" hangs the first pass of the
  8521.  compiler (FOR1).
  8522.  
  8523.  Response:
  8524.     This is not a problem with the compiler but is a restriction that
  8525.  has been eliminated in Version 4.00.
  8526.     This file name does not hang the computer; rather, the computer is
  8527.  waiting for input from the keyboard. Issuing a CONTROL-C will return
  8528.  you to the DOS prompt.
  8529.     Both the FORTRAN compiler and the run-time library associate the
  8530.  name "ERR" with the MS-DOS standard error device handle. When you
  8531.  issue the command "FOR1 ERR;", the FORTRAN compiler expects source
  8532.  code from the keyboard rather than a file named "ERR.FOR".
  8533.  
  8534.  
  8535.  246. FORTRAN 4.10 README.DOC: Invariant Expressions in DO Loops
  8536.  
  8537.  Product Version(s): 4.10   | 4.10
  8538.  Operating System:   MS-DOS | OS/2
  8539.  Flags: PSSONLY | ENDUSER
  8540.  Last Modified: 30-OCT-1990    ArticleIdent: Q28808
  8541.  
  8542.     The following information is from the FORTRAN Version 4.10
  8543.  README.DOC file:
  8544.  
  8545.  Invariant Expressions in DO Loops
  8546.     Calculations in DO loops may involve variables whose values do not
  8547.  change within the loop. Such calculations should be performed outside
  8548.  of the loop. Performing calculations outside the loop saves time and
  8549.  allows you, rather than the compiler, to choose which invariant
  8550.  expressions are removed.
  8551.     The following sample program includes a DO loop that may cause
  8552.  program failure:
  8553.  
  8554.              REAL NUMER
  8555.              DIMENSION ARRAY(100)
  8556.              DO 10 I=1,100
  8557.                IF (DENOM .NE. 0) ARRAY(I) = ARRAY(I)+NUMER/DENOM
  8558.       10     CONTINUE
  8559.              END
  8560.  
  8561.     The compiler knows that NUMER/DENOM does not change within the
  8562.  loop, so it calculates NUMER/DENOM only once: before the start of the
  8563.  loop and before the IF statement within the loop can check for
  8564.  division by zero. You could rewrite the program as shown below to
  8565.  avoid this problem:
  8566.  
  8567.             REAL NUMER
  8568.             DIMENSION ARRAY(100)
  8569.             TEMP = 0.0
  8570.             IF (DENOM .NE. 0) TEMP = NUMER/DENOM
  8571.             DO 10 I=1,100
  8572.               ARRAY(I) = ARRAY(I)+TEMP
  8573.       10    CONTINUE
  8574.             END
  8575.  
  8576.  
  8577.  247. FORTRAN 4.10 README.DOC: Input/Output System
  8578.  
  8579.  Product Version(s): 4.10   | 4.10
  8580.  Operating System:   MS-DOS | OS/2
  8581.  Flags: PSSONLY | ENDUSER
  8582.  Last Modified: 30-OCT-1990    ArticleIdent: Q28809
  8583.  
  8584.     The following information is from the FORTRAN Version 4.10
  8585.  README.DOC file:
  8586.  
  8587.  NEW AND CHANGED FEATURES
  8588.     The following notes describe important new and changed features in
  8589.  the Microsoft FORTRAN Optimizing Compiler and the software provided
  8590.  with the compiler.
  8591.  
  8592.  Input/Output System -- Limits on Left Tabbing
  8593.     Left tabbing is legal within records written to devices. However,
  8594.  if the record that is written is longer than the buffer associated
  8595.  with the device, you cannot left tab to a position corresponding to
  8596.  the "previous" buffer.
  8597.     For example, the buffer associated with the console is 132 bytes
  8598.  long. If a record of 140 bytes is written to the console, left tabbing
  8599.  is allowed for only eight bytes, since the first 132 bytes of the
  8600.  record have been sent to the device and are no longer accessible.
  8601.  
  8602.  IOCHECK and Run-Time Error Numbers
  8603.     If the IOSTAT option is set and an error or end-of-file occurs at
  8604.  run time, the "iocheck" variable is set to the number of the run-time
  8605.  error. For example, if the following READ statement encounters an
  8606.  end-of-file
  8607.  
  8608.     READ(1,'(I5)',IOSTAT=IER) JUNK
  8609.  
  8610.  the IER variable is set to 6501, the number of the run-time error for
  8611.  an end-of-file condition.
  8612.  
  8613.  The END= Option with Direct-Access Files
  8614.     The END= I/O option can be specified along with the REC= I/O
  8615.  option in I/O statements.
  8616.  
  8617.  
  8618.  248. FORTRAN 4.10 README.DOC: New and Changed Compiler Features
  8619.  
  8620.  Product Version(s): 4.10    | 4.10
  8621.  Operating System:   MS-DOS  | OS/2
  8622.  Flags: PSSONLY | ENDUSER
  8623.  Last Modified: 30-OCT-1990    ArticleIdent: Q28810
  8624.  
  8625.     The following information is from the FORTRAN Version 4.10
  8626.  README.DOC file:
  8627.  
  8628.  Compiler -- Underscores (_) in Variable Names
  8629.     The underscore (_) can be used in variable names, as long as it is
  8630.  not the first character of a name.
  8631.  
  8632.  Character-Assignment Statements
  8633.     In a character-assignment statement, the variable to the left of
  8634.  the equal sign (that is, the variable having a value assigned to it)
  8635.  cannot appear as part of the character expression to the right of the
  8636.  equal sign (that is, the expression being assigned). For example, the
  8637.  following statement gives undefined results:
  8638.  
  8639.        var = varp // var
  8640.  
  8641.  The FUNCTION Statement
  8642.     In FUNCTION statements, the length specifier for the function type
  8643.  may follow the function name. For example, the following two
  8644.  declarations are equivalent:
  8645.  
  8646.        INTEGER*4 FUNCTION X(A)
  8647.  
  8648.        INTEGER FUNCTION X*4(A)
  8649.  
  8650.  Limits on Assigned-GOTO Statements
  8651.     The compiler limit on assigned-GOTO statements has been raised from
  8652.  64 per subroutine to 256 per subroutine.
  8653.  
  8654.  The PAUSE Statement
  8655.     If a string argument follows the PAUSE statement, then on output
  8656.  the argument appears without the "Pause" and the pause message. If a
  8657.  digit argument follows the PAUSE statement, then on output the "Pause"
  8658.  appears, followed by the digit. The following examples illustrate
  8659.  PAUSE statements and the messages that the statements display:
  8660.  
  8661.  C   EXAMPLE 1:  PAUSE STATEMENT WITH NO ARGUMENT
  8662.  
  8663.        PAUSE
  8664.  
  8665.  Pause - Please enter a blank line (to continue) or a DOS command.
  8666.  
  8667.  C   EXAMPLE 2:  PAUSE STATEMENT WITH STRING ARGUMENT
  8668.  
  8669.        PAUSE 'hit return to continue'
  8670.  
  8671.  hit return to continue
  8672.  
  8673.  C   EXAMPLE 3:  PAUSE STATEMENT WITH DIGIT ARGUMENT
  8674.  
  8675.        PAUSE 1
  8676.  
  8677.  Pause - 1
  8678.  
  8679.  
  8680.  249. Colon Required between the $NOTLARGE and Following Identifiers
  8681.  
  8682.  Product Version(s): 3.20
  8683.  Operating System:   MS-DOS
  8684.  Flags: ENDUSER | docerr
  8685.  Last Modified: 19-SEP-1988    ArticleIdent: Q10538
  8686.  
  8687.  Problem:
  8688.  
  8689.  The following code sample generates the error message "Error 824 --
  8690.  $large already set":
  8691.  
  8692.  $LARGE $NOTLARGE A,B
  8693.     DIMENSION A(10),B(10)
  8694.     END
  8695.  
  8696.  Response:
  8697.  
  8698.  Contrary to Page 73 of the "Microsoft FORTRAN Compiler User's Guide,"
  8699.  a colon is required between the $NOTLARGE and the identifiers that
  8700.  follow it. When the colon is missing, the identifiers are ignored and
  8701.  an error is generated. The above code should be changed to the
  8702.  following:
  8703.  
  8704.  $LARGE $NOTLARGE: A,B
  8705.     DIMENSION A(10),B(10)
  8706.     END
  8707.  
  8708.  
  8709.  250. Cannot Detect End of File
  8710.  
  8711.  Product Version(s): 3.20
  8712.  Operating System:   MS-DOS
  8713.  Flags: ENDUSER | docerr
  8714.  Last Modified:  7-SEP-1988    ArticleIdent: Q10539
  8715.  
  8716.  Problem:
  8717.  
  8718.  I am unable to detect end-of-file for direct access files.
  8719.  
  8720.  Response:
  8721.  
  8722.  Page 81 of the "Microsoft FORTRAN Compiler Reference" manual
  8723.  incorrectly states ENDFILE works when linked with the DOS2FOR library.
  8724.  
  8725.  The file-handling methods under DOS Versions 1.x cannot work with
  8726.  direct-access files. However, you can detect end-of-file for direct
  8727.  access files if you link with the DOS2FOR library that uses DOS
  8728.  Versions 2.x file-handling methods.
  8729.  
  8730.  
  8731.  251. FORTRAN 4.10 README.DOC: OS/2 Calls from FORTRAN
  8732.  
  8733.  Product Version(s): 4.10    | 4.10
  8734.  Operating System:   MS-DOS | OS/2
  8735.  Flags: PSSONLY | ENDUSER Doscalls API system
  8736.  Last Modified: 30-OCT-1990    ArticleIdent: Q28811
  8737.  
  8738.     The following information is from the FORTRAN Version 4.10
  8739.  README.DOC file:
  8740.  
  8741.  OS/2 Calls from FORTRAN
  8742.     OS/2 functions can be called from FORTRAN as integer functions.
  8743.  The fragment below shows how to call the OS/2 function VioGetMode (the
  8744.  sample program SORTDEMO.FOR contains numerous examples of OS/2 calls):
  8745.  
  8746.  $NOTRUNCATE
  8747.          INTERFACE TO INTEGER*2 FUNCTION VioGetMode
  8748.       +  [ALIAS:'VIOGETMODE']
  8749.       +  (MODE, VioHandle [VALUE])
  8750.          INTEGER*2 MODE(6), VioHandle
  8751.          END
  8752.  
  8753.          IMPLICIT INTEGER*2 (A-Z)
  8754.          DIMENSION MODE(6)
  8755.          .
  8756.          .
  8757.          MODE(1)=12
  8758.          RetVal=VioGetMode(MODE,0)
  8759.          MAXCOLOR=2**ISHL(MODE(2),-8)
  8760.          .
  8761.          .
  8762.          END
  8763.  
  8764.  Declaring OS/2 Functions
  8765.     To call an OS/2 function, you must first declare the function using
  8766.  an INTERFACE statement. The INTERFACE statement declares the function
  8767.  type and the number and type of the function's arguments. All OS/2
  8768.  functions are declared as INTEGER*2 functions because they return a
  8769.  single two-byte value (see below).
  8770.     Because OS/2 function names are usually longer than the normal
  8771.  FORTRAN limit of six characters, you must use the ALIAS attribute, the
  8772.  $NOTRUNCATE metacommand, or both. If you change the OS/2 function name
  8773.  to fit in six characters, you must use the ALIAS attribute to make the
  8774.  link between your program's name for the function and its actual OS/2
  8775.  name. If you use the $NOTRUNCATE metacommand, you may omit the ALIAS
  8776.  attribute because $NOTRUNCATE ensures that FORTRAN accepts up to 31
  8777.  characters for a variable or procedure name.
  8778.     To determine the number and type of the OS/2 function's arguments,
  8779.  look up the function in the MS OS/2 Programmer's Reference and use the
  8780.  tables on pages 280-293 in the Microsoft FORTRAN Optimizing Compiler
  8781.  User's Guide to find the FORTRAN data type corresponding to the C data
  8782.  type in the function call. Notice that you must use the VALUE
  8783.  attribute in the INTERFACE statement for any OS/2 function argument
  8784.  that is not a pointer.
  8785.     Some OS/2 function calls take the address of a structure as an
  8786.  argument. Because FORTRAN does not have a structure or record data
  8787.  type, you must use an integer array to simulate the structure. In the
  8788.  example above, the VioGetMode function uses a twelve-byte structure,
  8789.  so MODE is declared as a six-element array of two-byte words. MODE
  8790.  could also have been declared as a twelve-element array of INTEGER*1.
  8791.     If you emulate a structure using an INTEGER*1 array and the
  8792.  structure contains word fields, or you use an INTEGER*2 array and the
  8793.  structure contains byte fields, your program will need to do some
  8794.  extra work to access the fields. You can use bit-manipulation
  8795.  functions or equivalenced arrays to get at byte fields in word arrays
  8796.  or word fields in byte arrays.
  8797.     See pp. 90-92 in the Microsoft FORTRAN Optimizing Compiler Language
  8798.  Reference for information about FORTRAN's bit-manipulation functions.
  8799.  Notice that if you use an INTEGER*1 array and the structure contains
  8800.  word fields, you'll use the bit functions to combine array elements.
  8801.  Similarly, if you use an INTEGER*2 array and the structure contains
  8802.  byte fields, you'll need to use the bit functions to manipulate the
  8803.  byte fields.
  8804.     Because bytes in a two-byte integer are stored in reverse order,
  8805.  you must be careful to select the correct byte when breaking down
  8806.  two-byte integer values.  For example, the twelve-byte structure used
  8807.  with VioGetMode begins with a word value followed by two one byte
  8808.  values: type and color. In the example above, the two one-byte fields
  8809.  are treated as a single integer, so color winds up in the high-order
  8810.  byte and type is the low-order byte. So, to get the value of color
  8811.  (the high-order byte of MODE(2)), you must shift MODE(2) right by
  8812.  eight bit positions.
  8813.     You can avoid doing bit manipulation by using the EQUIVALENCE
  8814.  statement. The following segment shows the fragment above rewritten
  8815.  to avoid bit manipulation:
  8816.  
  8817.  $NOTRUNCATE
  8818.          INTERFACE TO INTEGER*2 FUNCTION VioGetMode
  8819.       +  [ALIAS:'VIOGETMODE']
  8820.       +  (MODE, VioHandle [VALUE])
  8821.          INTEGER*2 MODE(6), VioHandle
  8822.          END
  8823.  
  8824.          IMPLICIT INTEGER*2 (A-Z)
  8825.          DIMENSION MODE(6)
  8826.          INTEGER*1 BMODE(2),Color,Type
  8827.          EQUIVALENCE (BMODE(1),MODE(2)),(BMODE(1),Type),(BMODE(2),Color)
  8828.          .
  8829.          .
  8830.          MODE(1)=12
  8831.          RETVAL=VioGetMode(MODE,0)
  8832.          MaxColor=2**Color
  8833.          .
  8834.          .
  8835.          END
  8836.  
  8837.     The EQUIVALENCE statement equates the start of the two-element
  8838.  INTEGER*1 array, BMODE, to the two one-byte fields in the MODE
  8839.  structure. The statement then equates two INTEGER*1 variables to the
  8840.  individual byte fields. Notice that when you use an EQUIVALENCE
  8841.  statement this way, you do not have to worry about reversed bytes.
  8842.     NOTE: OS/2 calls assume that all arguments passed by reference are
  8843.  passed as far references. Thus, if you use medium memory model (which
  8844.  uses near references), you must use the FAR attribute with any
  8845.  arguments that are passed by reference.
  8846.  
  8847.  Return Values
  8848.     The value returned by an OS/2 function indicates whether or not
  8849.  there was an error. A return value of zero indicates there was no
  8850.  error; any other value indicates an error. See the Microsoft OS/2
  8851.  Programmer's Reference for information about specific error values.
  8852.  
  8853.  Thread Restrictions
  8854.     Because FORTRAN library routines are not reentrant, FORTRAN
  8855.  routines that use any of the OS/2 functions involving threads or
  8856.  requiring reentrancy cannot use FORTRAN library routines. The OS/2
  8857.  functions that use multiple threads or require reentrancy include the
  8858.  following:
  8859.  
  8860.  DOSCREATETHREAD
  8861.  DOSRESUMETHREAD
  8862.  DOSSUSPENDTHREAD
  8863.  DOSSETSIGHANDLER
  8864.  DOSSETVEC
  8865.  DOSMONOPEN
  8866.  DOSMONCLOSE
  8867.  DOSMONREAD
  8868.  DOSMONWRITE
  8869.  DOSMONREG
  8870.  
  8871.     You may be able to write routines using these OS/2 functions and
  8872.  FORTRAN library routines if your program provides a way for each
  8873.  routine to test whether or not another routine is using the library
  8874.  routines. Or, you may want to write your own reentrant library
  8875.  routines. (This is an advanced technique that Microsoft does not
  8876.  support.)
  8877.  
  8878.  
  8879.  252. FORTRAN 4.10 README.DOC: Corrections to Documentation
  8880.  
  8881.  Product Version(s): 4.10   | 4.10
  8882.  Operating System:   MS-DOS | OS/2
  8883.  Flags: PSSONLY | ENDUSER
  8884.  Last Modified: 30-OCT-1990    ArticleIdent: Q28812
  8885.  
  8886.     The following information is from the FORTRAN Version 4.10
  8887.  README.DOC file:
  8888.  
  8889.  CORRECTIONS TO DOCUMENTATION -- Version 4.10 Update
  8890.  
  8891.  LIBBUILD under Protected-Mode OS/2
  8892.     To use the LIBBUILD.BAT batch file under protected-mode OS/2,
  8893.  change the file's name to LIBBUILD.CMD.
  8894.  
  8895.  Additional Error Messages
  8896.     There are two new command line messages:
  8897.  
  8898.     Number  Message                      Description
  8899.  
  8900.     D2025   missing argument             A required argument was omitted
  8901.                                          from the option. Check the syntax
  8902.                                          of the option. This is an error
  8903.                                          message.
  8904.  
  8905.     D4019   string too long - truncated  A string of more than 40 characters
  8906.             to 40 characters             was specified for one of the followin
  8907.                                          switches: /NM, /NT, /St, or /Ss.
  8908.                                          The string is truncated to 40
  8909.                                          characters, and FL continues. This
  8910.                                          message is a warning.
  8911.  
  8912.     There is one new compiler warning message:
  8913.  
  8914.     F4186    string too long - truncated  A string of more than 40 characters
  8915.              to 40 characters             was used in a $TITLE or $SUBTITLE
  8916.                                           metacommand. The string is truncated
  8917.                                           to 40 characters.
  8918.  
  8919.  User's Guide -- Defining Macros for MAKE
  8920.     Section 6.7.1 states that macro definitions that include white
  8921.  space should be enclosed in double quotes. This statement is true only
  8922.  for macros defined on the MAKE command line. Macros with white space
  8923.  in MAKE description files should not be enclosed in double quotes.
  8924.  
  8925.  Quick Reference Guide
  8926.     In the Microsoft FORTRAN Optimizing Compiler Quick Reference Guide,
  8927.  the /Tf option of the FL command is misspelled as "/TF".
  8928.  
  8929.  
  8930.  253. FORTRAN 4.10 CVREADME.DOC: Mouse Driver
  8931.  
  8932.  Product Version(s): 4.10   | 4.10
  8933.  Operating System:   MS-DOS | OS/2
  8934.  Flags: ENDUSER |
  8935.  Last Modified: 27-APR-1988    ArticleIdent: Q28815
  8936.  
  8937.     The following information is from the FORTRAN Version 4.10
  8938.  CVREADME.DOC file:
  8939.  
  8940.  CVREADME.DOC -- (C) Copyright Microsoft Corporation, 1987, 1988
  8941.  Microsoft(R) FORTRAN Optimizing Compiler Version 4.10
  8942.  
  8943.  Notes on CodeView and Utilities -- The Mouse Driver
  8944.     If you will be using the Microsoft Mouse with the Microsoft
  8945.  CodeView debugger you must have Version 6.01 or later of the Microsoft
  8946.  Mouse. If you do not, use the version of the MOUSE.COM driver provided
  8947.  in this package. Copy MOUSE.COM to the appropriate mouse directory.
  8948.  When you are ready to use the mouse, type
  8949.  
  8950.          mouse
  8951.  
  8952.  at the DOS command level. If you want to install the mouse driver
  8953.  automatically every time you reboot, insert the "mouse" command in
  8954.  your AUTOEXEC.BAT file.
  8955.     Note that in earlier releases of Microsoft C, both the MOUSE.SYS
  8956.  and the MOUSE.COM driver were provided. If you have been using an
  8957.  earlier version of the MOUSE.SYS driver, delete the following line
  8958.  from your CONFIG.SYS file:
  8959.  
  8960.          device=\<directory>\mouse.sys
  8961.  
  8962.  where <directory> is the directory where the earlier mouse driver
  8963.  resides.
  8964.  
  8965.  
  8966.  254. FORTRAN 4.10 CVREADME.DOC: New Command-Line Option
  8967.  
  8968.  Product Version(s): 4.10   | 4.10
  8969.  Operating System:   MS-DOS | OS/2
  8970.  Flags: ENDUSER |
  8971.  Last Modified: 27-APR-1988    ArticleIdent: Q28816
  8972.  
  8973.     The following information is from the FORTRAN Version 4.10
  8974.  CVREADME.DOC file:
  8975.  
  8976.  Microsoft CodeView(R) Debugger -- New Command-Line Option
  8977.     If you have an IBM Personal System/2, then you can use the /50
  8978.  command-line option to start the CodeView debugger in 50-line mode.
  8979.  Note that you must be in 25-line mode to effectively use either the
  8980.  /43 or /50 command-line option.
  8981.  
  8982.  
  8983.  255. FORTRAN 4.10 CVREADME.DOC: CONFIG.SYS Setting for CVP
  8984.  
  8985.  Product Version(s): 4.10    | 4.10
  8986.  Operating System:   MS-DOS  | OS/2
  8987.  Flags: ENDUSER |
  8988.  Last Modified: 27-APR-1988    ArticleIdent: Q28817
  8989.  
  8990.     The following information is from the FORTRAN Version 4.10
  8991.  CVREADME.DOC file:
  8992.  
  8993.  CONFIG.SYS Setting for CVP
  8994.     To run the protected-mode CodeView debugger (CVP.EXE), you must
  8995.  have the following line in your CONFIG.SYS file:
  8996.  
  8997.     IOPL=YES
  8998.  
  8999.  
  9000.  256. Complex Division
  9001.  
  9002.  Product Version(s): 3.2
  9003.  Operating System:   MS-DOS
  9004.  Flags: ENDUSER | TAR02493 buglist3.20 fixlist3.30
  9005.  Last Modified:  8-MAR-1988    ArticleIdent: Q10633
  9006.  
  9007.  Problem:
  9008.     Contrary to the documentation, the negative range of double
  9009.  precision complex numbers is 1X10**-154. Attempts to use greater
  9010.  negative numbers results in a real math overflow at runtime.
  9011.  
  9012.  Response:
  9013.     Microsoft confirmed this to be a problem in Version 3.20 of the
  9014.  FORTRAN compiler.
  9015.    The problem was corrected in Version 3.30.
  9016.  
  9017.  
  9018.  257. FORTRAN 4.10 CVREADME.DOC: CodeView Demonstration
  9019.  
  9020.  Product Version(s): 4.10    | 4.10
  9021.  Operating System:   MS-DOS  | OS/2
  9022.  Flags: ENDUSER |
  9023.  Last Modified: 27-APR-1988    ArticleIdent: Q28818
  9024.  
  9025.     The following information is from the FORTRAN Version 4.10
  9026.  CVREADME.DOC file:
  9027.  
  9028.  Microsoft CodeView(R) Debugger Demonstration
  9029.     The demonstration runs only under MS-DOS or real-mode OS/2. You
  9030.  must compile the program STATS.FOR before you can run the CodeView
  9031.  demonstration. Compile the program using the following command and
  9032.  place the EXE file in the same directory as the other demonstration
  9033.  files:
  9034.  
  9035.     FL /AM /FPc /Zi /Od STATS.FOR
  9036.  
  9037.  
  9038.  258. FORTRAN 4.10 CVREADME.DOC: IMAG and AIMAG
  9039.  
  9040.  Product Version(s): 4.10    | 4.10
  9041.  Operating System:   MS-DOS  | OS/2
  9042.  Flags: ENDUSER |
  9043.  Last Modified: 27-APR-1988    ArticleIdent: Q28819
  9044.  
  9045.     The following information is from the FORTRAN Version 4.10
  9046.  CVREADME.DOC file:
  9047.  
  9048.  IMAG and AIMAG Intrinsic Functions
  9049.     The Microsoft CodeView(R) debugger considers the IMAG and AIMAG
  9050.  functions to be synonymous (it extracts the imaginary part of the
  9051.  complex number).
  9052.  
  9053.  Using the 7 Command in Protected Mode
  9054.     If you are using OS/2 protected mode and have a math coprocessor,
  9055.  then you need to use a patch before you can use the CVP 7 command. To
  9056.  apply the patch, use the OS2PATCH.EXE and PTRACE87.PAT files that come
  9057.  on the same disk that CVP.EXE is on. You also need to locate the
  9058.  PATCH.EXE file that comes with OS/2 and make sure that this file is in
  9059.  a directory listed in your PATH environment variable. Then follow
  9060.  these steps:
  9061.  
  9062.     1. Change the current drive and directory to the root directory of
  9063.  the boot disk. (If the boot disk is a floppy, make sure it is inserted
  9064.  in the drive you used to boot from.)
  9065.     2. Give the following command line at the DOS prompt:
  9066.  
  9067.     OS2PATCH /A PTRACE87.PAT
  9068.  
  9069.     Note that you may need to give the complete path names for the
  9070.  OS2PATCH.EXE and for the PTRACE87.PAT file. You do not need to give a
  9071.  path name for the OS2PATCH.EXE file if you have placed this file in a
  9072.  directory listed in your PATH environment variable.
  9073.  
  9074.  
  9075.  259. FORTRAN 4.10 CVREADME.DOC: Compatibility Box
  9076.  
  9077.  Product Version(s): 4.10    | 4.10
  9078.  Operating System:   MS-DOS  | OS/2
  9079.  Flags: ENDUSER |
  9080.  Last Modified: 27-APR-1988    ArticleIdent: Q28820
  9081.  
  9082.     The following information is from the FORTRAN Version 4.10
  9083.  CVREADME.DOC file:
  9084.  
  9085.  Using the Real-Mode Debugger in the Compatibility Box
  9086.     When running the real-mode CodeView debugger in the DOS 3.x
  9087.  compatibility box, start the debugger with the /S command-line option.
  9088.  Otherwise, the mouse pointer will not appear.
  9089.  
  9090.  
  9091.  260. FORTRAN 4.10 CVREADME.DOC: Codeview with BIND
  9092.  
  9093.  Product Version(s): 4.10   | 4.10
  9094.  Operating System:   MS-DOS | OS/2
  9095.  Flags: ENDUSER |
  9096.  Last Modified: 27-APR-1988    ArticleIdent: Q28821
  9097.  
  9098.     The following information is from the FORTRAN Version 4.10
  9099.  CVREADME.DOC file:
  9100.  
  9101.  Using the CodeView Debugger with BIND
  9102.     The real-mode CodeView debugger cannot debug bound (dual-mode)
  9103.  applications. However, the protected-mode CodeView debugger, CVP, can
  9104.  debug bound applications.
  9105.  
  9106.  
  9107.  261. FORTRAN 4.10 CVREADME.DOC: BASIC Programs with CodeView
  9108.  
  9109.  Product Version(s): 4.10    | 4.10
  9110.  Operating System:   MS-DOS  | OS/2
  9111.  Flags: ENDUSER |
  9112.  Last Modified: 27-APR-1988    ArticleIdent: Q28822
  9113.  
  9114.     The following information is from the FORTRAN Version 4.10
  9115.  CVREADME.DOC file:
  9116.  
  9117.  Compiling BASIC Programs for CodeView Debugger
  9118.     To compile BASIC programs for use with the CodeView debugger,
  9119.  specify the /Zi option rather than the /D option.
  9120.  
  9121.  Expression Evaluator for BASIC Programs
  9122.     In the BASIC expression evaluator, "+" is not supported for string
  9123.  concatenation.
  9124.  
  9125.  
  9126.  262. Problems Reading an Array in Version 3.20
  9127.  
  9128.  Product Version(s): 3.20
  9129.  Operating System:   MS-DOS
  9130.  Flags: ENDUSER | buglist3.20 fixlist3.30
  9131.  Last Modified:  7-OCT-1988    ArticleIdent: Q10659
  9132.  
  9133.  Problem:
  9134.  
  9135.  Array reads that read the entire array do not function correctly if
  9136.  the array crosses a 64K boundary in a particular way. In the program
  9137.  below, support "array" is more than 64K in length, and "barray" is
  9138.  equivalenced to array so that barray crosses the 64K boundary in
  9139.  array. Reading barray with READ() (barray(i),i=1,dim) works properly,
  9140.  but READ()barray fails.
  9141.  
  9142.  The following is an example:
  9143.  
  9144.          integer*4 array(20000)
  9145.          integer*4 barray(2000)
  9146.          equivalence(array(16001),barray)
  9147.  c
  9148.  c
  9149.          write(*,*)' writing data'
  9150.          open(6,file='data',status='new',form='unformatted')
  9151.          write(6)(i,i=1,2000)
  9152.  c
  9153.  c
  9154.          write(*,*)' reading data'
  9155.          rewind(6)
  9156.          read(6)barray
  9157.  c
  9158.          ierr=0
  9159.          do 10 i=1,2000
  9160.          if (barray(i).eq.i) goto 10
  9161.          write(*,*)i,barray(i)
  9162.          ierr=ierr+1
  9163.          if (ierr.eq.10) goto 11
  9164.     10   continue
  9165.     11   write(*,*)' done checking implicit read'
  9166.  c
  9167.  c
  9168.          write(*,*)' reading data'
  9169.          rewind(6)
  9170.          read(6)(barray(i),i=1,2000)
  9171.  c
  9172.          ierr=0
  9173.          do 20 i=1,2000
  9174.          if (barray(i).eq.i) goto 20
  9175.          write(*,*)i,barray(i)
  9176.     20   continue
  9177.          write(*,*)' done checking explicit read'
  9178.          end
  9179.  
  9180.  Response:
  9181.  
  9182.  The reported behavior was due to an arithmetic overflow in the huge
  9183.  array I/O routines.
  9184.  
  9185.  Microsoft has confirmed this to be a problem in Version 3.20. This
  9186.  problem was corrected in Version 3.30.
  9187.  
  9188.  
  9189.  263. FORTRAN 4.10 CVREADME.DOC: Error Message
  9190.  
  9191.  Product Version(s): 4.10    | 4.10
  9192.  Operating System:   MS-DOS  | OS/2
  9193.  Flags: ENDUSER |
  9194.  Last Modified: 27-APR-1988    ArticleIdent: Q28823
  9195.  
  9196.     The following information is from the FORTRAN Version 4.10
  9197.  CVREADME.DOC file:
  9198.  
  9199.  Error Messages
  9200.     The error message "? cannot display" indicates that the Display
  9201.  Expression command (?) has been passed a valid symbol that it cannot
  9202.  display. In previous versions of the debugger, structures could not be
  9203.  displayed. With current version of the debugger, only the enums type
  9204.  cannot be displayed.
  9205.     The error message "Expression not a memory address" occurs when the
  9206.  Tracepoint command is given without a symbol that evaluates to a
  9207.  single memory address. For example, the commands "TP?1" and "TP?a+b"
  9208.  each produce this error message. The proper way to put a tracepoint
  9209.  on the word at address 1 is with the command "TPW 1".
  9210.     The error message "Function call before 'main'" occurs when you
  9211.  attempt to evaluate a program-defined function before you have entered
  9212.  the main function. Execute to at least to the beginning of the main
  9213.  function before attempting to evaluate program-defined functions.
  9214.     The error message "Bad emulator info" occurs when CodeView cannot
  9215.  read data from the floating-point emulator.
  9216.     The error message "Floating point not loaded" has a special meaning
  9217.  for CVP (in addition to the explanation given in the CodeView and
  9218.  Utilities manual). Each thread has its own floating-point emulator.
  9219.  This message is issued when the current thread has not initialized its
  9220.  own emulator.
  9221.  
  9222.  
  9223.  264. Internal Compiler Error: getattrib.c 1.41, Line 170
  9224.  
  9225.  Product Version(s): 4.00 4.01 4.10
  9226.  Operating System:   MS-DOS
  9227.  Flags: ENDUSER | buglist4.00 buglist4.01 buglist4.10 fixlist5.00
  9228.  Last Modified:  6-NOV-1989    ArticleIdent: Q29588
  9229.  
  9230.  An incorrectly written program causes the following error message to
  9231.  appear:
  9232.  
  9233.     fatal error F1001:  Internal Compiler Error
  9234.     (compiler file '@(#)getattrib.c:1.41', line 170)
  9235.     Contact Microsoft Technical Support
  9236.  
  9237.  The following program causes this error:
  9238.  
  9239.          SUBROUTINE SUB1(X)
  9240.          COMMON Y
  9241.          RETURN
  9242.          ENTRY SUB2(Y)
  9243.          RETURN
  9244.          END
  9245.  
  9246.  This problem can be avoided by changing the first line to the
  9247.  following:
  9248.  
  9249.          SUBROUTINE SUB1
  9250.  
  9251.  This is a known problem in Versions 4.00, 4.01, and 4.10. This
  9252.  problem was corrected in Version 5.00 under MS-DOS. However, the
  9253.  compiler gives a general protection violation in OS/2.
  9254.  
  9255.  
  9256.  265. Incorrect Integer Arithmetic with /Ot Optimization
  9257.  
  9258.  Product Version(s): 4.00 4.01 4.10
  9259.  Operating System:   MS-DOS
  9260.  Flags: ENDUSER | buglist4.00 buglist4.01 buglist4.10 fixlist5.00
  9261.  Last Modified:  7-NOV-1989    ArticleIdent: Q29594
  9262.  
  9263.  The small program below demonstrates an optimization problem with
  9264.  integer calculation. The program contains about 15 COMMON variables.
  9265.  In subroutine TESTR, the following line is evaluated incorrectly:
  9266.  
  9267.     IST=KS+2*IS-2
  9268.  
  9269.  The line should evaluate to 143=141+2*2-2; however, it evaluates to
  9270.  163.
  9271.  
  9272.  To work around the problem, do the following:
  9273.  
  9274.  1. Disable the optimization with compiler option /Od.
  9275.  
  9276.  2. Delete any of the four statements after the COMMON statement in
  9277.     TESTR. (Note that none of these four lines changes any variables
  9278.     used in the calculation of IST.)
  9279.  
  9280.  3. Make the COMMON variables local variables.
  9281.  
  9282.  Microsoft has confirmed this to be a problem in Versions 4.00, 4.01,
  9283.  and 4.10 of the FORTRAN compiler. This problem was corrected in
  9284.  Version 5.00.
  9285.  
  9286.  The following program demonstrates the problem:
  9287.  
  9288.  C   PROGRAM TO TEST INTEGER CALCULATION FAILURE
  9289.        IMPLICIT REAL*8(A-H,O-Z)
  9290.        COMMON/TSTCOM/IPT,NU,NV,NPTS,MX,NX,KF,KS,KT,KNT,NPCH,LF,LS,LT,IND
  9291.        AVE = 0.0D0
  9292.        IX = 1
  9293.        KF = 1
  9294.        IS = 2
  9295.        KS = 141
  9296.        NU = 11
  9297.        NV = 7
  9298.        NX = 12
  9299.        CALL TESTR (IX,IS)
  9300.        END
  9301.  
  9302.        SUBROUTINE TESTR (IX,IS)
  9303.        IMPLICIT REAL*8(A-H,O-Z)
  9304.        COMMON/TSTCOM/IPT,NU,NV,NPTS,MX,NX,KF,KS,KT,KNT,NPCH,LF,LS,LT,IND
  9305.  C
  9306.  C************* IF ANY OF THE FOLLOWING 4 LINES IS OMITTED, COMMON IS
  9307.  C************* REMOVED AND VARIABLES MOVED TO LOCAL VARIABLES IN THIS
  9308.  C************* PROGRAM OR IF THE ROUTINES ARE COMPILED USING MICROSOFT
  9309.  C************* FORTRAN 3.20, THE VARIABLE "IST" IS CORRECTLY COMPUTED
  9310.  C************* AS 143.  IF THIS ROUTINE AND THE MAIN PROGRAM ARE USED
  9311.  C************* AS SHOWN HERE "IST" IS SET TO 163.
  9312.        IFT=IS
  9313.        IST=KF+2*IS-2
  9314.        IF(IX.EQ.2) GOTO 20
  9315.        IFT=(IS-1)*NU+1
  9316.  C*************
  9317.        WRITE(*,18)KS,IS
  9318.     18 FORMAT(' KS =',I4,', IS =',I3)
  9319.        IST=KS+2*IS-2
  9320.        WRITE(*,19)IST
  9321.     19 FORMAT(' IST =',I4)
  9322.     20 RETURN
  9323.        END
  9324.  
  9325.  
  9326.  266. Run-Time Error 2101
  9327.  
  9328.  Product Version(s): 3.20
  9329.  Operating System:   MS-DOS
  9330.  Flags: ENDUSER |
  9331.  Last Modified: 12-MAY-1988    ArticleIdent: Q10635
  9332.  
  9333.  Problem:
  9334.     The following program generates run-time error 2101:
  9335.  
  9336.     complex c1
  9337.     do 100 i=1,100
  9338.     c1 = cmplx (10.0**i,10.0**i)
  9339.     write (*,*) i,csqrt(c1),cabs(c1) 100 continue
  9340.     end
  9341.  
  9342.  Response:
  9343.     Microsoft confirmed this to be a problem in Version 3.20 of the
  9344.  FORTRAN compiler. This problem was corrected in Version 3.30.
  9345.  
  9346.  
  9347.  267. ERRORLEVEL Flag Not Set to Attempted Compilation
  9348.  
  9349.  Product Version(s): 3.20
  9350.  Operating System:   MS-DOS
  9351.  Flags: ENDUSER |
  9352.  Last Modified: 12-MAY-1988    ArticleIdent: Q10639
  9353.  
  9354.  Problem:
  9355.     The compiler does not set the ERRORLEVEL flag according to the
  9356.  results of the attempted compilation.
  9357.  
  9358.  Response:
  9359.     This problem was corrected in Version 3.30.
  9360.  
  9361.  
  9362.  268. Formal Parameters Greater than 64K
  9363.  
  9364.  Product Version(s): 3.20
  9365.  Operating System:   MS-DOS
  9366.  Flags: ENDUSER |
  9367.  Last Modified: 12-MAY-1988    ArticleIdent: Q10640
  9368.  
  9369.  Problem:
  9370.     Formal parameters greater than 64K give specification errors if
  9371.  preceded by other formal parameters of particular byte sizes.
  9372.     It appears that 0-byte and 8-byte offsets are correct, but 4-byte
  9373.  and 12-byte offsets give an error.
  9374.  
  9375.  Response:
  9376.    Microsoft confirmed this to be a problem in Version 3.20 of the
  9377.  FORTRAN compiler.
  9378.    This problem was corrected in Version 3.30.
  9379.  
  9380.  
  9381.  269. Invoking PAS2 from a Batch File
  9382.  
  9383.  Product Version(s): 3.20
  9384.  Operating System:   MS-DOS
  9385.  Flags: ENDUSER |
  9386.  Last Modified: 12-MAY-1988    ArticleIdent: Q10653
  9387.  
  9388.  Problem:
  9389.     A problem may occur when invoking PAS2 from a batch file. If there
  9390.  are any trailing blanks following the command "PAS2", PAS2 requests a
  9391.  RETURN before continuing.
  9392.  
  9393.  Response:
  9394.     Micorsoft confirmed this to be a problem in Version 3.2 of the
  9395.  FORTRAN compiler.
  9396.     This problem was corrected in Version 3.30.
  9397.  
  9398.  
  9399.  270. OPEN Statement Required or System Will Stop
  9400.  
  9401.  Product Version(s): 3.20
  9402.  Operating System:   MS-DOS
  9403.  Flags: ENDUSER |
  9404.  Last Modified:  5-MAY-1988    ArticleIdent: Q10669
  9405.  
  9406.  Problem:
  9407.     Under the following conditions, an OPEN statement is required or
  9408.  the system will stop:
  9409.  
  9410.     1. Using Northstar Advantage.
  9411.     2. Running DOS Version 1.10.
  9412.     3. Using unit 0 rather than the * for console.
  9413.  
  9414.  Response:
  9415.     Microsoft is unable to duplicate this problem under DOS Versions
  9416.  1.00 or 2.00.
  9417.  
  9418.  
  9419.  271. Compile Error 835
  9420.  
  9421.  Product Version(s): 3.20
  9422.  Operating System:   MS-DOS
  9423.  Flags: ENDUSER | buglist3.20 fixlist3.30
  9424.  Last Modified: 13-JAN-1989    ArticleIdent: Q10663
  9425.  
  9426.  Problem:
  9427.  
  9428.  The example of SAVE on Page 119 of the "Microsoft FORTRAN Reference"
  9429.  manual produces compiler error 835 in pass 1 of the compiler (FOR1).
  9430.  The following program demonstrates this problem:
  9431.  
  9432.     integer*4 myvar
  9433.     common /mycom/ n
  9434.     save /mycom/, myvar
  9435.     end
  9436.  
  9437.  Response:
  9438.  
  9439.  Microsoft has confirmed this to be a problem in Version 3.20 of the
  9440.  FORTRAN compiler. This problem was corrected in Version 3.30.
  9441.  
  9442.  
  9443.  272. $DEBUG Metacommand
  9444.  
  9445.  Product Version(s): 3.20
  9446.  Operating System:   MS-DOS
  9447.  Flags: ENDUSER |
  9448.  Last Modified: 12-MAY-1988    ArticleIdent: Q10644
  9449.  
  9450.  Problem:
  9451.     The following program gives the run-time error "long integer math
  9452.  overflow" when compiled with $DEBUG, but runs properly without the
  9453.  metacommand:
  9454.  
  9455.     $DEBUG
  9456.        PROGRAM TEST
  9457.        INTEGER*4 IX
  9458.  
  9459.        X=327.64
  9460.        IX=32780
  9461.  
  9462.        DO 10 J=1,10
  9463.        IX=(X*100)
  9464.        WRITE(*,*)IX,X
  9465.       10 X=X+.01
  9466.  
  9467.        END
  9468.  
  9469.  Response:
  9470.     This problem was corrected in Version 3.30.
  9471.  
  9472.  
  9473.  273. Implied DO Loops on READ Statements
  9474.  
  9475.  Product Version(s): 3.20
  9476.  Operating System:   MS-DOS
  9477.  Flags: ENDUSER |
  9478.  Last Modified: 12-MAY-1988    ArticleIdent: Q10643
  9479.  
  9480.  Problem:
  9481.     READ statements with implied DO loops are always executed at least
  9482.  once. This is not the case with explicit DO loops or WRITE statements
  9483.  with implied loops.
  9484.  
  9485.  Response:
  9486.     This is correct behavior for READ statements.
  9487.     The ANSI Standard says the statement 'READ(*,*) (I,J=1,0)' should
  9488.  behave the same as a READ(*,*).
  9489.     An implied DO loop in a READ is not equivalent to a real DO loop
  9490.  containing a READ.
  9491.  
  9492.  
  9493.  274. SP Edit Descriptor
  9494.  
  9495.  Product Version(s): 3.20
  9496.  Operating System:   MS-DOS
  9497.  Flags: ENDUSER | buglist3.20 fixlist3.30
  9498.  Last Modified: 20-OCT-1988    ArticleIdent: Q10668
  9499.  
  9500.  Problem:
  9501.  
  9502.  The SP edit descriptor does not function correctly. It fails to put in
  9503.  plus (+) signs for positive numbers and negative numbers are
  9504.  incorrectly changed to positive. The following is a code sample that
  9505.  demonstrates this behavior:
  9506.  
  9507.         do 10 i1=-10,10,2
  9508.         write(*,100) i1,i1,i1
  9509.   10    continue
  9510.   100   format(' ',i3,' ',sp,i3,' ',i3)
  9511.         end
  9512.  
  9513.  Response:
  9514.  
  9515.  Microsoft confirmed this to be a problem in Version 3.20 of the
  9516.  FORTRAN compiler. This problem was corrected in Version 3.30.
  9517.  
  9518.  
  9519.  275. READ to Unit 1
  9520.  
  9521.  Product Version(s): 3.20
  9522.  Operating System:   MS-DOS
  9523.  Flags: enduser |
  9524.  Last Modified:  2-MAY-1988    ArticleIdent: Q10661
  9525.  
  9526.  Problem:
  9527.     A program opens the console as logical unit 1 in the main program.
  9528.  A subsequent "READ(1," in a subroutine fails to read any data from the
  9529.  keyboard. When the "READ (1," is replaced by a "READ (0," the program
  9530.  works properly.
  9531.  
  9532.  Response:
  9533.     The READ statement to unit 1 is correctly taking the error path
  9534.  because you cannot read from a unit to which you have just written
  9535.  without first doing a Rewind and BACKSPACE. You cannot rewind the
  9536.  console.
  9537.     One method to achieve your goal is to READ and WRITE from different
  9538.  units both connected to CON.
  9539.  
  9540.  
  9541.  276. Run-Time Error "Real Indefinite"
  9542.  
  9543.  Product Version(s): 3.20
  9544.  Operating System:   MS-DOS
  9545.  Flags: ENDUSER | buglist3.20 fixlist3.30
  9546.  Last Modified:  7-OCT-1988    ArticleIdent: Q10637
  9547.  
  9548.  Problem:
  9549.  
  9550.  DREAL(IMAG*16) compiles without error but gives the run-time error
  9551.  "Real Indefinite". The following is a short code example that
  9552.  demonstrates this problem:
  9553.  
  9554.  PROGRAM TEST COMPLEX*16 A REAL*8 X,Y
  9555.  
  9556.  A=DCMPLX(-.121E+04,.406E+04) WRITE(*,'(3H A=,2E10.3)')A
  9557.  X=DIMAG(A) WRITE(*,'(10H DIMAG(A)=,E10.3)')X Y=DREAL(A)
  9558.  WRITE(*,'(10H DREAL(A)=,E10.3)')Y
  9559.  
  9560.  END
  9561.  
  9562.  Response:
  9563.  
  9564.  Microsoft confirmed this to be a problem in Version 3.20 of the
  9565.  FORTRAN compiler. This problem was corrected in Version 3.30.
  9566.  
  9567.  
  9568.  277. Run-Time Error 1232
  9569.  
  9570.  Product Version(s): 3.20
  9571.  Operating System:   MS-DOS
  9572.  Flags: ENDUSER | buglist3.20
  9573.  Last Modified: 20-OCT-1988    ArticleIdent: Q10627
  9574.  
  9575.  Problem:
  9576.  
  9577.  A BLOCK DATA subprogram following the main program in a source file
  9578.  generates a run-time error 1232. The following program demonstrates
  9579.  the problem:
  9580.  
  9581.         program tstblk
  9582.         common /tst/i
  9583.         write (*,1)i 1 format (' ',i10)
  9584.         stop
  9585.         end
  9586.         block data
  9587.         common /tst/i
  9588.         data i/5/
  9589.         end
  9590.  
  9591.  Response:
  9592.  
  9593.  Microsoft confirmed this to be a problem in Version 3.20 of the
  9594.  FORTRAN compiler. This problem was corrected in Version 3.30.
  9595.  
  9596.  The workaround to this problem is to place the BLOCK DATA first in the
  9597.  source file or compile separately.
  9598.  
  9599.  
  9600.  278. AIMAG of a Complex Function
  9601.  
  9602.  Product Version(s): 3.20
  9603.  Operating System:   MS-DOS
  9604.  Flags: ENDUSER | buglist3.20 fixlist3.30
  9605.  Last Modified: 20-OCT-1988    ArticleIdent: Q10625
  9606.  
  9607.  Problem:
  9608.  
  9609.  If the intrinsic function AIMAG is passed to a complex function as an
  9610.  argument, incorrect results are returned. The following program
  9611.  demonstrates the problem:
  9612.  
  9613.         program oct03b
  9614.         complex func2,zz
  9615.         zz = (1111.,2222.)
  9616.         write (*,*) aimag (func2 (zz))
  9617.         end
  9618.         complex function func2 (yy)
  9619.         complex yy
  9620.         func2 = (1111.,2222.)
  9621.         end
  9622.  
  9623.  Response:
  9624.  
  9625.  Microsoft confirmed this to be a problem in Version 3.20 of the
  9626.  FORTRAN compiler. This problem was corrected in Version 3.30.
  9627.  
  9628.  
  9629.  279. Array Greater Than 64K
  9630.  
  9631.  Product Version(s): 3.20
  9632.  Operating System:   MS-DOS
  9633.  Flags: ENDUSER |
  9634.  Last Modified: 20-OCT-1988    ArticleIdent: Q10671
  9635.  
  9636.  Problem:
  9637.  
  9638.  Arrays are not always accessed correctly if they are greater than 64K
  9639.  and the subscript to the array is an expression that references the
  9640.  array itself. The following is a code sample that demonstrates this
  9641.  behavior:
  9642.  
  9643.         PROGRAM TEST
  9644.         DIMENSION IA(20000)
  9645.         DIMENSION IB(10)
  9646.  
  9647.         WRITE(*,'(12H LENGTH >64K)')
  9648.         DO 15 I=1,10
  9649.         IA(I)=I 15 WRITE(*,*)I,IA(I),IA(IA(I))
  9650.  
  9651.         WRITE(*,'(12H LENGTH <64K)')
  9652.         DO 18 I=1,10
  9653.         IB(I)=I 18 WRITE(*,*)I,IB(I),IB(IB(I))
  9654.         END
  9655.  
  9656.  Response:
  9657.  
  9658.  Microsoft confirmed this to be a problem in Version 3.20 of the
  9659.  FORTRAN compiler. The problem was corrected in Version 3.30.
  9660.  
  9661.  
  9662.  280. Setting the Direction Flag with MASM
  9663.  
  9664.  Product Version(s): 3.20
  9665.  Operating System:   MS-DOS
  9666.  Flags: ENDUSER |
  9667.  Last Modified: 12-MAY-1988    ArticleIdent: Q10664
  9668.  
  9669.  Question:
  9670.     Setting the direction flag with an assembly language routine may
  9671.  cause the subsequent I/O operation to fail. The following source files
  9672.  demonstrate the problem:
  9673.  
  9674.     program dftst
  9675.     x = 1.2
  9676.     write(*, 100) 100 format(' Before direction flag has been set')
  9677.     write(*,*) x
  9678.     call dirflg
  9679.     write(*, 200) 200 format(' After direction flag has been set')
  9680.     write(*,*) x
  9681.     end
  9682.  
  9683.  data segment public 'data' data ends ; dgroup group data ; code segment 'code
  9684.     ASSUME CS:code, ds:dgroup, ss:dgroup
  9685.     public dirflg dirflg proc far
  9686.     std
  9687.     ret dirflg endp code ends
  9688.     end
  9689.  
  9690.  Response:
  9691.     The workaround for this problem is to link with DOS2FOR.
  9692.  
  9693.  
  9694.  281. Pas2 Hangs If Call Precedes Function Declaration
  9695.  
  9696.  Product Version(s): 3.20
  9697.  Operating System:   MS-DOS
  9698.  Flags: ENDUSER |
  9699.  Last Modified: 12-MAY-1988    ArticleIdent: Q10657
  9700.  
  9701.  Problem:
  9702.     If a function call precedes a function declaration, the compiler
  9703.  PAS2 hangs. If the function declaration precedes the call, the code is
  9704.  correctly flagged with the error message "subroutine name expected."
  9705.     The following small-code sample demonstrates this problem:
  9706.  
  9707.     PROGRAM A
  9708.     CALL I
  9709.     END
  9710.  
  9711.     FUNCTION I
  9712.     I=0
  9713.     RETURN
  9714.     END
  9715.  
  9716.  Response:
  9717.     Microsoft has confirmed this to be a problem in the FORTRAN
  9718.  Compiler Version 3.20.
  9719.     The problem was corrected in Version 3.30.
  9720.  
  9721.  
  9722.  282. Compile Error 84 "FUNCTION Type Conflict"
  9723.  
  9724.  Product Version(s): 3.20
  9725.  Operating System:   MS-DOS
  9726.  Flags: ENDUSER |
  9727.  Last Modified: 12-MAY-1988    ArticleIdent: Q10651
  9728.  
  9729.  Problem:
  9730.     The compiler generates an error 84 "FUNCTION type conflict" if an
  9731.  implicitly typed INTEGER function contains an IMPLICIT INTEGER*2
  9732.  declaration. The following program demonstrates the problem:
  9733.  
  9734.     function nvalue (nvar,mxcol,str)
  9735.     implicit integer*2 (a-z)
  9736.     real*4 fr
  9737.     dimension nvar(8,8),nfval(8,8),str(8,8),kpl(2)
  9738.     common fr
  9739.     mycol = 3 - mxcol
  9740.     do 1 i=1,8
  9741.     do 1 j=1,8 1 nfval(i,j)=0
  9742.     do 50 i=1,8
  9743.     do 50 j=1,8
  9744.     if (nvar(i,j).ne.0) nfval(i,j)=
  9745.     + ntot(i,j,nvar(i,j),nvar,str) 50 continue
  9746.     kpl(1)=0
  9747.     kpl(2)=0
  9748.     do 80 i=1,8
  9749.     do 80 j=1,8
  9750.     if (nvar(i,j).ne.0) kpl(nvar(i,j)) = kpl(nvar(i,j)) +nfval(i,j) 80 continu
  9751.     nvalue= kpl(mxcol) - kpl(mycol)
  9752.     if (kpl(mycol).eq.0) nvalue=nvalue + 500
  9753.     return
  9754.     end
  9755.  
  9756.  Response:
  9757.     Microsoft confirmed this to be a problem in Version 3.20 of the
  9758.  FORTRAN compiler.
  9759.     The problem was corrected in Version 3.30.
  9760.  
  9761.  
  9762.  283. Internal Error 828
  9763.  
  9764.  Product Version(s): 3.20
  9765.  Operating System:   MS-DOS
  9766.  Flags: enduser |
  9767.  Last Modified: 12-MAY-1988    ArticleIdent: Q10648
  9768.  
  9769.  Problem:
  9770.     Pass one of the compiler (FOR1) generates an internal error 828.
  9771.  This occurs if the formal parameter of a subroutine is used as an
  9772.  index variable in a READ statement with an implicit DO. The following
  9773.  program demonstrates this problem:
  9774.  
  9775.     SUBROUTINE EXAMPLE(I)
  9776.     DIMENSION A(80)
  9777.  
  9778.  C EXPLICIT DO LOOP WORKS FINE
  9779.     DO 10 I=1,10
  9780.     10 CONTINUE
  9781.  
  9782.  C IMPLICIT DO LOOP WORKS FINE IF VAR IS NOT FORMAL PARAMETER
  9783.     READ(*,*)(A(J),J=1,79)
  9784.  
  9785.  C IMPLICIT DO LOOP FAILS IF VAR IS FORMAL PARAMETER OF SUBROUTINE
  9786.     READ(*,*)(A(I),I=1,79)
  9787.  
  9788.     RETURN
  9789.     END
  9790.  
  9791.  Response:
  9792.     Microsoft has confirmed this to be a problem in Version 3.20 of the
  9793.  FORTRAN compiler. The problem was corrected in Version 3.30.
  9794.  
  9795.  
  9796.  284. Initialization of a Huge Array
  9797.  
  9798.  Product Version(s): 3.20
  9799.  Operating System:   MS-DOS
  9800.  Flags: ENDUSER | buglist3.20 fixlist3.30
  9801.  Last Modified: 24-OCT-1988    ArticleIdent: Q10645
  9802.  
  9803.  Problem:
  9804.     When using the Microsoft FORTRAN Compiler Version 3.20,
  9805.  initialization of a huge character array fails at the 64K boundary.
  9806.     In the following example, program arry(65336) is not initialized to
  9807.  "A":
  9808.  
  9809.     program arrytst
  9810.     character arry(100000)
  9811.     integer*4 n, nerr
  9812.     data arry / 100000 * 'A'/
  9813.     nerr = 0
  9814.     do 200 n = 1, 100000
  9815.     if (arry(n) .ne. 'A') then
  9816.     nerr = nerr + 1
  9817.     write(*,100) n, arry(n) 100 format(' ERROR! arry(',i7,') = ',a1)
  9818.     endif 200 continue
  9819.     if (nerr .eq. 0) then
  9820.     write(*,300) 300 format(' No errors occurred!')
  9821.     endif
  9822.     end
  9823.  
  9824.  Response:
  9825.     Microsoft confirmed this to be a problem in Version 3.20 of the
  9826.  FORTRAN compiler.
  9827.     This problem was corrected in FORTRAN Compiler Version 3.30.
  9828.  
  9829.  
  9830.  285. Symbol Defined More Than Once
  9831.  
  9832.  Product Version(s): 3.20
  9833.  Operating System:   MS-DOS
  9834.  Flags: ENDUSER |
  9835.  Last Modified: 12-MAY-1988    ArticleIdent: Q10620
  9836.  
  9837.  Problem:
  9838.     The following program specifies an external procedure IFRED. When
  9839.  linked with another module that defines IFRED, the linker generates
  9840.  the error "symbol defined more that once."
  9841.     The following program will produce this error:
  9842.  
  9843.     program darilek
  9844.     integer n(3)
  9845.     real pp,qq,r(100),pdif(6),rel,rels,er,ermax
  9846.     real vrince,xnr
  9847.     real ax,ans,zero,one,two,five
  9848.     double precision dseed,dzero,seed(2),sum,temp,amean
  9849.     external ifred
  9850.     i = 1
  9851.     call sub(ifred,i)
  9852.     write(*,*) i
  9853.     stop
  9854.     end
  9855.  
  9856.  Response:
  9857.     Microsoft confirmed this to be a problem in Version 3.20 of the
  9858.  FORTRAN compiler.
  9859.     This problem was corrected in FORTRAN Compiler Version 3.30.
  9860.  
  9861.  
  9862.  286. $Large Metacommand and Subroutines
  9863.  
  9864.  Product Version(s): 3.20
  9865.  Operating System:   MS-DOS
  9866.  Flags: ENDUSER |
  9867.  Last Modified: 12-MAY-1988    ArticleIdent: Q10622
  9868.  
  9869.  Problem:
  9870.     In the following example, the array "siwork" is not being
  9871.  recognized as a large array:
  9872.  
  9873.  $large
  9874.     subroutine fred(siwork)
  9875.     integer*2 siwork(1)
  9876.     write (*,*) siwork(33333)
  9877.     end
  9878.  
  9879.  Response:
  9880.     Microsoft confirmed this to be a problem in Version 3.20 of the
  9881.  FORTRAN compiler.
  9882.     The problem was corrected in Version 3.30.
  9883.  
  9884.  
  9885.  287. Read from * Causes Triple Space Rather Than Double Space
  9886.  
  9887.  Product Version(s): 3.20
  9888.  Operating System:   MS-DOS
  9889.  Flags: ENDUSER | buglist3.20 fixlist3.30
  9890.  Last Modified:  6-MAY-1988    ArticleIdent: Q10624
  9891.  
  9892.  Problem:
  9893.     A read from "*" causes a subsequent write to "*" to triple-space
  9894.  rather than double-space.
  9895.     The following is a short code sample that demonstrates the problem:
  9896.  
  9897.     character*1 ina(73)
  9898.     write(*,'(a)') ' Reference line.'
  9899.     read(*,'(73a1)')ina
  9900.     write(*,'(a)') '0< Using "0" here, double space gives triple'
  9901.     write(*,'(a)') '0double spaced.'
  9902.     write(*,'(a)') '0double spaced'
  9903.     end
  9904.  
  9905.  Response:
  9906.     Microsoft has confirmed this to be a problem in the FORTRAN
  9907.  Compiler Version 3.20.
  9908.     The problem was corrected in Version 3.30.
  9909.  
  9910.  
  9911.  288. DREAL Functions Used in Double Complex
  9912.  
  9913.  Product Version(s): 3.20
  9914.  Operating System:   MS-DOS
  9915.  Flags: ENDUSER |
  9916.  Last Modified: 12-MAY-1988    ArticleIdent: Q10636
  9917.  
  9918.  Problem:
  9919.     Pass one of the compiler (FOR1) generates "compile time error 87"
  9920.  when processing a DREAL function used as an argument for a DCMPLX.
  9921.     The following program demonstrates this behavior:
  9922.  
  9923.        complex*16 x, y
  9924.        x = (0.0d0, 0.0d0)
  9925.        y = dcmplx(dreal(x), 0.0d0)
  9926.        stop
  9927.        end
  9928.  
  9929.  Response:
  9930.     Microsoft confirmed this to be a problem in Version 3.20 of the
  9931.  FORTRAN compiler.
  9932.     This problem was corrected in Version 3.30.
  9933.  
  9934.  
  9935.  289. INT Function Producing Incorrect Answer
  9936.  
  9937.  Product Version(s): 3.20
  9938.  Operating System:   MS-DOS
  9939.  Flags: ENDUSER |
  9940.  Last Modified: 20-OCT-1988    ArticleIdent: Q10647
  9941.  
  9942.  Problem:
  9943.  
  9944.  The function INT produces an incorrect answer if given a mixed-mode
  9945.  expression. The following code sample returns the value 94 (it should
  9946.  return the value 95):
  9947.  
  9948.         s = .95
  9949.         n = 100
  9950.         i = int (n*s)
  9951.         write (*,*) s,n,i
  9952.         x = n*s
  9953.         j = int(x)
  9954.         write (*,*) x,j
  9955.         end
  9956.  
  9957.  Response:
  9958.  
  9959.  This is not a problem with the compiler. The different values in the
  9960.  above example are obtained because, in the first case, truncation
  9961.  occurs after the value has been rounded to an 80-bit representation of
  9962.  the expression 100 * .95. In the second case, truncation occurs after
  9963.  the value has been rounded to a 32-bit representation.
  9964.  
  9965.  
  9966.  290. LEN Function
  9967.  
  9968.  Product Version(s): 3.20
  9969.  Operating System:   MS-DOS
  9970.  Flags: ENDUSER |
  9971.  Last Modified:  6-OCT-1988    ArticleIdent: Q10667
  9972.  
  9973.  Problem:
  9974.  
  9975.  The FORTRAN intrinsic LEN is missing from this version of the
  9976.  compiler; however, it will compile and link without error if you use
  9977.  the LEN function in a program. The result from the LEN function is
  9978.  always 538976288. The following is a code sample that demonstrates
  9979.  this behavior:
  9980.  
  9981.         character*20
  9982.         alphaline = 'This is a test'
  9983.         i = len(alphaline)
  9984.         write (*,10) i
  9985.  10     format (1x,i16)
  9986.         end
  9987.  
  9988.  Response:
  9989.  
  9990.  The LEN intrinsic function is not supported in this version of the
  9991.  compiler. However, the LEN intrinsic function was implemented in a
  9992.  peculiar manner in that the front end recognizes the LEN as an
  9993.  intrinsic, but generates incorrect code. In Version 3.30, LEN is not
  9994.  recognized at all. In Version 4.00, LEN is fully supported.
  9995.  
  9996.  
  9997.  291. FORTRAN Version 4.10 README DOC: Pascal Programs
  9998.  
  9999.  Product Version(s): 4.10   | 4.10
  10000.  Operating System:   MS-DOS | OS/2
  10001.  Flags: ENDUSER |
  10002.  Last Modified: 13-JAN-1989    ArticleIdent: Q28824
  10003.  
  10004.  The following information is from the FORTRAN Version 4.10
  10005.  CVREADME.DOC file:
  10006.  
  10007.  Microsoft Pascal Programs
  10008.  
  10009.  In this release, Microsoft Pascal programs cannot be debugged with the
  10010.  CodeView debugger. However the Pascal 4.00, just released, does have
  10011.  CodeView support.
  10012.  
  10013.  The Pascal example on Page 61 of the Microsoft CodeView and Utilities
  10014.  manual should read
  10015.  
  10016.  PAS1 /Z TEST;
  10017.  
  10018.  rather than
  10019.  
  10020.  PAS1 /Zi TEST;
  10021.  
  10022.  Although, the PL driver does use the "/Zi" switch.
  10023.  
  10024.  
  10025.  292. FORTRAN 4.10 CVREADME.DOC: Overlay Restrictions
  10026.  
  10027.  Product Version(s): 4.10   | 4.10
  10028.  Operating System:   MS-DOS | OS/2
  10029.  Flags: ENDUSER |
  10030.  Last Modified: 27-APR-1988    ArticleIdent: Q28825
  10031.  
  10032.     The following information is from the FORTRAN Version 4.10
  10033.  CVREADME.DOC file:
  10034.  
  10035.  Overlay Restrictions
  10036.     You cannot use long jumps (using the longjmp library function) or
  10037.  indirect calls (through a function pointer) to pass control to an
  10038.  overlay. When a function is called through a pointer, the called
  10039.  function must be in the same overlay or in the root.
  10040.  
  10041.  
  10042.  293. FORTRAN 4.10 CVREADME.DOC: Library Manager
  10043.  
  10044.  Product Version(s): 4.10   | 4.10
  10045.  Operating System:   MS-DOS | OS/2
  10046.  Flags: ENDUSER |
  10047.  Last Modified: 27-APR-1988    ArticleIdent: Q28826
  10048.  
  10049.     The following information is from the FORTRAN Version 4.10
  10050.  CVREADME.DOC file:
  10051.  
  10052.  Microsoft Library Manager (LIB) -- New Option
  10053.     There is a new option for LIB: /NOIGNORECASE (abbreviated as /N).
  10054.  This option tells LIB to not ignore case when comparing symbols.
  10055.  names. By default, LIB ignores case. Multiple symbols that are the
  10056.  same except for case can be put in the same library. An example of
  10057.  this is: "_Open" and "_open". Normally you could not add both these
  10058.  symbols to the same library.
  10059.     Note that if a library is built with /NOI, the library is
  10060.  internally "marked" to indicate /NOI. All libraries built with
  10061.  earlier versions of LIB are not marked.
  10062.     If you combine multiple libraries, and any one of them is marked
  10063.  /NOI, then /NOI is assumed for the output library.
  10064.     In addition, LIB also supports the option /IGNORECASE (/I), which
  10065.  is completely analogous to /NOIGNORECASE. /I is the default. The only
  10066.  reason to use it would be if you have an existing library marked /NOI
  10067.  that you wanted to combine with other libraries which were not marked,
  10068.  and have the output library be not marked. If you don't use
  10069.  /IGNORECASE, the output is marked /NOI (see above).
  10070.  
  10071.  Changed LIB Error Messages
  10072.     Warning messages U4152, U4155, and U4157-U4159 for LIB are now
  10073.  nonfatal error messages U2152, U2155, and U2157-U2159, respectively.
  10074.     Warning message U4151 has been changed to read as follows:
  10075.  
  10076.     U4151   '<name>' : symbol defined in module <name>,
  10077.                             redefinition ignored
  10078.  
  10079.  New LIB Error Messages
  10080.     The following new warning messages have been added for LIB:
  10081.  
  10082.     U4155   <modulename> : module not in library
  10083.  
  10084.     A module specified to be replaced does not already exist in the
  10085.  library. LIB adds the module anyway.
  10086.  
  10087.     U4157   insufficient memory, extended dictionary not created
  10088.     U4158   internal error, extended dictionary not created
  10089.  
  10090.     For the reason indicated, LIB could not create an extended
  10091.  dictionary. The library is still valid, but the linker is not able to
  10092.  take advantage of the extended dictionary to speed linking.
  10093.  
  10094.  
  10095.  294. FORTRAN 4.10 CVREADME.DOC: ILink Warning Messages
  10096.  
  10097.  Product Version(s): 4.10    | 4.10
  10098.  Operating System:   MS-DOS  | OS/2
  10099.  Flags: ENDUSER |
  10100.  Last Modified:  5-MAY-1988    ArticleIdent: Q28827
  10101.  
  10102.     The following information is from the FORTRAN Version 4.10
  10103.  CVREADME.DOC file:
  10104.  
  10105.  ILINK Warning messages
  10106.  
  10107.     Fixup frame relative to an (as yet) undefined symbol - assuming ok
  10108.  See documentation for LINK error messages L4001 and L4002, in the
  10109.  Microsoft CodeView and Utilities manual.
  10110.  
  10111.     <name> contains TYPEDEFs - ignored
  10112.     <name> contains BLKDEFs - ignored
  10113.     The .OBJ file contains records no longer supported by Microsoft
  10114.  language compilers.
  10115.     Old .EXE free information lost The free list in the .EXE file has
  10116.  been corrupted. The free list keeps track of "holes" of free space in
  10117.  the EXE file. These holes are made available when segments are moved
  10118.  to new locations.
  10119.     File <name> has no useful contribution The given module makes no
  10120.  contribution to any segment.
  10121.     Main entry point moved The program starting address changed. You
  10122.  may want to consider doing a full link.
  10123.  
  10124.  
  10125.  295. FORTRAN 4.10 Patch README.DOC: IBM PC-DOS 3.20
  10126.  
  10127.  Product Version(s): 4.10    | 4.10
  10128.  Operating System:   MS-DOS  | OS/2
  10129.  Flags: PSSONLY | ENDUSER
  10130.  Last Modified: 30-OCT-1990    ArticleIdent: Q28828
  10131.  
  10132.     The following information is from the FORTRAN Version 4.10 Patch
  10133.  README.DOC file:
  10134.  
  10135.     There is a bug in IBM PC-DOS 3.20 which may cause improper
  10136.  operation of a program if a floating point exception is generated.
  10137.  This patch to IBM PC-DOS 3.20 is provided to insure proper operation
  10138.  of programs which may generate floating point exceptions. In
  10139.  particular, the C runtime routine signal with the SIGFPE parameter
  10140.  does not work with the unpatched version of IBM PC-DOS 3.20. IBM has
  10141.  also made a patch for this problem available.
  10142.     Procedure for patching IBM PC-DOS 3.20:
  10143.  
  10144.     1. Use the DOS sys command to transfer IBMDOS.COM and IBMBIO.COM to
  10145.  a writable diskette.
  10146.     2. Copy command.com, sys.com and debug.com from your IBM DOS 3.20
  10147.  diskette to the new diskette.
  10148.     3. Copy stkpat.bat, stkpat.scr, rmrhs.exe and setrhs.exe from the
  10149.  \patch directory to the new diskette.
  10150.     4. Reboot the system from the new diskette.
  10151.     5. Run stkpat.bat. This patches the IBMBIO.COM on the new diskette.
  10152.     6. Use the DOS sys command to transfer the patch to any other IBM
  10153.  PC-DOS 3.20 diskette.
  10154.  
  10155.     If you are running any version of DOS 3.20 other than IBM PC-DOS
  10156.  3.20, contact your hardware manufacturer (OEM) to find out if the
  10157.  problem exists in your DOS 3.20 version.
  10158.  
  10159.  
  10160.  296. FORTRAN 4.10 CVREADME.DOC: Stack Trace Command
  10161.  
  10162.  Product Version(s): 4.10   | 4.10
  10163.  Operating System:   MS-DOS | OS/2
  10164.  Flags: ENDUSER |
  10165.  Last Modified: 27-APR-1988    ArticleIdent: Q28829
  10166.  
  10167.     The following information is from the FORTRAN Version 4.10
  10168.  CVREADME.DOC file:
  10169.  
  10170.  Stack Trace Command
  10171.     In order for the Stack Trace command (or the Calls menu) to work
  10172.  reliably, you need to execute to at least the beginning of the main
  10173.  function or procedure, and the current module should have full
  10174.  CodeView information (a module has full CodeView information if
  10175.  compiled or assembled with /Zi).
  10176.  
  10177.  
  10178.  297. FORTRAN 4.10 CVREADME.DOC: Exit Codes
  10179.  
  10180.  Product Version(s): 4.10   | 4.10
  10181.  Operating System:   MS-DOS | OS/2
  10182.  Flags: ENDUSER |
  10183.  Last Modified: 27-APR-1988    ArticleIdent: Q28830
  10184.  
  10185.     The following information is from the FORTRAN Version 4.10
  10186.  CVREADME.DOC file:
  10187.  
  10188.  Exit Codes for Utilities
  10189.     The exit codes for LINK and the utilities in the Microsoft CodeView
  10190.  and Utilities manual should appear as follows:
  10191.  
  10192.  LINK
  10193.  
  10194.     Code    Meaning
  10195.  
  10196.     0       No error.
  10197.  
  10198.     2       Program error--something was wrong with the commands
  10199.             or files input to the linker.
  10200.  
  10201.     4       System error.  The linker
  10202.  
  10203.             - ran out of space on output files
  10204.             - was unable to reopen the temporary file
  10205.             - experienced an internal error
  10206.             - was interrupted by the user
  10207.  
  10208.  LIB, EXEPACK, EXEMOD, MAKE, and SETENV
  10209.  
  10210.     Code    Meaning
  10211.  
  10212.     0       No error.
  10213.  
  10214.     2       Program error--something was wrong with the commands
  10215.             or files input to the utility.
  10216.  
  10217.     4       System error.  The utility ran out of memory, was
  10218.             interrupted by the user, or experienced an internal
  10219.             error.
  10220.  
  10221.             Microsoft Segmented-Executable Linker (LINK)
  10222.  
  10223.  
  10224.  298. "END=" on Multiple Executions
  10225.  
  10226.  Product Version(s): 3.20
  10227.  Operating System:   MS-DOS
  10228.  Flags: ENDUSER | TAR50049 buglist3.20 fixlist3.30
  10229.  Last Modified:  6-OCT-1988    ArticleIdent: Q10666
  10230.  
  10231.  Problem:
  10232.  
  10233.  Using "END=" to branch works properly the first time, but can fail
  10234.  under multiple executions. The following code sample demonstrates this
  10235.  behavior:
  10236.  
  10237.          program contlz
  10238.  
  10239.          real*4 a,b
  10240.  
  10241.          i = 0
  10242.  10      write(*,*) 'real ?'
  10243.          read(*,*,end=200) a
  10244.  
  10245.          write(*,*) 'second real ?'
  10246.          read(*,*,end=200) b
  10247.          goto 100
  10248.  
  10249.  200     write (*,*) 'end of file encountered'
  10250.  100     write(*,*) 'end of program message'
  10251.          i = i + 1
  10252.          if (i.lt.3) goto 10
  10253.          end
  10254.  
  10255.  Response:
  10256.  
  10257.  Microsoft confirmed this to be a problem in Version 3.20 of the
  10258.  FORTRAN compiler. The problem was corrected in Version 3.30.
  10259.  
  10260.  
  10261.  299. FORTRAN 4.10 CVREADME.DOC: Changed LINK Error Messages
  10262.  
  10263.  Product Version(s): 4.10    | 4.10
  10264.  Operating System:   MS-DOS  | OS/2
  10265.  Flags: ENDUSER |
  10266.  Last Modified: 27-APR-1988    ArticleIdent: Q28831
  10267.  
  10268.     The following information is from the FORTRAN Version 4.10
  10269.  CVREADME.DOC file:
  10270.  
  10271.  Changed LINK Error Messages
  10272.     The explanation for fatal-error message L1008 is changed as
  10273.  follows:
  10274.  
  10275.     The /SEGMENTS option specified a limit greater than 3072 on the
  10276.  number of segments allowed.
  10277.  
  10278.     Error message L1009 has been changed to read as follows:
  10279.  
  10280.          L1009   <number> : CPARMAXALLOC : illegal value
  10281.  
  10282.     Error message L1053 has been changed to read as follows:
  10283.  
  10284.          L1053   out of memory for symbol table
  10285.  
  10286.     The program had more symbolic information (such as public,
  10287.  external, segment, group, class, and file names) than the amount that
  10288.  could fit in  available real memory.
  10289.     Try freeing memory by linking from the DOS command level instead of
  10290.  from a MAKE file or from an editor. Otherwise, combine modules or
  10291.  segments and try to eliminate as many public symbols as possible.
  10292.     Warning message L4050 has been changed as follows:
  10293.  
  10294.          L4050   too many public symbols for sorting
  10295.  
  10296.     The linker uses the stack and all available memory in the near heap
  10297.  to sort public symbols for the /MAP option. If the number of public
  10298.  symbols exceeds the space available for them, this warning is issued,
  10299.  and the symbols are not sorted in the map file but are listed in
  10300.  arbitrary order.
  10301.  
  10302.  
  10303.  300. FORTRAN 4.10 CVREADME.DOC: New LINK Error Messages
  10304.  
  10305.  Product Version(s):
  10306.  Operating System:   4.10   | 4.10
  10307.  Flags: MS-DOS | OS/2
  10308.  Last Modified: 29-AUG-1988    ArticleIdent: Q28832
  10309.  ENDUSER |
  10310.  
  10311.     The following information is from the FORTRAN Version 4.10
  10312.  CVREADME.DOC file:
  10313.  
  10314.  New LINK Error Messages
  10315.  
  10316.     L1003   /QUICKLIB, /EXEPACK incompatible
  10317.  
  10318.     You cannot link with both the /QU option and the /E option.
  10319.  
  10320.     L1006   <option-text>: stack size exceeds 65535 bytes
  10321.  
  10322.     The value given as a parameter to the /STACKSIZE option exceeds the
  10323.  maximum allowed.
  10324.  
  10325.     L1063   out of memory for CodeView information
  10326.  
  10327.     The linker was given too many object files with debug information,
  10328.  and the linker ran out of space to store it. Reduce the number of
  10329.  object files that have debug information.
  10330.  
  10331.     L1115   /QUICKLIB, overlays incompatible
  10332.  
  10333.     You specified overlays and used the /QUICKLIB option. These cannot
  10334.  be used together.
  10335.  
  10336.     L2013   LIDATA record too large
  10337.  
  10338.     An LIDATA record contained more than 512 bytes. This is probably a
  10339.  compiler error.
  10340.  
  10341.     L2024   <name>: special symbol already defined
  10342.  
  10343.     Your program defined a symbol name that is already used by the
  10344.  linker for one of its own low-level symbols. (For example, the linker
  10345.  generates special symbols used in overlay support and other
  10346.  operations.) Choose another name for the symbol in order to avoid
  10347.  conflict.
  10348.  
  10349.     L2025   <segmentname>: segment with > 1 class name not allowed with
  10350.  /INC
  10351.  
  10352.  ******<The following is a correction to the CVREADME.DOC file.>*******
  10353.     The above error number is not correct. L2025 refers to Symbol
  10354.  defined more than once.
  10355.  *****************************<END>************************************
  10356.  
  10357.     Your program defined a segment more than once, giving the segment
  10358.  different class names. Different class names for the same segment are
  10359.  not allowed when you link with the /INCREMENTAL option. Normally, this
  10360.  error should never appear unless you are programming with MASM. For
  10361.  example, if you give the two MASM statements
  10362.  
  10363.     _BSS segment 'BSS'
  10364.  
  10365.     and
  10366.  
  10367.     _BSS segment 'DATA'
  10368.  
  10369.  then the statements have the effect of declaring two distinct
  10370.  segments. ILINK does not support this situation, so it is disallowed
  10371.  when the /INCREMENTAL option is used.
  10372.  
  10373.     L2041   stack plus data exceed 64K
  10374.  
  10375.     The total of near data and requested stack size exceeds 64K, and
  10376.  the program will not run correctly. Reduce the stack size. The linker
  10377.  only checks for this condition if /DOSSEG is enabled, which is done
  10378.  automatically in the library startup module.
  10379.  
  10380.     L2043   Quick Library support module missing
  10381.  
  10382.     When creating a Quick library, you did not link with the required
  10383.  QUICKLIB.OBJ module.
  10384.  
  10385.     L2044   <name> : symbol multiply defined, use /NOE
  10386.  
  10387.     The linker found what it interprets as a public-symbol
  10388.  redefinition, probably because you have redefined a symbol that is
  10389.  defined in a library. Relink with the /NOEXTDICTIONARY (/NOE) option.
  10390.  If error L2025 results for the same symbol, then you have a genuine
  10391.  symbol-redefinition error.
  10392.  
  10393.     L4003   intersegment self-relative fixup at <offset> in segment
  10394.  <name> pos: <offset> Record type: 9C target external '<name>'
  10395.  
  10396.     The linker found an intersegment self-relative fixup. This error
  10397.  may be caused by compiling a small-model program with the /NT option.
  10398.  
  10399.     L4034   more than 239 overlay segments; extra put in root
  10400.  
  10401.     Your program designated more than the limit of 239 segments to go
  10402.  in overlays. Starting with the 234th segment, they are assigned to
  10403.  the root (that is, the permanently resident portion of the program).
  10404.  
  10405.  
  10406.  301. BACKSPACE Working Improperly
  10407.  
  10408.  Product Version(s): 3.20
  10409.  Operating System:   MS-DOS
  10410.  Flags: ENDUSER |
  10411.  Last Modified: 20-OCT-1988    ArticleIdent: Q10711
  10412.  
  10413.  Problem:
  10414.  
  10415.  BACKSPACE does not seem to work properly using the DOS1 unit v. The
  10416.  following is a code sample that demonstrates this behavior:
  10417.  
  10418.         program xxx
  10419.         character*70 line
  10420.         open (1,file=' ',status='old') 100 continue
  10421.         read (1,110,end=200) line 110 format (a)
  10422.         write (*,*) line
  10423.         go to 100 200 continue
  10424.         if (eof(1)) write (*,*) 'unit 1 is at eof'
  10425.         backspace 1
  10426.         write (1,900) '*****this is new info****' 900 format
  10427.      (a)
  10428.         write (1,900) 'and so is this...!'
  10429.         end
  10430.  
  10431.  Response:
  10432.  
  10433.  A workaround to this problem is to link with DOS2FOR.LIB. Because
  10434.  future versions of the compiler will no longer support DOS1 unit v,
  10435.  the problem will no longer occur.
  10436.  
  10437.  
  10438.  302. FORTRAN 4.10 CVREADME.DOC: Mixed-Language Programming
  10439.  
  10440.  Product Version(s): 4.10   | 4.10
  10441.  Operating System:   MS-DOS | OS/2
  10442.  Flags: ENDUSER |
  10443.  Last Modified: 27-APR-1988    ArticleIdent: Q28833
  10444.  
  10445.     The following information is from the FORTRAN Version 4.10
  10446.  CVREADME.DOC file:
  10447.  
  10448.  Mixed-Language Programming -- C Naming Conventions
  10449.     C recognizes the first 31 characters of a symbolic name.
  10450.  
  10451.  Accessing Parameters on the Stack
  10452.     In Section 6.1.5 of the Microsoft Mixed Languages Programming
  10453.  Guide, the instruction
  10454.  
  10455.          mov     bx, [bp+6]
  10456.  
  10457.  loads the argument into the BX register rather than the BP register.
  10458.  
  10459.  Setting Up Calls to High-Level Languages
  10460.     Section 6.6 of the Microsoft Mixed Languages Programming Guide
  10461.  gives instructions for setting up a call to a high-level language from
  10462.  assembly language. Before you execute a call to a BASIC, Pascal, or
  10463.  FORTRAN routine, remember to declare an additional parameter if the
  10464.  return value is noninteger. This additional parameter must contain the
  10465.  offset address of the return value, for which you must allocate room
  10466.  within the stack segment (normally DGROUP, the same as the default
  10467.  data segment).
  10468.  
  10469.  BASIC Return Values
  10470.     BASIC functions use the FORTRAN/Pascal conventions, rather than the
  10471.  C conventions, for receiving return values.
  10472.  
  10473.  Passing C Strings to BASIC
  10474.     In Section 8.4.3 of the Microsoft Mixed Languages Programming
  10475.  Guide, in the example illustrating how C passes string arguments to
  10476.  BASIC functions, the sd_len field should be declared as shown below:
  10477.  
  10478.          int sd_len
  10479.  
  10480.  BASIC Array Declarations
  10481.     The sample BASIC array declaration in Table 9.1 of the Microsoft
  10482.  Mixed Language Guide should read
  10483.  
  10484.          DIM x(c-1, r-1)
  10485.  
  10486.  Linking with MASM Files
  10487.     If you are linking C modules with modules created by the Microsoft
  10488.  Macro Assembler, either assemble the MASM modules with the /MX option
  10489.  to preserve case sensitivity in these modules; or, use the LINK
  10490.  command to link in a separate step, and do NOT specify the /NOI linker
  10491.  option.
  10492.  
  10493.  Linking Mixed-Language Programs
  10494.     This section explains how to link Microsoft C modules with modules
  10495.  created by other Microsoft languages. The discussions assume that you
  10496.  are linking with the Microsoft Segmented-Executable Linker, LINK.
  10497.  (This is the version of LINK provided with this version of FORTRAN and
  10498.  Version 5.10 of the Microsoft C Optimizing Compiler.)
  10499.     To link object modules created using the Microsoft C Optimizing
  10500.  Compiler, Version 5.10, with those created using the Microsoft FORTRAN
  10501.  Optimizing Compiler Version 4.00 or 4.01, you must create a special
  10502.  version of each of the FORTRAN libraries you intend to use. Create one
  10503.  FORTRAN library to correspond to each C library you are using; that
  10504.  is, create a FORTRAN library that supports the same
  10505.  memory-model/math-option combination as the corresponding C library.
  10506.  Be sure that you choose the "C compatibility" option when you build
  10507.  each FORTRAN library.
  10508.     Next, use the SETUP program provided with Microsoft C, Version
  10509.  5.10, to create all the combined C 5.10 libraries that you will need.
  10510.  SETUP creates a subdirectory named \MIXLANG under the C 5.10 base
  10511.  directory.
  10512.     Place the FORTRAN libraries you have created in this directory.
  10513.  Then make the \MIXLANG directory the current directory and run
  10514.  F4COMPAT, which brings the FORTRAN libraries up to date and makes them
  10515.  compatible with C 5.10. F4COMPAT takes two arguments: one specifying
  10516.  the memory model and one specifying the floating-point-math package
  10517.  that the library supports. For example,
  10518.  
  10519.          F4COMPAT L 7
  10520.  
  10521.  makes a C 5.10-compatible version of LLIBFOR7.LIB.
  10522.  
  10523.     Once the libraries are built, use the following LINK command line
  10524.  to link the appropriate C library with the FORTRAN library that you
  10525.  converted in the previous example:
  10526.  
  10527.       LINK objs,,,LLIBC7.LIB LLIBFOR7.LIB /NOE;
  10528.  
  10529.     The LINK command lines for other memory models and floating-point
  10530.  math packages are similar. Note that the C library must be given
  10531.  first on the command line. Specify the \MIXLANG subdirectory either in
  10532.  the LIB environment variable or on the LINK command line so that the
  10533.  linker can find the FORTRAN library. Use only large- and medium-model
  10534.  libraries. Huge-model programs use large-model libraries.
  10535.     To link other combinations of language libraries, the BASIC
  10536.  libraries (either BCOM40 or BRUN40) should be listed first on the LINK
  10537.  command line, since the main program must be written in BASIC.
  10538.  Otherwise, the C 5.10 library should be listed first. (Or, if you are
  10539.  using C 4.00 with FORTRAN 4.00 or later, the FORTRAN library should be
  10540.  listed first.) For best results, using large-memory-model C is
  10541.  suggested.
  10542.  
  10543.  
  10544.  303. FORTRAN 4.10 CVREADME.DOC: The BIND Utility
  10545.  
  10546.  Product Version(s): 4.10    | 4.10
  10547.  Operating System:   MS-DOS  | OS/2
  10548.  Flags: ENDUSER |
  10549.  Last Modified: 27-APR-1988    ArticleIdent: Q28834
  10550.  
  10551.     The following information is from the FORTRAN Version 4.10
  10552.  CVREADME.DOC file:
  10553.  
  10554.  The BIND Utility -- Specifying Libraries
  10555.     You need to include DOSCALLS.LIB on the BIND command line. If
  10556.  DOSCALLS.LIB is not in the current directory, you must give the
  10557.  complete path name to DOSCALLS.LIB.
  10558.     BIND automatically searches for API.LIB by looking in directories
  10559.  listed in the LIB environment variable. However, if API.LIB is
  10560.  specified on the command line, then BIND does not check the LIB
  10561.  environment variable; instead, you need to give the complete path
  10562.  name.
  10563.     For example, the following command line successfully uses BIND, if
  10564.  API.LIB is located in a directory listed in the LIB environment
  10565.  variable:
  10566.  
  10567.  BIND FOO.EXE \LIB\DOSCALLS.LIB
  10568.  
  10569.  Using BIND with Packed Files
  10570.     The version of BIND released with this package does not work with
  10571.  files that have been linked with the /EXEPACK linker option.
  10572.  
  10573.  Running Bound Files with DOS 2.1
  10574.     A dual-mode executable file produced with BIND can be run in both
  10575.  DOS 3.x and DOS 2.x environments. However, if you change the name of
  10576.  an executable file produced by BIND, then it will not run under DOS
  10577.  2.1.
  10578.  
  10579.  
  10580.  304. FORTRAN 4.10 CVREADME.DOC: ILink Fatal Error Messages
  10581.  
  10582.  Product Version(s): 4.10    | 4.10
  10583.  Operating System:   MS-DOS  | OS/2
  10584.  Flags: ENDUSER |
  10585.  Last Modified: 27-APR-1988    ArticleIdent: Q28835
  10586.  
  10587.     The following information is from the FORTRAN Version 4.10
  10588.  CVREADME.DOC file:
  10589.  
  10590.  The Microsoft Incremental Linker (ILINK) -- ILINK Fatal Error Messages
  10591.  
  10592.  .sym seek error
  10593.  .sym read error
  10594.  
  10595.     The .SYM file is corrupted. Do a full link. If the error persists,
  10596.  contact Microsoft.
  10597.  
  10598.  .sym write error
  10599.  
  10600.     The disk is full or the .SYM file already exists with the READONLY
  10601.  attribute.
  10602.  
  10603.  map for segment <name> exceeds 64K
  10604.  
  10605.     The symbolic information associated with the given segment exceeds
  10606.  64K bytes, which is more than ILINK can handle.
  10607.  
  10608.  can't ilink library <name>
  10609.  
  10610.     You tried to incrementally link an altered library. ILINK does not
  10611.  link .LIB files but only .OBJ files. Use a full link instead.
  10612.  
  10613.  .obj close error
  10614.  
  10615.     The operating system returned an error when ILINK attempted to
  10616.  close one of the .OBJ files. Do a full link. If the error persists,
  10617.  contact Microsoft.
  10618.  
  10619.  too many LNAMES in <modname>
  10620.  
  10621.     An object module has more than 255 LNAME records.
  10622.  
  10623.  too many SEGDEFs in <modname>
  10624.  
  10625.     The given object module has more than 100 SEGDEF records.
  10626.  
  10627.  too many GRPDEFs in <modname>
  10628.  
  10629.     The given object module has more than 10 GRPDEF records.
  10630.  
  10631.  symbol <name> multiply defined
  10632.  
  10633.     The given symbol is defined more than once.
  10634.  
  10635.  #3
  10636.  
  10637.     Please report this error to Microsoft.
  10638.  
  10639.  Out of Memory
  10640.  
  10641.     ILINK ran out of memory for processing the input. If you are
  10642.  running ILINK under MAKE, try running it from the shell. Otherwise, do
  10643.  a full link.
  10644.  
  10645.  could not run exec
  10646.  
  10647.     ILINK was unable to find the file EXEC.EXE, which should be placed
  10648.  somewhere in the search path or in the current directory.
  10649.  
  10650.  .exe file too big, change alignment
  10651.  
  10652.     The segment sector alignment value in the .EXE file is too small to
  10653.  express the size of one of the segments.  Do a full link and increase
  10654.  the alignment value with the /ALIGNMENT option to LINK.
  10655.  
  10656.  .ilk seek error
  10657.  
  10658.     The .ILK file is corrupted. Do a full link. If the error
  10659.  persists, contact Microsoft.
  10660.  
  10661.  Too many defined segments
  10662.  
  10663.     ILINK has a limit of 255 defined segments, which are segments
  10664.  defined in an object module as opposed to an executable segment.
  10665.  Reduce the number of segments if you want to use ILINK.
  10666.  
  10667.  too many library files
  10668.  
  10669.     ILINK has a limit of 32 runtime libraries (.LIB files). Reduce the
  10670.  number of libraries.
  10671.  
  10672.  too many modules
  10673.  
  10674.     ILINK has a limit of 1204 modules in a program. Reduce the number
  10675.  of modules.
  10676.  
  10677.  .ilk write error
  10678.  
  10679.     The disk is full, or else ILINK cannot write to the .SYM file
  10680.  because a .SYM file currently exists and has the READONLY attribute.
  10681.  
  10682.  file <name> does not exist
  10683.  
  10684.     ILINK was unable to open the given file. The file named was in the
  10685.  file list in the .ILK file.
  10686.  
  10687.  seek error on library
  10688.  
  10689.     A .LIB file was corrupted. Do a full link and check your .LIB
  10690.  files.
  10691.  
  10692.  library close error
  10693.  
  10694.     The operating system returned an error when ILINK attempted to
  10695.  close one of the .LIB files. Do a full link. If the error persists,
  10696.  contact Microsoft.
  10697.  
  10698.  error closing EXE file
  10699.  
  10700.     The operating system returned an error when ILINK attempted to
  10701.  close the .EXE file. Do a full link. If the error persists, contact
  10702.  Microsoft.
  10703.  
  10704.  Invalid module reference <module>
  10705.  
  10706.     The program makes a dynamic link reference to a dynamic link module
  10707.  which is not represented in the .EXE file.
  10708.  
  10709.  could not update time on <filename>
  10710.  
  10711.     The operating system returned an error when ILINK attempted to
  10712.  update the time on the given file. Possibly the file had the READONLY
  10713.  attribute set.
  10714.  
  10715.  invalid flag <flag>
  10716.  only one -e command allowed
  10717.  
  10718.     The ILINK command syntax is incorrect.
  10719.  
  10720.  User Abort
  10721.  
  10722.     The user issued CTRL+C or CTRL+BREAK.
  10723.  
  10724.  file <name> write protected
  10725.  
  10726.     The .EXE, .ILK, or .SYM file needed to be updated and has the
  10727.  READONLY attribute. Change attribute to READWRITE.
  10728.  
  10729.  file <name> missing
  10730.  
  10731.     One of the .OBJ files specified on the command line is missing.
  10732.  
  10733.  file <name> invalid .OBJ format
  10734.  file <name> has invalid <recordtype> record
  10735.  
  10736.     The given .OBJ file has an invalid format or one that is not
  10737.  recognized by ILINK. This may have been caused by a compiler or
  10738.  assembler.
  10739.  
  10740.  file <module> was not full linked
  10741.  
  10742.     An .OBJ file was specified as input to ILINK, which was not in the
  10743.  list of files in the original full link.
  10744.  
  10745.  LOBYTE seg-relative fixups not supported
  10746.  
  10747.     This error message should occur only with MASM files. See the
  10748.  Microsoft Macro Assembler 5.0 Programmer's Guide. This type of object
  10749.  module is not supported by ILINK.
  10750.  
  10751.  <number> undefined symbols
  10752.  
  10753.     The given number of symbols were referred to in fixups but never
  10754.  publicly defined in the program.
  10755.  
  10756.  
  10757.  305. FORTRAN 4.10 CVREADME.DOC: Incremental Violations
  10758.  
  10759.  Product Version(s): 4.10   | 4.10
  10760.  Operating System:   MS-DOS | OS/2
  10761.  Flags: ENDUSER |
  10762.  Last Modified: 27-APR-1988    ArticleIdent: Q28836
  10763.  
  10764.     The following information is from the FORTRAN Version 4.10
  10765.  CVREADME.DOC file:
  10766.  
  10767.  Incremental Violations
  10768.     These errors cause a full link to occur if the -e option is used
  10769.  and -i is not used, or else they are fatal errors:
  10770.  
  10771.  symbol <name> deleted
  10772.  
  10773.     A symbol was deleted from an incrementally-linked module.
  10774.  
  10775.  <modname> contains new SEGMENT
  10776.  
  10777.     A segment was added to the program.
  10778.  
  10779.  <modname> contains changed segment <name>
  10780.  
  10781.     The segment contribution (code or data which the module contributes
  10782.  to a segment) changed for the given module: it contributed to a
  10783.  segment it didn't previously contribute to, or a contribution was
  10784.  removed.
  10785.  
  10786.  <modname>'s segment <name> grew too big
  10787.  
  10788.     The given segment grew beyond the padding for the given module.
  10789.  
  10790.  <modname> contains new GROUP <name>
  10791.  
  10792.     A new group was defined, via the GROUP directive in assembly
  10793.  language or via the /ND C compiler option.
  10794.  
  10795.  <modname> redefines group <name> to include <name>
  10796.  
  10797.     The members of the given group changed.
  10798.  
  10799.  symbol <name> changed
  10800.  
  10801.     The given data symbol was moved.
  10802.  
  10803.  can't add new communal data symbol <name>
  10804.  
  10805.     A new communal data symbol was added as an uninitialized variable
  10806.  in C or with the COMM feature in MASM.
  10807.  
  10808.  communal variable <name> grew too big
  10809.  
  10810.     The given communal variable changed size too much.
  10811.  
  10812.  invalid symbol type for <name>
  10813.  
  10814.     A symbol which was previously code became data, or vice versa.
  10815.  
  10816.  too many COMDEFS
  10817.  too many EXTDEFS
  10818.  
  10819.     The limit on the total of COMDEF records (communal data variables)
  10820.  and EXTDEF records (external references) is 2000.
  10821.  
  10822.  invalid CodeView information in .EXE file
  10823.  
  10824.     The CodeView information found is invalid.
  10825.  
  10826.  <name> contains new CodeView symbolic info
  10827.  
  10828.     A module previously compiled without -Zi was compiled with -Zi.
  10829.  
  10830.  <name> contains new linnum info
  10831.  
  10832.     A module previously compiled without -Zi or -Zd was compiled with
  10833.  -Zi or -Zd.
  10834.  
  10835.  <name> contains new public CV info
  10836.  
  10837.     New information on public-symbol addresses was added.
  10838.  
  10839.  invalid .exe file
  10840.  
  10841.     The .EXE file is invalid. Make sure you are using an up-to-date
  10842.  linker. If the error persists, contact Microsoft.
  10843.  
  10844.  invalid .ilk file
  10845.  .ilk read error
  10846.  .ilk seek error
  10847.  
  10848.     The .ILK file is invalid. Make sure you are using an up-to-date
  10849.  linker. If the error persists, contact Microsoft.
  10850.  
  10851.  .SYM/.ILK mismatch
  10852.  
  10853.     The .SYM and .ILK files are out of sync. Make sure you are using
  10854.  an up-to-date linker. If the error persists, contact Microsoft.
  10855.  
  10856.  <libname> has changed
  10857.  
  10858.     The given library has changed.
  10859.  
  10860.  can't link 64K-length segments
  10861.  
  10862.     ILINK cannot handle segments greater than 65,535 bytes long.
  10863.  
  10864.  can't link iterated segments
  10865.  
  10866.     ILINK cannot handle programs linked with /EXEPACK.
  10867.  
  10868.  Entry table expansion not implemented
  10869.  
  10870.     The program call tree changed in such a way that ILINK could not
  10871.  handle it.
  10872.  
  10873.  file <name> does not exist
  10874.  
  10875.     The .EXE, .SYM, or .ILK files are missing.
  10876.  
  10877.  <name> has changed
  10878.  
  10879.     The given library module name has changed.
  10880.  
  10881.  
  10882.  306. FORTRAN 4.10 CVREADME.DOC: Microsoft Editor
  10883.  
  10884.  Product Version(s): 4.10   | 4.10
  10885.  Operating System:   MS-DOS | OS/2
  10886.  Flags: ENDUSER |
  10887.  Last Modified: 27-APR-1988    ArticleIdent: Q28837
  10888.  
  10889.     The following information is from the FORTRAN Version 4.10
  10890.  CVREADME.DOC file:
  10891.  
  10892.  Microsoft Editor -- Setting Up the Microsoft Editor
  10893.     The FORTRAN setup program does not install the Microsoft Editor.
  10894.  To install the Microsoft Editor, insert the Microsoft Editor disk and
  10895.  run the MSETUP batch file. To use the MSETUP batch file under
  10896.  protected-mode OS/2, rename MSETUP.BAT to MSETUP.CMD.
  10897.  
  10898.  CALLTREE.EXE
  10899.     The CALLTREE program mentioned on page 112 of the Microsoft Editor
  10900.  User's Guide is not included with FORTRAN Version 4.10 because the
  10901.  utility can only be used with C and assembly programs.
  10902.  
  10903.  C Extension Files
  10904.     The files mentioned in Section 8, "Programming C Extensions," in
  10905.  the Microsoft Editor User's Guide are not included with FORTRAN
  10906.  Version 4.1, although this file includes corrections to the manual.
  10907.  
  10908.  Keystroke Configurations
  10909.     Some of the keystroke configurations listed in Table A.2 of the
  10910.  Microsoft Editor User's Guide may need to be changed.
  10911.     In the Quick/WordStar(R) configuration, the Sinsert function is
  10912.  assigned to ALT+INS, not CTRL+INS.
  10913.     In the BRIEF(R) configuration, the Plines function is assigned to
  10914.  ALT+D, and the Refresh function is assigned to CTRL+].
  10915.     In the EPSILON(TM) configuration, the Ppage function is assigned to
  10916.  PGDN, and the Sdelete function is assigned to DEL and CTRL+D.
  10917.  
  10918.  The Compile Function
  10919.     The commands
  10920.  
  10921.          Arg streamarg Compile
  10922.          Arg textarg Compile
  10923.  
  10924.  each use the command specified by the extmake:text switch. The editor
  10925.  does not check the extension of the file name given as an argument,
  10926.  but instead uses the "text" extension. The streamarg or textarg
  10927.  replaces a %s in the command. These commands are typically used to
  10928.  invoke MAKE.
  10929.  
  10930.  The Setfile Function
  10931.     The commands that use Setfile, along with a streamarg or textarg,
  10932.  accept a variety of input: either the name of a file, a file name with
  10933.  a wild-card character (* or ?), the name of a directory, or the name
  10934.  of a disk drive. File names can also include environment variables,
  10935.  such as $INIT. If the streamarg or textarg is a directory name, then
  10936.  the editor changes the current directory. If the argument is a drive
  10937.  name, then the editor changes the current drive. Environment
  10938.  variables are translated into directories to be searched for a file.
  10939.  For example, the following macro directs the editor to search the
  10940.  $INIT environment variable in order to find the tools.ini file:
  10941.  
  10942.      tools.ini := Arg "$TOOLS:tools.ini" Setfile
  10943.  
  10944.  Entering Strings in Macros
  10945.     When you enter a text argument directly, no characters have special
  10946.  meaning (except when the argument is interpreted as a regular
  10947.  expression). However, when you enter text as part of a macro, then
  10948.  strings inside of quotes are interpreted according to the C string
  10949.  format. This format uses a backslash followed by double quotes (\")
  10950.  to represent double quotes and it uses two backslashes (\\) to
  10951.  represent a single backslash. Therefore, to find the next occurrence
  10952.  of the string
  10953.  
  10954.      She wrote, "Here is a backslash: \ "
  10955.  
  10956.  you could use the following macro definition:
  10957.  
  10958.      findit := Arg "She wrote, \"Here is a backslash: \\ \"" Psearch
  10959.  
  10960.     Note that to indicate a backslash for a regular expression that is
  10961.  also part of a macro definition, you must use four consecutive
  10962.  backslashes.
  10963.  
  10964.  Using Text Switches
  10965.     The text switches extmake and readonly each take a special kind of
  10966.  syntax that allows you to specify drive, file name, base name, or file
  10967.  extension. The syntax consists of the characters:
  10968.  
  10969.  %|<letters>F
  10970.  
  10971.  where <letters> consists of any of the following: "p" for path, "d"
  10972.  for drive, "f" for file base name, or "e" for file extension. For
  10973.  example, if you are editing the file c:\dir1\sample.c, and you make
  10974.  the following switch assignment:
  10975.  
  10976.  extmake:c cl /Fod:%|pfF %|dfeF
  10977.  
  10978.  then each time you give the command <Arg><Compile>, the editor
  10979.  performs the following system-level command:
  10980.  
  10981.  cl /Fod:\dir1\sample c:sample.c
  10982.  
  10983.     The expression "%s" is equivalent to "%|feF" except that the former
  10984.  only works once, whereas the latter can appear any number of times in
  10985.  the extmake switch assignment. The expression "%|F" is equivalent to
  10986.  "%|dpfeF".
  10987.  
  10988.  The Filetab Switch
  10989.     The filetab switch is a numeric switch that determines how the
  10990.  editor translates tabs when loading a file into memory.  The value of
  10991.  the switch gives the number of spaces associated with each tab column.
  10992.  For example, the setting "filetab:4" assumes a tab column every 4
  10993.  positions on each line. Every time the editor finds a tab character
  10994.  in a file, it loads the buffer with the number of spaces necessary to
  10995.  get to the next tab column. Depending on the value of the entab
  10996.  switch, the editor also uses the filetab switch to determine how to
  10997.  convert spaces into tabs when writing to a file. The default value of
  10998.  filetab is 8.
  10999.  
  11000.  Functions Callable by C Extensions
  11001.     The following list summarizes functions from the standard compact-
  11002.  memory-model library, which should work when called by a C-extension
  11003.  module.  (The technique of programming C extensions is presented in
  11004.  Chapter 8 of the Microsoft Editor User's Guide.)  The memory model of
  11005.  the extension is assumed to be /Asfu (small code pointers, far data
  11006.  pointers, and stack segment unequal to data segment).  This list uses
  11007.  the function categories from Chapter 4 of the Microsoft C Optimizing
  11008.  Compiler Run-Time Library Reference (Version 4.0 or later.)
  11009.  
  11010.     Buffer Manipulation: All functions can be called.
  11011.     Character Classification and Conversion: All functions can be
  11012.  called.
  11013.     Data Conversion: All functions can be called except for
  11014.  
  11015.       strtod()
  11016.  
  11017.     Directory Control: All functions can be called except for
  11018.  
  11019.       getcwd()
  11020.  
  11021.     File Handling: All functions can be called.
  11022.  
  11023.     Low-Level I/O Routines: All functions can be called, but write()
  11024.  will not work in binary mode.
  11025.     Console and Port I/O: All functions can be called except for
  11026.  
  11027.       cgets()
  11028.       cprintf()
  11029.       cscanf()
  11030.  
  11031.     Searching and Sorting: All functions can be called except for
  11032.  
  11033.       qsort()
  11034.  
  11035.     String Manipulation: All functions can be called except for
  11036.  
  11037.       strdup()
  11038.  
  11039.     BIOS Interface: All functions can be called.
  11040.     MS-DOS Interface: All functions can be called except for
  11041.  
  11042.       int86()
  11043.       int86x()
  11044.  
  11045.     Time: All functions can be called except for
  11046.  
  11047.       ctime()
  11048.       gmtime()
  11049.       localtime()
  11050.       utime()
  11051.  
  11052.     Miscellaneous: All functions can be called except for
  11053.  
  11054.       assert()
  11055.       getenv()
  11056.       perror()
  11057.       putenv()
  11058.       _searchenv()
  11059.  
  11060.  Linking Extensions in Protected Mode
  11061.     To link C extension modules in protected mode, link with the object
  11062.  file EXTHDRP.OBJ, instead of the real-mode header EXTHDR.OBJ.
  11063.  
  11064.  
  11065.  307. FORTRAN 4.10 Startup README.DOC: Startup Sources
  11066.  
  11067.  Product Version(s): 4.10   | 4.10
  11068.  Operating System:   MS-DOS | OS/2
  11069.  Flags: PSSONLY | ENDUSER
  11070.  Last Modified: 30-OCT-1990    ArticleIdent: Q28838
  11071.  
  11072.     The following information is from the FORTRAN Version 4.10
  11073.  Startup README.DOC file:
  11074.  
  11075.  FORTRAN Runtime Library Startup Sources
  11076.     The directory \startup and its subdirectories contain the files
  11077.  necessary for building the startup portion of the FORTRAN run-time
  11078.  library. The \startup directory contains the startup source files, the
  11079.  include include files, the batch file and the make file used to build
  11080.  the startup object files. The subdirectories of \startup contain OS
  11081.  specific sources.
  11082.     The startup object files can be built by invoking startup.bat from
  11083.  within the \startup directory. This batch file assumes the following:
  11084.  
  11085.     1. make.exe, link.exec, the FORTRAN compiler, and the assembler
  11086.  must be in the execution path. MASM 5.0 or later is required to build
  11087.  the startup sources.
  11088.     2. doscalls.lib must be in the directory specified by the LIB
  11089.  environment variable.
  11090.     3. For linking the nulbody program, startup.bat assumes that
  11091.  directories containing the FORTRAN libraries (llibfor7.lib and
  11092.  mlibfor7.lib, or llibfore.lib and mlibfore.lib) are in the library
  11093.  search path (LIB environment variable). (The alternative math
  11094.  libraries could be used if the option -FPa is added to $(FL) in the
  11095.  makefile.)
  11096.  
  11097.     Startup will create two memory model specific subdirectories (M and
  11098.  L) and place the appropriate object files there. Under each memory
  11099.  model subdirectory, startup creates two additional subdirectories, OS2
  11100.  and DOS, where OS specific objects reside.
  11101.     The message "<cEnd - nogen>" is generated when some of the assembly
  11102.  language source files are assembled. This message is expected and is
  11103.  totally benign.
  11104.     The startup batch file requires as arguments a list of capital
  11105.  letters describing the memory models you wish to build. For example,
  11106.  "startup M L" will build the medium and large model startup objects.
  11107.  Startup will then link the objects with a sample FORTRAN program
  11108.  called nulbody.for to produce nulbody.exe. [Invoking startup.bat with
  11109.  no arguments will give usage information.]
  11110.     Note: startup sources written in assembly language have been edited
  11111.  with tabstops set to 8.
  11112.     The following files are contained in the \startup directory:
  11113.  
  11114.  Startup source files (OS independent):
  11115.  
  11116.          chkstk.asm
  11117.          chksum.asm
  11118.          crt0fp.asm
  11119.          onexit.asm
  11120.  
  11121.  Startup source files (OS specific):
  11122.  
  11123.          crt0.asm
  11124.          crt0dat.asm
  11125.          crt0msg.asm
  11126.          nmsghdr.asm
  11127.          stdalloc.asm
  11128.          stdenvp.asm
  11129.          stdargv.asm
  11130.  
  11131.  Startup include files:
  11132.  
  11133.          brkctl.inc
  11134.          cmacros.inc
  11135.          msdos.inc
  11136.          version.inc
  11137.  
  11138.  Make and batch files:
  11139.  
  11140.          startup.bat:    invokes make file to build objs and link to
  11141.                          null program
  11142.          makefile:       contains rules for building startup sources
  11143.          nulbody.for:    null FORTRAN program
  11144.          nulbody.lnk:    link script for linking null program
  11145.  
  11146.  Documentation:
  11147.  
  11148.          readme.doc:     information about \startup directory structure
  11149.                          and contents
  11150.  
  11151.                                  --- End ---
  11152.  
  11153.  
  11154.  308. FORTRAN 4.10 CVREADME.DOC: Program Maintenance Utility
  11155.  
  11156.  Product Version(s): 4.10   | 4.10
  11157.  Operating System:   MS-DOS | OS/2
  11158.  Flags: ENDUSER |
  11159.  Last Modified: 27-APR-1988    ArticleIdent: Q28840
  11160.  
  11161.     The following information is from the FORTRAN Version 4.10
  11162.  CVREADME.DOC file:
  11163.  
  11164.  Microsoft Program Maintenance Utility (MAKE) -- New Error Message
  11165.  
  11166.     U1015: <file> : error redirection failed
  11167.  
  11168.     This error occurs if the /X option is given and error output cannot
  11169.  be redirected to the given file (for example, because the file is
  11170.  read-only).
  11171.  
  11172.  Inference Rules
  11173.     You cannot have inference rules in both the TOOLS.INI and the
  11174.  description file that use both the same inextension and outextension.
  11175.  For example, you cannot place the following inference rule in the
  11176.  TOOLS.INI file:
  11177.  
  11178.          .c.obj:
  11179.                  cl /c /Zi /Od $*.c
  11180.  
  11181.  while also placing the following line in the description file:
  11182.  
  11183.          .c.obj:
  11184.                  cl /Ot $*.c
  11185.  
  11186.     However, you can define the same macro in both the TOOLS.INI and
  11187.  the description file. In such cases, the definition in the description
  11188.  file takes precedence.
  11189.  
  11190.  Backslash (\) as Continuation Character
  11191.     Note that MAKE considers a backslash immediately followed by a
  11192.  new-line character to be a continuation character. When it finds this
  11193.  combination in a description file, MAKE continues the line
  11194.  immediately following the combination with the line where the
  11195.  combination appears.
  11196.     If you define a macro that ends in a backslash, make sure that you
  11197.  put a space after the terminating backslash. For example, if you want
  11198.  to define macros for the path C:\SRC\BIN and C:\SRC\LIB, you must use
  11199.  the format illustrated below:
  11200.  
  11201.          BINPATH=C:\SRC\BIN\<space><newline>
  11202.          LIBPATH=C:\SRC\LIB\<space><newline>
  11203.  
  11204.     To illustrate the problems that can result if you do not put a
  11205.  space before the new-line character, assume that the macros above
  11206.  appear as shown below instead:
  11207.  
  11208.          BINPATH=C:\SRC\BIN\<newline>
  11209.          LIBPATH=C:\SRC\LIB\<newline>
  11210.  
  11211.     Because a new-line character appears immediately after the
  11212.  backslash at the end of the first macro, MAKE assumes that you are
  11213.  defining the single macro shown below:
  11214.  
  11215.          BINPATH=C:\SRC\BIN\LIBPATH=C:\SRC\LIB\
  11216.  
  11217.  Microsoft STDERR Redirection Utility (ERROUT)
  11218.     The ERROUT utility does not accept batch files. To redirect
  11219.  standard-error output from a batch file, you must enter a command of
  11220.  the following form:
  11221.  
  11222.          ERROUT COMMAND /c <batchcommand>
  11223.  
  11224.     If no /f option is given, then ERROUT redirects standard-error
  11225.  output to the standard-output device.
  11226.  
  11227.  
  11228.  309. "Share Not Installed" Incorrectly Produced in Protected Mode
  11229.  
  11230.  Product Version(s): 4.10
  11231.  Operating System:   MS-DOS
  11232.  Flags: ENDUSER |
  11233.  Last Modified: 12-MAY-1988    ArticleIdent: Q29562
  11234.  
  11235.     The following code will generate the error message "share not
  11236.  installed" when it is run in protected mode:
  11237.  
  11238.         OPEN(UNIT=7,FILE=FL,STATUS='NEW',MODE='READWRITE',
  11239.       +  SHARE='DENYWR')
  11240.         WRITE(7,'(A12)')'ARE YOU OPEN'
  11241.         write (7,*)'hello'
  11242.        END
  11243.  
  11244.     Trying to open a file with status = 'new' when the file already
  11245.  exists will incorrectly produce the error message "share not
  11246.  installed." The correct error message is "file already exists".
  11247.     This error only occurs in protected mode.
  11248.  
  11249.  
  11250.  310. Version 3.31 Cannot Pass a Logical Expression
  11251.  
  11252.  Product Version(s): 3.31
  11253.  Operating System:   MS-DOS
  11254.  Flags: ENDUSER |
  11255.  Last Modified: 12-MAY-1988    ArticleIdent: Q10822
  11256.  
  11257.  Problem:
  11258.     The following code generates incorrect results:
  11259.  
  11260.     real rsw
  11261.     logical ll
  11262.     real r
  11263.  
  11264.     ll = .TRUE.
  11265.     write (0,*) rsw(ll,1.0,0.0)
  11266.     ll = .FALSE.
  11267.     write (0,*) rsw(ll,1.0,0.0)
  11268.  
  11269.     r = 1.0
  11270.     write (0,*) rsw(r .gt. 0.0,1.0,0.0)
  11271.  
  11272.     write (0,*) rsw(r .lt. 0.0,1.0,0.0)
  11273.     end
  11274.  
  11275.     real function rsw (l,t,f)
  11276.     logical l
  11277.     real t,f
  11278.  
  11279.     rsw = f
  11280.     if (l) rsw = t
  11281.     return
  11282.     end
  11283.  
  11284.     The following output is produced:
  11285.  
  11286.     1.0000000
  11287.     .0000000
  11288.     .0000000
  11289.     .0000000
  11290.  
  11291.  Response:
  11292.     Version 3.31 of the compiler does not pass logical expressions in a
  11293.  parameter list correctly.
  11294.     The following are two workarounds:
  11295.  
  11296.     1. Define the function before calling it.
  11297.     2. Create an INTERFACE statement for the function.
  11298.  
  11299.     This problem was corrected in Version 4.00.
  11300.  
  11301.  
  11302.  311. Symbol Defined More Than Once
  11303.  
  11304.  Product Version(s): 3.30
  11305.  Operating System:   MS-DOS
  11306.  Flags: ENDUSER | buglist3.30
  11307.  Last Modified: 12-MAY-1988    ArticleIdent: Q10809
  11308.  
  11309.     The false link error "symbol defined more than once" is generated
  11310.  when an object module has an external reference to a function that is
  11311.  never used.
  11312.  
  11313.     A workaround is to remove the external statement for the unused
  11314.  function.
  11315.     Microsoft confirmed this to be a problem in Version 3.30 of the
  11316.  FORTRAN compiler. This problem was corrected in Version 3.31.
  11317.  
  11318.  
  11319.  312. Microsoft Floating Point Versus IEEE
  11320.  
  11321.  Product Version(s): 3.2 3.3x 4.0x
  11322.  Operating System:   MS-DOS
  11323.  Flags: enduser |
  11324.  Last Modified:  2-MAY-1988    ArticleIdent: Q10866
  11325.  
  11326.  Question:
  11327.     I have created files containing floating point values in BASIC and
  11328.  would like to use these files in FORTRAN. How would I accomplish this?
  11329.  
  11330.  Response:
  11331.     Since Basic uses Microsoft floating point binary format to store
  11332.  real values and FORTRAN uses the IEEE format, you would have to
  11333.  convert your real values from Microsoft floating point binary to IEEE.
  11334.     To accomplish this procedure using single precision, please see
  11335.  Page 167 of the FORTRAN user's guide.
  11336.     To accomplish this procedure using double precision numbers, you
  11337.  would have to do the following:
  11338.  
  11339.     1. Write a BASIC program to read the numerical data files, and then
  11340.  create an output file in text (ASCII) format.
  11341.     2. Write a FORTRAN program to read the text file, and then write a
  11342.  binary file that contains the double precision numbers in the IEEE
  11343.  floating point format (FORTRAN-readable format).
  11344.  
  11345.  
  11346.  313. Run-Time Error "No Room in Heap"
  11347.  
  11348.  Product Version(s): 3.30
  11349.  Operating System:   MS-DOS
  11350.  Flags: ENDUSER |
  11351.  Last Modified: 12-MAY-1988    ArticleIdent: Q10860
  11352.  
  11353.  Problem:
  11354.     I have developed a program that has about 150 subroutines (400K
  11355.  code and 120K data). Most of the data is in common blocks, but the
  11356.  error message "no room in heap" still is generated at run time.
  11357.  
  11358.  Response:
  11359.     The following is a list of possible reasons for this error:
  11360.  
  11361.     1. There may not be enough memory in your machine. The maximum
  11362.  memory you can have in your machine is 640K. You will constantly reach
  11363.  your limit unless you have a full 640K (and perhaps even if you do)
  11364.  because your data and code use 520K (400K for code, 120K for data).
  11365.     2. Something in your code may be using up DGROUP space. An error
  11366.  indicating there is no room in the heap may occur when you are opening
  11367.  a file in your program. Opening a file uses dynamic memory allocation,
  11368.  which requires space from DGROUP. If there is not enough space left in
  11369.  DGROUP, opening a file will result in a "no room in heap" error.
  11370.     3. Your format strings may be using up DGROUP space. If this is the
  11371.  case, you could put your format strings in a character variables file
  11372.  in a common block. Unfortunately, this action creates unreadable code,
  11373.  but it is a possible workaround.
  11374.     4. Long parameter lists may be using up DGROUP space, which you
  11375.  will have to break up.
  11376.  
  11377.  
  11378.  314. WRITE Statement and Parenthesis Expression
  11379.  
  11380.  Product Version(s): 3.30
  11381.  Operating System:   MS-DOS
  11382.  Flags: ENDUSER |
  11383.  Last Modified: 12-MAY-1988    ArticleIdent: Q10817
  11384.  
  11385.  Problem:
  11386.     The following code
  11387.  
  11388.     WRITE (*,*) (1+2)*3
  11389.     END
  11390.  
  11391.  generates the following errors:
  11392.  
  11393.     Error 59, line 1 -- "=" expected
  11394.     Error 162, line 1 -- unrecognizable I/O list element
  11395.     Error 59, line 1 -- "=" expected
  11396.     Error 152, line 1 -- end of statement encountered in
  11397.     implied DO
  11398.  
  11399.  Response:
  11400.     These errors are generated because the compiler considers the
  11401.  expression (1+2) an implied DO list. It is illegal to put a
  11402.  parenthesis at the beginning of an output list unless it is an implied
  11403.  DO-LOOP.
  11404.     You can avoid these errors by rewriting your program as follows:
  11405.  
  11406.     WRITE(*,*) 3*(1+2)
  11407.     END
  11408.  
  11409.  
  11410.  315. Run-Time Error 2136
  11411.  
  11412.  Product Version(s): 3.30
  11413.  Operating System:   MS-DOS
  11414.  Flags: enduser | buglist3.30
  11415.  Last Modified:  2-MAY-1988    ArticleIdent: Q10812
  11416.  
  11417.  Problem:
  11418.     Run-time error 2136 (Real indefinite) is generated when an
  11419.  expression contains an array declared in a COMMON block and the array
  11420.  is indexed by a variable declared in the same COMMON block (but
  11421.  contained in a different segment).
  11422.  
  11423.  Response:
  11424.     Microsoft confirmed this to be a problem in Version 3.30 of the
  11425.  FORTRAN compiler. The problem was corrected in Version 3.31.
  11426.  
  11427.  
  11428.  316. Floating Point Expression
  11429.  
  11430.  Product Version(s): 3.30
  11431.  Operating System:   MS-DOS
  11432.  Flags: enduser | buglist3.30
  11433.  Last Modified:  2-MAY-1988    ArticleIdent: Q10808
  11434.  
  11435.  Problem:
  11436.     Floating point expressions are being evaluated incorrectly in a
  11437.  compound IF statement if a combination of REAL and INTEGER COMMON
  11438.  variables is used.
  11439.  
  11440.  Response:
  11441.     Microsoft confirmed this to be a problem in Version 3.30 of the
  11442.  FORTRAN compiler. The problem was corrected in Version 3.31.
  11443.  
  11444.  
  11445.  317. FORTRAN: COMPLEX*8 Arithmetic Expression Evaluates Incorrectly
  11446.  
  11447.  Product Version(s): 4.10
  11448.  Operating System:   MS-DOS
  11449.  Flags: ENDUSER | buglist4.10 fixlist5.00
  11450.  Last Modified: 16-JUN-1989    ArticleIdent: Q29565
  11451.  
  11452.  In some cases, when variables are declared as COMPLEX*8, arithmetic
  11453.  expressions evaluate to the wrong value.
  11454.  
  11455.  One way to work around the problem is to declare the variables as
  11456.  COMPLEX*16, rather than COMPLEX*8.
  11457.  
  11458.  The following code sample demonstrates the problem, with the suggested
  11459.  workaround in comments:
  11460.  
  11461.     COMPLEX*8 a,b,c
  11462.  
  11463.     c   This problem can be worked around by changing the above
  11464.     c   declaration to the following:
  11465.     c
  11466.     c       COMPLEX*16 a,b,c
  11467.     c
  11468.          a=(1.,0.)
  11469.          b=(0.,1.)
  11470.          write(*,'('' a ='',f10.3,1x,f10.3)') a
  11471.          write(*,'('' b ='',f10.3,1x,f10.3)') b
  11472.          c=a+(-1.0)*b
  11473.          write(*,'(''  a+(-1.0)*b=  '',2(1x,f10.3))') c
  11474.          write(*,'(''  correct answer is'',2(1x,f10.3))') (1.,-1.)
  11475.          end
  11476.  
  11477.  Microsoft has confirmed this to be a problem in Version 4.10; the
  11478.  problem was corrected in Version 5.00.
  11479.  
  11480.  
  11481.  318. FORTRAN: IOSTAT Returns an Invalid Run-Time Error
  11482.  
  11483.  Product Version(s): 4.10
  11484.  Operating System:   MS-DOS
  11485.  Flags: ENDUSER | buglist4.10 fixlist5.00
  11486.  Last Modified: 16-JUN-1989    ArticleIdent: Q29787
  11487.  
  11488.  The code below will return an incorrect run-time error in "IOSTAT." To
  11489.  work around this problem, you must do one of the following:
  11490.  
  11491.     1. Use a temporary variable to perform the concatenation outside
  11492.        the open statement.
  11493.  
  11494.     2. Replace the integer variable 'long' with its numerical
  11495.        representation. Thus, the substring would look like
  11496.        'chaine(1:7)'.
  11497.  
  11498.     3. Define chaine as character*8 and remove substrings.
  11499.  
  11500.     4. Do not use substrings, leave chaine as character*80, and use
  11501.        in real mode. This workaround will not work in protected mode.
  11502.  
  11503.  The problem lies in the open statement. The concatenation and
  11504.  substrings inside the function cause this to fail:
  11505.  
  11506.        character*80 chaine
  11507.        integer ier,long
  11508.        ier = 0
  11509.        chaine = 'filename'
  11510.        long = 7
  11511.        open (unit=1,file=chaine(1:long)//'.cal',
  11512.       + status='unknown',err=10,iostat = ier)
  11513.  10    if (ier.ne.0) then
  11514.         write (*,*)'Errornumber',ier,'at opening file:',
  11515.       +    chaine (1:long)//'.cal'
  11516.         else
  11517.         write (*,*)'Correctly opened'
  11518.         write (*,*)'correctly opened'
  11519.         close(1)
  11520.         end if
  11521.         end
  11522.  
  11523.  Microsoft has confirmed this to be a problem in Version 4.10. This
  11524.  problem was corrected in Version 5.00.
  11525.  
  11526.  
  11527.  319. Internal Compiler Error: trees.c, Line 1165
  11528.  
  11529.  Product Version(s): 4.10
  11530.  Operating System:   MS-DOS
  11531.  Flags: ENDUSER | buglist4.10 fixlist5.00
  11532.  Last Modified:  8-NOV-1989    ArticleIdent: Q29792
  11533.  
  11534.  The programs below generate the following errors:
  11535.  
  11536.     initmin.for
  11537.     initmin.for(8) : warning F4202: PRINTV : formal argument NPOINT :
  11538.                      never used
  11539.     initmin.for(6) : fatal error F1001: Internal Compiler Error
  11540.                      (compiler file '../trees.c', line 1165)
  11541.                      Contact Microsoft Technical Support
  11542.  
  11543.  The problems occur because the code does not conform to the ANSI 77
  11544.  Standard. Following the standard, an adjustable-size array must be
  11545.  passed as one of the arguments to the subroutine. (For more
  11546.  information on adjustable-size arrays, see Section 5.5.1 of the "ANSI
  11547.  X3.9-1978 FORTRAN 77" manual.)
  11548.  
  11549.  To work around this problem, pass the array VBlock to the subroutine
  11550.  along with the array index.
  11551.  
  11552.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  11553.  FORTRAN compiler. This problem was corrected in Version 5.00.
  11554.  
  11555.  The following program should generate a syntax error:
  11556.  
  11557.     subroutine PrintVars ( inPoints )
  11558.  
  11559.     real VBlock ( nPoints )
  11560.     equivalence ( VBlock, S )
  11561.  
  11562.     call rvprint ( VBlock (nPoints) )
  11563.     return
  11564.     end
  11565.  
  11566.  In this case, only the array index is passed. If the program is
  11567.  changed to the following (to conform to the standard), the internal
  11568.  compiler error is not generated:
  11569.  
  11570.     subroutine PrintVars (VBlock, nPoints)
  11571.  
  11572.     real VBlock ( nPoints )
  11573.  
  11574.     call rvprint ( VBlock (nPoints) )
  11575.     return
  11576.     end
  11577.  
  11578.  
  11579.  320. L1103 Linker Error: Accessing Data Outside Segment Bounds
  11580.  
  11581.  Product Version(s): 4.01 4.10 5.00 | 4.10 5.00
  11582.  Operating System:   MS-DOS         | OS/2
  11583.  Flags: ENDUSER | buglist4.01 buglist4.10 fixlist5.00
  11584.  Last Modified:  7-NOV-1989    ArticleIdent: Q29883
  11585.  
  11586.  Problem:
  11587.  
  11588.  The following link error message occurs when I link and compile a
  11589.  large program:
  11590.  
  11591.     "L1103 attempt to access data outside segment bounds"
  11592.  
  11593.  I am compiling and linking as follows:
  11594.  
  11595.     fl /4I2 /FPi /c /Od /Zi program.for
  11596.     link /SE:320 /NOD /CO @program.rsp
  11597.  
  11598.  Response:
  11599.  
  11600.  You can work around this problem by changing the compile to the
  11601.  following:
  11602.  
  11603.      fl /4I2 /FPi /c program.for
  11604.  
  11605.  The generation of symbolic information may be part of the problem.
  11606.  
  11607.  Another workaround is to compile the different functions separately;
  11608.  doing this allows you to use CodeView and avoid the L1103 error.
  11609.  
  11610.  Microsoft has confirmed this to be a problem in Versions 4.01 and
  11611.  4.10 of the FORTRAN compiler. This problem was corrected in Version
  11612.  5.00.
  11613.  
  11614.  
  11615.  321. FL Automatically Adds the Extension .OBJ
  11616.  
  11617.  Product Version(s): 4.10   | 4.10
  11618.  Operating System:   MS-DOS | OS/2
  11619.  Flags: ENDUSER | docerr
  11620.  Last Modified:  7-SEP-1988    ArticleIdent: Q29884
  11621.  
  11622.  Problem:
  11623.  
  11624.  Page 14, Section 3.6.5, of the "Microsoft FORTRAN Optimizing Compiler
  11625.  Version 4.10" update manual states that "FL automatically adds the
  11626.  extension .FOR." However, my source cannot be compiled unless I give
  11627.  the extension with the name.
  11628.  
  11629.  Response:
  11630.  
  11631.  The documentation is incorrect. The statement should read as
  11632.  follows:
  11633.  
  11634.  "FL automatically adds the extension .OBJ".
  11635.  
  11636.  
  11637.  322. F1901 Program Too Large for Memory on Array Initialization
  11638.  
  11639.  Product Version(s): 4.01 4.10
  11640.  Operating System:   MS-DOS
  11641.  Flags: ENDUSER | buglist4.01 buglist4.10 fixlist5.00
  11642.  Last Modified:  6-NOV-1989    ArticleIdent: Q30541
  11643.  
  11644.  Problem:
  11645.  
  11646.  I have an integer*2 array of 1100 elements that is initialized in the
  11647.  source code. The total size of the array is about 4K and it is the
  11648.  only thing in the program; however, I still get the error message
  11649.  "F1901 program too big to fit in memory."
  11650.  
  11651.  Response:
  11652.  
  11653.  Microsoft has confirmed this to be a problem in Versions 4.01 and 4.10
  11654.  of the FORTRAN compiler. This problem was corrected using F1L.EXE in
  11655.  Version 5.00.
  11656.  
  11657.  A workaround is to declare the array in the source code and to
  11658.  initialize it by reading in the data from a file. This procedure
  11659.  allows more flexibility in changing the data. You could then just
  11660.  change the data file, instead of modifying the source, recompiling,
  11661.  and relinking.
  11662.  
  11663.  The following code demonstrates the problem:
  11664.  
  11665.        PROGRAM ESSAI
  11666.        INTEGER*2 IT0(1101)
  11667.  C===
  11668.        DATA IT0/
  11669.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11670.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11671.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11672.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11673.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11674.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11675.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11676.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11677.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11678.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11679.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11680.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11681.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11682.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11683.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11684.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11685.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11686.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11687.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11688.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11689.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11690.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11691.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11692.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11693.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11694.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11695.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11696.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11697.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11698.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11699.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11700.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11701.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11702.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11703.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11704.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11705.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11706.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11707.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11708.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11709.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11710.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11711.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11712.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11713.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11714.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11715.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11716.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11717.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11718.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11719.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11720.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11721.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11722.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11723.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11724.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11725.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11726.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11727.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11728.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11729.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11730.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11731.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11732.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11733.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11734.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11735.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11736.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11737.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11738.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11739.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11740.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11741.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11742.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11743.       -2808,12,45,65,89,546,458,54,48,489,45,944,
  11744.       -2050,2059,13,15,816,73,75,876,141,143,944,
  11745.       -203,2096,18,816,18,12,15,6565,5454,54,944,
  11746.       -2808,12,45,65,89,546,458,54,48,489,45,944/
  11747.        END
  11748.  
  11749.  
  11750.  323. FORTRAN 4.10 PACKING.LST
  11751.  
  11752.  Product Version(s): 4.10
  11753.  Operating System:   MS-DOS
  11754.  Flags: PSSONLY | ENDUSER
  11755.  Last Modified: 30-OCT-1990    ArticleIdent: Q30570
  11756.  
  11757.  The following information is from the FORTRAN Version 4.10 PACKING.LST
  11758.  file:
  11759.  
  11760.  PACKING.LST
  11761.  for Microsoft(R) FORTRAN Optimizing Compiler Version 4.1
  11762.  (C) Copyright 1987, 1988, Microsoft Corporation
  11763.  
  11764.     This file describes the parts of the Microsoft(R) FORTRAN
  11765.  Optimizing Compiler Version 4.1 package.
  11766.  
  11767.  DOCUMENTATION
  11768.     There are three binders:
  11769.  
  11770.     1. Microsoft FORTRAN Optimizing Compiler Version 4.1 Update and
  11771.  Microsoft FORTRAN Optimizing Compiler User's Guide
  11772.     2. Microsoft FORTRAN Optimizing Compiler Language Reference
  11773.     3. Microsoft CodeView(R) and Utilities and Microsoft Editor
  11774.  
  11775.     The package also includes a quick reference guide and templates:
  11776.  
  11777.     Microsoft FORTRAN Optimizing Compiler Quick Reference Guide
  11778.     Two function-key templates for the Microsoft CodeView debugger
  11779.  
  11780.  DISKS
  11781.     The Microsoft FORTRAN compiler is distributed on ten 5-1/4" disks
  11782.  or five 3-1/2" disks. The 3-1/2" disks are not included in this
  11783.  package. To obtain 3-1/2" disks, telephone Microsoft Sales and Service
  11784.  at (800) 426-9400. Please have your manuals handy when you call.
  11785.     The following two lists describe the layout of the 5-1/4" disks and
  11786.  show how the contents of the 5-1/4" disks are combined to make up the
  11787.  3-1/2" disks.
  11788.  
  11789.  5-1/4" Disk Layout
  11790.  
  11791.       Disk 1:  Setup
  11792.  
  11793.            DEMOS    <DIR>
  11794.            PATCH    <DIR>
  11795.            EMOEM.ASM      MASM source to modify 87.LIB for
  11796.                           non-IBM(R) compatibles
  11797.            F3S.EXE        FORTRAN compiler, Pass 3, small model (non-optimized
  11798.            FL.ERR         Error message file for FL.EXE
  11799.            FL.EXE         FORTRAN compiler driver
  11800.            FL.HLP         Help file for FL.EXE
  11801.            FLOPSET.DOC    Floppy disk set up documentation
  11802.            PACKING.LST    Packing list (this file)
  11803.            PATCH87.EXE    MS-DOS 3.2 Patch program
  11804.            README.DOC     Information made available after manuals
  11805.                           were printed
  11806.            SETUP.DAT      Data file for SETUP program
  11807.            SETUP.EXE      FORTRAN SETUP program
  11808.  
  11809.                  (13 files)
  11810.  
  11811.            \DEMOS subdirectory (Demonstration Programs)
  11812.  
  11813.            CIRC.C         C-module for GRAPH.EXE program
  11814.            DEMO.FOR       FORTRAN demo program
  11815.            DEMOEXEC.FOR   FORTRAN demo program (calling a C procedure)
  11816.            DEMORAN.FOR    FORTRAN demo program (random number generator)
  11817.            DWHET.FOR      Popular benchmark program
  11818.            FOREXEC.INC    FORTRAN demo program (include file)
  11819.            GRAPH.BAT      Batch file for GRAPH.EXE file
  11820.            GRAPH.FOR      FORTRAN module for GRAPH.EXE program
  11821.            SECNDS.FOR     Subroutine for benchmarks
  11822.            SIEVE.FOR      Popular benchmark program
  11823.            SWHET.FOR      Popular benchmark program
  11824.  
  11825.                  (11 files)
  11826.  
  11827.            \PATCH subdirectory (PC-DOS 3.2 patch):
  11828.  
  11829.            README.DOC
  11830.            RMRHS.EXE
  11831.            SETRHS.EXE
  11832.            STKPAT.BAT
  11833.            STKPAT.SCR
  11834.  
  11835.                  (5 files)
  11836.  
  11837.       Disk 2:  Compiler 1
  11838.  
  11839.            F1.ERR         Error message files for compiler, Pass 1
  11840.            F1.EXE         FORTRAN compiler, Pass 1
  11841.            F3.EXE         FORTRAN compiler, Pass 3
  11842.  
  11843.                  (3 files)
  11844.  
  11845.       Disk 3:  Compiler 2
  11846.  
  11847.            EXEC.EXE       Utility used only by ILINK
  11848.            F2.EXE         FORTRAN compiler, Pass 2
  11849.            F23.ERR        Error messages for FORTRAN compiler,
  11850.                           Passes 2 and 3
  11851.            ILINK.EXE      Microsoft Incremental Linker
  11852.            LIBBUILD.BAT   Combined library builder
  11853.  
  11854.                  (5 files)
  11855.  
  11856.       Disk 4:  Utilities
  11857.  
  11858.            BIND.EXE       Operating System/2 BIND Utility
  11859.            ERROUT.EXE     STDERR Redirection Utility
  11860.            EXEHDR.EXE     Segmented EXE Header Utility
  11861.            EXEMOD.EXE     EXE File Header Utility
  11862.            EXEPACK.EXE    EXE File Compression Utility
  11863.            IMPLIB.EXE     Import Library Manager
  11864.            LIB.EXE        Library Manager
  11865.            LINK.EXE       Segmented-Executable Linker
  11866.            MAKE.EXE       Program Maintenance Utility
  11867.            SETENV.EXE     Environment Expansion Utility
  11868.  
  11869.                  (10 files)
  11870.  
  11871.       Disk 5:  Microsoft CodeView(R) for MS-DOS(R)
  11872.  
  11873.            DEMO.BAT       CodeView debugger demonstration file
  11874.            MOUSE.COM      Mouse driver
  11875.            C_AUTO.CV      CodeView debugger demonstration file
  11876.            E_AUTO.CV      CodeView debugger demonstration file
  11877.            L_AUTO.CV      CodeView debugger demonstration file
  11878.            M_AUTO.CV      CodeView debugger demonstration file
  11879.            Q_AUTO.CV      CodeView debugger demonstration file
  11880.            S_AUTO.CV      CodeView debugger demonstration file
  11881.            IN.DAT         Data file used with STATS.FOR
  11882.            CVREADME.DOC   Information about CodeView/Utilities
  11883.                           made available after manuals were printed
  11884.            CV.EXE         CodeView debugger
  11885.            WHAT.EXE       Program used by CodeView demo
  11886.            STATS.FOR      FORTRAN program used in CodeView demo
  11887.            CV.HLP         CodeView debugger help file
  11888.  
  11889.               (14 files)
  11890.  
  11891.       Disk 6:  Microsoft CodeView for OS/2
  11892.  
  11893.            CVP.EXE        OS/2 CodeView debugger
  11894.            CVP.HLP        OS/2 CodeView help file
  11895.            CVPACK.EXE     Debugging information packing utility
  11896.            MAKESORT.BAT   DOS batch file for SORTDEMO.FOR
  11897.            MAKESORT.CMD   OS/2 batch file for SORTDEMO.FOR
  11898.            OS2PATCH.EXE   OS/2 patch utility
  11899.            PTRACE87.PAT   Patch file for OS2PATCH.EXE
  11900.            SORTDEMO.FOR   OS/2 demonstration file
  11901.  
  11902.               (8 files)
  11903.  
  11904.       Disk 7:  Libraries (Large Model)
  11905.  
  11906.            87.LIB         8087/80287 math library (model independent)
  11907.            ALTMATH.LIB    Large-model FORTRAN 3.3x-compatible alternate math
  11908.                           library
  11909.            EM.LIB         Emulator library (model independent)
  11910.            FORTRAN.LIB    Large-model FORTRAN 3.3x-compatible library
  11911.            LCLIB1.LIB     Large-model DOS 3 C library
  11912.            LIBH.LIB       Helper library (model independent)
  11913.            LLIBFA.LIB     Large-model alternate-math library
  11914.            LLIBFOR.LIB    Large-model standard FORTRAN library
  11915.            LLIBFOR1.LIB   Large-model DOS 3 FORTRAN library
  11916.            LLIBFP.LIB     Large-model floating-point math library
  11917.            MATH.LIB       Large-model FORTRAN 3.3x math compatibility library
  11918.            NBUILD.OBJ     Error-message stub file (model independent)
  11919.  
  11920.                  (12 files)
  11921.  
  11922.       Disk 8 of 10:  Libraries (Medium Model)
  11923.  
  11924.            87.LIB         8087/80287 math library (model independent)
  11925.            EM.LIB         Emulator library (model independent)
  11926.            LIBH.LIB       Helper library (model independent)
  11927.            MCLIB1.LIB     Medium-model DOS 3 C library
  11928.            MLIBFA.LIB     Medium-model alternate math library
  11929.            MLIBFOR.LIB    Medium-model standard FORTRAN library
  11930.            MLIBFOR1.LIB   Medium-model DOS 3 FORTRAN library
  11931.            MLIBFP.LIB     Medium-model floating-point math library
  11932.            NBUILD.OBJ     Error-message stub file (model independent)
  11933.  
  11934.                  (9 files)
  11935.  
  11936.       Disk 9 of 10:  MS OS/2 Libraries
  11937.  
  11938.            STARTUP  <DIR>
  11939.            API.LIB        Family API emulation library
  11940.            APILMR.OBJ     64K stack object file (for use with BIND)
  11941.            DOSCALLS.LIB   Import library for API
  11942.            LCLIB2.LIB     Large-model OS/2 C library
  11943.            LLIBFOR2.LIB   Large-model OS/2 FORTRAN library
  11944.            MCLIB2.LIB     Medium-model OS/2 C library
  11945.            MLIBFOR2.LIB   Medium-model OS/2 FORTRAN library
  11946.  
  11947.                  (8 files)
  11948.  
  11949.            \STARTUP subdirectory (startup source code):
  11950.  
  11951.            DOS      <DIR>
  11952.            OS2      <DIR>
  11953.            BRKCTL.INC
  11954.            CHKSTK.ASM
  11955.            CHKSUM.ASM
  11956.            CMACROS.INC
  11957.            CRT0FP.ASM
  11958.            MAKEFILE
  11959.            MSDOS.INC
  11960.            NULBODY.FOR
  11961.            ONEXIT.ASM
  11962.            README.DOC
  11963.            STARTUP.BAT
  11964.            VERSION.INC
  11965.  
  11966.                  (14 Files)
  11967.  
  11968.            \STARTUP\DOS subdirectory (DOS-specific startup source code):
  11969.  
  11970.            CRT0.ASM
  11971.            CRT0DAT.ASM
  11972.            CRT0MSG.ASM
  11973.            NMSGHDR.ASM
  11974.            NULBODY.LNK
  11975.            STDALLOC.ASM
  11976.            STDARGV.ASM
  11977.            STDENVP.ASM
  11978.  
  11979.                  (8 Files)
  11980.  
  11981.            \STARTUP\OS2 subdirectory (OS\2-specific startup source code):
  11982.  
  11983.            CRT0.ASM
  11984.            CRT0DAT.ASM
  11985.            CRT0MSG.ASM
  11986.            EXECMSG.ASM
  11987.            NMSGHDR.ASM
  11988.            NULBODY.LNK
  11989.            STDALLOC.ASM
  11990.            STDARGV.ASM
  11991.            STDENVP.ASM
  11992.  
  11993.                   (9 Files)
  11994.  
  11995.       Disk 10:  Microsoft Editor
  11996.  
  11997.            INI      <DIR>
  11998.            MSETUP.BAT     Installation and setup routine
  11999.            FIXSHIFT.COM   Keyboard driver patching utility
  12000.            ECH.EXE        Character echoing utility used by Microsoft Editor
  12001.            EXP.EXE        Expunge utility (used with RM)
  12002.            M.EXE          Microsoft Editor
  12003.            MEGREP.EXE     Pattern finding utility (GREP)
  12004.            MEP.EXE        OS/2 Microsoft Editor
  12005.            RM.EXE         File removing utility
  12006.            UNDEL.EXE      File undeletion utility (used with RM)
  12007.            WHAT.EXE       Program used by MSETUP
  12008.  
  12009.                   (11 Files)
  12010.  
  12011.            \INI subdirectory (Initialization files for Microsoft Editor):
  12012.  
  12013.            BRIEF.INI      BRIEF(R) initialization file
  12014.            EPSILON.INI    Epsilon(TM) initialization file
  12015.            QUICK.INI      Quick-product initialization file
  12016.            WS.DLL         Protected-mode extension file
  12017.            WS.ZXT         Real-mode (DOS) extension file
  12018.  
  12019.                   (5 Files)
  12020.  
  12021.  3-1/2" Disk Layout
  12022.     The five 3-1/2" disks combine the 5-1/4" disks as follows:
  12023.  
  12024.       Disk 1:  Setup / Compiler 1
  12025.       Disk 2:  Compiler 2 / Utilities
  12026.       Disk 3:  Microsoft CodeView for MS-DOS / Microsoft CodeView for OS/2
  12027.       Disk 4:  Libraries (Large and Medium Models)
  12028.       Disk 5:  MS OS/2 Libraries / Microsoft Editor
  12029.  
  12030.  
  12031.  324. __Flclenv Should be __FCclenv
  12032.  
  12033.  Product Version(s): 4.00 4.01 4.10 | 4.10
  12034.  Operating System:   MS-DOS         | OS/2
  12035.  Flags: ENDUSER | docerr
  12036.  Last Modified: 15-JUN-1988    ArticleIdent: Q30588
  12037.  
  12038.     There are three references to a global variable named "__FIclenv"
  12039.  on Page 261 of the "Microsoft Fortran Optimizing Compiler User's
  12040.  Guide."
  12041.     These references are incorrect; the correct name is "__FCclenv".
  12042.  
  12043.  
  12044.  325. Compile-Time Fatal Error F1914 Occurs When Using FORTRAN
  12045.  
  12046.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  12047.  Operating System:   MS-DOS              | OS/2
  12048.  Flags: ENDUSER |
  12049.  Last Modified: 26-JUL-1990    ArticleIdent: Q30589
  12050.  
  12051.  The "F1914 cannot open internal files" compile-time fatal error
  12052.  message may appear when you use Microsoft FORTRAN.
  12053.  
  12054.  This error occurs if you improperly set your environment. Your
  12055.  AUTOEXEC.BAT and CONFIG.SYS files must have the correct syntax; there
  12056.  should be no spaces in the settings with the exception of a space
  12057.  between SET and the particular variable being set.
  12058.  
  12059.  For example, the variable setting PATH = C:\DOS (note the spaces
  12060.  around the equals sign) must be changed to PATH=C:\DOS.
  12061.  
  12062.  FILES = 20 must be changed to FILES=20. In addition, there should be
  12063.  no space or hidden characters at the end of a line such as SET
  12064.  TMP=C:\TMP.
  12065.  
  12066.  The F1914 error also can occur if the specified directory does not
  12067.  exist. For example, the environment variable setting SET TMP=C:\TEMP
  12068.  is incorrect if C:\TEMP does not exist. Misspelling C:\TMP as C:\TEMP
  12069.  can cause this error.
  12070.  
  12071.  If there is no room on the disk for a file to be created, the F1914
  12072.  error occurs. This error can occur if a RAM drive is being used for
  12073.  the TEMP subdirectory. If the RAM drive is set too small or set
  12074.  incorrectly, error F1914 can be generated.
  12075.  
  12076.  
  12077.  326. Global Array Pointed to by __FCclenv
  12078.  
  12079.  Product Version(s): 4.00 4.01 4.10 | 4.10
  12080.  Operating System:   MS-DOS         | OS/2
  12081.  Flags: ENDUSER | __FCclenv global array
  12082.  Last Modified: 19-SEP-1988    ArticleIdent: Q34972
  12083.  
  12084.  Question:
  12085.  
  12086.  What is exactly pointed to by the global variable __FCclenv in
  12087.  FORTRAN? I see it referenced on Page 261 of the "Microsoft FORTRAN
  12088.  Optimizing Compiler User's Guide," but I don't understand what is
  12089.  being stored.
  12090.  
  12091.  Response:
  12092.  
  12093.  The __FCclenv global variable contains the address to an array that
  12094.  contains the lengths of character arrays that are being passed to a
  12095.  FORTRAN subroutine or function. The compiler must keep track of the
  12096.  actual lengths of the character arrays, whether the arrays are varying
  12097.  or not, thus storing the information in this global array.
  12098.  
  12099.  The first element of this global array will contain the length of the
  12100.  character array for the return value of a character function. If the
  12101.  function returns anything other than a character array, or is a
  12102.  subroutine, the first value will contain whatever happens to be at the
  12103.  particular memory location (i.e., meaningless information). Consider
  12104.  the following two examples:
  12105.  
  12106.  character*80 function junk(a,b,c,d,e,f,g)
  12107.  character*(*) a,b,c,e,f,g
  12108.  character*4 d
  12109.  
  12110.  This declaration will put 80 in the first element of the global array
  12111.  pointed to by __FCclenv. This will be followed by the lengths of the
  12112.  arrays of a, b, c, d, e, f, g.
  12113.  
  12114.  subroutine junk(a,b,c,d,e,f,g)
  12115.  character*(*) a,b,c,e,f,g
  12116.  character*4 d
  12117.  
  12118.  This declaration will put nothing in the first element (so the memory
  12119.  location for this first element will be whatever value happens to be
  12120.  at that location). The remaining elements will contain the lengths of
  12121.  the passed arrays. This will also hold true for other functions that
  12122.  return values other than characters.
  12123.  
  12124.  
  12125.  327. NonPrintable Characters in Source File
  12126.  
  12127.  Product Version(s): 4.00 4.01 4.10
  12128.  Operating System:   MS-DOS
  12129.  Flags: ENDUSER |
  12130.  Last Modified:  9-JUN-1988    ArticleIdent: Q31022
  12131.  
  12132.     Page 13 of the FORTRAN Versions 4.00 and 4.10 Optimizing Compiler
  12133.  reference manual (section 2.2) states the following:
  12134.  
  12135.     "Microsoft FORTRAN source files can contain any PRINTABLE
  12136.  characters in the ASCII character set."
  12137.  
  12138.     This sentence in the manual is indicated to be an extension because
  12139.  the standard itself does not permit lowercase letters.
  12140.     Embedded control characters in source files generally are used to
  12141.  either control the screen cursor or a printer, or send a "beep" to the
  12142.  screen. You can do any of these without embedding control characters.
  12143.     For example, to send a message ending with a "beep" to the
  12144.  terminal, write the following:
  12145.  
  12146.     CHARACTER OUTSTR*20
  12147.     OUTSTR = 'This is the message'
  12148.     OUTSTR(20:20) = CHAR(7)
  12149.     WRITE (*,*) OUTSTR
  12150.     END
  12151.  
  12152.     This code conforms to the ANSI X3.9-1978 FORTRAN standard, so it
  12153.  will run on all standard conforming compilers. With this example, you
  12154.  can substitute any of the ASCII characters (i.e., CHAR(0) to
  12155.  CHAR(255)).
  12156.     However, the same is not true if you try to embed the character in
  12157.  the string itself.
  12158.  
  12159.     While some characters, such as BEL (CHARACTER(7)), may produce the
  12160.  desired results when embedded in a character string, others, e.g. NUL
  12161.  (CHAR(0)), CTRL-Z (CHAR(26), and BS (CHAR(8)), may cause unexpected
  12162.  behavior.
  12163.     The use of nonprintable ASCII characters embedded in source files
  12164.  is not supported. The same results can be achieved by using the CHAR
  12165.  function to insert the characters in their proper place at run time by
  12166.  either using character substrings or the // concatenation operator.
  12167.     The following is a source line that causes the error "F2031:
  12168.  closing quote missing":
  12169.  
  12170.     80 SUPB = '\033S\000\010'
  12171.  
  12172.     The following four characters were present in "SUPB" to change the
  12173.  printer to bold superscripting:
  12174.  
  12175.     1. ESC (hex 1B)
  12176.     2. "S"
  12177.     3. NUL (hex 00)
  12178.     4. BS (hex  08)
  12179.  
  12180.     This attempt has several flaws; it is nonportable, and both
  12181.  compiler and editor dependent.
  12182.     There are several more-preferable ways to do this, using either
  12183.  portable or nonportable features. Using standard features, the line
  12184.  could be rewritten as follows:
  12185.  
  12186.     80 SUPB = CHAR(27) // 'S' // CHAR(0) // CHAR(8)
  12187.  
  12188.     If the nonprintable characters have been defined individually as
  12189.  character variables, the line could be rewritten as follows:
  12190.  
  12191.     80 SUPB = ESC // 'S' // NUL // BS
  12192.  
  12193.     If you want to be nonstandard, the line could be rewritten as
  12194.  follows:
  12195.  
  12196.     80 SUPB = #1B530008
  12197.  
  12198.  
  12199.  
  12200.  328. How CTRL-Z Is Interpretted for Various File Types
  12201.  
  12202.  Product Version(s): 3.20 3.30 3.31 3.32 4.00 4.01 4.10
  12203.  Operating System:   MS-DOS
  12204.  Flags: ENDUSER |
  12205.  Last Modified:  9-JUN-1988    ArticleIdent: Q31023
  12206.  
  12207.     The following list demonstrates the various file types, and whether
  12208.  or not an embedded CTRL-Z is allowed:
  12209.  
  12210.                          Embedded
  12211.                          CTRL-Z
  12212.  File Type               Allowed         Notes
  12213.  
  12214.  Binary                  Yes             Read or write; no restriction.
  12215.  Unformatted             Yes             Read or write; no restriction.
  12216.  Formatted               No (not on read)
  12217.                                          Trailing CTRL-Z and NULL (0)
  12218.                                          characters are stripped off.
  12219.                                          You can write CTRL-Z (using CHAR(26))
  12220.                                          into a file, but unless you are
  12221.                                          reading a character variable, you
  12222.                                          will get a run-time error if a
  12223.                                          CTRL-Z is found.
  12224.                                          A text file should not have
  12225.                                          any non-printable characters
  12226.                                          in it.
  12227.  
  12228.  Internal                No (not on read)
  12229.  
  12230.  
  12231.  
  12232.  329. Real*8 or Double Precision Must Contain an Exponent
  12233.  
  12234.  Product Version(s): 4.00 4.01 4.10
  12235.  Operating System:   MS-DOS
  12236.  Flags: ENDUSER |
  12237.  Last Modified: 12-JUL-1988    ArticleIdent: Q31173
  12238.  
  12239.     When using real*8 or double-precision variables, the FORTRAN manual
  12240.  says the variables should be significant to 15 digits. However, these
  12241.  variables use only the first seven digits correctly; the remaining
  12242.  eight digits are used randomly.
  12243.     To get 15 digits of precision into your real*8 variables, you must
  12244.  declare the constant with an exponent. If the exponent is omitted, the
  12245.  number is interpreted as a single-precision constant.
  12246.     For more information, please refer to the "Microsoft FORTRAN
  12247.  Optimizing Compiler Language Reference" manual, Section 2.4.3, Pages
  12248.  23-24.
  12249.  
  12250.     The following is a code example of the proper way to set a
  12251.  double-precision variable with the D:
  12252.  
  12253.           real*8 doub_real
  12254.     c      double precision doub_real
  12255.     c      either real*8 or double precision needs to use the D.
  12256.  
  12257.           doub_real = .55555555555555555555D0
  12258.           print '(f20.18)',doub_real
  12259.           end
  12260.  
  12261.  
  12262.  330. $DECLARE Fails on Nondeclared Argument-List Variables
  12263.  
  12264.  Product Version(s): 4.10
  12265.  Operating System:   MS-DOS
  12266.  Flags: ENDUSER | Buglist4.1
  12267.  Last Modified: 16-JUN-1988    ArticleIdent: Q31320
  12268.  
  12269.     The $DECLARE metacommand does not generate a compile-time warning
  12270.  when a variable appearing in the argument list of a subroutine is used
  12271.  without being typed.
  12272.     The following code sample does not warn that "A" is undeclared, but
  12273.  it should generate a compile-time warning:
  12274.  
  12275.     $DECLARE
  12276.              SUBROUTINE POOT(A)
  12277.              A=1.0
  12278.              RETURN
  12279.              END
  12280.  
  12281.     Microsoft has confirmed this to be a problem with Microsoft FORTRAN
  12282.  Version 4.10.
  12283.     Microsoft is researching this problem and will post new information
  12284.  as it becomes available.
  12285.  
  12286.  
  12287.  331. Passing Function Names as Arguments to NonFORTRAN Routines
  12288.  
  12289.  Product Version(s): 4.10
  12290.  Operating System:   MS-DOS
  12291.  Flags: ENDUSER |
  12292.  Last Modified: 16-JUN-1988    ArticleIdent: Q31322
  12293.  
  12294.     FORTRAN procedural arguments are not compatible with C-procedure
  12295.  pointers ( e.g. you cannot pass function names as arguments to C
  12296.  routines). Because FORTRAN treats function pointers differently then
  12297.  other pointers, the C routines do not "understand" what is being passed
  12298.  to them.
  12299.     For more information on this subject, please see Pages 287-288
  12300.  (Section 11.3.8.6) and Page 293 (Section 11.3.8.9) in the "Microsoft
  12301.  FORTRAN Optimizing Compiler User's Guide."
  12302.  
  12303.  
  12304.  332. Appending to a File
  12305.  
  12306.  Product Version(s): 3.x 4.00 4.01
  12307.  Operating System:   MS-DOS
  12308.  Flags: ENDUSER |
  12309.  Last Modified:  8-MAR-1988    ArticleIdent: Q11271
  12310.  
  12311.  Problem:
  12312.     Under mainframe FORTRAN there is a function MOD; it adds data to
  12313.  the end of a file in FORTRAN. I cannot find a similar
  12314.  command in your compiler. I want to add some data to
  12315.  the end of an ASCII file.
  12316.     I have used the command ENDFILE as an example to solve the problem.
  12317.  However, a sequential file that is opened and written to will
  12318.  overwrite the existing data (as stated in the manual).
  12319.  
  12320.  Response:
  12321.     On Pages 15-23 and 15-23s of the ANSI FORTRAN standard (ANSI
  12322.  X3.9-1978, which both mainframe and microcomputers follow), in the
  12323.  section concerning functions and subroutines, a MOD function is
  12324.  described that is used for remaindering, not for appending data to a
  12325.  file.
  12326.     The only function we are aware of that you may be thinking of is
  12327.  the specifier that some FORTRANs have added to the OPEN statement for
  12328.  example, ACCESS=APPEND. However, this is not part of the ANSI
  12329.  standard.
  12330.     At any rate, there is no mechanism in the ANSI standard to append
  12331.  to the end of files, and we have not added one. The only way to append
  12332.  to the end of a file is to do the following:
  12333.  
  12334.     1. Read from an old file.
  12335.     2. Write to a new file.
  12336.     3. Repeat (1) and (2) until reaching end-of file on the old file.
  12337.     4. Write new information to the new file.
  12338.  
  12339.  
  12340.  333. Incorrect Expression Evaluation
  12341.  
  12342.  Product Version(s): 3.31
  12343.  Operating System:   MS-DOS
  12344.  Flags: ENDUSER |
  12345.  Last Modified: 12-MAY-1988    ArticleIdent: Q11347
  12346.  
  12347.  Problem:
  12348.     The expression '(I - 1) * 256' is not being evaluated correctly.
  12349.     When $STORAGE:2 and $DEBUG metacommands are used and I is given the
  12350.  value 128, an integer overflow error occurs.
  12351.     The following code example demonstrates this behavior:
  12352.  
  12353.        $STORAGE:2
  12354.        $DEBUG
  12355.        PROGRAM TEST
  12356.        I = 128
  12357.        J = (I - 1) * 256
  12358.        END
  12359.  
  12360.  Response:
  12361.     Microsoft confirmed this to be a problem in Version 3.31 of the
  12362.  FORTRAN compiler.
  12363.     This problem was corrected in Version 4.00.
  12364.  
  12365.  
  12366.  334. Problem Assigning Format Label
  12367.  
  12368.  Product Version(s): 3.31
  12369.  Operating System:   MS-DOS
  12370.  Flags: ENDUSER | buglist3.31 fixlist4.00
  12371.  Last Modified: 20-OCT-1988    ArticleIdent: Q11356
  12372.  
  12373.  Problem:
  12374.  
  12375.  There is a problem associated with assigning a format label to an
  12376.  integer variable using the ASSIGN statement, then using the format
  12377.  label more than once in a WRITE statement.
  12378.  
  12379.  The following is a code sample that reproduces this behavior:
  12380.  
  12381.         PROGRAM TEST
  12382.         ASSIGN 4 TO I
  12383.         WRITE(*,4)' HELLO'
  12384.         WRITE(*,4)' HELLO' 4 FORMAT(A6)
  12385.         END
  12386.  
  12387.  Response:
  12388.  
  12389.  Microsoft confirmed this to be a problem in Version 3.31 of the
  12390.  FORTRAN compiler. This problem was corrected in Version 4.00.
  12391.  
  12392.  
  12393.  335. Incorrect Code Generated when Passing the Same Argument Twice
  12394.  
  12395.  Product Version(s): 4.10 5.00
  12396.  Operating System:   MS-DOS
  12397.  Flags: ENDUSER | buglist4.10 fixlist5.00
  12398.  Last Modified:  7-NOV-1989    ArticleIdent: Q31420
  12399.  
  12400.  The following program generates bad code when compiled with
  12401.  optimization on; it works correctly when compiled with -Od:
  12402.  
  12403.  C     Beginning of program
  12404.        call sub(i, i)
  12405.        end
  12406.  C--------------------------
  12407.        subroutine sub(i, j)
  12408.        i=17
  12409.        j=44
  12410.        write(*, *) i, j
  12411.        return
  12412.        end
  12413.  
  12414.  Because FORTRAN is passed by reference, this program should print out
  12415.  "   44    44   ". This is the result with optimization off; however,
  12416.  the result is "  17    44   " when the optimization is turned on.
  12417.  
  12418.  This problem occurs when the optimizer is on because it forces
  12419.  incorrect mov instructions, which causes a "pass by value" result.
  12420.  
  12421.  Microsoft has confirmed this to be a problem in FORTRAN Version 4.10.
  12422.  This problem was corrected in Version 5.00.
  12423.  
  12424.  The following assembly code was taken from an assembly dump of the
  12425.  program above.  This fragment comes after the initialization of I
  12426.  and J and before the CALL to __FFwr ( write function ):
  12427.  
  12428.  Optimization off:                       On:
  12429.  ( moves address )                       ( moves value )
  12430.  
  12431.  les   bx, dword ptr [bp+6]              mov ax, 44
  12432.  push  word ptr es:[bx+2]                cwd
  12433.  push  word ptr es:[bx]                  push dx
  12434.  ;                                       push ax
  12435.  ;
  12436.  les   bx dword ptr [bp+10]              mov  ax, 17
  12437.  push  word ptr es:[bx+2]                cwd
  12438.  push  word ptr es:[bx]                  push dx
  12439.                                          push ax
  12440.  
  12441.  The following command line was used:
  12442.  
  12443.     FL -AL -FPi -Zi -Fs -Fa -O? test.for.
  12444.  
  12445.  
  12446.  336. Carriage-Control Character Not Recognized
  12447.  
  12448.  Product Version(s): 4.00
  12449.  Operating System:   MS-DOS
  12450.  Flags: ENDUSER | buglist4.00 fixlist4.01
  12451.  Last Modified: 16-JUN-1988    ArticleIdent: Q31421
  12452.  
  12453.     The carriage-control character, '1', is not recognized as a
  12454.  carriage-control character and is printed out as the character one.
  12455.     In the following example program, using the format specifier 'Nx'
  12456.  in a previous FORMAT edit list causes subsequent formatting to be
  12457.  corrupted. The string output is unexpectedly moved to the right by N
  12458.  spaces, and so the carriage-control character is not in position to be
  12459.  used by the printer.
  12460.     A workaround is to use the edit decriptor for end-of-record, '/',
  12461.  in the first position in the subsequent FORMAT's editlist.
  12462.     This is a known problem with Version 4.00. This problem was
  12463.  corrected in Version 4.01.
  12464.  
  12465.     The following is the example program:
  12466.  
  12467.        CHARACTER*72 RFMT,TITLE
  12468.        OPEN(5,FILE='TRY.INP')
  12469.        OPEN(6,FILE='PRN')
  12470.        READ(5,5)RFMT
  12471.      5 FORMAT(A)
  12472.        READ(5,5)TITLE
  12473.      1 READ(5,RFMT,END=3)X,Y
  12474.        GO TO 1
  12475.      3 WRITE(6,9)TITLE
  12476.      9 FORMAT('1',A)
  12477.        WRITE(6,2)X,Y
  12478.      2 FORMAT('-','X IS',F15.5/
  12479.       1     '-','Y IS',F15.5)
  12480.        STOP
  12481.        END
  12482.  
  12483.     The input file contains the following:
  12484.  
  12485.  (5x,f5.1,6x,f6.0)
  12486.  titlestring
  12487.    5.7  6.9  3797 36778
  12488.    6.5  6.9  4099 36588
  12489.  
  12490.     The output on the printer appears as follows:
  12491.  
  12492.       1titlestring
  12493.  X IS        6.90000
  12494.  Y IS    36588.00000
  12495.  
  12496.     The workaround statement is to replace the following FORMAT line:
  12497.  
  12498.     9 FORMAT('1',A)
  12499.  
  12500.     with the following:
  12501.  
  12502.     9 FORMAT(/'1',A)
  12503.  
  12504.     This process will produce the correct output, as follows:
  12505.  
  12506.  titlestring
  12507.  X IS        6.90000
  12508.  Y IS    36588.00000
  12509.  
  12510.  
  12511.  337. Logical Expressions in Parameter List
  12512.  
  12513.  Product Version(s): 3.31
  12514.  Operating System:   MS-DOS
  12515.  Flags: ENDUSER | buglist3.31
  12516.  Last Modified: 12-MAY-1988    ArticleIdent: Q11584
  12517.  
  12518.  Problem:
  12519.     There is an inconsistency in the way the compiler evaluates logical
  12520.  expressions when they are used as parameters in a function call.
  12521.     Specifically, if a logical expression involving a real number is
  12522.  used as a parameter in a function call, it is not properly evaluated
  12523.  before being passed to the function.
  12524.     The following is a program that demonstrates this behavior:
  12525.  
  12526.     integer iso
  12527.     real riso
  12528.     logical chkr,t1,t2
  12529.     iso=45
  12530.     riso=45.0
  12531.  
  12532.     if (chkr(.TRUE.,(riso.ge.0.0), (riso.lt.180.0))) then
  12533.     write(*,*) 'real true'
  12534.     else
  12535.     write(*,*) 'real false'
  12536.     endif
  12537.  
  12538.     t1=(riso.ge.0.0)
  12539.     t2=(riso.lt.180.0)
  12540.     if (chkr(.TRUE.,t1,t2)) then
  12541.     write(*,*) 'real true'
  12542.     else
  12543.     write(*,*) 'real false'
  12544.     endif
  12545.  
  12546.     stop
  12547.     end
  12548.  
  12549.     logical function chkr(b1,b2,b3)
  12550.     logical b1,b2,b3
  12551.  
  12552.     chkr=(b1.and.b2.and.b3)
  12553.     if (chkr) return
  12554.     write(*,*) 'error'
  12555.     return
  12556.     end
  12557.  
  12558.  Response:
  12559.     Microsoft confirmed this to be a problem in Version 3.31 of the
  12560.  FORTRAN compiler.
  12561.     This problem was corrected in Version 4.00.
  12562.  
  12563.  
  12564.  338. Problem with LLE()
  12565.  
  12566.  Product Version(s): 3.31
  12567.  Operating System:   MS-DOS
  12568.  Flags: enduser | buglist3.31
  12569.  Last Modified:  2-MAY-1988    ArticleIdent: Q11583
  12570.  
  12571.  Problem:
  12572.     The function LLE() does not handle the characters "z" and "Z"
  12573.  correctly if they are embedded in a string. If the function is given
  12574.  two single characters to compare, it will return the correct value.
  12575.  
  12576.  Response:
  12577.     Microsoft confirmed this to be a problem in Version 3.31 of the
  12578.  FORTRAN compiler. The problem was corrected in Version 4.00.
  12579.  
  12580.  
  12581.  339. C Attribute on Named Common
  12582.  
  12583.  Product Version(s): 3.30
  12584.  Operating System:   MS-DOS
  12585.  Flags: ENDUSER |
  12586.  Last Modified: 12-MAY-1988    ArticleIdent: Q11664
  12587.  
  12588.  Problem:
  12589.     The C attribute on a named common apparently has no effect. Because
  12590.  of this limitation, you must actually call a FORTRAN routine to access
  12591.  FORTRAN common from a C program. This will return a pointer to the first
  12592.  element in common.
  12593.     The following is a code sample that demonstrates this behavior:
  12594.  
  12595.     subroutine test
  12596.     common/stmt [C]/j(3)
  12597.     j(1)=3
  12598.     j(2)=5
  12599.     j(3)=8
  12600.     stop
  12601.     end
  12602.  
  12603.  Response:
  12604.     You can work around this problem by using the "ALIAS" attribute,
  12605.  which gives your variable a lowercase name preceded by an underscore.
  12606.  The following is an example:
  12607.  
  12608.     SUBROUTINE TEST
  12609.     COMMON /STMT [ alias:'_stmt' ] / j(3)
  12610.     j(1)=3
  12611.     j(2)=5
  12612.     j(3)=8
  12613.     STOP
  12614.     END
  12615.  
  12616.     Microsoft confirmed this to be a problem in Version 3.30 of the
  12617.  FORTRAN compiler.
  12618.     The problem was corrected in Version 3.31.
  12619.  
  12620.  
  12621.  340. Logical*1 Arrays Written Incorrectly
  12622.  
  12623.  Product Version(s): 4.00 4.01
  12624.  Operating System:   MS-DOS
  12625.  Flags: ENDUSER | buglist4.01
  12626.  Last Modified: 31-MAY-1988    ArticleIdent: Q26267
  12627.  
  12628.  Problem:
  12629.     The following program :
  12630.  
  12631.          LOGICAL*1 TBP(8)
  12632.          OPEN(1,FILE='B',STATUS='OLD')
  12633.          READ(1,*)TBP
  12634.          WRITE(*,*)TBP
  12635.          WRITE(*,*)TBP(1),TBP(2),TBP(3),TBP(4),TBP(5),TBP(6),TBP(7),TBP(8)
  12636.          REWIND(1)
  12637.          READ(1,*)TBP(1),TBP(2),TBP(3),TBP(4),TBP(5),TBP(6),TBP(7),TBP(8)
  12638.          WRITE(*,*)TBP
  12639.          WRITE(*,*)TBP(1),TBP(2),TBP(3),TBP(4),TBP(5),TBP(6),TBP(7),TBP(8)
  12640.          END
  12641.  
  12642.  produces the following output:
  12643.  
  12644.          F F F F F F F F
  12645.          F F F F F F F F
  12646.          T T T T T T T T
  12647.          T T T T F T T F
  12648.  
  12649.     Only the last line of the output is correct.
  12650.  
  12651.  Response:
  12652.     Changing the logical*1 declaration to logical*2 produces correct
  12653.  output for all write statements.
  12654.     Microsoft is researching this problem and will post new information
  12655.  as it becomes available.
  12656.  
  12657.  
  12658.  341. Syntax Errors Hang Compiler
  12659.  
  12660.  Product Version(s): 4.x
  12661.  Operating System:   MS-DOS
  12662.  Flags: ENDUSER | buglist4.01
  12663.  Last Modified: 31-MAY-1988    ArticleIdent: Q26268
  12664.  
  12665.  Problem:
  12666.     The following program issues the expected messages for the syntax
  12667.  errors, then the compiler hangs:
  12668.  
  12669.                IF (I) THEN
  12670.                  X=0
  12671.                ELSE IF (I.GT.0) THEN
  12672.                  X=1
  12673.                ENDIF
  12674.                IF (I.EQ.0) THEN
  12675.                 X=0.
  12676.                ELSE IF (I) THEN
  12677.                 X=1.
  12678.                ENDIF
  12679.                END
  12680.  
  12681.  Response:
  12682.     Microsoft is researching this problem and will post new information
  12683.  as it becomes available.
  12684.  
  12685.  
  12686.  342. FORTRAN: /4Yb Switch Causes F2367 Range Error
  12687.  
  12688.  Product Version(s): 4.01 4.10
  12689.  Operating System:   MS-DOS
  12690.  Flags: ENDUSER | buglist4.01 buglist4.10
  12691.  Last Modified: 16-JUN-1989    ArticleIdent: Q31422
  12692.  
  12693.  Compiling with the /4Yb debug switch causes the following error:
  12694.  
  12695.     F2367 : value nnnnn : INTEGER : range error
  12696.  
  12697.  This error occurs when the high order (sign) bit is set, i.e., for
  12698.  values between -32768 (#8000) to -1 (#FFFF) ), as follows:
  12699.  
  12700.        integer*2 i
  12701.  
  12702.        i = #7fff          OK
  12703.        i = #8000          Fails with /4Yb switch
  12704.        i = #ffff          Fails with /4Yb switch
  12705.  
  12706.  The compiler is not performing the correct conversion from an unsigned
  12707.  hexadecimal value to a signed decimal value when the /4Yb switch is
  12708.  used.
  12709.  
  12710.  This is a known problem with the FORTRAN compiler Versions 4.01 and
  12711.  4.10. Microsoft is researching this problem and will post new
  12712.  information as it becomes available.
  12713.  
  12714.  
  12715.  343. FORTRAN: Internal Compiler Error: ctypes.c 1.89, Line 428
  12716.  
  12717.  Product Version(s): 4.10
  12718.  Operating System:   MS-DOS
  12719.  Flags: ENDUSER | buglist4.10 fixlist5.00
  12720.  Last Modified: 16-JUN-1989    ArticleIdent: Q31483
  12721.  
  12722.  The program below will cause the following error when compiled with FL
  12723.  /Od LINE482.FOR.:
  12724.  
  12725.  line482.for
  12726.  line482.for(18) : fatal error F1001: Internal Compiler Error
  12727.                  (compiler file '@(#)ctypes.c:1.89', line 428)
  12728.                  Contact Microsoft Technical Support
  12729.  
  12730.  The program below should not generate the internal compiler error.
  12731.  However, the program code is incorrectly passing the wrong type of
  12732.  arguments to connect.
  12733.  
  12734.  To work around this problem, declare "x" and "y" as characters and
  12735.  initialize them as such. This will prevent the internal compiler error
  12736.  and allow the function to execute properly. Use the EQUIVALENCE
  12737.  function if you want to access the variables in different ways.
  12738.  
  12739.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  12740.  FORTRAN compiler. This problem was corrected in Version 5.00.
  12741.  
  12742.  The program code is as follows:
  12743.  
  12744.      interface to integer*2 function connect[pascal](c,l)
  12745.        character*40 c, l
  12746.        end
  12747.  
  12748.        integer*2 connect, x, y, s
  12749.        x = 1
  12750.        y = 2
  12751.        s = connect(x,y)
  12752.  
  12753.        end
  12754.  
  12755.  
  12756.  344. Bound Programs in DOS Version 2.x Give Error SYS 2090
  12757.  
  12758.  Product Version(s): 4.10
  12759.  Operating System:   MS-DOS
  12760.  Flags: ENDUSER | s_c h_masm s_pascal
  12761.  Last Modified: 23-JUN-1988    ArticleIdent: Q31499
  12762.  
  12763.     Bound programs generate the following error under DOS Version 2.x
  12764.  when that program does not reside in the current directory:
  12765.  
  12766.     SYS2090: The system is unable to load the program
  12767.  
  12768.     The workaround is to make sure that the following programs reside
  12769.  in the current working directory, or to switch over to DOS Version
  12770.  3.x. Make certain that that if you are using DOS Version 3.x , your
  12771.  version of COMMAND.COM reported by "command" matches your version of
  12772.  DOS reported by "ver".
  12773.     Microsoft is researching this problem and will post new information
  12774.  as it becomes available.
  12775.  
  12776.     This error is generated even if the full drive path of the program
  12777.  is given or if the program is in a directory that is in the PATH.
  12778.  These programs include the FORTRAN compiler Version 4.10, the PASCAL
  12779.  compiler Version 4.00, and bound versions of the following utilities
  12780.  that are packaged with C Version 5.10, MASM Version 5.10, FORTRAN
  12781.  Version 4.10, and Pascal Version 4.00:
  12782.  
  12783.       SETUP.EXE
  12784.       CREF.EXE
  12785.       CVPACK.EXE
  12786.       MAKE.EXE
  12787.       LIB.EXE
  12788.       EXEHDR.EXE
  12789.       LINK.EXE
  12790.       IMPLIB.EXE
  12791.       BIND.EXE
  12792.  
  12793.  
  12794.  345. FORTRAN: WRITE to Screen Truncates String in 4.10
  12795.  
  12796.  Product Version(s): 4.10
  12797.  Operating System:   MS-DOS
  12798.  Flags: ENDUSER | buglist4.10 fixlist5.00
  12799.  Last Modified: 16-JUN-1989    ArticleIdent: Q31513
  12800.  
  12801.  The following code demonstrates an error in the FORTRAN Version 4.10
  12802.  compiler. A subroutine called prior to a WRITE statement fails to
  12803.  correctly process a character string unless a WRITE statement is
  12804.  present before a certain assignment in the subroutine, or optimization
  12805.  is turned off (/Od).
  12806.  
  12807.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  12808.  FORTRAN compiler. This problem was corrected in Version 5.00.
  12809.  
  12810.  The following program demonstrates a problem with the FORTRAN
  12811.  compiler. The routine should print "N7A", but does not do so unless
  12812.  the WRITE statement in the subroutine below is installed, or /Od is
  12813.  used:
  12814.  
  12815.         IMPLICIT INTEGER (A-Z)
  12816.         DIMENSION WIN(4)
  12817.         DATA WIN/'N','7','A',' '/
  12818.         DATA BLANK/' '/
  12819.  C
  12820.         WOUT=BLANK
  12821.         DO 2 I=1,4
  12822.         CALL BYTE2(WIN(I),1,WOUT,I)
  12823.       2 CONTINUE
  12824.         WRITE(*,'(A,A4,A)') ' ** BYTE2:''',WOUT,''''
  12825.         STOP
  12826.         END
  12827.  ***********************************************************************
  12828.  ***********************************************************************
  12829.        SUBROUTINE BYTE2(WIN,INBYT,WOUT,IOBYT)
  12830.        IMPLICIT INTEGER (A-Z)
  12831.        CHARACTER*1 AIN,AOUT
  12832.        DIMENSION AIN(4),AOUT(4)
  12833.        EQUIVALENCE (AIN,XIN),(AOUT,XOUT)
  12834.  c
  12835.        XIN=WIN
  12836.        XOUT=WOUT
  12837.  C     WRITE(5,'(1x,a4)')wout
  12838.  C  Reinstalling the above WRITE statement corrects the problem.
  12839.        AOUT(IOBYT)=AIN(INBYT)
  12840.        WOUT=XOUT
  12841.        RETURN
  12842.        END
  12843.  
  12844.  
  12845.  346. L2029 "Unresolved Externals" Error in FORTRAN Library
  12846.  
  12847.  Product Version(s): 4.00 4.01 4.10
  12848.  Operating System:   MS-DOS
  12849.  Flags: ENDUSER |
  12850.  Last Modified: 23-JUN-1988    ArticleIdent: Q31577
  12851.  
  12852.     It is likely that the FORTRAN libraries were built with C
  12853.  compatibility if many type L2029 "unresolved externals" errors occur
  12854.  on names beginning with an underscore when linking a FORTRAN program.
  12855.     A problem will occur when the FORTRAN library is built with C
  12856.  compatibility and the C libraries are not also linked in. This problem
  12857.  will occur even if no C modules, only FORTRAN modules, are linked in.
  12858.     When a FORTRAN library is set up to be C compatible, the routines
  12859.  that are in common between C and FORTRAN are removed from the FORTRAN
  12860.  library. The user must link with the C libraries each time to make
  12861.  those routines available to the linker, even if only FORTRAN modules
  12862.  are being linked in.
  12863.     This error also will occur if the linker being used is not the
  12864.  latest version; it also can be caused by TSR interference. When these
  12865.  two common reasons for the L2029 error are eliminated, check the
  12866.  libraries to see if they contain the module that is unresolved. This
  12867.  can be done with the library manager LIB.EXE file.
  12868.  
  12869.  
  12870.  347. Carriage-Control Processing only on Terminal Files
  12871.  
  12872.  Product Version(s): 4.10
  12873.  Operating System:   MS-DOS
  12874.  Flags: ENDUSER |
  12875.  Last Modified:  4-NOV-1988    ArticleIdent: Q37543
  12876.  
  12877.  Carriage-control processing is only performed on terminal files, i.e.,
  12878.  screen and printer files (LPT1). Therefore the following code will not
  12879.  process the carriage-control character:
  12880.  
  12881.        character*6 b
  12882.        integer c(31)
  12883.        open(unit=11,file='LPT2',form=formatted,status=new,iostat=ios);
  12884.        write(11,1,iostat=ios) b,c
  12885.  1     format('+',a,31a4)
  12886.  
  12887.  The '+' is printed out to LPT2 as a character instead of carriage
  12888.  control for printing. This is because LPT2 is not a terminal file.
  12889.  
  12890.  
  12891.  348. Linking FORTRAN and C, "L2044 _FF_MsgBanner Multiply Defined"
  12892.  
  12893.  Product Version(s): 4.00 4.01
  12894.  Operating System:   MS-DOS
  12895.  Flags: ENDUSER | S_C 5.00 5.01
  12896.  Last Modified: 20-APR-1989    ArticleIdent: Q31609
  12897.  
  12898.  Problem:
  12899.  
  12900.  When linking FORTRAN and C modules, I receive the error "L2044
  12901.  _FF_MsgBanner Symbol Multiply Defined." I have set up FORTRAN for C
  12902.  compatibility and I am linking with the /NOE switch.
  12903.  
  12904.  Response:
  12905.  
  12906.  When using FORTRAN Version 4.00 or 4.01 with C 5.00 or C 5.10, you
  12907.  need to run the F4COMPAT file to make your FORTRAN libraries C
  12908.  compatible because FORTRAN Versions 4.00 and 4.01 were written in C
  12909.  Version 4.00.
  12910.  
  12911.  If the /NOD switch is used, altering the order of the libraries may
  12912.  change the error message received. When the FORTRAN library is first,
  12913.  the error may be "R6002 Floating Point Not Loaded." When the C library
  12914.  is first, the error is "Symbol Multiply Defined."
  12915.  
  12916.  
  12917.  349. Infinite Loop and Protection Violation Error in FORTRAN 4.x
  12918.  
  12919.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  12920.  Operating System:   MS-DOS              | OS/2
  12921.  Flags: ENDUSER | buglist4.00 buglist4.01 buglist4.10 fixlist5.00
  12922.  Last Modified:  7-NOV-1989    ArticleIdent: Q31649
  12923.  
  12924.  The following code will repeatedly loop when compiled and executed in
  12925.  real mode with FORTRAN 4.00, 4.01, or 4.10. In OS/2, this code
  12926.  produces a protection violation during compile time.
  12927.  
  12928.  The workaround is to compile with either /Od or /Odct.
  12929.  
  12930.  Microsoft has confirmed this to be a problem in the FORTRAN compiler
  12931.  Versions 4.00, 4.01, and 4.10. This problem was corrected in Version
  12932.  5.00.
  12933.  
  12934.  The following code demonstrates the problem:
  12935.  
  12936.         DATA LIMIT/57/, JUMP/14/
  12937.  C
  12938.    110  FORMAT(4I12)
  12939.         PAUSE 0
  12940.         DO 120 KOUNT = 1, LIMIT, JUMP
  12941.    120  WRITE(*,110) KOUNT, LIMIT, JUMP
  12942.         PAUSE 'DO-loop done'
  12943.         LOOP = JUMP
  12944.    130  WRITE(*,110) LOOP
  12945.         LOOP = LOOP - 1
  12946.         IF (LOOP .GT. 0) GOTO 130
  12947.         PAUSE 'GOTO-loop done'
  12948.         DO 140 KOUNT = 1, LIMIT, JUMP
  12949.    140  WRITE(*,110) KOUNT, LIMIT, JUMP
  12950.         PAUSE 'DO-loop done'
  12951.         WRITE(*, '(/'' Do we see this message???'')')
  12952.    150  END
  12953.  
  12954.  The line "Do we see this message???" appears only when this code is
  12955.  compiled with /Od or /Odct in real mode. When compiled in protected
  12956.  mode, the compiler will issue a protection violation error.
  12957.  
  12958.  
  12959.  350. System Languages Do Not Generate 386-Code, 32-Bit Addressing
  12960.  
  12961.  Product Version(s): 3.x 4.00 4.01 4.10 | 4.10
  12962.  Operating System:   MS-DOS             | OS/2
  12963.  Flags: ENDUSER | S_Pascal h_masm S_C S_QuickC
  12964.  Last Modified: 18-AUG-1988    ArticleIdent: Q31663
  12965.  
  12966.     The system languages C, FORTRAN, MASM, and Pascal do not generate
  12967.  386-code or use 32-bit addressing. However, the Microsoft Macro
  12968.  Assembler will assemble 386 instructions, but it will not use 32-bit
  12969.  addressing. For more information on the Macro Assembler, please see
  12970.  the "Microsoft Macro Assembler Programmer's Guide" (Version 5.10).
  12971.     This limitation occurs because the operating systems on which our
  12972.  system languages operate, MS-DOS and OS/2, do not make use of the
  12973.  32-bit addressing available with the 80386 processor. These operating
  12974.  systems, and the system languages, will all execute on a 80386
  12975.  machine; however, they will behave as if it is a fast 80286 machine.
  12976.  The high-level system languages have the compile-time options /G0,
  12977.  /G1, and /G2. These options tell the compiler to generate code for the
  12978.  8086/88, 80186/188 and 80286, respectively.
  12979.  
  12980.  
  12981.  351. Returning a Floating-Point Value to FORTRAN from Assembly
  12982.  
  12983.  Product Version(s): 4.10
  12984.  Operating System:   MS-DOS
  12985.  Flags: ENDUSER |
  12986.  Last Modified: 23-JUN-1988    ArticleIdent: Q31714
  12987.  
  12988.    The following FORTRAN and assembly code will demonstrate how to pass
  12989.  an integer value to an assembly routine from FORTRAN, perform some
  12990.  floating-point function, and then return the new floating-point value.
  12991.  (For more information on returning a floating-point value to a FORTRAN
  12992.  main from an assembly procedure, see Pages 78-79, Section 6.1.6, in
  12993.  the "Microsoft Mixed-Language Programming Guide.")
  12994.  
  12995.         INTERFACE TO REAL*4 FUNCTION M(I,J)
  12996.         INTEGER*4 I,J
  12997.         END
  12998.  
  12999.         INTEGER*4 I,J
  13000.  C*****Note that the function M is defined below*****
  13001.         REAL*4 L,M
  13002.         I =  1680649580
  13003.         J = 32
  13004.         L = M(I,J)
  13005.         PRINT *, L
  13006.         END
  13007.  
  13008.  ;***********Assembly Module**********
  13009.  .MODEL LARGE
  13010.  .CODE
  13011.          PUBLIC  M
  13012.  M       PROC FAR
  13013.          push    bp      ;Save old base pointer
  13014.          mov     bp,sp   ;Establish bp as the "framepointer"
  13015.          sub     sp,4
  13016.          finit
  13017.          les     bx,DWORD PTR [bp+8]     ;J
  13018.          fild    DWORD PTR es:[bx]       ;Push J on the coprocessor stack
  13019.          les     bx,DWORD PTR [bp+12]    ;I
  13020.          fild    DWORD PTR [bx]          ;Push I on the coprocessor stack
  13021.          fdiv    ST,ST(1)                ;Perform the division
  13022.          mov     bx,WORD PTR [bp+6]      ;Move the return value offset into bx
  13023.          fstp    DWORD PTR [bx]          ;Pop the coprocessor stack
  13024.          fwait
  13025.          finit
  13026.          mov     ax,bx              ;Move the return value offset into ax
  13027.          mov     dx,ds              ;Move the data segment value into dx
  13028.          mov     sp,bp              ;Recover old stack pointer(sp)
  13029.          pop     bp                 ;Get old bp
  13030.          ret     10                 ;Return 10 since 2 4-byte args were passed
  13031.  
  13032.  M       ENDP
  13033.          END
  13034.  
  13035.  
  13036.  
  13037.  352. EQUIVALENCEing Subroutine Argument in FORTRAN 4.10
  13038.  
  13039.  Product Version(s): 4.10 5.00
  13040.  Operating System:   OS/2
  13041.  Flags: ENDUSER | buglist4.10 fixlist5.00
  13042.  Last Modified:  7-NOV-1989    ArticleIdent: Q31831
  13043.  
  13044.  The following subroutine causes a protection violation while it is
  13045.  compiling with the default switches under OS/2 with FORTRAN Version
  13046.  4.10.
  13047.  
  13048.  The workaround is to perform the EQUIVALENCE outside of the
  13049.  subroutine, and then pass both arguments to the subroutine.
  13050.  
  13051.  Microsoft has confirmed this to be a problem with FORTRAN Version
  13052.  4.10. This problem was corrected in Version 5.00.
  13053.  
  13054.  The following is a code example:
  13055.  
  13056.          subroutine sub (line)
  13057.  
  13058.          equivalence (lyne,line)
  13059.          return
  13060.          end
  13061.  
  13062.  Using a subprogram argument in an EQUIVALENCE statement does not
  13063.  conform to the FORTRAN 77 Standard. This subroutine causes the
  13064.  following syntax error with the FORTRAN Versions 4.01 and 4.10
  13065.  compilers under DOS:
  13066.  
  13067.  eq.for
  13068.  eq.for(3) : error F2312: LINE : EQUIVALENCE : formal argument illegal
  13069.  
  13070.  
  13071.  353. Third-Party Libraries Available for Microsoft FORTRAN
  13072.  
  13073.  Product Version(s): 3.x 4.x
  13074.  Operating System:   MS-DOS
  13075.  Flags: ENDUSER |
  13076.  Last Modified:  3-OCT-1990    ArticleIdent: Q31838
  13077.  
  13078.  Microsoft FORTRAN for MS-DOS provides a number of utilities and math
  13079.  libraries. In addition, there are a number of subroutines and
  13080.  libraries that can be obtained through third-party software vendors
  13081.  that could further speed your development.
  13082.  
  13083.  There are a range of graphic libraries available, such as the
  13084.  following:
  13085.  
  13086.  1. Plotting libraries (ATC, Microcompatibles, GSS), 3-D graphics
  13087.     (Microcompatibles)
  13088.  
  13089.  2. ANSI/ISO graphics (GSS, ATC)
  13090.  
  13091.  3. Image processing (Werner Frei)
  13092.  
  13093.  4. General graphics (Media Cybernetics)
  13094.  
  13095.  For data management, Softcraft provides Btrieve for ISAM support
  13096.  and Microrim provides a Microsoft FORTRAN program interface to its
  13097.  RBase product.
  13098.  
  13099.  Although FORTRAN math support is extensive, there are other more
  13100.  specialized math libraries available, such as the following:
  13101.  
  13102.  1. Modeling (Mitchell & Gauthier)
  13103.  
  13104.  2. FFT (MicroWay, Wiley)
  13105.  
  13106.  3. Vector
  13107.  
  13108.  4. Matrix
  13109.  
  13110.  5. Numerical analysis
  13111.  
  13112.  6. Signal and image processing libraries (Wiley, Quantitative
  13113.     Technology Corporation, Systolic Systems)
  13114.  
  13115.  7. Statistic (Wiley, IMSL, MAGUS, IMSL)
  13116.  
  13117.  8. Broad engineering/scientific math libraries (Wiley, NAG)
  13118.  
  13119.  General-purpose libraries are available through MEF that provide
  13120.  the following support in one package:
  13121.  
  13122.  1. Communications
  13123.  
  13124.  2. File management
  13125.  
  13126.  3. Graphics
  13127.  
  13128.  4. DOS
  13129.  
  13130.  5. Screen handling
  13131.  
  13132.  6. String handling
  13133.  
  13134.  Even very specialized libraries such as IEEE 488 Support (Tecmar)
  13135.  are available.
  13136.  
  13137.  Contact these third-party vendors for more information on their
  13138.  libraries for Microsoft FORTRAN or obtain a copy of the Language
  13139.  Support Directory by contacting Microsoft Sales and Service at (800)
  13140.  426-9400.
  13141.  
  13142.  
  13143.  354. Internal Compiler Error: p2symtab.c 1.85, Line 915
  13144.  
  13145.  Product Version(s): 4.10
  13146.  Operating System:   MS-DOS
  13147.  Flags: ENDUSER | buglist4.10 fixlist5.00
  13148.  Last Modified:  6-NOV-1989    ArticleIdent: Q31846
  13149.  
  13150.  If the EQUIVALENCE statement follows the initializing TYPE statement,
  13151.  the correct F2311 error is generated. If the EQUIVALENCE statement
  13152.  precedes the TYPE statement, then P1 does not produce an error and P2
  13153.  fails with a p2symtab.c assertion error.
  13154.  
  13155.  The workaround is to declare the variables before you EQUIVALENCE
  13156.  them.
  13157.  
  13158.  Microsoft has confirmed this to be a problem in Version 4.10. This
  13159.  problem was corrected in Version 5.00.
  13160.  
  13161.  The following internal compiler error was produced by the code
  13162.  below:
  13163.  
  13164.  t71.for
  13165.  t71.for(4) : fatal error F1001: Internal Compiler Error
  13166.                  (compiler file '@(#)p2symtab.c:1.85', line 915)
  13167.                  Contact Microsoft Technical Support
  13168.  
  13169.  The following code demonstrates the problem:
  13170.  
  13171.         equivalence (fmt(1),prefix)
  13172.         character*4 prefix/'73h '/
  13173.         character*1 fmt(80)
  13174.         end
  13175.  
  13176.  If the EQUIVALENCE statement is placed after the two character-type
  13177.  lines, then the compiler will produce the correct error message, as
  13178.  follows:
  13179.  
  13180.  t71.for
  13181.  t71.for(3) : error F2311: PREFIX : EQUIVALENCE : preinitialization
  13182.  illegal
  13183.  
  13184.  
  13185.  355. Program Statement in Incorrect Order in Graphics Examples
  13186.  
  13187.  Product Version(s): 5.00
  13188.  Operating System:   MS-DOS
  13189.  Flags: ENDUSER | docerr
  13190.  Last Modified: 23-APR-1990    ArticleIdent: Q60843
  13191.  
  13192.  The PROGRAM statement in the code examples listed below is incorrect
  13193.  and should come AFTER the INCLUDE 'FGRAPH.FI' statement, but BEFORE
  13194.  the INCLUDE 'FGRAPH.FD' statement. The code examples are from the
  13195.  "Microsoft FORTRAN Advanced Topics" manual listed on the following
  13196.  pages:
  13197.  
  13198.  1. Function getcolor on Page 204
  13199.  
  13200.  2. Subroutine getcurrentposition, getcurrentposition_w on Page 205
  13201.  
  13202.  3. Subroutine getfillmask on Page 207
  13203.  
  13204.  4. Function getpixel, getpixel_w on Page 215
  13205.  
  13206.  5. Subroutine setfillmask on Page 256
  13207.  
  13208.  In the examples listed above, the (incorrect) heading for the source
  13209.  code is as follows:
  13210.  
  13211.         PROGRAM [program_name]
  13212.  
  13213.         INCLUDE 'FGRAPH.FI'
  13214.         INCLUDE 'FGRAPH.FD'
  13215.  
  13216.  The headings should instead be as follows:
  13217.  
  13218.         INCLUDE 'FGRAPH.FI'
  13219.  
  13220.         PROGRAM [program_name]
  13221.  
  13222.         INCLUDE 'FGRAPH.FD'
  13223.  
  13224.  The include file FGRAPH.FI includes interface statements for the
  13225.  graphics routines in the graphics library. Microsoft FORTRAN requires
  13226.  the interface statements to be located outside of a program block of
  13227.  code in a source file. In the first example above, the interface
  13228.  statements would be placed inside the main program code block, thus
  13229.  causing compile errors. The second example above solves the problem by
  13230.  placing the interface statements outside of the main program block of
  13231.  code.
  13232.  
  13233.  
  13234.  356. FORTRAN Academic 10-Packs
  13235.  
  13236.  Product Version(s): 5.00   | 5.00
  13237.  Operating System:   MS-DOS | OS/2
  13238.  Flags: ENDUSER |
  13239.  Last Modified: 24-APR-1990    ArticleIdent: Q60978
  13240.  
  13241.  Microsoft FORTRAN Academic 10-Packs is a new product for academic
  13242.  users.
  13243.  
  13244.  The FORTRAN Academic 10-Packs are designed for math, engineering, and
  13245.  scientific professors in schools and universities. Like Microsoft's
  13246.  other academic 10-packs, the FORTRAN 10-pack consists of 10 disk sets
  13247.  and one complete set of documentation, and is intended for use in
  13248.  labs. The suggested retail price, before discounts, is $1395. That
  13249.  equates to a per-workstation price, before discounts, of $139.50.
  13250.  
  13251.  The planned availability date is June, 1990.
  13252.  
  13253.  To order, or to obtain further information about the Microsoft FORTRAN
  13254.  10-Pack, call Microsoft Education Sales at (800) 227-4679.
  13255.  
  13256.  Some of the benefits to the Microsoft FORTRAN Version 5.00 10-Packs
  13257.  are the following:
  13258.  
  13259.  1. Certified ANSI 77 FORTRAN compiler
  13260.  
  13261.  2. Selected ANSI 8X extensions
  13262.  
  13263.  3. A complete product, including the FORTRAN compiler
  13264.  
  13265.  4. The CodeView debugger
  13266.  
  13267.  5. The Microsoft Editor
  13268.  
  13269.  6. The same professional-quality software as the retail FORTRAN 5.00
  13270.     product
  13271.  
  13272.  Additional manuals and conversion to 3.5-inch or 5.25-inch disk sets
  13273.  are available through Microsoft's Education Sales.
  13274.  
  13275.  
  13276.  357. FORTRAN and C Compatibility in Protected Mode
  13277.  
  13278.  Product Version(s): 4.10   | 4.10
  13279.  Operating System:   MS-DOS | OS/2
  13280.  Flags: ENDUSER |
  13281.  Last Modified: 21-JUL-1988    ArticleIdent: Q32044
  13282.  
  13283.     When FORTRAN libraries have been built with C compatibility, link
  13284.  the FORTRAN and C modules as follows:
  13285.  
  13286.     LINK objs,,,LLIBCEP.LIB LLIBFEP.LIB DOSCALLS.LIB /NOE /NOD;
  13287.  
  13288.     It is not necessary to use F4COMPAT.BAT for protected-mode
  13289.  programs. Any of the three math packages can be used as long as they
  13290.  are consistent between the languages. The C library must be the first
  13291.  library, the FORTRAN library and DOSCALLS.LIB must be linked
  13292.  explicitly, and the switches /NOE and /NOD must be used. The /NOE
  13293.  switch is used to prevent symbols from being defined more than once
  13294.  (error L2025). The /NOD switch turns off the default library search so
  13295.  that the order of these libraries can be given explicitly.
  13296.     For information on linking real-mode programs, please refer to the
  13297.  "Linking Mixed-Language Programs" section in the C Version 5.00
  13298.  README.DOC.
  13299.  
  13300.  
  13301.  358. Missing Files for Writing C Extensions
  13302.  
  13303.  Product Version(s): 4.10   | 4.10
  13304.  Operating System:   MS-DOS | OS/2
  13305.  Flags: ENDUSER | appnote
  13306.  Last Modified:  7-NOV-1988    ArticleIdent: Q32046
  13307.  
  13308.  Page 68 of the "Microsoft Editor User's Guide," Section 8.1, states
  13309.  the following requirements for creating C extensions for the Microsoft
  13310.  Editor:
  13311.  
  13312.  "To create C extensions, you need to have the following files and
  13313.  software present in your current directory:
  13314.  
  13315.     Microsoft C Version 4.00 or later
  13316.  
  13317.     Microsoft Overlay Linker Version 3.60 or later or Microsoft
  13318.  
  13319.     Segmented-Executable Linker Version 5.01 or later
  13320.  
  13321.     EXTHDR.OBJ  (supplied with the editor)
  13322.  
  13323.     EXT.H       (supplied with the editor)
  13324.  
  13325.     SKEL.C      (a template that you can replace with your own code)"
  13326.  
  13327.  The three files EXTHDR.OBJ, EXT.H, and SKEL.C are not found on any of
  13328.  the Microsoft FORTRAN Version 4.10 Optimizing Compiler product disks.
  13329.  These three files are available from Microsoft System Languages
  13330.  Product Support by calling (206) 454-2030.
  13331.  
  13332.  
  13333.  359. Proper Use of SCWRQQ and LCWRQQ
  13334.  
  13335.  Product Version(s): 4.00 4.01 4.10 | 4.10
  13336.  Operating System:   MS-DOS         | 4.10
  13337.  Flags: ENDUSER | docerr
  13338.  Last Modified: 25-JUL-1988    ArticleIdent: Q32110
  13339.  
  13340.     On Pages 362-363 of the "Microsoft FORTRAN Optimizing Compiler
  13341.  User's Guide," there are references to the SSWRQQ and SCWRQQ functions
  13342.  and the LCWRQQ subroutine. These functions do not appear to work
  13343.  correctly (they are procedures to set and clear the floating-point
  13344.  exceptions).
  13345.     The documentation is incorrect; the last line of Page 362 refers to
  13346.  "SCWRQQ", which should be "SSWRQQ", as follows:
  13347.  
  13348.     INTEGER*2 FUNCTION SSWRQQ
  13349.  
  13350.     You cannot declare the subroutine "INTEGER*2 FUNCTION SCWRQQ", as
  13351.  stated in the documentation. The keyword function cannot be in the
  13352.  declaration. The FUNCTION statement is used for declaring user-defined
  13353.  functions and for the interface statement, as shown on Pages 218 and
  13354.  241 of the "Microsoft FORTRAN Optimizing Compiler Language Reference,"
  13355.  respectively.
  13356.     The following is an example:
  13357.  
  13358.        call rndzr
  13359.        stop
  13360.        end
  13361.  
  13362.        subroutine rndzr
  13363.  c   not "integer*2 function scwrqq" as the documentation states
  13364.        integer*2 scwrqq
  13365.        integer*2 cw
  13366.  
  13367.  c   get old control word
  13368.        cw = scwrqq()
  13369.  
  13370.  c   set new control word variable
  13371.        cw = 16#133f
  13372.  
  13373.  c   actually set new control word
  13374.        call lcwrqq(cw)
  13375.        return
  13376.  
  13377.  
  13378.  360. Minimal Support for Writing DLLs in FORTRAN 4.10
  13379.  
  13380.  Product Version(s): 4.10   | 4.10
  13381.  Operating System:   MS-DOS | OS/2
  13382.  Flags: ENDUSER |
  13383.  Last Modified: 21-JUL-1988    ArticleIdent: Q32144
  13384.  
  13385.     FORTRAN Version 4.10 should not be used to write Dynamic Link
  13386.  Libraries (DLL) for OS/2.
  13387.  
  13388.     Writing Dynamic Link Libraries in FORTRAN Version 4.10 is not
  13389.  feasible. Although it is possible to write a DLL using FORTRAN Version
  13390.  4.10, it may not be very useful: you cannot call any FORTRAN library
  13391.  routines. This includes the following restrictions:
  13392.  
  13393.     1. No floating point math
  13394.     2. Very little INTEGER*4 math
  13395.     3. No I/O
  13396.     4. No character operations except assignments
  13397.     5. No $DEBUG metacommand support for extended run-time error
  13398.        information
  13399.  
  13400.     A FORTRAN Version 4.10 DLL should be code only, no data, and no
  13401.  data or stack segment. The .DEF (module definition) file for the
  13402.  FORTRAN DLL should have the "NODATA" statement within it. This
  13403.  restriction requires that the process calling the DLL have MS-FORTRAN
  13404.  compatible initialization code for setting up a stack and data segment
  13405.  that the DLL could use, such as the initialization code produced from
  13406.  a main program module in Microsoft C, MS-FORTRAN, or MS-Pascal.
  13407.     Routines in a FORTRAN DLL should be able to receive arguments from
  13408.  the calling process by means of the formal parameters for the DLL
  13409.  routines. FORTRAN passes arguments by reference (by default);
  13410.  therefore, the DLL could modify the content of the arguments as long
  13411.  as the above restrictions are followed.
  13412.  
  13413.  
  13414.  361. Huge Addressing under OS/2
  13415.  
  13416.  Product Version(s): 4.10   | 4.10
  13417.  Operating System:   MS-DOS | OS/2
  13418.  Flags: ENDUSER |
  13419.  Last Modified: 20-OCT-1988    ArticleIdent: Q32206
  13420.  
  13421.  When a huge array is allocated space, OS/2 allocates segments from the
  13422.  Segment Selector Table in increments of n+0i, n+1i, n+2i, etc., where
  13423.  "n" is the starting selector and "i" is the incremental value. The
  13424.  value of "i" must be determined at load time for different versions of
  13425.  the OS/2 and for different configurations of the similar versions. The
  13426.  way that huge addressing is performed under OS/2 is identical to the
  13427.  way in which DOS accesses huge addresses. However, under DOS, "i" is
  13428.  always 4,096.
  13429.  
  13430.  Below is an example of how to obtain the value of "i" in a FORTRAN
  13431.  program. The value of "i" is 2 raised to the power returned by
  13432.  DosGetHugeShift. This information is discussed in detail in the
  13433.  Microsoft Press book "Inside OS/2" by Gordon Letwin, Section 9.2.2.
  13434.  
  13435.  The following example shows how to obtain the value of "i" in a
  13436.  FORTRAN program:
  13437.  
  13438.         INTERFACE TO INTEGER*2 FUNCTION DosGetHugeShift
  13439.        + [ALIAS: 'DOSGETHUGESHIFT'] (SHIFT)
  13440.         INTEGER*2 SHIFT
  13441.         END
  13442.         INTEGER*2 SHIFT,DosGetHugeShift
  13443.         INTEGER*2 I
  13444.         I = DosGetHugeShift(SHIFT)
  13445.         PRINT *,'DosGetHugeShift = ',SHIFT
  13446.         PRINT *,'i = ',(2**SHIFT)
  13447.         STOP
  13448.         END
  13449.  
  13450.  
  13451.  362. Protection Violation When Compiled with Defaults under OS/2
  13452.  
  13453.  Product Version(s): 4.10
  13454.  Operating System:   MS-DOS
  13455.  Flags: ENDUSER | buglist4.10 fixlist5.00
  13456.  Last Modified: 16-JUN-1989    ArticleIdent: Q32227
  13457.  
  13458.  The program below generates a protection violation when compiled with
  13459.  the defaults under OS/2. When compiling under DOS, the program either
  13460.  hangs the compiler or generates code that does not function properly.
  13461.  The error occurs only when the statement labeled 6 is in the program.
  13462.  
  13463.  The workaround for this problem is to compile the program with the
  13464.  /Odclt option; this causes the compiler to enforce alias checking
  13465.  during optimization.
  13466.  
  13467.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  13468.  FORTRAN compiler. This problem was corrected in Version 5.00.
  13469.  
  13470.  The program is as follows:
  13471.  
  13472.  $STORAGE:2
  13473.  $NOFLOATCALLS
  13474.        COMPLEX F
  13475.        DIMENSION NUMBER(7),F(8192)
  13476.        N=16
  13477.        NROOT=4
  13478.        NRTWO=NROOT+NROOT
  13479.        NRQRT=NROOT/4
  13480.  5     CALL FFTO(F,N)
  13481.        NUMBER(3)=NUMBER(3)+N
  13482.  6     IF (NUMBER(3).LE.4096) GO TO 5
  13483.        WRITE(*,'(5H   T=,i3)')KLOCK()-K
  13484.        WRITE(*,'(8F9.4)')(F(I),I=N-NRTWO+1,N,NRQRT)
  13485.        WRITE(*,'(8F9.4)')(F(I),I=1,NRTWO,NRQRT)
  13486.        STOP
  13487.        END
  13488.  
  13489.  
  13490.  363. FORTRAN: Setting /link Options with FL Environment Variable
  13491.  
  13492.  Product Version(s): 4.10   | 4.10
  13493.  Operating System:   MS-DOS | OS/2
  13494.  Flags: ENDUSER | buglist4.10 docerr
  13495.  Last Modified: 16-JUN-1989    ArticleIdent: Q32245
  13496.  
  13497.  Page 12 of the "Microsoft FORTRAN Optimizing Compiler Version 4.1
  13498.  Update" states that /link options can be specified with the FL
  13499.  environment variable. However, setting any /link options with the FL
  13500.  environment variable will cause the compiler to cease compiling with
  13501.  the following command line error:
  13502.  
  13503.     Command line error D2003 : missing source file name
  13504.  
  13505.  This problem is caused by the compiler reading the /link option before
  13506.  it has read the source filename. The identical error will occur if the
  13507.  /link option is given at the FL command before the source file, as in
  13508.  the following example:
  13509.  
  13510.     FL /link /INFO source.for
  13511.  
  13512.  
  13513.  364. The FORTRAN Substitute for C-Style Pointers (DOS and OS/2)
  13514.  
  13515.  Product Version(s): 4.10   | 4.10
  13516.  Operating System:   MS-DOS | OS/2
  13517.  Flags: ENDUSER |
  13518.  Last Modified: 21-JUL-1988    ArticleIdent: Q32253
  13519.  
  13520.     This article applies to both MS-DOS and MS OS/2 FORTRAN.
  13521.     On many computer systems, advanced FORTRAN programmers have been
  13522.  able to get around the lack of C-style pointers by using the intrinsic
  13523.  function LOC to get the address of variables and then calculating the
  13524.  out-of-bounds index to an array variable that will access the value of
  13525.  another variable. When this is attempted in Microsoft FORTRAN, some
  13526.  problems occur that are not traditionally a problem for FORTRAN
  13527.  programmers.
  13528.  
  13529.     The idea is to access the value of a variable by indexing outside
  13530.  the bounds of an auxiliary array. This is the FORTRAN kludge that
  13531.  substitutes for C-style pointers, which FORTRAN does not have. The
  13532.  following program fragment illustrates the method for NON-HUGE
  13533.  addressing:
  13534.  
  13535.           INTEGER*2 BASE(1),VAL1,VAL2
  13536.           INTEGER*4 VAL1_PTR,VAL2_PTR
  13537.            ...
  13538.           VAL1_PTR=(LOC(VAL1)-LOC(BASE))/2+1
  13539.           VAL2_PTR=(LOC(VAL2)-LOC(BASE))/2+1
  13540.            ...
  13541.  C                         These should match.   These should match.
  13542.           WRITE(*,*) VAL1, BASE(VAL1_PTR), VAL2, BASE(VAL2_PTR)
  13543.  
  13544.     For this method to work, the array must be allocated at a lower
  13545.  address than the variables to be referenced, and the type of the array
  13546.  must be the same as that of the variable accessed. Also, because the
  13547.  "pointer" we create is really an element index rather than a byte
  13548.  pointer, the array and the variable accessed must be aligned so that
  13549.  the distance in bytes between the beginning of the auxiliary array and
  13550.  the beginning of the variable accessed is divisible by the size of the
  13551.  value in bytes.
  13552.     This is not a problem for INTEGER*2s, because they are
  13553.  automatically aligned, or for any 1-byte types. But for 4-byte
  13554.  integers, for reals, and for character types other than CHARACTER*1,
  13555.  steps must be taken to enforce alignment, e.g. by using equivalence or
  13556.  common statements.
  13557.     Another problem occurs when the difference between the byte
  13558.  addresses of the variable and the base array is greater than 65536
  13559.  bytes. This causes the following problems:
  13560.  
  13561.     1. The base array must be accessed using huge indexing.
  13562.     2. The LOC function returns a standard DOS far pointer, which is
  13563.        not a linear address.
  13564.  
  13565.     LOC returns a double-word value: the high word contains the segment
  13566.  number and the low word contains the byte offset within the segment.
  13567.  Under DOS, the segment selector offset is 12 bits. Therefore, to get a
  13568.  linear address you have to shift the high word to the right 12 bits
  13569.  and add it to the low word. Under OS/2, the segment selector offset is
  13570.  variable and a call to the OS/2 system call DosGetHugeShift is
  13571.  necessary. To get a linear address you have to shift the high word to
  13572.  the right by HI_SHIFT bits and add it to the low word.
  13573.     The following code fragment is an example of how to calculate the
  13574.  linear HUGE address of the variable ABC:
  13575.  
  13576.        INTERFACE TO INTEGER*2 FUNCTION DosGetHugeShift
  13577.       + [ALIAS: 'DOSGETHUGESHIFT'] (HI_SHIFT)
  13578.        INTEGER*2 HI_SHIFT
  13579.        END
  13580.  C     ...
  13581.        INTEGER HI_SHIFT,LOC_ABC*4
  13582.  C  For DOS, HI_SHIFT would always be set to 12
  13583.        INTEGER*2 HI_SHIFT,DosGetHugeShift
  13584.        INTEGER*2 I
  13585.  C     ...
  13586.        I = DosGetHugeShift(HI_SHIFT)
  13587.        IF (I.NE.0) WRITE (*,*) 'Error getting Huge Shift'
  13588.        LOC_ABC=ISHFT(IAND(LOC(ABC),#FFFF0000),-HI_SHIFT) +
  13589.       +              IAND(LOC(ABC),#0000FFFF)
  13590.  C     ...
  13591.        END
  13592.  
  13593.  
  13594.  365. M Editor Converts Spaces to Tabs, Columns 73-80 Not Ignored
  13595.  
  13596.  Product Version(s): 4.10   | 4.10
  13597.  Operating System:   MS-DOS | OS/2
  13598.  Flags: ENDUSER |
  13599.  Last Modified:  6-OCT-1988    ArticleIdent: Q32323
  13600.  
  13601.  The ANSI standard for FORTRAN specifies that columns 73-80 are to be
  13602.  ignored by the compiler. The M editor, using the default settings,
  13603.  takes every eight spaces and converts them into a tab character to
  13604.  save file space. This process causes problems for the compiler because
  13605.  it does not convert these tabs back into spaces.
  13606.  
  13607.  Therefore, even if you press the SPACEBAR to move to Columns 73-80,
  13608.  the compiler will read this as Column 9 because 72 spaces are
  13609.  converted to nine tabs, with eight spaces per tab. If you set ENTAB:0
  13610.  in your TOOLS.INI file, the M Editor will not convert spaces to tabs
  13611.  and the files will be suitable to FORTRAN.
  13612.  
  13613.  
  13614.  366. Error F2600: "Function Directly Recursive" Not Documented
  13615.  
  13616.  Product Version(s): 4.00 4.01 4.10 | 4.10
  13617.  Operating System:   MS-DOS         | OS/2
  13618.  Flags: ENDUSER | docerr
  13619.  Last Modified:  7-JUL-1988    ArticleIdent: Q32344
  13620.  
  13621.     The FORTRAN compile-time error F2600 is not documented in the
  13622.  manuals or README.DOC files. The text of the error is "Function
  13623.  Directly Recursive." Recursive functions are not allowed in Microsoft
  13624.  FORTRAN, as documented on Page 218, second paragraph, of the
  13625.  "Microsoft FORTRAN Optimizing Compiler Language Reference" for
  13626.  Versions 4.00, 4.01, 4.10.
  13627.  
  13628.  
  13629.  367. PC and XT Floating Point Exceptions for C and FORTRAN
  13630.  
  13631.  Product Version(s): 4.10
  13632.  Operating System:   MS-DOS
  13633.  Flags: ENDUSER | buglist4.10 fixlist5.00 H_Fortran
  13634.  Last Modified: 30-MAR-1990    ArticleIdent: Q32385
  13635.  
  13636.  When equipped with coprocessors, certain 8086 machines (IBM, Compaq,
  13637.  and clones) have exhibited floating-point exceptions. These
  13638.  exceptions, identified by error messages M6111 "Stack underflow" and
  13639.  M6101 "Invalid" are never supposed to occur with code generated by
  13640.  Microsoft compilers, as discussed on Page 284 of the "Microsoft C 5.1
  13641.  Optimizing Compiler User's Guide" and Page 448 of the "Microsoft
  13642.  FORTRAN 4.1 Optimizing Compiler User's Guide."
  13643.  
  13644.  This problem apparently occurs because the 8087 requires the 8086 to
  13645.  issue an FWAIT instruction prior to a coprocessor instruction. Also, a
  13646.  potential cause is that the BIOS does not meet specifications.
  13647.  
  13648.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  13649.  FORTRAN compiler. The FWAIT problem was corrected in Version 5.00.
  13650.  
  13651.  An application note called FPFIX corrects the FWAIT problem. This
  13652.  application note is available from Microsoft Product Support Services
  13653.  by calling (206) 454-2030. BIOS upgrades should be considered as well.
  13654.  
  13655.  This information also applies to Microsoft C 5.10.
  13656.  
  13657.  The following information describes some of the problems inherent to
  13658.  the generation of floating-point exceptions M6101, M6108, M6110, and
  13659.  M6111. The errors M6101 and M6111 are of particular concern because
  13660.  the others offer alternate explanations, such as "too complex an
  13661.  expression."
  13662.  
  13663.  In the course of processing floating-point numbers, the 8087
  13664.  coprocessor runs into processing exceptions, for which INTEL has
  13665.  provided a variety of solutions. One solution is to mask the exception
  13666.  from your software. For a precise definition of masked, see the INTEL
  13667.  iAPX86/88.
  13668.  
  13669.  The other solution is to unmask the exception so an interrupt is
  13670.  issued and a software interrupt handler is invoked to deal with the
  13671.  exception. Microsoft prefers this solution. The basic architecture of
  13672.  the exception handling situation is as follows:
  13673.  
  13674.          _______                _______                 _______
  13675.         |       |     INTX     |       |       IR      |       |
  13676.         | 8086/8| <----------- | 8259A |  <----------- | 8087  |<--
  13677.         |_______|       2      |_______|        1      |_______|  |
  13678.             |                                      --->|_______|  |
  13679.             |                                      |              |
  13680.             |                                      |              |
  13681.        INTY | 3       _______                      |              |
  13682.             |        |       |                     |              |
  13683.             |        | bios  |----------------------              |
  13684.             |        |_______|                                  4 |
  13685.             |       _______________________________________       |
  13686.             |      |                                       |      |
  13687.             -----> |       MS INTERRUPT HANDLER            |------
  13688.                    |_______________________________________|
  13689.  
  13690.  Upon experiencing an exception, the 8087 issues an interrupt request
  13691.  (IR), which in the case of the 86/88, is fielded by the 8259A, the
  13692.  Programmable Interrupt Controller. In the 286 configuration, there are
  13693.  two 8259As (see Page 417 of the "MS-DOS Encyclopedia"). The 8259A then
  13694.  issues a hardware interrupt (INTX), which is received by the CPU. The
  13695.  CPU then issues a software interrupt (INTY), which is fielded by our
  13696.  interrupt handler.
  13697.  
  13698.  The interrupt handler clears the status flags and restarts the
  13699.  process. It appears this problem occurs because of the FWAIT
  13700.  instruction's omission. Another potential cause of the problem is the
  13701.  the BIOS version.
  13702.  
  13703.  The BIOs reportedly generating this problem is as follows:
  13704.  
  13705.     phoenix 1.46
  13706.  
  13707.  To diagnose a Compaq AT, run the Norton SI utility. If the date is
  13708.  4/85 or earlier, the BIOS most likely is faulty.
  13709.  
  13710.  The following machines reportedly cause these problems:
  13711.  
  13712.     IBM PC upgraded to a hard-disk configuration
  13713.  
  13714.     IBM XT with 3.5-inch drive
  13715.  
  13716.     ITT XL
  13717.  
  13718.     Compaq portable
  13719.  
  13720.     Compaq AT (prior to 4/85)
  13721.  
  13722.     The following references were used to prepare this information:
  13723.  
  13724.  1. "INTEL iAPX86/88 Programmers Reference Manual," Pages 6-18
  13725.  
  13726.  2. "INTEL iAPX86/88 Users Manual Hardware Reference," Section 3
  13727.  
  13728.  3. "INTEL 80286 and 80287 Programmers Reference Overview of
  13729.     Numeric Processing"
  13730.  
  13731.  4. "Microsoft C 5.1 Optimizing Compiler User's Guide"
  13732.  
  13733.  5. "Microsoft FORTRAN 4.1 Optimizing Compiler User's Guide"
  13734.  
  13735.  
  13736.  368. Internal Compiler Error: srclist.c 1.58 Line 1367
  13737.  
  13738.  Product Version(s): 4.10   | 4.10
  13739.  Operating System:   MS-DOS | OS/2
  13740.  Flags: ENDUSER | buglist4.10 fixlist5.00
  13741.  Last Modified:  8-NOV-1989    ArticleIdent: Q32118
  13742.  
  13743.  Using the $SUBTITLE metacommand with the NULL set as an argument, and
  13744.  compiling with the /Fs switch, will generate the following fatal error:
  13745.  
  13746.     fatal error F1001: Internal Compiler Error
  13747.     (compiler file '@(#)srclist.c:1.58', line 1367)
  13748.     Contact Microsoft Technical Support
  13749.  
  13750.  The following code generates the fatal error above when compiled with
  13751.  the /c and /Fs switches:
  13752.  
  13753.              $TITLE: 'Test Title'
  13754.              $SUBTITLE: ''
  13755.              END
  13756.  
  13757.  To work around this problem, do one of the following:
  13758.  
  13759.  1. Do not use the $SUBTITLE command with the NULL set. If you do not
  13760.     use the $SUBTITLE metacommand, FORTRAN will assign the NULL set to
  13761.     the subtitle set by default; therefore, using this metacommand is
  13762.     unnecessary.
  13763.  
  13764.  2. Do not compile with the /Fs switch. This process will cause the
  13765.     $SUBTITLE metacommand to be ignored.
  13766.  
  13767.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  13768.  FORTRAN compiler. This problem was corrected in Version 5.00.
  13769.  
  13770.  
  13771.  369. Using FORTRAN Version 4.10 SETUP to Build Libraries Only
  13772.  
  13773.  Product Version(s): 4.10   | 4.10
  13774.  Operating System:   MS-DOS | OS/2
  13775.  Flags: ENDUSER |
  13776.  Last Modified:  6-OCT-1988    ArticleIdent: Q32524
  13777.  
  13778.  To build FORTRAN Version 4.10 libraries using the SETUP.EXE
  13779.  program, it is necessary to have previously set up the entire FORTRAN
  13780.  package, either by using the F choice in SETUP's Main menu screen or
  13781.  by copying the necessary files from the distribution disks by hand.
  13782.  
  13783.  Specifically, the LIB.EXE needed by SETUP must already be in your
  13784.  path. In addition, before running SETUP for building additional
  13785.  libraries, it is necessary to set the PATH so that the correct version
  13786.  of the LIB utility can be found by SETUP. Without this step, the
  13787.  message "error trying to run library manager" appears, and you are
  13788.  then returned to the SETUP Main menu.
  13789.  
  13790.  The Main menu gives the following choice, among the three choices
  13791.  presented:
  13792.  
  13793.  "To build a new library, press L. Do not try to build a new library
  13794.  unless you have already set up Microsoft FORTRAN."
  13795.  
  13796.  This message does not explain the necessity of having previously set a
  13797.  path to the LIB.EXE utility.
  13798.  
  13799.  
  13800.  370. Passing a FORTRAN Common Block to C
  13801.  
  13802.  Product Version(s): 4.00 4.01 | 4.10
  13803.  Operating System:   MS-DOS    | OS/2
  13804.  Flags: ENDUSER | s_c
  13805.  Last Modified: 12-JUL-1988    ArticleIdent: Q32665
  13806.  
  13807.     The following example demonstrates how to pass COMMON variables
  13808.  from FORTRAN to C. Make sure the memory models are consistent because
  13809.  FORTRAN and C have different defaults.
  13810.  
  13811.  FORTRAN PROGRAM
  13812.  
  13813.        INTERFACE TO SUBROUTINE CFUNC[C,ALIAS:'_cfunc']
  13814.        END
  13815.        INTEGER*2 A
  13816.        REAL*4 B
  13817.        CHARACTER*12 C
  13818.        COMMON /ABC[C,ALIAS:'_PTR']/ A, B, C
  13819.  
  13820.        A = 1
  13821.        B = 2.5
  13822.        C = 'HELLO WORLD' C
  13823.        CALL CFUNC()
  13824.        END
  13825.  
  13826.  C ROUTINE
  13827.  
  13828.  #include <stdio.h>
  13829.  
  13830.  void cfunc(void);      /* Function prototype                    */
  13831.  
  13832.  extern struct common_block
  13833.         {               /* structure that looks like the FORTRAN */
  13834.         int a;          /* common block                          */
  13835.         float b;
  13836.         char c[12];
  13837.         } PTR;
  13838.  
  13839.  void cfunc()
  13840.  {
  13841.  printf( "Element a = %d\n", PTR.a );
  13842.  printf( "Element b = %f\n", PTR.b );
  13843.  printf( "Element c = %s\n", PTR.c );
  13844.  }
  13845.  
  13846.  OUTPUT
  13847.  
  13848.  Element a = 1
  13849.  Element b = 2.500000
  13850.  Element c = HELLO WORLD
  13851.  
  13852.  
  13853.  371. Page Update-19 Refers to "Programmer's Guide"
  13854.  
  13855.  Product Version(s): 4.10   | 4.10
  13856.  Operating System:   MS-DOS | OS/2
  13857.  Flags: ENDUSER | docerr
  13858.  Last Modified: 21-JUL-1988    ArticleIdent: Q32745
  13859.  
  13860.     Page Update-19 of the "Microsoft FORTRAN 4.10 Optimizing Compiler"
  13861.  manual, in the section marked "Update (FORTRAN 4.1)", refers to a
  13862.  manual titled "Microsoft Operating System/2 Programmer's Guide." This
  13863.  manual is not part of the FORTRAN Version 4.10 package.
  13864.     Manuals titled "Programmer's Reference" and "Programmer's Learning
  13865.  Guide" are provided with the Microsoft Operating System/2 Programmer's
  13866.  Toolkit.
  13867.  
  13868.  
  13869.  
  13870.  372. Redirected Input Incorrect after Error
  13871.  
  13872.  Product Version(s): 4.10   | 4.10
  13873.  Operating System:   MS-DOS | OS/2
  13874.  Flags: ENDUSER |
  13875.  Last Modified: 25-JUL-1988    ArticleIdent: Q33103
  13876.  
  13877.     The following program will work correctly when taking input from
  13878.  the console. However, when the input is redirected to take input from
  13879.  a file, it incorrectly rewinds to the beginning of the file if an
  13880.  error occurs.
  13881.     To work around this problem, open the input file and read from that
  13882.  unit, rather than reading from a redirected Standard Out.
  13883.  
  13884.     The error occurs when redirecting input (TEST < TEST.INP) from a
  13885.  file to the TEST.EXE program.
  13886.     The following is a sample code:
  13887.  
  13888.    character*40 line
  13889.        real  z
  13890.  10    continue
  13891.        read (*,*, err=30) z
  13892.        write(*,*) 'z = ', z
  13893.        goto 10
  13894.  
  13895.  30    read(*,'(a)') line
  13896.        write(*,*) line
  13897.  
  13898.        stop
  13899.        end
  13900.  
  13901.     The TEST.INP input file for the TEST.EXE program is as follows:
  13902.  
  13903.  1.0 this is first
  13904.  2.0
  13905.  3.0
  13906.  s
  13907.  5.0 this should print
  13908.  6.0
  13909.  
  13910.  
  13911.  
  13912.  373. /4Yb ($DEBUG) Not Checking for Integer Overflow in FORTRAN 4.1
  13913.  
  13914.  Product Version(s): 4.10 5.00  | 4.10 5.00
  13915.  Operating System:   MS-DOS     | OS/2
  13916.  Flags: ENDUSER | buglist4.10 fixlist5.00
  13917.  Last Modified:  7-NOV-1989    ArticleIdent: Q33107
  13918.  
  13919.  When compiled with the /4Yb option (or $DEBUG), the program below will
  13920.  not check for integer overflow, as stated in the manual.
  13921.  
  13922.  Microsoft has confirmed this to be a problem in Version 4.10. This
  13923.  problem was corrected in Version 5.00.
  13924.  
  13925.  To work around this problem, use a temporary variable instead of "k";
  13926.  replace "k = j * k" with "l = j * k". This process enforces the
  13927.  overflow checking.
  13928.  
  13929.  The following is a sample program:
  13930.  
  13931.  $DEBUG
  13932.        integer*2 i,j,k
  13933.        k = 1
  13934.        j = 2
  13935.  10    k = j * k
  13936.        write (*,*) k
  13937.        goto 10
  13938.        stop
  13939.        end
  13940.  
  13941.  
  13942.  374. Incorrect Code Generation in FORTRAN 4.10
  13943.  
  13944.  Product Version(s): 4.10 5.00 | 4.10 5.00
  13945.  Operating System:   MS-DOS    | OS/2
  13946.  Flags: ENDUSER | buglist4.10 fixlist5.00
  13947.  Last Modified:  7-NOV-1989    ArticleIdent: Q33109
  13948.  
  13949.  The FORTRAN Version 4.10 compiler seems to be generating some
  13950.  incorrect code in the following particular loop:
  13951.  
  13952.        INTEGER*2 A(3)
  13953.  10    READ(*,100,ERR=200) A(1)
  13954.  100   FORMAT(3I2)
  13955.        STOP
  13956.  200   GOTO 10
  13957.        END
  13958.  
  13959.  The program executes properly when an integer is entered; however,
  13960.  if a character or a number of characters (garbage) is entered, the
  13961.  error routine is called and the program goes back to the READ
  13962.  statement but falls. This problem causes an infinite loop at that
  13963.  point, jumping from 10 to 200 and back again, hanging the machine.
  13964.  
  13965.  By inserting a PRINT statement before the READ statement outside of
  13966.  the loop, the program will execute correctly. For example, place the
  13967.  following code line just before the READ statement:
  13968.  
  13969.        PRINT *,"HI THERE"
  13970.  
  13971.  Microsoft has confirmed this to be a problem in Version 4.10.
  13972.  This problem was corrected in Version 5.00.
  13973.  
  13974.  
  13975.  375. How to Combine Segments in DGROUP Part 2
  13976.  
  13977.  Product Version(s): 4.10   | 4.10
  13978.  Operating System:   MS-DOS | OS/2
  13979.  Flags: ENDUSER | docerr S_QUICKC S_C S_PASCAL h_masm B_BBASIC B_QUICKBAS
  13980.  Last Modified: 30-SEP-1988    ArticleIdent: Q33114
  13981.  
  13982.  On Page 93 of the "Microsoft Mixed-Language Programming Guide" (and
  13983.  Page 307 of the "Microsoft QuickC Programmer's Guide" for Versions
  13984.  1.00 and 1.01 and Page 334 of the "Microsoft QuickBASIC 4.0 Learning
  13985.  and Using Microsoft QuickBASIC" manual), in the section describing how
  13986.  to combine segments in DGROUP part 2, the declaration is incorrect.
  13987.  
  13988.  The text incorrectly states the following:
  13989.  
  13990.  GROUP    DGROUP  _DATA _BSS
  13991.  
  13992.  The declaration should be as follows:
  13993.  
  13994.  DGROUP   GROUP   CONST, _BSS, _DATA
  13995.  
  13996.  Without this correction, assembling under Macro Assembler Versions
  13997.  5.00 or 5.10 will generate the "A2105: Expected: instruction,
  13998.  directive, or label" error. Under Macro Assembler Version 4.00, the
  13999.  assembly code generates the "error 10: Syntax error."
  14000.  
  14001.  
  14002.  376. Loop Optimization Problem in FORTRAN 4.10
  14003.  
  14004.  Product Version(s): 4.10 5.00  | 4.10 5.00
  14005.  Operating System:   MS-DOS | OS/2
  14006.  Flags: ENDUSER | buglist4.10 fixlist5.00
  14007.  Last Modified:  7-NOV-1989    ArticleIdent: Q33118
  14008.  
  14009.  K does not get set to two with loop optimization on.
  14010.  
  14011.  To work around this problem, compile with /Odct.
  14012.  
  14013.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  14014.  FORTRAN compiler. This problem was corrected in Version 5.00.
  14015.  
  14016.  The following is a sample program:
  14017.  
  14018.  $STORAGE:2
  14019.        PROGRAM F77BUG
  14020.        DIMENSION  II(7),IJ(7),IP(7),NJ(3),NE(3)
  14021.        DATA II/0,1,2,2,3,4,5/,IJ/1,2,3,4,5,5,6/,IP/3,3,3,15,3,3,28/
  14022.        DATA NJ/3*1/,NE/1,0,0/
  14023.        IU37 = 37
  14024.        OPEN(IU37,FILE='XXX.LIS',STATUS='UNKNOWN')
  14025.        ME = 1
  14026.        NA = 7
  14027.  CC     ORIGINAL PROGRAM CODE
  14028.        ISQ = 0
  14029.    400 continue
  14030.        MP = 32001
  14031.        K  = 1
  14032.        J  = NE(K)
  14033.        DO 440 I = K,ME
  14034.    440 continue
  14035.        NE(I) = NE(I+1)
  14036.        ME = ME - 1
  14037.        ISQ = ISQ + 1
  14038.        IP(J) = ISQ
  14039.        L = IJ(J)
  14040.        NJ(L) = NJ(L) - 1
  14041.        WRITE (IU37,441) K,ME,J,ISQ,L,NJ(L)
  14042.    441 FORMAT(' AFTER 440 ',6I6)
  14043.        IF(NJ(L))450,450,400
  14044.    450 continue
  14045.        I = 0
  14046.        J = NA + 1
  14047.    500 continue
  14048.        K = (I + J) / 2
  14049.        WRITE (IU37,501) I,J,K,L,II(K),NA
  14050.    501 FORMAT( ' 500 I,J,K,L II(K),NA',6I6)
  14051.        IF(J - I  - 1)400,400,460
  14052.    460 WRITE (IU37,*) ' 460   L K II(K) ',L,K,II(K)
  14053.        IF(L - II(K))470,490,480
  14054.    470 continue
  14055.        J = K
  14056.        GO TO 500
  14057.    480 continue
  14058.        I = K
  14059.        GO TO 500
  14060.    490 WRITE (IU37,*) ' 490 NOTE!!!! K VALUE IS 1 . K L ',  K ,L
  14061.        WRITE (IU37,*) ' IN LINE ABOVE K = 2      !! '
  14062.        WRITE (IU37,*) ' F77 MODIFIED K FROM 2 TO 1 !! '
  14063.        IF(K - 1)510,510,520
  14064.    520 IF(L - II(K-1))510,530,510
  14065.    530 continue
  14066.        K = K - 1
  14067.        GO TO 490
  14068.  CC REPLACED TO AVOID LOOP
  14069.  C 510 IF(L - II(K))400,540,400
  14070.    540 IF(K - NA)550,550,400
  14071.    550 continue
  14072.  9      ME = ME + 1
  14073.        NE(ME) = K
  14074.        K = K + 1
  14075.        WRITE (IU37,551) K,L,II(K),ME
  14076.    551 FORMAT( ' 550 K,L,II(K),ME',5I6)
  14077.        GO TO 510
  14078.    510 CONTINUE
  14079.   1100 END
  14080.  
  14081.  
  14082.  377. FORTRAN: F2124: Code Generation Error
  14083.  
  14084.  Product Version(s): 4.01 4.10 | 4.10
  14085.  Operating System:   MS-DOS    | OS/2
  14086.  Flags: ENDUSER | buglist4.01 buglist4.10 fixlist5.00
  14087.  Last Modified: 16-JUN-1989    ArticleIdent: Q33267
  14088.  
  14089.  The following program will cause a "code generation error" when
  14090.  compiled with /Od or /4Yb:
  14091.  
  14092.        real k3
  14093.        y = 2 * k3 + 2 * k6
  14094.        return
  14095.        end
  14096.  
  14097.  The following error is generated:
  14098.  
  14099.     flew.for(2) : error F2124: Code Generation Error
  14100.                  Contact Microsoft Technical Support
  14101.  
  14102.  Microsoft has confirmed this to be a problem in Versions 4.01 and
  14103.  4.10. This problem was corrected in Version 5.00.
  14104.  
  14105.  To work around this problem, break up the expression into separate
  14106.  expressions, one for the real variable k3 and one for the integer
  14107.  variable k6, and then combine the two expressions. The integer
  14108.  variable k6 could also be converted to a REAL, as follows:
  14109.  
  14110.     y = 2 * k3 + 2 * REAL (k6)
  14111.  
  14112.  
  14113.  378. FORTRAN Version 4.10 and C Compatibilty
  14114.  
  14115.  Product Version(s): 4.10   | 4.10
  14116.  Operating System:   MS-DOS | OS/2
  14117.  Flags: ENDUSER |
  14118.  Last Modified: 25-JUL-1988    ArticleIdent: Q33297
  14119.  
  14120.     When setting up FORTRAN Version 4.10, and you are asked whether to
  14121.  include C compatibility, consider that this option only will work
  14122.  correctly with C Version 5.00 or later.
  14123.     If you use C Version 4.00 and a FORTRAN library built with C
  14124.  compatibility, you will receive the "L2029 : Unresolved External
  14125.  __wrt2err" error.
  14126.     To work around this problem, build the FORTRAN libraries without C
  14127.  compatibility and use the /NOE switch at link time.
  14128.  
  14129.  
  14130.  
  14131.  379. Accessing Command-Line Arguments
  14132.  
  14133.  Product Version(s): 4.00 4.01 4.10 | 4.10
  14134.  Operating System:   MS-DOS         | 4.10
  14135.  Flags: ENDUSER | appnote
  14136.  Last Modified:  7-NOV-1988    ArticleIdent: Q33307
  14137.  
  14138.  An application note called "Version 4.x Accessing Command Line," which
  14139.  explains how to access the command line arguments under FORTRAN
  14140.  Versions 4.00, 4.01, and 4.10, is available from Microsoft Product
  14141.  Support Services by calling (206) 454-2030.
  14142.  
  14143.  The application note contains two files that must be compiled and
  14144.  linked with the your main program. Also included is an example
  14145.  program, which when compiled and linked with the other two files will
  14146.  demonstrate how a FORTRAN program can access the command line
  14147.  arguments.
  14148.  
  14149.  The following is a list of the files that make up the application note
  14150.  and a short description:
  14151.  
  14152.     CMDLIN.FOR   This routine returns the current command line
  14153.                  and its length.
  14154.  
  14155.     DREF.FOR     This routine is called from subroutine
  14156.                  CMDLIN and serves to "de-reference" the
  14157.                  arguments "CMDIN" and "NIN," which are sent
  14158.                  to this routine as addresses passed by value
  14159.                  (courtesy of the INTERFACE statement in subroutine
  14160.                  CMDLIN).
  14161.  
  14162.     TSTCMD.FOR   This routine tests subroutine CMDLIN, which
  14163.                  returns the current command line and its
  14164.                  length.
  14165.  
  14166.  The three provided routines may be compiled by the following FL
  14167.  command:
  14168.  
  14169.      FL TSTCMD.FOR DREF.FOR CMDLIN.FOR
  14170.  
  14171.  
  14172.  380. FORTRAN Gives "Error F2115: Syntax Error"
  14173.  
  14174.  Product Version(s): 4.01 4.10 | 4.10
  14175.  Operating System:   MS-DOS    | OS/2
  14176.  Flags: ENDUSER | buglist4.01 buglist4.10 fixlist5.00
  14177.  Last Modified: 16-JUN-1989    ArticleIdent: Q33308
  14178.  
  14179.  Page 296 of the "Microsoft FORTRAN 4.1 Optimizing Compiler Language
  14180.  Reference Mixed-Language Programming Guide" (Section 6.2.5) states
  14181.  that the $FREEFORM metacommand (or the /4Yf switch) is a specifier
  14182.  that tells the compiler that the source file is in the free-form
  14183.  format.
  14184.  
  14185.  In free-form FORTRAN programs, statement line numbers may start on a
  14186.  column other than column 1. Versions 4.01 and 4.10 of the compiler
  14187.  both generate "error F2115: syntax error."
  14188.  
  14189.  Microsoft has confirmed this to be a problem in Versions 4.01 and
  14190.  4.10 of the Microsoft FORTRAN Optimizing Compiler. This problem was
  14191.  corrected in Version 5.00.
  14192.  
  14193.  To work around this problem, make sure all the labels start in the
  14194.  first column.
  14195.  
  14196.  The following sample code demonstrates the problem:
  14197.  
  14198.  $FREEFORM
  14199.  write (*,1)
  14200.  1           format( 1x, 'Label on column 1 is OK' )
  14201.  
  14202.   write (*,2)
  14203.   2          format( 1x, 'Gives error F2115: syntax error' )
  14204.  
  14205.  end
  14206.  
  14207.  
  14208.  381. FORTRAN: Common Subexpression Optimizer Fails in 4.10, 5.00
  14209.  
  14210.  Product Version(s): 4.10 5.00   | 4.10 5.00
  14211.  Operating System:   MS-DOS      | OS/2
  14212.  Flags: ENDUSER | buglist4.10 buglist5.00
  14213.  Last Modified:  6-NOV-1989    ArticleIdent: Q33309
  14214.  
  14215.  The code below demonstrates a bug in the common subexpression
  14216.  optimizations of Versions 4.10 and 5.00 of the FORTRAN compiler. If
  14217.  you compile this code with the full optimization default, the
  14218.  resulting output for the variable C is incorrect.
  14219.  
  14220.  Microsoft has confirmed this to be a problem in Versions 4.10 and
  14221.  5.00. We are researching this problem and will post new information as
  14222.  it becomes available.
  14223.  
  14224.  To work around this problem, compile the code with /Odlt optimization,
  14225.  or change the line C=X(I) to an equivalent statement, as follows:
  14226.  
  14227.     TEMP = I
  14228.     C = X(TEMP).
  14229.  
  14230.  This problem occurs because the optimizer generates code for the line
  14231.  C=X(I) that reevaluates the division of A and B rather than doing a
  14232.  simple assignment. This process assigns C to 1.0 regardless of the
  14233.  input values of A, B, or X(I).
  14234.  
  14235.  The following is a sample code:
  14236.  
  14237.                real x(10)
  14238.                read(*,*) i,a,b
  14239.  
  14240.                x(i)=a/b
  14241.                a=b
  14242.                c=x(i)
  14243.  
  14244.                write(*,*) c
  14245.                end
  14246.  
  14247.  
  14248.  382. Interfacing between Assembly Language and FORTRAN
  14249.  
  14250.  Product Version(s): 4.00 4.10 | 4.10
  14251.  Operating System:   MS-DOS    | OS/2
  14252.  Flags: ENDUSER | h_masm
  14253.  Last Modified: 18-AUG-1988    ArticleIdent: Q33351
  14254.  
  14255.     When assembler routines are called from FORTRAN, the assembler
  14256.  routine should obey certain rules.
  14257.     The first rule applies if you compile your FORTRAN routine with /Os
  14258.  or /Op. Optimizing your program will cause FORTRAN to use the SI and
  14259.  DI registers extensively. An assembly routine that changes SI and DI
  14260.  is responsible for saving and restoring the registers. The Microsoft
  14261.  FORTRAN Compiler also assumes that the direction flag is always
  14262.  cleared.
  14263.     In assembler, the direction flag can be cleared by using the CLD
  14264.  instruction. As a general rule, the segment registers, DS, SS, and ES
  14265.  should also be preserved.
  14266.     For more information on this topic, see the "Microsoft
  14267.  FORTRAN Optimizing Compiler User's Guide", Chapter 11 "Interfaces with
  14268.  Assembly Language and C," section 11.2.9 "Register Considerations."
  14269.  
  14270.  
  14271.  
  14272.  383. Using C for Carriage Control for FORTRAN OUTTEXT
  14273.  
  14274.  Product Version(s): 5.00   | 5.00
  14275.  Operating System:   MS-DOS | OS/2
  14276.  Flags: ENDUSER |
  14277.  Last Modified: 26-JUL-1990    ArticleIdent: Q63966
  14278.  
  14279.  The OUTTEXT graphics function included with Microsoft FORTRAN version
  14280.  5.00 does not provide any carriage control features. Some carriage
  14281.  control can be added by calling OUTTEXT from a C subroutine and
  14282.  passing a C string to the function. The C string can include some of
  14283.  the escape sequences described on Page 16 of the "Microsoft FORTRAN
  14284.  Reference" manual for version 5.00. The '\n' sequence, for example,
  14285.  will generate a new line.
  14286.  
  14287.  The following code shows an example of passing a string to a C
  14288.  subroutine and using the OUTTEXT function:
  14289.  
  14290.  FORTRAN CODE
  14291.  
  14292.        INTERFACE TO SUBROUTINE outc [C] (cstring)
  14293.        CHARACTER*(*) cstring [REFERENCE]
  14294.        END
  14295.  
  14296.        INCLUDE 'fgraph.fi'
  14297.  
  14298.        PROGRAM out
  14299.  
  14300.        INCLUDE 'fgraph.fd'
  14301.  
  14302.        INTEGER*2 dummy
  14303.        CHARACTER*10 cstring
  14304.  
  14305.        dummy = setvideomode($MAXRESMODE)
  14306.  
  14307.        cstring = 'LINE 1\n' C               ! C string with
  14308.        CALL outc(cstring)                   ! escape sequence
  14309.  
  14310.        cstring = 'LINE 2' C
  14311.        CALL outc(cstring)
  14312.  
  14313.        READ (*,*)
  14314.        dummy = setvideomode($DEFAULTMODE)
  14315.        END
  14316.  
  14317.  C CODE:
  14318.  
  14319.  void outc(char * string)
  14320.  {
  14321.      _outtext(string);
  14322.  }
  14323.  
  14324.  The output produced by this code is as follows:
  14325.  
  14326.  LINE 1
  14327.  LINE 2
  14328.  
  14329.  If OUTTEXT is called from FORTRAN, the C string escape sequence '\n'
  14330.  is not recognized, and a new line is not generated. There is a
  14331.  difference between the way in which OUTTEXT is used and interpreted
  14332.  between the two languages.
  14333.  
  14334.  Not all the C string escape sequences listed in the FORTRAN
  14335.  manual are supported in graphics mode.
  14336.  
  14337.  The sequences that are supported are as follows:
  14338.  
  14339.     \n, \r, \\, \'', \", \xhh, and \ooo
  14340.  
  14341.  The sequences that are not supported are as follows:
  14342.  
  14343.     \a, \b, \f, \t, and \v
  14344.  
  14345.  This program was tested using versions 5.10 and 6.00 of C under DOS
  14346.  and OS/2. To compile and link this program use the following:
  14347.  
  14348.          FL /c out.for
  14349.          CL /c  /AL outc.c
  14350.  
  14351.          (linking under DOS)
  14352.  
  14353.          LINK out outc,,,/nod /noe (flib) (clib) graphics;
  14354.  
  14355.          where:
  14356.                  (flib) is the FORTRAN library,
  14357.                  (clib) is the C library, and
  14358.                  'graphics' is the FORTRAN 5.00 Graphics Library.
  14359.  
  14360.  It is NOT necessary to link with the C Graphics Library. The OUTTEXT
  14361.  function is resolved correctly with the FORTRAN library.
  14362.  
  14363.          (linking under OS/2)
  14364.  
  14365.          LINK out outc,,,/nod /noe (flib) (clib) doscalls
  14366.                  grtextp;
  14367.  
  14368.          where:
  14369.                  'doscalls'is the import library for OS/2 API
  14370.                          calls, and
  14371.                  'grtextp' is the FORTRAN 5.00 OS/2 Graphics
  14372.                          Library.
  14373.  
  14374.  When linking with the C 6.00 libraries, it is possible to get the
  14375.  following errors:
  14376.  
  14377.     ...L2025: STKHQQ : symbol defined more than once
  14378.     ...L2025: __aaltstkovr : symbol defined more than once
  14379.     ...L2025: __chkstk : symbol defined more than once
  14380.  
  14381.  Under DOS this does not affect the program. Under OS/2, however,
  14382.  running the program causes a system error. This can be corrected by
  14383.  removing the CHKSTK module from the FORTRAN library. For more
  14384.  information on this process, query on the words following words:
  14385.  
  14386.     L2025 and CHKSTK.ASM
  14387.  
  14388.  
  14389.  384. Loop Optimization Problem
  14390.  
  14391.  Product Version(s): 4.00 4.01 4.10 | 4.10
  14392.  Operating System:   MS-DOS         | OS/2
  14393.  Flags: ENDUSER | buglist4.10 fixlist5.00
  14394.  Last Modified:  6-NOV-1989    ArticleIdent: Q33480
  14395.  
  14396.  The following program incorrectly executes the loop only once when
  14397.  compiled with loop optimization:
  14398.  
  14399.        PROGRAM TEST
  14400.           INTEGER J(16:30)
  14401.           DO 20 I=16,30
  14402.  20    J(I) = 2**(62-2*I)
  14403.           WRITE (*,'(I11)') J
  14404.           END
  14405.  
  14406.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  14407.  FORTRAN compiler. This problem was corrected in Version 5.00.
  14408.  
  14409.  To work around this problem, either disable the loop optimization or
  14410.  make the following modification to the code:
  14411.  
  14412.  20       J(I) = 2**(62-(2*I))
  14413.  
  14414.  By forcing the desired order of precedence with parentheses, the loop
  14415.  is correctly executed.
  14416.  
  14417.  
  14418.  385. Internal Compiler Error ctypes.c 1.89 Line 1601
  14419.  
  14420.  Product Version(s): 4.10   | 4.10
  14421.  Operating System:   MS-DOS | OS/2
  14422.  Flags: ENDUSER | buglist4.10 fixlist5.00
  14423.  Last Modified:  6-NOV-1989    ArticleIdent: Q33484
  14424.  
  14425.  When compiled with /Od, the code below generates the following error:
  14426.  
  14427.            fatal error F1001: Internal Compiler Error
  14428.                  (compiler file '@(#)ctypes.c:1.89', line 1601)
  14429.                  Contact Microsoft Technical Support
  14430.  
  14431.  Microsoft has confirmed this to be a problem in Version 4.10. This
  14432.  problem was corrected in Version 5.00. The workaround is given below.
  14433.  
  14434.  The following is the code:
  14435.  
  14436.        subroutine feedch()
  14437.  
  14438.        double precision nr, sri, ssg, vgc, zabp, dent1,
  14439.       +                 dent2, dent3
  14440.  
  14441.        IF (NRSW.EQ.1)
  14442.       1 NR=117.4D0-363.D0*SRI+263.7D0*SSG+288.6D0*VGC-69.2D0
  14443.       2    *ZABP*1.D-3+40.6D0*ZABP*ZABP*1.D-6
  14444.  
  14445.        end
  14446.  
  14447.  This error can be avoided by compiling with any optimization other
  14448.  than /Od, or by changing the code to the following:
  14449.  
  14450.        IF (NRSW.EQ.1)
  14451.       1  THEN
  14452.          dent1 = 117.4d0 - (363.d0 * sri)
  14453.          dent2 = (263.7d0 * ssg) + (288.6d0 * vgc)
  14454.          dent3 = (69.2d0 * zabp * 1.d-3) + (40.6d0 * zabp *
  14455.       1         zabp * 1.d-6)
  14456.          nr = dent1 + dent2 - dent3
  14457.          endif
  14458.  
  14459.  
  14460.  386. Linking FORTRAN Version 4.10 with Version 3.3x Modules
  14461.  
  14462.  Product Version(s): 3.20 3.3X 4.00 4.01 4.10
  14463.  Operating System:   MS-DOS
  14464.  Flags: ENDUSER |
  14465.  Last Modified: 13-JAN-1989    ArticleIdent: Q35397
  14466.  
  14467.  I am linking some FORTRAN Version 4.10 object modules with object
  14468.  modules that have been compiled with FORTRAN Version 3.20 or 3.3x. I
  14469.  have built the Version 4.10 libraries with Version 3.30 compatibility
  14470.  and I am linking with compatibility library, FORTRAN.LIB. I always
  14471.  receive the errors below.
  14472.  
  14473.  The solution to this problem is to use the /NOD switch and to
  14474.  link with the FORTRAN.LIB first.
  14475.  
  14476.  The following errors demonstrate the problem:
  14477.  
  14478.  Microsoft (R) Segmented-Executable Linker  Version 5.01.20
  14479.  Copyright (C) Microsoft Corp 1984-1988.  All rights reserved.
  14480.  
  14481.  d:\lib\FORTRAN.LIB(MANV) : error L2025: __fltused : symbol defined more than
  14482.  once
  14483.   pos: 4F38 Record type: 7D04
  14484.  
  14485.  LINK : error L2029: Unresolved externals:
  14486.  
  14487.  __cfltcvt_tab in file(s):
  14488.   d:\lib\LLIBFORE.LIB(..\fltused.ASM)
  14489.  __cfltcvt in file(s):
  14490.   d:\lib\LLIBFORE.LIB(..\fltused.ASM)
  14491.  
  14492.  There were three errors detected.
  14493.  
  14494.  This problem occurs because the linker first tries to resolve all the
  14495.  externals in the .OBJs. It will resolve as many externals as possible
  14496.  from the first library and then try to resolve the functions that the
  14497.  library has. It will then go to the next library and do the same
  14498.  thing. It will not go back to the previous libraries, so the order of
  14499.  the libraries is critical.
  14500.  
  14501.  The following is an example of a proper link line:
  14502.  
  14503.  LINK test1.obj test2.obj,,,fortran.lib llibfore.lib /NOD;
  14504.  
  14505.  For more information on Versions 3.20 or 3.30 compatibility, see
  14506.  section 2.4.6.6 in the "Microsoft FORTRAN Optimizing compiler User's
  14507.  Guide", Page 33.
  14508.  
  14509.  
  14510.  387. Integer Overflow Is Not Flagged for Some Values
  14511.  
  14512.  Product Version(s): 4.10   | 4.10
  14513.  Operating System:   MS-DOS | OS/2
  14514.  Flags: ENDUSER | buglist4.10 fixlist5.00
  14515.  Last Modified:  6-NOV-1989    ArticleIdent: Q33719
  14516.  
  14517.  Version 4.10 of the FORTRAN Compiler does not flag the range
  14518.  2,147,614,720 to 4,295,229,439 as an integer overflow for an INTEGER*4
  14519.  variable. The maximum value for an INTEGER*4 is 2,147,483,647.
  14520.  
  14521.  The sample code below demonstrates this problem. If you enter a number
  14522.  within the above inclusive range, this program returns an erroneous
  14523.  value. If you enter a number that is larger than the largest INTEGER*4
  14524.  value, but not within this range, an integer overflow and subsequent
  14525.  read error occurs.
  14526.  
  14527.  Microsoft has confirmed this to be a problem in Version 4.10. This
  14528.  problem was corrected in version 5.00.
  14529.  
  14530.  The following is the sample code:
  14531.  
  14532.         INTEGER*4 TEMP
  14533.         TEMP = 0
  14534.  
  14535.         write(*,*) 'enter an integer value'
  14536.         READ(*,*,err=20) TEMP
  14537.         write(*,*) 'result:'
  14538.         write(*,*) temp
  14539.  
  14540.  20     write(*,*) 'Error in read statement'
  14541.  30     END
  14542.  
  14543.  
  14544.  388. FORTRAN Compiler Causes a Null-Pointer Assignment
  14545.  
  14546.  Product Version(s): 4.10 5.00 | 4.10 5.00
  14547.  Operating System:   MS-DOS    | OS/2
  14548.  Flags: ENDUSER | buglist4.10 fixlist5.00
  14549.  Last Modified:  7-NOV-1989    ArticleIdent: Q33727
  14550.  
  14551.  The sample code below causes the "F1900: Maximum memory allocation
  14552.  size exceeded" error, then generates a null-pointer assignment error
  14553.  R6001 when compiled under DOS.
  14554.  
  14555.  Under OS/2, the result is a general-protection failure. However, in
  14556.  the DOS compatibility box, the result is simply the error F1900 with
  14557.  no subsequent null-pointer assignment.
  14558.  
  14559.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  14560.  FORTRAN compiler. This problem was corrected in Version 5.00.
  14561.  
  14562.  The following is the sample code:
  14563.  
  14564.  $INCLUDE:'INFTST1.INF'
  14565.          SUBROUTINE INFTST1(A,N)
  14566.  
  14567.          INTEGER*2       N
  14568.          INTEGER*2       A(N)
  14569.          A(1) = 1
  14570.          END
  14571.  
  14572.  c      (include file: inftst1.inf)
  14573.          INTERFACE TO SUBROUTINE INFTST1(A,N)
  14574.          INTEGER*2       N
  14575.          INTEGER*2       A(N)
  14576.          END
  14577.  
  14578.  
  14579.  389. Internal Compiler Error exphelp.c:1.55, Line 1308
  14580.  
  14581.  Product Version(s): 4.00
  14582.  Operating System:   MS-DOS
  14583.  Flags: ENDUSER | buglist4.00 fixlist4.01
  14584.  Last Modified:  5-AUG-1988    ArticleIdent: Q33728
  14585.  
  14586.     The sample code below generates the following error:
  14587.  
  14588.     test.for(9) : fatal error F1001: Internal Compiler Error
  14589.                  (compiler file '@(#)exphelp.c:1.55', line 1308)
  14590.                  Contact Microsoft Technical Support
  14591.  
  14592.     Microsoft has confirmed this to be a problem in Version 4.00. This
  14593.  problem was corrected in Version 4.01.
  14594.     This error can be avoided by compiling with /Odclt.
  14595.  
  14596.     The following sample code demonstrates the problem:
  14597.  
  14598.        program grid
  14599.        real gridd(4,4), nugrid(4), x(4)
  14600.        data x/-1000.0, -5000.0, 0.0, -7500./
  14601.        data ((gridd(i,J), i=1,4), J=1,4) /-3.0, 1.0, 0.0,0.0,
  14602.       +5.0,-24.0,5.0,4.0,0.0,1.0,-5.0,0.0,0.0,4.0,0.0,-34.0/
  14603.        print *, 'grid(4,4)  :'
  14604.        print *, ((gridd(I,j), i=1,4), j=1,4)
  14605.        do 20 k=1,4
  14606.          do 10  i=1,4
  14607.              do 10 j=1,4
  14608.  c            temp=gridd(i,j)*x(j)
  14609.              nugrid(k)=nugrid(k)+temp
  14610.  10    continue
  14611.  20    continue
  14612.        print *, 'nugrid = ',(nugrid(n), n=1,4)
  14613.        end
  14614.  
  14615.  
  14616.  390. Formatted READ Reads Past CTRL+Z in Disk File
  14617.  
  14618.  Product Version(s): 4.10   | 4.10
  14619.  Operating System:   MS-DOS | OS/2
  14620.  Flags: ENDUSER |
  14621.  Last Modified: 13-JAN-1989    ArticleIdent: Q34060
  14622.  
  14623.  Question:
  14624.  
  14625.  I updated to FORTRAN Version 4.10 from FORTRAN Version 3.31. My
  14626.  program reads a formatted file that contains a CTRL+Z character to
  14627.  mark the end of the file. Because the file was created with an old
  14628.  program that uses File Control Block (FCB) I/O, the file is padded to
  14629.  a 128-byte boundary with random characters after the CTRL+Z.
  14630.  
  14631.  My program worked correctly under Version 3.31, stopping when it hit
  14632.  the CTRL+Z. However, it reads right past the CTRL+Z under Version
  14633.  4.10, not stopping until it reads all of the characters in the file.
  14634.  What is wrong?
  14635.  
  14636.  Response:
  14637.  
  14638.  The FORTRAN I/O library has been rewritten to increase the speed of
  14639.  I/O. One of the side effects of the rewrite is that the CTRL+Z
  14640.  character will not be recognized as marking the end-of-file in files
  14641.  that are in the format described above.
  14642.  
  14643.  To work around this problem, do one the following:
  14644.  
  14645.  1. Use binary mode and read character-by-character, checking for the
  14646.     CTRL+Z in each character. This process is likely to be quite slow.
  14647.  
  14648.  2. Read into CHARACTER*x variables in formatted mode and check each
  14649.     string read for CTRL+Z using the INDEX function. This process
  14650.     should be faster.
  14651.  
  14652.  3. Modify the input file so that its actual length is the same as
  14653.     its logical length or so all of the characters after the CTRL+Z
  14654.     are either CTRL+Zs or nulls (ASCII code = 0). This process is
  14655.     best if you do not mind passing the input file through a filter.
  14656.  
  14657.  
  14658.  391. File I/O Return Codes Using IOSTAT
  14659.  
  14660.  Product Version(s): 3.x 4.00 4.01 4.10 | 4.10
  14661.  Operating System:   MS-DOS             | OS/2
  14662.  Flags: ENDUSER |
  14663.  Last Modified: 18-AUG-1988    ArticleIdent: Q33730
  14664.  
  14665.  Question:
  14666.     I opened a file and received a return code with IOSTAT. Where can
  14667.  I look to find out what this code means?
  14668.  
  14669.  Response:
  14670.     If the number you received is zero, there was no error; however,
  14671.  if you received a positive number back, there was an error and the number
  14672.  corresponds to a run-time error message.
  14673.     The run-time error messages are documented starting on Page 434 of
  14674.  the "Microsoft FORTRAN 4.1 Optimizing Compiler Users Guide."
  14675.  
  14676.  
  14677.  392. Passing a FORTRAN String to a C Function
  14678.  
  14679.  Product Version(s): 4.10   | 4.10
  14680.  Operating System:   MS-DOS | OS/2
  14681.  Flags: ENDUSER | s_c
  14682.  Last Modified: 16-AUG-1988    ArticleIdent: Q33763
  14683.  
  14684.     The following example illustrates how to pass a FORTRAN string to a
  14685.  C function and return a capitalized version of the string. The string
  14686.  passed remains unchanged. For additional information, see the
  14687.  "Microsoft Mixed-Language Programming Guide", sections 4.1, 4.2, and
  14688.  4.4.
  14689.  
  14690.     When passing a string from FORTRAN to C, the FORTRAN interface
  14691.  statement must have the following form:
  14692.  
  14693.     INTERFACE TO return_type FUNCTION func_name [C] ( ARG )
  14694.     return_type ARG [REFERENCE]
  14695.  
  14696.     In the above declaration "return type" can be any type, such
  14697.  as character*30. Note that all data types are references (addresses)
  14698.  in FORTRAN.
  14699.     The [C] attribute tells FORTRAN to treat the function as a C
  14700.  function. This attribute accomplishes the following:
  14701.  
  14702.     1. Pushes parameters from left to right
  14703.     2. Appends a leading underscore to the function name
  14704.     3. Prepares the calling program to take care of the stack unlike
  14705.        FORTRAN and Pascal, in which the called sub-program takes care
  14706.        of the stack.
  14707.     4. The C attribute is also used to tell FORTRAN that a string
  14708.        literal is to be treated as a C string; i.e., to place a NULL
  14709.        terminator after the literal in the CONST segment of DGROUP.
  14710.  
  14711.     The [REFERENCE] attribute tells FORTRAN to pass the address of ARG
  14712.  instead of its value. Note that the value of ARG is an address; as a
  14713.  result, its address is passed. There are two levels of indirection
  14714.  similar to a pointer in C (e.g. char **p).
  14715.     The following is an example of mixed language calling C from
  14716.  FORTRAN:
  14717.  
  14718.        interface to character*30 function UpCase [C] ( str )
  14719.        character*30 str [REFERENCE]
  14720.        end
  14721.  
  14722.        character*30 string
  14723.        character*30 buffer
  14724.        character*30 UpCase
  14725.  
  14726.        string = 'hello, world!'  C
  14727.  
  14728.  C     The C following 'hello, world!' NULL terminates the literal.
  14729.  
  14730.        buffer = UpCase( string )
  14731.  
  14732.        write(6, 10) string
  14733.        write(6, 11) buffer
  14734.  
  14735.    10  format( 1x, 'string = ', A13 )
  14736.    11  format( 1x, 'buffer = ', A13 )
  14737.  
  14738.        end
  14739.  
  14740.  =====================================================================
  14741.  PRINTOUT:
  14742.  
  14743.  string = hello, world!
  14744.  buffer = HELLO, WORLD!
  14745.  
  14746.  =====================================================================
  14747.  
  14748.  C:
  14749.  
  14750.  #include <malloc.h>
  14751.  
  14752.  char *
  14753.  UpCase( const char *string )
  14754.  {
  14755.       int   i=0;
  14756.       char  *str; /* Create buffer so you do not change string value */
  14757.  
  14758.       while ( string[i++] != 0 );   /* Get string length */
  14759.       str = malloc( --i );          /* Give buffer some space */
  14760.  
  14761.       i = 0;
  14762.       while ( string[i] != 0 ) /* Change to uppercase, copy into str */
  14763.       {
  14764.            if ( string[i] >= 'a' && string[i] <= 'z' )
  14765.                 str[i] = string[i] - 32;
  14766.            else
  14767.                 str[i] = string[i];
  14768.            i++;
  14769.       }
  14770.  
  14771.       return( str );
  14772.  }
  14773.  
  14774.  
  14775.  393. Using the Debug Option with /Zi Causes Problems
  14776.  
  14777.  Product Version(s): 4.00 4.01 4.10 | 4.10
  14778.  Operating System:   MS-DOS         | 4.10
  14779.  Flags: ENDUSER | s_pascal SR# G880727-1846
  14780.  Last Modified:  5-AUG-1988    ArticleIdent: Q33832
  14781.  
  14782.     The two compiler switches /Zi and /4Yb for FORTRAN, or /Pd for
  14783.  Pascal are mutually exclusive. The line information that each of these
  14784.  store, conflicts with each other. If both are used and the code is
  14785.  brought up under CodeView, the source comes up in assembly mode with
  14786.  the statement, No Symbolic Information.  There is no reason to turn on
  14787.  the debugging switch if you intend to do your debugging in CodeView.
  14788.  
  14789.     The use of the Pascal /Pd switch is identical to the PAS1 option
  14790.  /D, which turns on all debugging. The FORTRAN /4Yb switch also turns
  14791.  on all debugging. These are equivalent to the $DEBUG metacommand.
  14792.  
  14793.  
  14794.  394. FORTRAN: Error F2409 Erroneously Generated
  14795.  
  14796.  Product Version(s): 4.10   | 4.10
  14797.  Operating System:   MS-DOS | OS/2
  14798.  Flags: ENDUSER | buglist4.10 fixlist5.00
  14799.  Last Modified: 16-JUN-1989    ArticleIdent: Q33898
  14800.  
  14801.  The sample program below causes the error F2409: "nonstatic address
  14802.  illegal in initialization." If the $NOTRUNCATE command is given at the
  14803.  top of the program, it compiles cleanly. If INDEXER in shortened to
  14804.  INDEXE, i.e., six characters, the program compiles without error.
  14805.  Microsoft FORTRAN only recognizes the first six characters of the
  14806.  variable name unless the $NOTRUNCATE command is given.
  14807.  
  14808.  Microsoft has confirmed this to be a problem in Version 4.10. This
  14809.  problem was corrected in Version 5.00.
  14810.  
  14811.  The following sample program demonstrates the problem:
  14812.  
  14813.         DIMENSION A(5,5)
  14814.         DATA (( A(INDEXER, J), INDEXER=1,5), J=1,5) /25*1.0/
  14815.         END
  14816.  
  14817.  bug.for(2) : error F2409: A : nonstatic address illegal in initialization
  14818.  
  14819.  
  14820.  395. How to Avoid Compiler Error F6700: "Heap Space Limit Exceeded"
  14821.  
  14822.  Product Version(s): 4.00 4.01 4.10 | 4.10
  14823.  Operating System:   MS-DOS         | OS/2
  14824.  Flags: ENDUSER |
  14825.  Last Modified:  7-SEP-1988    ArticleIdent: Q33995
  14826.  
  14827.  Problem:
  14828.  
  14829.  I have received the F6700: "heap space limit exceeded" run-time error.
  14830.  The error documentation implies that I may have too many files opened
  14831.  at once; however, this is not the case. I have files=20 in my
  14832.  CONFIG.SYS and I only have opened five files myself.
  14833.  
  14834.  Response:
  14835.  
  14836.  This problem may occur because there is not enough memory to allocate
  14837.  another file control block (FCB). A FCB must be allocated from the
  14838.  heap for each file opened. Try using the /Gt switch, which frees up
  14839.  space in the default data segment and allows more room for the near
  14840.  heap and consequently the FCBs.
  14841.  
  14842.  
  14843.  396. How to Avoid Compiler Error F2220: "Length Redefined"
  14844.  
  14845.  Product Version(s): 4.00 4.01 4.10 | 4.10
  14846.  Operating System:   MS-DOS         | 4.10
  14847.  Flags: ENDUSER |
  14848.  Last Modified: 18-AUG-1988    ArticleIdent: Q33996
  14849.  
  14850.     The sample program below generates the following compiler error:
  14851.  
  14852.     doub.for(9) : error F2220: PA : length redefined
  14853.  
  14854.     Function return types must be defined within subprograms that make
  14855.  calls to these functions. Within function F1, variable PA must be
  14856.  explicitly typed to be double precision to match the previous function
  14857.  definition of PA. The error is generated because the default type of
  14858.  PA would be REAL*4 or single precision. This process causes the
  14859.  compiler error F2220.
  14860.  
  14861.     The following sample program demonstrates the problem:
  14862.  
  14863.        double precision function pa (w, x)
  14864.        w = 1.5
  14865.        x = 2.4
  14866.        pa = w + x
  14867.        return
  14868.        end
  14869.  C
  14870.        double precision function f1 (x)
  14871.        f1 = pa (w, x) - sig1
  14872.        return
  14873.        end
  14874.  
  14875.     The function definition of F1 should be as follows:
  14876.  
  14877.        double precision function f1 (x)
  14878.        double precision pa
  14879.        f1 = pa (w, x) - sig1
  14880.        return
  14881.        end
  14882.  
  14883.  
  14884.  
  14885.  397. Benchmarks for Microsoft FORTRAN
  14886.  
  14887.  Product Version(s): 4.00 4.01 4.10 | 4.10
  14888.  Operating System:   MS-DOS         | OS/2
  14889.  Flags: ENDUSER | benchmark
  14890.  Last Modified:  7-SEP-1988    ArticleIdent: Q34138
  14891.  
  14892.  The following periodicals contain articles that compare the Microsoft
  14893.  FORTRAN Optimizing Compiler to other FORTRAN compilers:
  14894.  
  14895.  1. November 1987 "Byte Magazine"
  14896.  2. July 1988 IEEE "Software Magazine"
  14897.  
  14898.  
  14899.  398. L2025 Error: "Symbol Defined More than Once"
  14900.  
  14901.  Product Version(s): 4.00 4.01 4.10 | 4.10
  14902.  Operating System:   MS-DOS         | OS/2
  14903.  Flags: ENDUSER | _main
  14904.  Last Modified: 10-AUG-1988    ArticleIdent: Q33998
  14905.  
  14906.     When a FORTRAN program generates the link error L2025: "symbol
  14907.  defined more than once" occurring on the symbol _main, it usually means
  14908.  that more than one of the object modules being linked appeared to the
  14909.  linker as a main program.
  14910.     Make sure all the subprograms in all object modules, other than the
  14911.  main, have the FUNCTION or SUBROUTINE statement.
  14912.  
  14913.  
  14914.  399. How to Avoid Compiler Error 803
  14915.  
  14916.  Product Version(s): 3.20
  14917.  Operating System:   MS-DOS
  14918.  Flags: ENDUSER |
  14919.  Last Modified: 10-AUG-1988    ArticleIdent: Q33999
  14920.  
  14921.  Question:
  14922.     When I compile my FORTRAN program I receive an error 803 "Starting
  14923.  location is odd." What is wrong with my code?
  14924.  
  14925.  Response:
  14926.     This error is usually generated by one or more of the following
  14927.  conditions:
  14928.  
  14929.     1. Characters and reals or integers have been declared in one
  14930.        COMMON block. You can reorder the declaration or make the
  14931.        character declaration of even type. You can also put the
  14932.        character declarations in a different COMMON block than the
  14933.        integers and reals.
  14934.  
  14935.     2.  An EQUIVALENCE statement was made between a character string
  14936.         of odd length with integers or reals.
  14937.  
  14938.     Correcting the above situations in your code eliminates the
  14939.  compiler error.
  14940.  
  14941.  
  14942.  400. Floating-Point Option Causes Error D2011
  14943.  
  14944.  Product Version(s): 4.10   | 4.10
  14945.  Operating System:   MS-DOS | OS/2
  14946.  Flags: ENDUSER |
  14947.  Last Modified: 18-AUG-1988    ArticleIdent: Q34270
  14948.  
  14949.     It is possible to get the FORTRAN Version 4.10 compiler error
  14950.  "D2011 only one floating-point model allowed" when the floating-point
  14951.  option is given after the source or object file. This error can occur
  14952.  if the FL environment variable contains a source or object file before
  14953.  the floating-point option. All options always should occur before
  14954.  source and object files on the command line.
  14955.  
  14956.     The following is an example of an incorrect FL environment setting:
  14957.  
  14958.     SET FL=FL /FPi
  14959.  
  14960.     This setting causes the error D2011.
  14961.     This error occurs because the compiler assumes that the second FL
  14962.  is a filename. Because there is no extension, the compiler assumes
  14963.  that "FL" is "FL.OBJ;" as a result, it does not try to compile it.
  14964.  Because the filename "FL.OBJ" appears on the command line before the
  14965.  /FPi option, the /FPi option does not apply to "FL.OBJ," applying only
  14966.  to the file(s) that follow on the command line.
  14967.     The "FL.OBJ" is assumed to have the default option /FPi87, so the
  14968.  "only one floating-point model allowed" error occurs.
  14969.     The error D2011 also can be produced by invoking the compiler using
  14970.  the command FL FL /FPi filename.for with no environment variable set.
  14971.  Compiling with FL FL /FPi87 filename.for will not produce the error
  14972.  because the floating-point option is consistent, /FPi87 is the
  14973.  default. (The linker will give an error when it fails to find the
  14974.  FL.OBJ file.)
  14975.     The correct FL environment setting is as follows:
  14976.  
  14977.     SET FL=/FPi
  14978.  
  14979.  
  14980.  401. FORTRAN 4.1 F1001 Error in omf_ms.c:1.115, line 1093
  14981.  
  14982.  Product Version(s): 4.10 5.00 | 4.10 5.00
  14983.  Operating System:   MS-DOS | OS/2
  14984.  Flags: ENDUSER | buglist4.10 fixlist5.00
  14985.  Last Modified:  7-NOV-1989    ArticleIdent: Q34271
  14986.  
  14987.  The code below produces the following error, which produces a
  14988.  protection violation during compile time under OS/2:
  14989.  
  14990.     fatal error F1001:  Internal Compiler Error
  14991.                  (compiler file '@(#)omf_ms.c:1.115', line 1093)
  14992.  
  14993.  To work around this problem, remove the interface statement.
  14994.  
  14995.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  14996.  FORTRAN compiler. This problem was corrected in Version 5.00.
  14997.  
  14998.  The same internal compiler error is produced when a function, which is
  14999.  being passed to another function, is not declared as being EXTERNAL
  15000.  inside a subprogram. An example of this process would be a program
  15001.  that has Function 1, Function 2, and a subroutine. If Function 2 is
  15002.  passed to Function 1 inside the following subroutine, then Function 2
  15003.  must be declared inside the subroutine as being EXTERNAL:
  15004.  
  15005.     result = Function1 (Function2)
  15006.  
  15007.  The workaround to this problem is to make sure the function (Function
  15008.  2, in this case) is declared as EXTERNAL.
  15009.  
  15010.  The following sample code demonstrates the problem:
  15011.  
  15012.         interface to integer function f0 ()
  15013.         end
  15014.  
  15015.         integer f1, f0, x
  15016.  
  15017.         write (*,*) f0()
  15018.         x = f1(f0)
  15019.         write (*,*) x
  15020.         end
  15021.  
  15022.         integer function f0 ()
  15023.         f0 = 88
  15024.         end
  15025.  
  15026.         integer function f1 (fx)
  15027.         integer fx
  15028.         f1 = 12 + fx()
  15029.         end
  15030.  
  15031.  
  15032.  402. Building LLIBFOR7.LIB Using the Library Manager
  15033.  
  15034.  Product Version(s): 4.00 4.01 4.10 | 4.10
  15035.  Operating System:   MS-DOS         | OS/2
  15036.  Flags: ENDUSER |
  15037.  Last Modified: 16-AUG-1988    ArticleIdent: Q34272
  15038.  
  15039.     To build the library LLIBFOR7.LIB (large-model, coprocessor-math
  15040.  FORTRAN library) the component libraries below must be combined using
  15041.  the Library Manager. These libraries should be placed in one directory
  15042.  and the PATH environment variable should be set so that the most
  15043.  current version of LIB.EXE is in the path. The Library Manager should
  15044.  be run from the directory that contains the component libraries.
  15045.  
  15046.     The syntax is as follows:
  15047.  
  15048.  LIB LLIBFOR7.LIB
  15049.  
  15050.  ( the LIB utility will ask you to create ) Y
  15051.  
  15052.  OPERATIONS: +LIBH.LIB +LLIBFP.LIB +LLIBFOR.LIB +LLIBFOR1
  15053.                    +87.LIB +LCLIB1.LIB
  15054.  
  15055.  LIST FILE:  <cr>
  15056.  
  15057.  OUTPUT LIBRARY:  <cr>
  15058.  
  15059.     At this point, the Library Manager will combine the component
  15060.  libraries into the combined library LLIBFOR7.LIB.
  15061.  
  15062.  
  15063.  403. F2124 Error Caused by a Real Array Index
  15064.  
  15065.  Product Version(s): 4.10 5.00 | 4.10 5.00
  15066.  Operating System:   MS-DOS    | OS/2
  15067.  Flags: ENDUSER | buglist4.10 fixlist5.00
  15068.  Last Modified:  7-NOV-1989    ArticleIdent: Q34328
  15069.  
  15070.  The program below generates the following error when compiled with the
  15071.  /Od:
  15072.  
  15073.     error F2124 : CODE GENERATION ERROR
  15074.                 Contact Microsoft Technical Support
  15075.  
  15076.  In the following sample code, the i variable is used incorrectly in
  15077.  the second loop as an integer when it is declared as a real*8. Using a
  15078.  real as an array index should cast the real to an integer. If the i
  15079.  variable is changed to the j variable, which is defined as an integer,
  15080.  the program compiles correctly.
  15081.  
  15082.  The following sample code demonstrates the problem:
  15083.  
  15084.  c
  15085.  c         Main program that generates a code generation error
  15086.  c
  15087.         complex*16 carr, carr2
  15088.         real*8 data,i
  15089.         integer nn,isign,j
  15090.            dimension carr(128),data(256),carr2(128)
  15091.  c
  15092.         nn = 128
  15093.         isign = 1
  15094.  c
  15095.         do 100 i = 0.001,0.128,0.001
  15096.         carr(i) = dsin(i*360/(2*3.14159))
  15097.    100  continue
  15098.  c
  15099.         do 200 i = 1,128
  15100.         data((2*i)-1) = real (carr(i))
  15101.         data(2*i) = imag(carr(i))
  15102.    200  continue
  15103.  c
  15104.         stop
  15105.         end
  15106.  
  15107.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  15108.  FORTRAN compiler. This problem was corrected in Version 5.00.
  15109.  
  15110.  
  15111.  404. External Data and Public Variables in FORTRAN
  15112.  
  15113.  Product Version(s): 4.10 5.00 | 4.10 5.00
  15114.  Operating System:   MS-DOS    | OS/2
  15115.  Flags: ENDUSER | docerr s_c h_masm s_pascal
  15116.  Last Modified: 20-JUN-1990    ArticleIdent: Q34370
  15117.  
  15118.  FORTRAN cannot declare individual variables as public. Common blocks
  15119.  are the only way to declare publicly accessible variables.
  15120.  
  15121.  Section 9.3, "External Data," of the "Microsoft Mixed-Language
  15122.  Programming Guide," and Section 5.3.3, "External Data," of the
  15123.  "Microsoft FORTRAN Advanced Topics" guide for version 5.00 discuss
  15124.  possibilities for shared data. The guide states the following:
  15125.  
  15126.     You can always share data between two languages by passing
  15127.     parameters. In the case of local variables and all BASIC variables,
  15128.     passing parameters is the only convenient way to share data.
  15129.  
  15130.     However, C, FORTRAN, and Pascal routines can access data directly
  15131.     that are external.
  15132.  
  15133.  FORTRAN can access variables declared external in C and Pascal
  15134.  routines; however, FORTRAN cannot declare a single variable as public.
  15135.  The example on Page 131 of the "Microsoft Mixed-Language Programming
  15136.  Guide" and Pages 109-110 of the "Microsoft FORTRAN Advanced Topics"
  15137.  incorrectly shows C and Pascal accessing a public variable in the
  15138.  FORTRAN routine. This process is impossible because all FORTRAN
  15139.  variables are local. Only common blocks and subprogram names are
  15140.  public in FORTRAN.
  15141.  
  15142.  To declare a variable or set of variables public in FORTRAN, place
  15143.  them in a common block. Because common blocks are public, you can
  15144.  access the variables through that common block, but not individually.
  15145.  For example, you can declare a common block in a FORTRAN program, then
  15146.  access that block in a C routine by declaring an external structure
  15147.  with the same form.
  15148.  
  15149.  
  15150.  405. Opening More than 20 Files under OS/2
  15151.  
  15152.  Product Version(s): 4.10
  15153.  Operating System:   MS-DOS
  15154.  Flags: ENDUSER |
  15155.  Last Modified: 10-NOV-1989    ArticleIdent: Q34395
  15156.  
  15157.  You cannot open more that 20 files with FORTRAN 4.1 under OS/2. You
  15158.  can change this limit in FORTRAN 5.0. See pages 405-407 of the FORTRAN
  15159.  5.0 Reference manual for more information.
  15160.  
  15161.  FORTRAN 4.1 has the 20 open-files limit hard coded into the compiler.
  15162.  This is not a limitation of OS/2, which has the limit of open files at
  15163.  255. However, to get the full 20 files in FORTRAN, you must call the
  15164.  OS/2 function DosSetMaxFH().
  15165.  
  15166.  You cannot open the full 20 files without calling DosSetMaxFH because
  15167.  OS/2 opens several files to start. This OS/2 function increases the
  15168.  OS/2 file limit. By increasing the OS/2 file limit, the preopened OS/2
  15169.  files are freed from the FORTRAN limit of 20 files. Freeing these
  15170.  preopened file handles will allow FORTRAN to open 20 files of its own.
  15171.  
  15172.  The following program demonstrates how to call DosSetMaxFH to
  15173.  open 20 files:
  15174.  
  15175.        INTERFACE TO INTEGER*2 FUNCTION DOSSET
  15176.       + [ALIAS:'DosSetMaxFH'](fhnum)
  15177.        INTEGER*2 fhnum[VALUE]
  15178.        END
  15179.  
  15180.        INTEGER*2 J, DOSSET
  15181.        CHARACTER*12 fname
  15182.        fname='FILE   .DAT'
  15183.        J = DOSSET(40)
  15184.  
  15185.        DO 10, I = 1, 40
  15186.        WRITE(fname(5:7),100)I
  15187.  100   FORMAT(I3.3)
  15188.        OPEN(UNIT=I,FILE=fname,STATUS='NEW',ERR=20)
  15189.        WRITE(I,*)fname
  15190.  10    CONTINUE
  15191.  20    WRITE(*,*) 'cannot open at i=', i
  15192.        STOP
  15193.        END
  15194.  
  15195.  
  15196.  406. Blank Interpretation BN Is the Default
  15197.  
  15198.  Product Version(s): 4.00 4.01 4.10 | 4.10
  15199.  Operating System:   MS-DOS         | OS/2
  15200.  Flags: ENDUSER | docerr
  15201.  Last Modified:  7-SEP-1988    ArticleIdent: Q35222
  15202.  
  15203.  In section 4.8.1.10 "Blank Interpretation (BN, BZ)" of the "Microsoft
  15204.  FORTRAN Optimizing Compiler Language Reference" there is a discussion
  15205.  of these two edit descriptors. In the fourth paragraph on Page 132, it
  15206.  correctly states that BN is the default. However in the last
  15207.  paragraph, on Page 133, it incorrectly states that, "If BZ editing
  15208.  were in effect, as it is by default,..."
  15209.  
  15210.  This statement is incorrect. BN is the default.
  15211.  
  15212.  
  15213.  407. Error F2328 (already typed) should be generated in FORTRAN 4.1
  15214.  
  15215.  Product Version(s): 4.10 5.00 | 4.10 5.00
  15216.  Operating System:   MS-DOS | OS/2
  15217.  Flags: ENDUSER | buglist4.10 fixlist5.00
  15218.  Last Modified:  7-NOV-1989    ArticleIdent: Q35234
  15219.  
  15220.  The following code should produce the error F2328 (already typed) on
  15221.  lines 2 and 4, respectively, when using FORTRAN Version 4.10:
  15222.  
  15223.        INTEGER A
  15224.        INTEGER A
  15225.        INTEGER B(10)
  15226.        INTEGER B
  15227.        END
  15228.  
  15229.  However, these errors are not generated. If these variables had been
  15230.  declared as reals and not integers, the appropriate errors would have
  15231.  been produced.
  15232.  
  15233.  Microsoft has confirmed this to be a problem in Version 4.10. This
  15234.  problem was corrected in Version 5.00.
  15235.  
  15236.  In the following example, "I" gets set to integer in the first
  15237.  declaration, so it is actually redefined in the second declaration:
  15238.  
  15239.         SUBROUTINE SUB(A,I)
  15240.      INTEGER A(I)
  15241.      INTEGER I
  15242.      END
  15243.  
  15244.  In this example, a redefinition error would not be appropriate. The
  15245.  compiler should check to see if the variables being typed are dummy
  15246.  variables. If the redefined variable is not a dummy variable, then the
  15247.  redefinition error F2328 should occur.
  15248.  
  15249.  
  15250.  408. Implicit DO within Read May Fail in Certain Cases
  15251.  
  15252.  Product Version(s): 4.10   | 4.10
  15253.  Operating System:   MS-DOS | OS/2
  15254.  Flags: ENDUSER | buglist4.10 fixlist5.00
  15255.  Last Modified:  6-NOV-1989    ArticleIdent: Q35236
  15256.  
  15257.  In the example code below, the implicit DO within the read may cause
  15258.  the next access to file to fail. The code takes four strings of data
  15259.  from a file, but depending on how the data is organized, the program
  15260.  may or may not be able to retrieve the last line of data. It does not
  15261.  seem to recognize the end-of-record marker in the next-to-last line of
  15262.  the data file.
  15263.  
  15264.  Microsoft has confirmed this to be a problem in Version 4.10. This
  15265.  problem was corrected in version 5.00.
  15266.  
  15267.  A work around for this problem is to replace the (A80) with the
  15268.  default *.
  15269.  
  15270.  The following sample code demonstrates this problem:
  15271.  
  15272.        program showbug
  15273.        character*8 string(4),last*80
  15274.        open (1,file=' ', status='OLD')
  15275.        read (1,*) (string(I),I=1,4)
  15276.        do 10 i = 1,4
  15277.  10      print *,'string(',i,')=',string(i)
  15278.        read (1,'(A80)') last
  15279.  C     The workaround is to use the following read statement
  15280.  C     read (1,*)last
  15281.        print *,'last=',last
  15282.        stop
  15283.        end
  15284.  
  15285.  The segment will not retrieve the last line of code if the data is
  15286.  organized as follows:
  15287.  
  15288.  'one'
  15289.  'two'
  15290.  'three'
  15291.  'four'
  15292.  'Last line of text'
  15293.  
  15294.  However, if the file is organized as follows, it works correctly:
  15295.  
  15296.  'one'
  15297.  'two'
  15298.  'three' 'four'
  15299.  'Last line of text'
  15300.  
  15301.  
  15302.  409. Directory Listing for FORTRAN 4.10 Distribution Disks
  15303.  
  15304.  Product Version(s): 4.10   | 4.10
  15305.  Operating System:   MS-DOS | OS/2
  15306.  Flags: ENDUSER |
  15307.  Last Modified:  7-SEP-1988    ArticleIdent: Q35237
  15308.  
  15309.  Below is a listing of the directories for each of the Microsoft
  15310.  FORTRAN Optimizing Compiler Version 4.10 distribution disks (5.25
  15311.  inches).
  15312.  
  15313.  The information is the resulting output when the DOS command "dir" is
  15314.  performed on each directory and subdirectory.
  15315.  
  15316.  A line of colons (:::::) separates each disk, and subdirectories are
  15317.  listed below their parent directory. The first line of each disk
  15318.  description is the name of the disk as it is printed on the label.
  15319.  Information in parentheses is supplemental and not contained on the
  15320.  disk label.
  15321.  
  15322.  The following are directories for FORTRAN Version 4.10 distribution
  15323.  disks:
  15324.  
  15325.  (Disk 1 of 10)  --  Setup
  15326.  
  15327.   Volume in drive A is SETUP
  15328.   Directory of  A:\
  15329.  
  15330.  DEMOS        <DIR>      2-23-88   9:25a
  15331.  PATCH        <DIR>      2-23-88   9:25a
  15332.  EMOEM    ASM    12125   2-12-88   2:00p
  15333.  F3S      EXE    99308   2-12-88   2:00p
  15334.  FL       ERR     1965   2-12-88   2:00p
  15335.  FL       EXE    45965   2-18-88   5:33p
  15336.  FL       HLP     1726   2-12-88   2:00p
  15337.  FLOPSET  DOC     5339   2-12-88   2:00p
  15338.  PACKING  LST     8307   2-19-88   4:33p
  15339.  PATCH87  EXE     4206   2-12-88   2:00p
  15340.  README   DOC    21503   2-22-88  11:53a
  15341.  SETUP    DAT    46520   2-12-88   2:00p
  15342.  SETUP    EXE    42501   2-22-88  12:24p
  15343.         13 File(s)     10240 bytes free
  15344.  
  15345.   Volume in drive A is SETUP
  15346.   Directory of  A:\DEMOS
  15347.  
  15348.  .            <DIR>      2-23-88   9:25a
  15349.  ..           <DIR>      2-23-88   9:25a
  15350.  CIRC     C       4605   2-23-88   8:30a
  15351.  DEMO     FOR     1244   2-23-88   8:30a
  15352.  DEMOEXEC FOR      981   2-23-88   8:30a
  15353.  DEMORAN  FOR     2940   2-23-88   8:30a
  15354.  DWHET    FOR    12463   2-23-88   8:30a
  15355.  FOREXEC  INC     5331   2-23-88   8:30a
  15356.  GRAPH    BAT      603   2-23-88   8:30a
  15357.  GRAPH    FOR     1349   2-23-88   8:30a
  15358.  SECNDS   FOR      768   2-23-88   8:30a
  15359.  SIEVE    FOR     1440   2-23-88   8:30a
  15360.  SWHET    FOR    12312   2-23-88   8:30a
  15361.         13 File(s)     10240 bytes free
  15362.  
  15363.   Volume in drive A is SETUP
  15364.   Directory of  A:\PATCH
  15365.  
  15366.  .            <DIR>      2-23-88   9:25a
  15367.  ..           <DIR>      2-23-88   9:25a
  15368.  README   DOC     1192   2-23-88   8:30a
  15369.  RMRHS    EXE      543   2-23-88   8:30a
  15370.  SETRHS   EXE      543   2-23-88   8:30a
  15371.  STKPAT   BAT       94   2-23-88   8:30a
  15372.  STKPAT   SCR       30   2-23-88   8:30a
  15373.          7 File(s)     10240 bytes free
  15374.  
  15375.  :::::::::::::::::::::::::::::::::::::::
  15376.  
  15377.  (Disk 2 of 10)  --  Compiler 1
  15378.  
  15379.   Volume in drive A is COMPILER 1
  15380.   Directory of  A:\
  15381.  
  15382.  F1       ERR    15919   2-23-88   8:30a
  15383.  F1       EXE   167017   2-23-88   8:30a
  15384.  F3       EXE   155676   2-23-88   8:30a
  15385.          3 File(s)     21504 bytes free
  15386.  
  15387.  :::::::::::::::::::::::::::::::::::::::
  15388.  
  15389.  (Disk 3 of 10)  --  Compiler 2
  15390.  
  15391.   Volume in drive A is COMPILER 2
  15392.   Directory of  A:\
  15393.  
  15394.  EXEC     EXE     9299   2-23-88   8:30a
  15395.  F2       EXE   218189   2-23-88   8:30a
  15396.  F23      ERR     2967   2-23-88   8:30a
  15397.  ILINK    EXE    88929   2-23-88   8:30a
  15398.  LIBBUILD BAT    23513   2-23-88   8:30a
  15399.          5 File(s)     17408 bytes free
  15400.  
  15401.  :::::::::::::::::::::::::::::::::::::::
  15402.  
  15403.  (Disk 4 of 10)  --  Utilities
  15404.  
  15405.   Volume in drive A is UTILITIES
  15406.   Directory of  A:\
  15407.  
  15408.  BIND     EXE    36946   2-23-88   8:30a
  15409.  ERROUT   EXE    10729   2-23-88   8:30a
  15410.  EXEHDR   EXE    29942   2-23-88   8:30a
  15411.  EXEMOD   EXE    11765   2-23-88   8:30a
  15412.  EXEPACK  EXE    14803   2-23-88   8:30a
  15413.  IMPLIB   EXE    30166   2-23-88   8:30a
  15414.  LIB      EXE    49661   2-23-88   8:30a
  15415.  LINK     EXE   117001   2-23-88   8:30a
  15416.  MAKE     EXE    38613   2-23-88   8:30a
  15417.  SETENV   EXE    10313   2-23-88   8:30a
  15418.         10 File(s)      6144 bytes free
  15419.  
  15420.  :::::::::::::::::::::::::::::::::::::::
  15421.  
  15422.  (Disk 5 of 10)  --  Microsoft CodeView for MS-DOS
  15423.  
  15424.   Volume in drive A is DOSCODEVIEW
  15425.   Directory of  A:\
  15426.  
  15427.  DEMO     BAT     5512   2-23-88   8:30a
  15428.  MOUSE    COM    14455   2-23-88   8:30a
  15429.  C_AUTO   CV      2385   2-23-88   8:30a
  15430.  E_AUTO   CV      5464   2-23-88   8:30a
  15431.  L_AUTO   CV      9631   2-23-88   8:30a
  15432.  M_AUTO   CV       721   2-23-88   8:30a
  15433.  Q_AUTO   CV        13   2-23-88   8:30a
  15434.  S_AUTO   CV      6754   2-23-88   8:30a
  15435.  IN       DAT       65   2-23-88   8:30a
  15436.  CVREADME DOC    36960   2-23-88   8:30a
  15437.  CV       EXE   232896   2-23-88   8:30a
  15438.  WHAT     EXE     2434   2-23-88   8:30a
  15439.  STATS    FOR     3469   2-23-88   8:30a
  15440.  CV       HLP    21552   2-23-88   8:30a
  15441.         14 File(s)     10240 bytes free
  15442.  
  15443.  :::::::::::::::::::::::::::::::::::::::
  15444.  
  15445.  (Disk 6 of 10)  --  Microsoft CodeView for MS OS/2
  15446.  
  15447.   Volume in drive A is OS2CODEVIEW
  15448.   Directory of  A:\
  15449.  
  15450.  CVP      EXE   226591   2-23-88   8:30a
  15451.  CVP      HLP    21552   2-23-88   8:30a
  15452.  CVPACK   EXE    57437   2-23-88   8:30a
  15453.  MAKESORT BAT     1353   2-23-88   8:30a
  15454.  MAKESORT CMD     1305   2-23-88   8:30a
  15455.  OS2PATCH EXE     1069   2-23-88   8:30a
  15456.  PTRACE87 PAT      188   2-23-88   8:30a
  15457.  SORTDEMO FOR    29255   2-23-88   8:30a
  15458.          8 File(s)     17408 bytes free
  15459.  
  15460.  :::::::::::::::::::::::::::::::::::::::
  15461.  
  15462.  (Disk 7 of 10)  --  Library (Large Model)
  15463.  
  15464.   Volume in drive A is LIBRARIES 1
  15465.   Directory of  A:\
  15466.  
  15467.  87       LIB     4121   2-23-88   8:30a
  15468.  ALTMATH  LIB     7168   2-23-88   8:30a
  15469.  EM       LIB    16921   2-23-88   8:30a
  15470.  FORTRAN  LIB    34816   2-23-88   8:30a
  15471.  LCLIB1   LIB    21893   2-23-88   8:30a
  15472.  LIBH     LIB    13673   2-23-88   8:30a
  15473.  LLIBFA   LIB    82473   2-23-88   8:30a
  15474.  LLIBFOR  LIB    73427   2-23-88   8:30a
  15475.  LLIBFOR1 LIB    17539   2-23-88   8:30a
  15476.  LLIBFP   LIB    64207   2-23-88   8:30a
  15477.  MATH     LIB     6656   2-23-88   8:30a
  15478.  NBUILD   OBJ      596   2-23-88   8:30a
  15479.         12 File(s)     13312 bytes free
  15480.  
  15481.  :::::::::::::::::::::::::::::::::::::::
  15482.  
  15483.  (Disk 8 of 10)  --  Library (Medium Model)
  15484.  
  15485.   Volume in drive A is LIBRARIES 2
  15486.   Directory of  A:\
  15487.  
  15488.  87       LIB     4121   2-23-88   8:30a
  15489.  EM       LIB    16921   2-23-88   8:30a
  15490.  LIBH     LIB    13673   2-23-88   8:30a
  15491.  MCLIB1   LIB    21379   2-23-88   8:30a
  15492.  MLIBFA   LIB    81449   2-23-88   8:30a
  15493.  MLIBFOR  LIB    71891   2-23-88   8:30a
  15494.  MLIBFOR1 LIB    17539   2-23-88   8:30a
  15495.  MLIBFP   LIB    62669   2-23-88   8:30a
  15496.  NBUILD   OBJ      596   2-23-88   8:30a
  15497.          9 File(s)     66560 bytes free
  15498.  
  15499.  :::::::::::::::::::::::::::::::::::::::
  15500.  
  15501.  (Disk 9 of 10)  --  MS OS/2 Libraries
  15502.  
  15503.   Volume in drive A is LIBRARIES 3
  15504.   Directory of  A:\
  15505.  
  15506.  STARTUP      <DIR>      2-23-88   9:35a
  15507.  API      LIB    81408   2-23-88   8:30a
  15508.  APILMR   OBJ      105   2-23-88   8:30a
  15509.  DOSCALLS LIB    29184   2-23-88   8:30a
  15510.  LCLIB2   LIB    18833   2-23-88   8:30a
  15511.  LLIBFOR2 LIB    18059   2-23-88   8:30a
  15512.  MCLIB2   LIB    17809   2-23-88   8:30a
  15513.  MLIBFOR2 LIB    17547   2-23-88   8:30a
  15514.          8 File(s)      1024 bytes free
  15515.  
  15516.   Volume in drive A is LIBRARIES 3
  15517.   Directory of  A:\STARTUP
  15518.  
  15519.  .            <DIR>      2-23-88   9:35a
  15520.  ..           <DIR>      2-23-88   9:35a
  15521.  DOS          <DIR>      2-23-88   9:35a
  15522.  OS2          <DIR>      2-23-88   9:35a
  15523.  BRKCTL   INC      779   2-23-88   8:30a
  15524.  CHKSTK   ASM     2036   2-23-88   8:30a
  15525.  CHKSUM   ASM     3506   2-23-88   8:30a
  15526.  CMACROS  INC    12061   2-23-88   8:30a
  15527.  CRT0FP   ASM     2207   2-23-88   8:30a
  15528.  MAKEFILE         3113   2-12-88   2:00p
  15529.  MSDOS    INC     6087   2-12-88   2:00p
  15530.  NULBODY  FOR       11   2-12-88   2:00p
  15531.  ONEXIT   ASM     2793   2-12-88   2:00p
  15532.  README   DOC     2826   2-12-88   2:00p
  15533.  STARTUP  BAT     1407   2-12-88   2:00p
  15534.  VERSION  INC      398   2-12-88   2:00p
  15535.         16 File(s)      1024 bytes free
  15536.  
  15537.   Volume in drive A is LIBRARIES 3
  15538.   Directory of  A:\STARTUP\DOS
  15539.  
  15540.  .            <DIR>      2-23-88   9:35a
  15541.  ..           <DIR>      2-23-88   9:35a
  15542.  CRT0     ASM    14422   2-23-88   8:30a
  15543.  CRT0DAT  ASM    21296   2-23-88   8:30a
  15544.  CRT0MSG  ASM     3055   2-23-88   8:30a
  15545.  NMSGHDR  ASM     5132   2-23-88   8:30a
  15546.  NULBODY  LNK      156   2-23-88   8:30a
  15547.  STDALLOC ASM     3336   2-23-88   8:30a
  15548.  STDARGV  ASM    14371   2-23-88   8:30a
  15549.  STDENVP  ASM     3692   2-23-88   8:30a
  15550.         10 File(s)      1024 bytes free
  15551.  
  15552.   Volume in drive A is LIBRARIES 3
  15553.   Directory of  A:\STARTUP\OS2
  15554.  
  15555.  .            <DIR>      2-23-88   9:35a
  15556.  ..           <DIR>      2-23-88   9:35a
  15557.  CRT0     ASM    10303   2-23-88   8:30a
  15558.  CRT0DAT  ASM    10016   2-23-88   8:30a
  15559.  CRT0MSG  ASM     2891   2-23-88   8:30a
  15560.  EXECMSG  ASM     2203   2-23-88   8:30a
  15561.  NMSGHDR  ASM     3475   2-23-88   8:30a
  15562.  NULBODY  LNK      175   2-23-88   8:30a
  15563.  STDALLOC ASM     3234   2-23-88   8:30a
  15564.  STDARGV  ASM    13612   2-23-88   8:30a
  15565.  STDENVP  ASM     5316   2-23-88   8:30a
  15566.         11 File(s)      1024 bytes free
  15567.  
  15568.  :::::::::::::::::::::::::::::::::::::::
  15569.  
  15570.  (Disk 10 of 10)  --  Microsoft Editor
  15571.  
  15572.   Volume in drive A is MS EDITOR
  15573.   Directory of  A:\
  15574.  
  15575.  INI          <DIR>      2-23-88   9:37a
  15576.  MSETUP   BAT     2982   2-12-88   2:00p
  15577.  FIXSHIFT COM      690   2-23-88   8:30a
  15578.  ECH      EXE    19351   2-23-88   8:30a
  15579.  EXP      EXE    32220   2-23-88   8:30a
  15580.  M        EXE    94821   2-12-88   2:00p
  15581.  MEGREP   EXE    31915   2-12-88   2:00p
  15582.  MEP      EXE    97063   2-12-88   2:00p
  15583.  RM       EXE    24884   2-12-88   2:00p
  15584.  UNDEL    EXE    30046   2-12-88   2:00p
  15585.  WHAT     EXE     2434   2-12-88   2:00p
  15586.         11 File(s)      8192 bytes free
  15587.  
  15588.   Volume in drive A is MS EDITOR
  15589.   Directory of  A:\INI
  15590.  
  15591.  .            <DIR>      2-23-88   9:37a
  15592.  ..           <DIR>      2-23-88   9:37a
  15593.  BRIEF    INI     2094   2-23-88   8:30a
  15594.  EPSILON  INI      978   2-23-88   8:30a
  15595.  QUICK    INI     1058   2-23-88   8:30a
  15596.  WS       DLL     2609   2-23-88   8:30a
  15597.  WS       ZXT     2084   2-23-88   8:30a
  15598.          7 File(s)      8192 bytes free
  15599.  
  15600.  
  15601.  410. FORTRAN: Complex Expression Causes mactab.c 1.34 Line 639
  15602.  
  15603.  Product Version(s): 4.10   | 4.10
  15604.  Operating System:   MS-DOS | OS/2
  15605.  Flags: ENDUSER | buglist4.10 fixlist5.00
  15606.  Last Modified: 16-JUN-1989    ArticleIdent: Q35265
  15607.  
  15608.  The code below causes the following internal compiler error:
  15609.  
  15610.  bug.for
  15611.  bug.for(7) : fatal error F1001: Internal Compiler Error
  15612.                  (compiler file '@(#)mactab.c:1.34', line 639)
  15613.                  Contact Microsoft Technical Support
  15614.  
  15615.  The workaround for this problem is to simplify the offending line. You
  15616.  can use temporary variables, or just simplify the expression. To
  15617.  simplify the line, replace the line
  15618.  
  15619.  b =-(x/2d0-ima/2d0)
  15620.  
  15621.  with the following simplified line:
  15622.  
  15623.  b = (ima - x)/2d0
  15624.  
  15625.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  15626.  FORTRAN compiler. This problem was corrected in Version 5.00.
  15627.  
  15628.  The following sample code demonstrates the problem:
  15629.  
  15630.        subroutine ose4x4()
  15631.        complex*16      ima,x,b,temp1,temp2
  15632.        x = (1,0)
  15633.        ima = -(1,1)
  15634.        b =-(x/2d0-ima/2d0)
  15635.        return
  15636.        end
  15637.  
  15638.  
  15639.  411. How to Clear the Coprocessor Status Word
  15640.  
  15641.  Product Version(s): 3.31 4.00 4.01 4.10 | 4.10
  15642.  Operating System:   MS-DOS              | OS/2
  15643.  Flags: ENDUSER | 8087 80287 80387 80X87 status exception
  15644.  Last Modified: 16-JAN-1989    ArticleIdent: Q35434
  15645.  
  15646.  Appendix D on Page 359 of the "Microsoft FORTRAN 4.1 Optimizing
  15647.  Compiler User's Guide" states the following:
  15648.  
  15649.  "When one of the exception conditions occurs, the appropriate bit in
  15650.  the status word is set. This flag remains set, indicating that the
  15651.  exception occurred, until the user clears it."
  15652.  
  15653.  There only is a "load" instruction for the control word (LCWRQQ).
  15654.  
  15655.  The status word should be cleared by your interrupt handler. If
  15656.  written in C you should use the _clear87() call or _fpreset(). If you
  15657.  are using Microsoft's Macro Assembler, you can issue the 8087
  15658.  instruction FCLEX directly.
  15659.  
  15660.  Unfortunately, just clearing the status word has the potential of
  15661.  causing the coprocessor to ignore an interrupt generated at the same
  15662.  time as your "clear" instruction.
  15663.  
  15664.  
  15665.  412. Calling C Graphics Function _floodfill from a FORTRAN Program
  15666.  
  15667.  Product Version(s): 4.10
  15668.  Operating System:   MS-DOS
  15669.  Flags: ENDUSER | buglist4.10 fixlist5.00
  15670.  Last Modified: 19-DEC-1989    ArticleIdent: Q35647
  15671.  
  15672.  When calling a C module from a FORTRAN module that draws a box with
  15673.  the _lineto function and then _floodfill(s) the box, the _floodfill
  15674.  function performs incorrectly. Instead of filling the box with the
  15675.  choosen color, _floodfill only draws a horizontal line that intersects
  15676.  the point specified in the function call. When the C module is called
  15677.  from a C main routine, the function performs correctly.
  15678.  
  15679.  To work around this problem, use the _rectangle function with the
  15680.  _GFILLINTERIOR option, instead of the _lineto  and _floodfill
  15681.  functions.
  15682.  
  15683.  Microsoft has confirmed this to be a problem in Version 4.10 of the
  15684.  FORTRAN compiler. The problem has been corrected in Version 5.00 of
  15685.  the compiler.
  15686.  
  15687.  The following program demonstrates the problem (if using a Hercules
  15688.  card, make sure to run MSHERC.COM before this program):
  15689.  
  15690.  ********************************************************************
  15691.  
  15692.  c      FORTRAN Main Module
  15693.  c
  15694.  c      This program calls a C module that does some graphics.
  15695.  c
  15696.         interface to subroutine test[c,alias:'_test']
  15697.         end
  15698.         call test
  15699.         stop
  15700.         end
  15701.  
  15702.  /* This C module draws a box with the upper left coordinates at (0,0)
  15703.     and the lower right coordinates at (300,300) by drawing lines.
  15704.     It then fills in the box with a color.                          */
  15705.  
  15706.  #include "io.h"
  15707.  #include "stdio.h"
  15708.  #include "graph.h"
  15709.  
  15710.  void test (void);
  15711.  
  15712.  void  test(void)
  15713.  {
  15714.     _setvideomode(_HERCMONO);  /* _setvideomode needs to be changed */
  15715.     _moveto(0,0);              /* according to your configuration */
  15716.     _lineto(300, 0);
  15717.     _lineto(300, 300);
  15718.     _lineto(0, 300);
  15719.     _lineto(0,0);
  15720.     _floodfill(132,80, 4);
  15721.     getche();
  15722.     _setvideomode(_DEFAULTMODE);
  15723.   }
  15724.  ***********************************************************************
  15725.  
  15726.  
  15727.  413. List File Incorrectly Truncates File at Column 72
  15728.  
  15729.  Product Version(s): 4.10   | 4.10
  15730.  Operating System:   MS-DOS | OS/2
  15731.  Flags: ENDUSER | buglist 4.10 /Fs
  15732.  Last Modified:  2-NOV-1988    ArticleIdent: Q35650
  15733.  
  15734.  The list (.lst) file from the FORTRAN Version 4.10 Optimizing Compiler
  15735.  truncates the .lst file at the 72nd column, instead of column 73 as
  15736.  specified on Page 51 in the "Microsoft FORTRAN 4.1 Language Reference
  15737.  Guide." This process functions properly on FORTRAN Version 4.00.
  15738.  
  15739.  In Version 4.10, the source file compiles correctly, which is evidence
  15740.  that the compiler is not truncating the 72nd column. Yet the list file
  15741.  is incorrect.
  15742.  
  15743.  To work around this problem, use the $LINESIZE metacommand.
  15744.  
  15745.  Microsoft has confirmed this to be a problem in Version 4.10. We are
  15746.  researching this problem and will post new information as it becomes
  15747.  available.
  15748.  
  15749.  
  15750.  414. Printing with Control Characters
  15751.  
  15752.  Product Version(s): 4.10   | 4.10
  15753.  Operating System:   MS-DOS | OS/2
  15754.  Flags: ENDUSER |
  15755.  Last Modified: 12-JUN-1989    ArticleIdent: Q35867
  15756.  
  15757.  In FORTRAN, you can feed control characters directly to the printer
  15758.  without printing them.
  15759.  
  15760.  The following is a small example that prints the word "Hello", sends a
  15761.  form feed to the printer, then prints the word "World":
  15762.  
  15763.  OPEN(6, FILE='lpt1', STATUS='old')
  15764.  WRITE(6,*) 'HELLO'
  15765.  WRITE(6,*) char(12)
  15766.  WRITE(6,*) 'WORLD'
  15767.  END
  15768.  
  15769.  
  15770.  415. Parameter Statement Can't Define Negative Constant
  15771.  
  15772.  Product Version(s): 3.30 3.31
  15773.  Operating System:   MS-DOS
  15774.  Flags: ENDUSER | buglist3.30 buglist3.31 fixlist4.00
  15775.  Last Modified: 16-JAN-1989    ArticleIdent: Q35868
  15776.  
  15777.  When using parameter to give a constant a symbolic name in FORTRAN
  15778.  Versions 3.30 and 3.31, the following statement generates compiler
  15779.  error 22: "interger constant expected":
  15780.  
  15781.  parameter (x = -0.5)
  15782.  
  15783.  However, the following statements do not generate the error message
  15784.  when compiling:
  15785.  
  15786.  parameter (x = 0.5)  or
  15787.  parameter (L = -1)
  15788.  
  15789.  Microsoft has confirmed this to be a problem with FORTRAN compiler
  15790.  Versions 3.30 and 3.31. This problem was corrected in Version 4.00.
  15791.  
  15792.  
  15793.  416. FORTRAN: Open Not Freeing Up Memory During Repetitive Calls
  15794.  
  15795.  Product Version(s): 4.01 4.10
  15796.  Operating System:   MS-DOS
  15797.  Flags: ENDUSER | buglist4.01 buglist4.10 fixlist5.00
  15798.  Last Modified: 16-JUN-1989    ArticleIdent: Q35869
  15799.  
  15800.  When FORTRAN opens a file, it opens a File Control Block (FCB). When
  15801.  it closes the file, the FCB should be freed. However, FORTRAN does not
  15802.  free the memory; after numerous openings and closings of PRN, the
  15803.  F6700: "heap space limit exceeded" error is generated.
  15804.  
  15805.  This problem also occurs with other devices such as CON. This problem
  15806.  does not occur with files. The device buffer takes up most of the heap
  15807.  space. The default is 1024 bytes.
  15808.  
  15809.  To minimize this behavior, use the BLOCKSIZE= option when opening the
  15810.  device. The minimum is 512 bytes. This process minimizes the heapspace
  15811.  used; however, it doesn't eliminate the problem.
  15812.  
  15813.  Microsoft has confirmed this to be a problem in Version 4.01 and 4.10
  15814.  of the FORTRAN Compiler. This problem was corrected in Version 5.00.
  15815.  
  15816.  The following code demonstrates this problem:
  15817.  
  15818.     $STORAGE:2
  15819.     $DEBUG
  15820.            REAL*4 ARRY(5)
  15821.  
  15822.        10  CALL POPEN
  15823.            WRITE(2,ERR=8000,IOSTAT=IERR) ARRY
  15824.            GOTO 10
  15825.  
  15826.      8000  CALL FILERR(IERR)
  15827.            END
  15828.  
  15829.     C *****************************************
  15830.            SUBROUTINE FILERR(IERR)
  15831.            IMPLICIT INTEGER*2 (I-N)
  15832.  
  15833.            WRITE(*,*) IERR
  15834.            END
  15835.  
  15836.     C *****************************************
  15837.            SUBROUTINE POPEN
  15838.            IMPLICIT INTEGER*2 (I-N)
  15839.            CLOSE(2)
  15840.            OPEN(2,FILE='PRN',FORM='BINARY',ERR=8000,IOSTAT=IERR)
  15841.            RETURN
  15842.  
  15843.      8000  CALL FILERR(IERR)
  15844.            END
  15845.  
  15846.  
  15847.  417. Passing Constants to Subroutines in FORTRAN
  15848.  
  15849.  Product Version(s): 4.00 4.10 | 4.10
  15850.  Operating System:   MS-DOS    | OS/2
  15851.  Flags: ENDUSER |
  15852.  Last Modified: 30-SEP-1988    ArticleIdent: Q35871
  15853.  
  15854.  The code below will generate the following output:
  15855.  
  15856.          1.000000
  15857.          2.000000
  15858.  
  15859.  This behavior is not a problem with Microsoft FORTRAN. The FORTRAN 77
  15860.  ANSI standard, section 15.9.2, specifies that when passing a constant
  15861.  as an actual argument to a subroutine, the associated dummy argument
  15862.  (in this case x) cannot be modified.
  15863.  
  15864.  Microsoft FORTRAN does not generate error messages while compiling.
  15865.  The above code does not follow the standard; therefore, it will
  15866.  generate unpredictable results because FORTRAN passes by reference.
  15867.  
  15868.  If the associated dummy argument is going to be modified, pass a
  15869.  variable. For example, use "call sub1(y)" with y=1.
  15870.  
  15871.  The following code demonstrates this information:
  15872.  
  15873.          write (*,*) 1.0
  15874.          call sub1(1.0)
  15875.          write (*,*) 1.0
  15876.          end
  15877.  
  15878.          subroutine sub1(x)
  15879.          real x
  15880.          x = 2.0
  15881.          return
  15882.          end
  15883.  
  15884.  
  15885.  418. Domain and Range of FORTRAN Natural Log Functions
  15886.  
  15887.  Product Version(s): 4.00 4.01 4.10  | 4.10
  15888.  Operating System:   MS-DOS          | OS/2
  15889.  Flags: ENDUSER |
  15890.  Last Modified: 30-SEP-1988    ArticleIdent: Q35872
  15891.  
  15892.  The program below demonstrates the use of the exp (e**n) and log
  15893.  FORTRAN natural logarithm functions, using the limits of real*4 (or
  15894.  real) and real*8 values. Both the domain and range of these functions
  15895.  must be valid real*4 values for exp and log, and real*8 values for
  15896.  dexp and dlog. Consequently, the highest acceptable argument to the
  15897.  exp functions is the natural log of the maximum real number for the
  15898.  respective floating-point precisions.
  15899.  
  15900.  The following demonstrates this information:
  15901.  
  15902.  c Program to manipulate natural log and exp functions with greatest and
  15903.  c smallest real*4 and real*8 values. The 16th decimal digit displayed
  15904.  c exceeds the 15 significant digits, and may not be accurate.
  15905.  
  15906.  c Define extreme real*4 and real*8 values, and double- and
  15907.  c single-precision "e"
  15908.  
  15909.        real*8 maxr8, minr8, pos0r8, neg0r8, e8
  15910.        real*4 maxr4, minr4, pos0r4, neg0r4, e4
  15911.  
  15912.        maxr8  =  1.7976931348623156d+308
  15913.        minr8  = -1.7976931348623156d+308
  15914.        pos0r8 =  2.23d-308
  15915.        neg0r8 = -2.23d-308
  15916.        e8     = dexp(1)
  15917.  
  15918.        maxr4  =  1.701411e+38
  15919.        minr4  = -1.701411e+38
  15920.        pos0r4 =  1.701411e-38
  15921.        neg0r4 = -1.701411e-38
  15922.        e4     = exp(1)
  15923.  
  15924.        write(*,*)
  15925.        write(*,*) 'Program to demonstrate use of natural log functions'
  15926.        write(*,*) 'with domain & range values at floating point limits.'
  15927.        write(*,*)
  15928.        write(*,*) 'There are 7 significant decimal digits in a real*4'
  15929.        write(*,*) '15 (or 16) significant decimal digits in a real*8.'
  15930.        write(*,*)
  15931.        write(*,*) 'The Intel coprocessor reference states that the'
  15932.        write(*,*) 'range of double precision (real*8) values is'
  15933.        write(*,*) 'approximately +/-2.23e-308 to +/-1.80e308. The'
  15934.        write(*,*) 'larger real*8 has been carried out to additional'
  15935.        write(*,*) 'digits of signifigance below.'
  15936.        write(*,*)
  15937.        write(*,*) 'Press ENTER to continue...'
  15938.        read(*,*)
  15939.        write(*,*)
  15940.        write(*,*) 'Display extreme real*4 and real*8 values:'
  15941.        write(*,*)
  15942.        write(*,*) 'max real*8           =  ', maxr8
  15943.        write(*,*) 'min real*8           =  ', minr8
  15944.        write(*,*) 'smallest positive r8 =  ', pos0r8
  15945.        write(*,*) 'smallest negative r8 =  ', neg0r8
  15946.        write(*,*)
  15947.        write(*,*) 'max real*4           = ', maxr4
  15948.        write(*,*) 'min real*4           = ', minr4
  15949.        write(*,*) 'smallest positive r4 = ', pos0r4
  15950.        write(*,*) 'smallest negative r4 = ', neg0r4
  15951.        write(*,*)
  15952.        write(*,*) 'Press ENTER to continue...'
  15953.        read(*,*)
  15954.        write(*,*) 'Perform real*4 and real*8 natural log and'
  15955.        write(*,*) 'exponentiation functions on limit values:'
  15956.        write(*,*)
  15957.        write(*,*) 'dexp(1) = real*8 e   =  ', e8
  15958.        write(*,*) 'dlog(maxr8)          =  ', dlog(maxr8)
  15959.        write(*,*) 'dexp(dlog(maxr8))    =  ', dexp(dlog(maxr8))
  15960.        write(*,*) 'dlog(smallest pos r8)=  ', dlog(pos0r8)
  15961.        write(*,*) 'dexp(minr8)          =  ', dexp(minr8)
  15962.        write(*,*)
  15963.        write(*,*) 'exp(1) = real*4 e    = ', e4
  15964.        write(*,*) 'log(maxr4)           = ', log(maxr4)
  15965.        write(*,*) 'exp(log(maxr4))      = ', exp(log(maxr4))
  15966.        write(*,*) 'log(smallest pos r8) = ', log(pos0r4)
  15967.        write(*,*) 'exp(minr4)           = ', exp(minr4)
  15968.        write(*,*)
  15969.        write(*,*) 'Program completed. Good-bye.'
  15970.        end
  15971.  
  15972.  
  15973.  419. FORTRAN Code Generation Error with COMPLEX types
  15974.  
  15975.  Product Version(s): 4.10
  15976.  Operating System:   MS-DOS
  15977.  Flags: ENDUSER | buglist4.10 fixlist5.00
  15978.  Last Modified:  5-DEC-1989    ArticleIdent: Q35874
  15979.  
  15980.  The source code sample below generates the following error:
  15981.  
  15982.  wolf1.for(10) : error F2124: CODE GENERATION ERROR
  15983.                  Contact Microsoft Technical Support.
  15984.  wolf1.for(11) : error F2124: CODE GENERATION ERROR
  15985.                  Contact Microsoft Technical Support.
  15986.  
  15987.  Microsoft has confirmed this to be a problem in Version 4.10. We are
  15988.  researching this problem and will post new information as it becomes
  15989.  available.
  15990.  
  15991.  To work around this problem, either use the temporary variable I3,
  15992.  commented out below, or compile the code with the /Od switch.
  15993.  
  15994.  The following sample code demonstrates the problem:
  15995.  
  15996.          PROGRAM TEST
  15997.  C***************************************************
  15998.          COMPLEX*16 c(5,5)
  15999.          DOUBLE PRECISION a(5,5)
  16000.          INTEGER*2 I1,I2, I3
  16001.  C
  16002.          DO 1 I1 = 1,5
  16003.             DO 2 I2 = 1,5
  16004.  c             I3 = I1*I2
  16005.                c(I1,I2) = DCMPLX(I1*I2)
  16006.                a(I1,I2) = DFLOAT(I1*I2)
  16007.    2        CONTINUE
  16008.    1     CONTINUE
  16009.          STOP
  16010.          END
  16011.  
  16012.  
  16013.  420. Too Many Errors Cause FORTRAN Compiler to Hang
  16014.  
  16015.  Product Version(s): 4.10
  16016.  Operating System:   MS-DOS
  16017.  Flags: ENDUSER |
  16018.  Last Modified: 25-APR-1989    ArticleIdent: Q36400
  16019.  
  16020.  A source file consisting of two subroutines, the first with a
  16021.  statement out of order, causes the compiler to hang.
  16022.  
  16023.  The workaround to this problem is to eliminate the errors and then
  16024.  recompile. The errors are due to the code. When this is corrected, the
  16025.  routines compile correctly. Please see the figure on Page 55, section
  16026.  3.5, "Order of Statements" in the "Microsoft FORTRAN Compiler Language
  16027.  Reference."
  16028.  
  16029.  Both subroutines compile without hanging if compiled separately.
  16030.  However, the first routine generates 38 errors of the following type
  16031.  before it exits:
  16032.  
  16033.     x1.for(nn) : error F2836: statement out of order
  16034.  
  16035.  When both subroutines are in the same source file, the errors show on
  16036.  the screen, then the compiler hangs, requiring a warm boot.
  16037.  
  16038.  When the DATA statement is placed at the end of the subroutine, where
  16039.  the ANSI FORTRAN 77 requires it to be, everything compiles correctly.
  16040.  See also the "American National Standard Programming Language FORTRAN,
  16041.  ANSI X3.9-1978" Section 3.5.
  16042.  
  16043.  The following code demonstrates this problem:
  16044.  
  16045.         SUBROUTINE SUB1
  16046.  C this subroutine gives many errors due to a line out of order
  16047.        INTEGER LAST LINE
  16048.        SAVE LAST LINE
  16049.  C here is a line out of order
  16050.        DATA LAST LINE /-1/
  16051.  C normal order resumes
  16052.        INTEGER BLANK, ALPHA, DIGIT, LEFTBRACKET, RIGHTBRACKET,
  16053.       *   SINGLEQUOTE, DOUBLEQUOTE, COMMA, SLASH, NUMBERSIGN,
  16054.       *   AMPERSAND, SEMICOLAN, ASTERIX, EQUALSIGN, OTHER
  16055.        PARAMETER (BLANK=1 ,ALPHA=2 ,DIGIT=3 ,
  16056.       *         LEFTBRACKET=4, RIGHTBRACKET=5, SINGLEQUOTE=6,
  16057.       *         DOUBLEQUOTE=7,COMMA=8, SLASH=9,
  16058.       *         NUMBERSIGN=10, AMPERSAND=11, SEMICOLAN=12,
  16059.       *         ASTERIX=13, EQUALSIGN=14, OTHER=15)
  16060.        CHARACTER NEWBUF(4000)*1,BUFF(4000)*1,IOBUFFER*72,COMMENT*100
  16061.        CHARACTER NEWSTR*4000, OLDSTR*4000
  16062.        INTEGER LEN,PNBUFF,PBUFF,CHRSET(0:127)
  16063.        INTEGER BUFFCODE(4000),$COMMENT,CURRENTLINE
  16064.        COMMON /NB1/ NEWBUF
  16065.        COMMON /NB2/ LEN,PNBUFF,PBUFF,$COMMENT,CURRENTLINE
  16066.        COMMON /NB3/CHRSET
  16067.        COMMON /NB4/ BUFFCODE
  16068.        COMMON /NB5/ COMMENT
  16069.        EQUIVALENCE (NEWBUF(201),BUFF),(NEWSTR,NEWBUF),(OLDSTR,BUFF)
  16070.        EQUIVALENCE (BUFF,IOBUFFER)
  16071.        INTEGER SCANTO
  16072.        LOGICAL AGAIN, DONE
  16073.        CHARACTER ALPSTR(40)*1,ALPSTR1*40
  16074.        COMMON /LYNLOC1/ SCANTO,AGAIN,DONE
  16075.        COMMON /LYNLOC2/ ALPSTR
  16076.        EQUIVALENCE (ALPSTR,ALPSTR1)
  16077.        INTEGER RECLEN(100),RECIND(100),RECPTR
  16078.        COMMON /OLDREC/ RECLEN,RECIND,RECPTR
  16079.        CHARACTER * 6  CONTINUE6(19)
  16080.        INTEGER  CONTPTR
  16081.        COMMON /CON1/ CONTINUE6
  16082.        COMMON /CON2/ CONTPTR
  16083.        END
  16084.  
  16085.        SUBROUTINE SUB2
  16086.  C this subroutine will compile if in a separate file
  16087.        IMPLICIT LOGICAL (A-Z)
  16088.        INTEGER FSTART, START, TAGNUM (200), TAGSTART (1000), I
  16089.        INTEGER TAGEND (1000), TAGBEGIN (200), SYMSIZE (200), SMALL
  16090.        INTEGER TAGPTR, SYMPTR, CNT, J, K, POINTER, SPACE
  16091.        CHARACTER SYMTAB (200)*31, SMALLNAM*31
  16092.        INTEGER BLANK, ALPHA, DIGIT, LEFTBRACKET, RIGHTBRACKET,
  16093.       *   SINGLEQUOTE, DOUBLEQUOTE, COMMA, SLASH, NUMBERSIGN,
  16094.       *   AMPERSAND, SEMICOLAN, ASTERIX, EQUALSIGN, OTHER
  16095.        END
  16096.  
  16097.  
  16098.  421. F2128: Huge Array Cannot Be Aligned to Segment Boundary
  16099.  
  16100.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  16101.  Operating System:   MS-DOS              | OS/2
  16102.  Flags: ENDUSER |
  16103.  Last Modified: 26-JUL-1990    ArticleIdent: Q36414
  16104.  
  16105.  The Microsoft FORTRAN compiler will give the error
  16106.  
  16107.     F2128: name : huge array cannot be aligned to segment boundary
  16108.  
  16109.  when an array element spans a segment boundary. This error is
  16110.  discussed at the top of Page 218 in the Section 9.3.1.2 "Arrays Larger
  16111.  than 64K," in the "Microsoft FORTRAN Optimizing Compiler User's Guide"
  16112.  for versions 4.x and on Page 32 in the Section 2.3.2.2, "Limits on
  16113.  Fixed-Size Arrays Exceeding 64K" in the "Microsoft FORTRAN Advanced
  16114.  Topics" manual for version 5.00.
  16115.  
  16116.  The workaround for this limitation is to break up the array into
  16117.  arrays smaller than two segments, or change the size of the array
  16118.  elements to a power of 2 (2**n) bytes so that no elements cross a
  16119.  segment boundary.
  16120.  
  16121.  The compiler will attempt to offset the start of a huge (larger than
  16122.  64K) array so that no array element spans a segment boundary. If a
  16123.  huge array is large enough to cross more than one segment boundary
  16124.  (larger than 128K), and if the array elements are not a type whose
  16125.  size is a power of two, then no possible offset exists that will
  16126.  correctly align the array elements with respect to the segment
  16127.  boundaries.
  16128.  
  16129.  The following code demonstrates this problem:
  16130.  
  16131.        CHARACTER*10 TEST(13107)
  16132.        END
  16133.  
  16134.  This code gives the following error:
  16135.  
  16136.     F2128: TEST : huge array cannot be aligned to segment boundary
  16137.  
  16138.  
  16139.  422. Unresolved external _cfltcvt_tab with FORTRAN 4.10
  16140.  
  16141.  Product Version(s): 4.10   | 4.10
  16142.  Operating System:   MS-DOS | OS/2
  16143.  Flags: ENDUSER | S_C
  16144.  Last Modified: 25-FEB-1991    ArticleIdent: Q36553
  16145.  
  16146.  Question:
  16147.  
  16148.  I am getting an error:
  16149.  
  16150.      Link : error L2029: Unresolved external __cfltcvt_tab
  16151.  
  16152.  Is this an important symbol? How do I resolve it?
  16153.  
  16154.  Response:
  16155.  
  16156.  There are two instances when you get this unresolved external.
  16157.  One is if you are doing mixed language programming between C4.0
  16158.  and FORTRAN 4.1 and use any floating point math operations.  The
  16159.  other cause can be third party FORTRAN libraries.
  16160.  
  16161.  This unresolved external is due to the fact that C Version 4.00 doesn't
  16162.  have _cfltcvt_tab but C Versions 5.00 and C 5.10 do. _cfltcvt_tab is not
  16163.  necessary, you can still do mixed-language calling or use these FORTRAN
  16164.  libraries; you just have to resolve _cfltcvt_tab. You resolve it by
  16165.  making a dummy C module that has only one line, as follows:
  16166.  
  16167.  char near _cfltcvt_tab[20] = {'0'};
  16168.  
  16169.  Compile this and then use the library manager to add this object
  16170.  module to your C Version 4.00 library. The command to add it to your
  16171.  library is as follows:
  16172.  
  16173.  lib llibfp +dummy_c_module;
  16174.  
  16175.  (Note: if they do not have our C package your must send them our
  16176.  application note that includes this object module.)
  16177.  This will take care of your unresolved external and everything
  16178.  will work correctly.
  16179.  
  16180.  
  16181.  423. Installing In-Line 8087 Instructions
  16182.  
  16183.  Product Version(s): 4.00 4.01 4.10 | 4.10
  16184.  Operating System:   MS-DOS         | OS/2
  16185.  Flags: ENDUSER | docerr appnote S_C
  16186.  Last Modified:  7-NOV-1988    ArticleIdent: Q36799
  16187.  
  16188.  The assembler code on Page 14 of the "Microsoft FORTRAN 4.1 Update" is
  16189.  not correct. When assembled and linked with your FORTRAN application.
  16190.  This code will cause divide by zero and overflows to be masked.
  16191.  
  16192.  This behavior occurs because the code on Page 14 is incomplete.
  16193.  The correct code is listed below. Case is important, so assemble with
  16194.  the -Mx switch. You should also link with the /NOE switch. This code
  16195.  is provided in line 8087 instructions on FORTRAN Version 4.x and C
  16196.  Versions 5.x.
  16197.  
  16198.  This application note is also available from Microsoft Product Support
  16199.  Services by calling (206) 454-2030.
  16200.  
  16201.  ;************************************************************************
  16202.  ;rmfixups.asm -
  16203.  ;
  16204.  ;   Copyright (c) 1988-1988, Microsoft Corporation.  All Rights Reserved.
  16205.  ;
  16206.  ;Purpose:
  16207.  ;  Link with rmfixups.obj in order to prevent floating point instructions
  16208.  ;  from being fixed up.
  16209.  ;  The case of these names is important so assemble with the -Mx switch.
  16210.  ;
  16211.  ;*************************************************************************
  16212.  
  16213.  public  FIWRQQ,FIERQQ,FIDRQQ,FISRQQ,FJSRQQ,FIARQQ,FJARQQ,FICRQQ,FJCRQQ
  16214.  
  16215.  FIDRQQ  EQU     0
  16216.  FIERQQ  EQU     0
  16217.  FIWRQQ  EQU     0
  16218.  FIARQQ  EQU     0
  16219.  FJARQQ  EQU     0
  16220.  FISRQQ  EQU     0
  16221.  FJSRQQ  EQU     0
  16222.  FICRQQ  EQU     0
  16223.  FJCRQQ  EQU     0
  16224.  
  16225.  extrn   __fpmath:far
  16226.  extrn   __fptaskdata:far
  16227.  extrn   __fpsignal:far
  16228.  
  16229.  CDATA   segment word common 'DATA'
  16230.          dw      0
  16231.          dd      __fpmath
  16232.          dd      __fptaskdata
  16233.          dd      __fpsignal
  16234.  CDATA   ends
  16235.  
  16236.  end
  16237.  
  16238.  
  16239.  424. Largest REC Value in a WRITE Statement
  16240.  
  16241.  Product Version(s): 4.00 4.01 4.10 | 4.10
  16242.  Operating System:   MS-DOS         | OS/2
  16243.  Flags: ENDUSER |
  16244.  Last Modified:  1-DEC-1988    ArticleIdent: Q36800
  16245.  
  16246.  In the WRITE statement, the REC parameter is a positive integer
  16247.  expression specified for direct access or binary files. The largest
  16248.  value for the REC parameter is 32767.
  16249.  
  16250.  The REC parameter is discussed in the "Microsoft FORTRAN Optimizing
  16251.  Compiler for the MS-DOS Operating System Language Reference" section
  16252.  4.3.5, Page 107.
  16253.  
  16254.  
  16255.  425. The Standards to Which FORTRAN Version 4.10 Complies
  16256.  
  16257.  Product Version(s): 4.10   | 4.10
  16258.  Operating System:   MS-DOS | OS/2
  16259.  Flags: ENDUSER | 77
  16260.  Last Modified: 11-APR-1989    ArticleIdent: Q36801
  16261.  
  16262.  FORTRAN Version 4.10 is certified by the GSA as "error free" with
  16263.  respect to ANSI X3.9-1978, which is the FORTRAN77 ANSI standard. Two
  16264.  other names for ANSI X3.9-1978 are FIPS PUB 69 and ISO 1539-1980(E),
  16265.  so Microsoft conforms to those too.
  16266.  
  16267.  
  16268.  
  16269.  426. Loop Optimization with ibset Function
  16270.  
  16271.  Product Version(s): 4.00 4.01 | 4.10
  16272.  Operating System:   MS-DOS    | OS/2
  16273.  Flags: ENDUSER | buglist4.00 buglist4.01 fixlist4.10
  16274.  Last Modified:  1-DEC-1988    ArticleIdent: Q36956
  16275.  
  16276.  When compiled with loop optimization on, the sample code below does
  16277.  not produce the correct output. With loop optimization turned off, the
  16278.  program works correctly. Loop optimizaton can be turned off by using
  16279.  the compiler option /Od or /Odct.
  16280.  
  16281.  The problem occurs when passing to the intrinsic function "ibset", an
  16282.  array variable, instead of a variable. If an interger variable is
  16283.  passed to "ibset," or if loop optimization is turned off, the program
  16284.  works correctly. This behavior is a problem with the loop
  16285.  optimization.
  16286.  
  16287.  Microsoft has confirmed this to be a problem in Versions 4.00 and
  16288.  4.01. This problem was corrected in Version 4.10.
  16289.  
  16290.  More Information :
  16291.  
  16292.  The following code demonstrates this problem:
  16293.  
  16294.          integer*2 isum(2)
  16295.          isum(1) = 0
  16296.  
  16297.  c    integer i has fixed value 1 through the program
  16298.          i = 1
  16299.  
  16300.          do 100 k =1,8
  16301.          ii = ibset(isum(i),k-1)
  16302.  
  16303.  c   substitute the above line with following two lines, the problem
  16304.  c   goes away.
  16305.  c       jj = isum(i)
  16306.  c       ii = ibset(jj,k-1)
  16307.  
  16308.          isum(i) = ii
  16309.          write(*,*) isum(i),ii
  16310.  100     continue
  16311.          end
  16312.  
  16313.  
  16314.  427. Sample Code Included on the FORTRAN 5.00 Distribution Disks
  16315.  
  16316.  Product Version(s): 5.00   | 5.00
  16317.  Operating System:   MS-DOS | OS/2
  16318.  Flags: ENDUSER |
  16319.  Last Modified: 23-APR-1990    ArticleIdent: Q60980
  16320.  
  16321.  The Microsoft FORTRAN Optimizing Compiler Version 5.00 package
  16322.  includes many sample programs. Among these are standard FORTRAN
  16323.  programs, nearly two dozen sample graphics programs, and a complete
  16324.  set of source code for an OS/2 Presentation Manager (PM) application.
  16325.  
  16326.  All of the sample programs are on the disk labeled "Source Code."
  16327.  
  16328.  The following is a list of the sample code:
  16329.  
  16330.  DEMOS Subdirectory  (Demonstration Programs)
  16331.  ------------------
  16332.  
  16333.     Filename             Description
  16334.     --------             -----------
  16335.  
  16336.     DEMOEXEC.FOR         FORTRAN demo program (calling a C procedure)
  16337.     SWHET.FOR            Popular benchmark program
  16338.     EXEC.FI              FORTRAN demo program (include file)
  16339.     SIEVE.FOR            Popular benchmark program
  16340.     DWHET.FOR            Popular benchmark program
  16341.     SORTDEMO.FOR         OS/2 demonstration file
  16342.  
  16343.  SAMPLES Subdirectory  (Sample Graphics Programs)
  16344.  --------------------
  16345.  
  16346.     Filename             Description
  16347.     --------             -----------
  16348.  
  16349.     REALG.FOR            Chapter 9 graphics example
  16350.     SINE.FOR             Chapter 9 graphics example
  16351.     COLTEXT.FOR          Chapter 9 graphics example
  16352.     CGA.FOR              Chapter 9 graphics example
  16353.     EGA.FOR              Chapter 9 graphics example
  16354.     HORIZON.FOR          Chapter 9 graphics example
  16355.     GRAPHIC.FOR          Chapter 9 graphics example
  16356.     COLOR.FOR            Chapter 9 graphics example
  16357.     SAMPLER.FOR          Chapter 10 graphics example
  16358.     ANIMATE.FOR          Chapter 11 graphics example
  16359.     CGAPAL.FOR           Chapter 11 graphics example
  16360.     CURSOR.FOR           Chapter 11 graphics example
  16361.     FIGURE.FOR           Chapter 11 graphics example
  16362.     FILL.FOR             Chapter 11 graphics example
  16363.     FONTS.FOR            Chapter 11 graphics example
  16364.     MODES.FOR            Chapter 11 graphics example
  16365.     PAGE.FOR             Chapter 11 graphics example
  16366.     MAGNIFY.FOR          Chapter 11 graphics example
  16367.     PALETTE.FOR          Chapter 11 graphics example
  16368.     WINDOW.FOR           Chapter 11 graphics example
  16369.     SETROWS.FOR          Chapter 11 graphics example
  16370.     TEXT.FOR             Chapter 11 graphics example
  16371.     WRAP.FOR             Chapter 11 graphics example
  16372.  
  16373.  PM Subdirectory  (Sample OS/2 Presentation Manager Program)
  16374.  ---------------
  16375.  
  16376.     Filename             Description
  16377.     --------             -----------
  16378.  
  16379.     PMLIST               PMLIST makefile
  16380.     PMLIST.DOC           Information about the PMLIST program
  16381.     PMLIST.FD            PMLIST declarations include file
  16382.     PMLIST.FOR           PMLIST source file
  16383.     PMLIST.H             PMLIST header file
  16384.     PMLIST.RC            PMLIST resource script file
  16385.     PMLIST.DEF           PMLIST definitions file
  16386.  
  16387.  
  16388.  428. Internal read of ascii Characters
  16389.  
  16390.  Product Version(s): 4.10   | 4.10
  16391.  Operating System:   MS-DOS | OS/2
  16392.  Flags: ENDUSER |
  16393.  Last Modified: 14-NOV-1988    ArticleIdent: Q37075
  16394.  
  16395.  The following program
  16396.  
  16397.          character*2 dat2
  16398.          dat2=#0A
  16399.          read(dat2,'(a2)') n
  16400.          write(*,600)dat2,n
  16401.     600  format(z,' ',z)
  16402.          stop
  16403.          end
  16404.  
  16405.  produces the following output:
  16406.  
  16407.     0A00 2020
  16408.  
  16409.  When reading from an internal file, the file is treated as a formatted
  16410.  sequential file. When the file contains a hexadecimal 0x0A or 0x0D,
  16411.  they will be interpreted as a linefeed or carriage return. When they
  16412.  are read from a FORMATTED file, they are read as end-of-record markers
  16413.  and blanks are used to fill the record.
  16414.  
  16415.  This expected behavior is FORTRAN 77 ANSI standard. See the "American
  16416.  National Standard Programming Language FORTRAN ANSI X3.9-1978" section
  16417.  12.9.5.2.1 paragraph 45. Also, see the "Microsoft FORTRAN Optimizing
  16418.  Compiler for the MS-DOS Operating System Language Reference" section
  16419.  4.6 "Internal Files" Page 122.
  16420.  
  16421.  
  16422.  429. Internal Compiler Error ctypes.c 1.89 Line 1601
  16423.  
  16424.  Product Version(s): 4.10   | 4.10
  16425.  Operating System:   MS-DOS | OS/2
  16426.  Flags: ENDUSER |
  16427.  Last Modified: 14-NOV-1988    ArticleIdent: Q37077
  16428.  
  16429.  When compiled with loop optimization on, the code below generates the
  16430.  following error:
  16431.  
  16432.         fatal error F1001 : Internal Compiler Error
  16433.         (compiler file '@(#)ctypes.c:1.89', line 1601)
  16434.         Contact Microsoft Technical Support
  16435.  
  16436.  Microsoft has confirmed this to be a problem in Version FORTRAN 4.10.
  16437.  We are researching this problem and will post new information as is
  16438.  it becomes available.
  16439.  
  16440.  The following code demonstrates this problem:
  16441.  
  16442.        call gettim(ihr,imin,isec,i100th)
  16443.        b=10.0
  16444.        c=2.0
  16445.        do 10 i=1,1000
  16446.         x1=-b+sqrt(b**2-c)
  16447.         x2=-b-sqrt(b**2-c)
  16448.         x3=x1**2+2*b*x1+c
  16449.         x4=x2**2+2*b*x2+c
  16450.         x5=-b-sqrt(b**2-c)
  16451.         x6=c/x1
  16452.         x7=x1**2+2*b*x1+c
  16453.         x8=x2**2+2*b*x2+c
  16454.  10    continue
  16455.        call gettimn(ihr,imin,isec,i100th)
  16456.        stop
  16457.        end
  16458.  
  16459.  The problem can be avoided by compiling with the /Odct optimization.
  16460.  
  16461.  
  16462.  430. Common blocks and Segment Limits in OS/2
  16463.  
  16464.  Product Version(s): 4.10
  16465.  Operating System:   OS/2
  16466.  Flags: ENDUSER |
  16467.  Last Modified:  1-NOV-1988    ArticleIdent: Q37267
  16468.  
  16469.  A very large FORTRAN program you can compile and link under DOS with
  16470.  PLink86, compiles but does not link under OS/2 with the Microsoft
  16471.  Linker. Error "L1073 file-segment limit exceeded" is produced. Using
  16472.  the /SE switch with a large value to increase number of segments does
  16473.  not help.
  16474.  
  16475.  Although the 80286 allows a process to have 4095 segments in its local
  16476.  descriptor table, OS/2 only allows an application to have 254 physical
  16477.  segments. In FORTRAN Version 4.10, each common block is given its own
  16478.  physical segment. If a program has many common blocks, it may need
  16479.  more than 254 segments. Using the /SE switch to increase the number of
  16480.  segments will not work properly because this switch is only for
  16481.  logical, not physical, segments.
  16482.  
  16483.  Using the /PAC option to pack code segments may help. If it does not,
  16484.  the only workaround for this problem is to combine common blocks in
  16485.  the program.
  16486.  
  16487.  
  16488.  431. Manually Building FORTRAN Run-Time Libraries
  16489.  
  16490.  Product Version(s): 4.10 5.00  | 4.10 5.00
  16491.  Operating System:   MS-DOS     | OS/2
  16492.  Flags: ENDUSER | run-time manual
  16493.  Last Modified:  4-DEC-1990    ArticleIdent: Q37268
  16494.  
  16495.  To build combined Microsoft FORTRAN libraries, use the Setup program
  16496.  to build the libraries. If you have problems running the Setup
  16497.  program or want to build the libraries manually using the LIB
  16498.  utility, follow the procedures below:
  16499.  
  16500.  1. Copy the appropriate files (the contents of either your Large- or
  16501.     Medium-Model Libraries Disk) to your hard disk.
  16502.  
  16503.  2. Copy LIB.EXE to your current directory or make sure it is in a
  16504.     directory listed in your PATH statement.
  16505.  
  16506.  3. If you are building an emulator or coprocessor library, perform
  16507.     the following (where the question mark is either M for medium model
  16508.     or L for large model):
  16509.  
  16510.        LIB ?LIBFP.LIB
  16511.  
  16512.        Operations: -CVT.OBJ
  16513.  
  16514.      If you are building the alternate math library, perform the
  16515.      following (where the question mark is either M for medium model or
  16516.      L for large model)
  16517.  
  16518.        LIB ?LIBFA.LIB
  16519.  
  16520.        Operations: -FCCVT.OBJ
  16521.  
  16522.  4. Run the library manager to create the appropriate FORTRAN library
  16523.     as follows:
  16524.  
  16525.        LIB <name of the library you want to build>
  16526.        Library does not exist. Create?  <y>
  16527.        Operations: <from the operations list below>
  16528.        List file: <cr>
  16529.        Output library: <cr>
  16530.  
  16531.  To build a library with C compatibility, leave out either the
  16532.  ?CLIB1.LIB or the ?CLIB2.LIB in the lists of operations that follow.
  16533.  
  16534.  The following are the operations for all combinations of the FORTRAN
  16535.  libraries. Replace the question marks (?) below with either M for a
  16536.  medium-model library or L for a large-model library.
  16537.  
  16538.  DOS Libraries
  16539.  -------------
  16540.  
  16541.  Emulator ?LIBFORE.LIB
  16542.     Operations: LIBH.LIB+?LIBFP.LIB+?LIBFOR.LIB&
  16543.                 ?LIBFOR1.LIB+EM.LIB+?CLIB1.LIB
  16544.  
  16545.  Coprocessor ?LIBFOR7.LIB
  16546.     Operations: LIBH.LIB+?LIBFP.LIB+?LIBFOR.LIB&
  16547.                 ?LIBFOR1.LIB+87.LIB+?CLIB1.LIB
  16548.  
  16549.  Alternate ?LIBFORA.LIB
  16550.     Operations: LIBH.LIB+?LIBFA.LIB+?LIBFOR.LIB&
  16551.                 ?LIBFOR1.LIB+?CLIB1.LIB
  16552.  
  16553.  OS/2 Libraries
  16554.  --------------
  16555.  
  16556.  Emulator
  16557.     Real mode: ?LIBFER.LIB
  16558.     Operations: LIBH.LIB+?LIBFP.LIB+?LIBFOR.LIB&
  16559.                 ?LIBFOR1.LIB+EM.LIB+?CLIB1.LIB
  16560.  
  16561.     Protect mode ?LIBFEP.LIB
  16562.     Operations: LIBH.LIB+?LIBFP.LIB+?LIBFOR.LIB&
  16563.                 ?LIBFOR2.LIB+EM.LIB+?CLIB2.LIB
  16564.  
  16565.  Coprocessor
  16566.     Real mode: ?LIBF7R.LIB
  16567.     Operations: LIBH.LIB+?LIBFP.LIB+?LIBFOR.LIB&
  16568.                 ?LIBFOR1.LIB+87.LIB+?CLIB1.LIB
  16569.  
  16570.     Protect mode: ?LIBF7P.LIB
  16571.     Operations: LIBH.LIB+?LIBFP.LIB+?LIBFOR.LIB&
  16572.                 ?LIBFOR2.LIB+87.LIB+?CLIB2.LIB
  16573.  
  16574.  Alternate
  16575.     Real mode: ?LIBFAR.LIB
  16576.     Operations: LIBH.LIB+?LIBFA.LIB+?LIBFOR.LIB&
  16577.                 ?LIBFOR1.LIB+?CLIB1.LIB
  16578.  
  16579.     Protect mode: ?LIBFAP.LIB
  16580.     Operations: LIBH.LIB+?LIBFA.LIB+?LIBFOR.LIB&
  16581.                 ?LIBFOR2.LIB+?CLIB2.LIB
  16582.  
  16583.  The ampersand (&) is used for line continuation. If you place all of
  16584.  the operations on one line, replace the ampersand with a plus (+).
  16585.  
  16586.  
  16587.  432. Assumed-Sized Array Declarator Not Allowed in Common
  16588.  
  16589.  Product Version(s): 3.x 4.00 4.01 | 4.10
  16590.  Operating System:   MS-DOS        | OS/2
  16591.  Flags: ENDUSER | assumed-size adjustable common
  16592.  Last Modified:  7-NOV-1988    ArticleIdent: Q37544
  16593.  
  16594.  Question :
  16595.  
  16596.  I declare an array in a common block in my main FORTRAN program and
  16597.  want to reference it in another module. How can I declare the same array
  16598.  in a common block with an adjustable size or assumed-size array in the
  16599.  other module?
  16600.  
  16601.  Response:
  16602.  
  16603.  This CANNOT be done. As defined in ANSI standard (ANSI x3.9-1978,
  16604.  section 5.1.2), each array declarator is either an actual array
  16605.  declarator or a dummy array declarator. An adjustable array declarator
  16606.  and an assumed-size array declarator are dummy array declarators. A
  16607.  dummy array declarator is not permitted in a COMMON statement.
  16608.  Therefore, it is not possible to declare an array with an adjustable
  16609.  or assumed size in a common block.
  16610.  
  16611.  You may pass the array declared in your main program to a subroutine
  16612.  as an argument and declare the argument with an adjustable array
  16613.  declarator or assumed-size declarator in a DIMENSION statement.
  16614.  Notice, in the example below, the HUGE attribute must be used if the
  16615.  array has huge size.
  16616.  
  16617.  The following is an example::
  16618.  
  16619.  c source file 1
  16620.          program test
  16621.          common r(32000)
  16622.          ....
  16623.          call doit(r)
  16624.          end
  16625.  
  16626.  c source file 2
  16627.          subroutine doit (r)
  16628.          dimension r[huge](*)
  16629.          .....
  16630.          return
  16631.          end
  16632.  
  16633.  
  16634.  433. F6501 Error from Reading Hex 1A in Unformatted Format
  16635.  
  16636.  Product Version(s): 4.00
  16637.  Operating System:   MS-DOS
  16638.  Flags: ENDUSER | buglist4.00 fixlist4.01
  16639.  Last Modified: 23-APR-1990    ArticleIdent: Q60982
  16640.  
  16641.  The F6501 error "end-of-file encountered" can be generated if a
  16642.  record in an unformatted, direct-access file ends with the hex value
  16643.  1A.
  16644.  
  16645.  Microsoft has confirmed this to be a problem in FORTRAN Version 4.00.
  16646.  This problem was corrected in FORTRAN Version 4.01.
  16647.  
  16648.  FORTRAN mistakenly generates the F6501 error when an integer*1 is
  16649.  given the value 26 (Hex 1A) and is the last value of an unformatted,
  16650.  direct-access record. Hex 1A is an end-of-file marker, and FORTRAN
  16651.  mistakenly interprets that as an end-of-file marker, thus causing the
  16652.  F6501 error.
  16653.  
  16654.  The following sample code illustrates the problem:
  16655.  
  16656.        integer*1 d(4)
  16657.        open(3,file='test.dat',form='unformatted',
  16658.       +access='direct',recl=4)
  16659.        read(*,*)(d(j),j=1,4)
  16660.        write(3,rec=1)(d(j),j=1,4)
  16661.        read(3,rec=1)(d(j),j=1,4)
  16662.        end
  16663.  
  16664.  The input needed to generate the F6501 error is any three numbers
  16665.  separated by commas, followed by the number 26. For example, the
  16666.  following input to the above program generates the F6501 error:
  16667.  
  16668.     1,2,3,26
  16669.  
  16670.  
  16671.  434. FORTRAN: /Zi Switch Causes a .MAP File to Be Built
  16672.  
  16673.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  16674.  Operating System:   MS-DOS              | OS/2
  16675.  Flags: ENDUSER | buglist4.10 fixlist5.00
  16676.  Last Modified:  7-NOV-1989    ArticleIdent: Q37636
  16677.  
  16678.  When compiling with the Microsoft FORTRAN compiler, the FL driver with
  16679.  the /Zi option forces the linker to generate a .MAP file.
  16680.  
  16681.  Microsoft has confirmed this to be a problem in Version 4.10. This
  16682.  problem was corrected in Version 5.00.
  16683.  
  16684.  This problem does not occur with the Microsoft C Compiler Versions
  16685.  4.00, 5.00, 5.10, or with the Microsoft Pascal Compiler Version 4.00.
  16686.  
  16687.  
  16688.  435. FORTRAN Option /St Fails if in Enviornment Variable
  16689.  
  16690.  Product Version(s): 4.10   | 4.10
  16691.  Operating System:   MS-DOS | OS/2
  16692.  Flags: ENDUSER |
  16693.  Last Modified:  1-DEC-1988    ArticleIdent: Q38330
  16694.  
  16695.  If the Microsoft FORTRAN Optimizing Compiler Version 4.10 option /St
  16696.  is placed in the fl= enviornment variable, the compiler stops the
  16697.  subtitle at the first blank space in the quotation marks instead of
  16698.  stopping at the closing quotation. It also includes the " as the first
  16699.  character of the subtitle.
  16700.  
  16701.  The following steps produce the problem:
  16702.  
  16703.  1. Set your enviornment variable as follows:
  16704.  
  16705.     set fl= /c /Fs /St"some subtitle"
  16706.  
  16707.  2. Run the Microsoft FORTRAN Optimizing Compiler Version 4.10 as
  16708.     follows:
  16709.  
  16710.     fl foo.for
  16711.  
  16712.  3. Take a look at your foo.lst file; the subtitle appears as
  16713.     follows:
  16714.  
  16715.     "some
  16716.  
  16717.  To get expected results, e.g. correct subtitles, use the following
  16718.  steps:
  16719.  
  16720.  1. Run the Microsoft FORTRAN Optimizing Compiler Version 4.10 from the
  16721.     command line as follows:
  16722.  
  16723.     fl /c /Fs /St"some subtitle" foo.for
  16724.  
  16725.  2. Take a look at your foo.lst file, the subtitle appears as follows:
  16726.  
  16727.     some subtitle
  16728.  
  16729.  
  16730.  436. Accessing System and spawnlp and forexec.inc File.
  16731.  
  16732.  Product Version(s): 4.10   | 4.10
  16733.  Operating System:   MS-DOS | OS/2
  16734.  Flags: ENDUSER |
  16735.  Last Modified:  1-DEC-1988    ArticleIdent: Q38332
  16736.  
  16737.  The SYSTEM function passes a specified C string to the DOS interpreter
  16738.  (COMMAND.COM), which interprets and executes the string as a DOS
  16739.  command. The procedure to do this is described on Page 296 in the
  16740.  "Microsoft FORTRAN 4.1 Optimizing Compiler User's Guide."
  16741.  
  16742.  The manual also states that the INTERFACE statement is required to
  16743.  access SYSTEM and _SPAWNLP. Because the INTERFACE statements for these
  16744.  two functions are contained in the file forexec.inc (supplied with
  16745.  FORTRAN compiler), you can include this file instead of writing the
  16746.  INTERFACE statement yourself. The following is an example that uses
  16747.  the INCLUDE statement for SYSTEM defined in forexec.inc.
  16748.  
  16749.  The following program prints a directory of files in the current
  16750.  directory:
  16751.  
  16752.  $INCLUDE:'forexec.inc'
  16753.        INTEGER*2 SYSTEM
  16754.        I = SYSTEM('DIR'C)
  16755.        end
  16756.  
  16757.  The file forexec.inc is an interface file for C library routines. The
  16758.  interface to SYSTEM and _SPAWNLP is defined in the forexec.inc.
  16759.  
  16760.  
  16761.  437. Command-Line Switches Require Spaces between Them
  16762.  
  16763.  Product Version(s): 4.10   | 4.10
  16764.  Operating System:   MS-DOS | OS/2
  16765.  Flags: ENDUSER |
  16766.  Last Modified:  4-MAY-1989    ArticleIdent: Q43606
  16767.  
  16768.  The compiler command-line switches require spaces between them to
  16769.  function normally.
  16770.  
  16771.  For example, the following command line will execute the compile and
  16772.  go directly into the linker, ignoring the /c switch and possibly
  16773.  others as well:
  16774.  
  16775.     FL/4I2/FPc/Od/c <filename>
  16776.  
  16777.  Moving the /c to the front of the command line will result in a
  16778.  command-line warning "D4002 ignoring unknown flag," and will continue
  16779.  with the compile and link.
  16780.  
  16781.  Specifying the line with spaces as shown below will alleviate the
  16782.  problem:
  16783.  
  16784.     FL /4I2 /FPc /Od /c
  16785.  
  16786.  
  16787.  438. Module Name Lost when Compiled with /Gt and /4Yb in FORTRAN
  16788.  
  16789.  Product Version(s): 4.00 4.01 4.10 | 4.10
  16790.  Operating System:   MS-DOS         | OS/2
  16791.  Flags: ENDUSER |  buglist4.00 buglist4.01 buglist4.10 fixlist5.00
  16792.  Last Modified:  7-NOV-1989    ArticleIdent: Q38693
  16793.  
  16794.  If the /Gt option is used in conjunction with /4Yb or with the $DEBUG
  16795.  metacommand when compiling a program with the Microsoft FORTRAN
  16796.  Optimizing Compiler, you will get only the line number, instead of
  16797.  both module name and line number.
  16798.  
  16799.  Microsoft has confirmed this to be a problem in Versions 4.00, 4.01,
  16800.  and 4.10. This problem was corrected in Version 5.00.
  16801.  
  16802.  The sample program below demonstrates this behavior. Compile with
  16803.  /Gt10 and /4Yb. The following sample purposely simulates a R6103
  16804.  divide-by-zero run-time error:
  16805.  
  16806.        program zerodivide
  16807.        real x, y
  16808.        x = 5.0
  16809.        y = x
  16810.        y = y - x
  16811.        x = x / y
  16812.        end
  16813.  
  16814.  Source filenames are stored in DGROUP. When the /Gt option is used, it
  16815.  moves out to a different segment. It appears that the problem occurs
  16816.  when the numerical argument to /Gt (i.e., /Gt10) is less than the
  16817.  length of the source filename plus 6.
  16818.  
  16819.  
  16820.  439. FORTRAN Setup on System with Only 5.25-Inch & 3.5-Inch Drives
  16821.  
  16822.  Product Version(s): 5.00
  16823.  Operating System:   MS-DOS
  16824.  Flags: ENDUSER |
  16825.  Last Modified:  8-JUN-1990    ArticleIdent: Q60983
  16826.  
  16827.  Microsoft FORTRAN 5.00 does not have a setup option for systems with
  16828.  one 5.25-inch drive and one 3.5-inch drive with no hard drive;
  16829.  therefore, the setup must be done manually. Below are the steps needed
  16830.  to manually set up FORTRAN on such a system.
  16831.  
  16832.  This setup is for running the compiler from your 3.5-inch disk drive
  16833.  (Drive B), with the source code on your 5.25-inch disk drive (Drive
  16834.  A). Copy the following files from the Setup, Compiler 1, and Compiler
  16835.  2 disks onto a single 3.5-inch disk. The files are as follows:
  16836.  
  16837.  Setup Disk          Compiler 1 Disk         Compiler 2 Disk
  16838.  ----------          ---------------         ---------------
  16839.  
  16840.  FL.ERR              F3S.EX                  F2.EXE
  16841.  FL.EXE              F1.EXE                  LINK.EXE
  16842.  FL.HLP              F1.ERR
  16843.  F3.EXE              F23.ERR
  16844.  
  16845.  The next step is to manually build the appropriate library that you
  16846.  will use to link your FORTRAN modules with. The first step is to
  16847.  consult the table titled "Library Build Table" below and copy all of
  16848.  these modules (for example, LIBH.LIB and LLIBFP.LIB, etc.) and the
  16849.  file LIB.EXE from the Utilities 1 disk onto a single 3.5-inch disk.
  16850.  Next, with this 3.5-inch disk in Drive B, do the following:
  16851.  
  16852.  1. Type the following from the B:\> prompt
  16853.  
  16854.        LIB libraryname.LIB <ENTER>
  16855.  
  16856.     where libraryname is the name associated with the type of library
  16857.     you are making (for example, LLIBFORE.LIB).
  16858.  
  16859.  2. The library manager will prompt you at this point with the
  16860.     following:
  16861.  
  16862.        LIBRARY DOES NOT EXIST, CREATE ?
  16863.  
  16864.  3. Type Y and press ENTER at the prompt.
  16865.  
  16866.  4. At this point, the library manager will prompt you with the
  16867.     following:
  16868.  
  16869.        OPERATIONS:
  16870.  
  16871.  5. At the prompt, type the following
  16872.  
  16873.        +firstmodule.LIB+secondmodule.LIB+...+lastmodule.LIB <ENTER>
  16874.  
  16875.     where FIRSTMODULE.LIB is the name of the first module listed below
  16876.     in the LIBRARY BUILD TABLE, SECONDMODULE.LIB is the next, and so
  16877.     on.
  16878.  
  16879.  6. At this point, the library manager will prompt you with the
  16880.     following:
  16881.  
  16882.        LIST FILE?
  16883.  
  16884.  7. Press ENTER at the prompt.
  16885.  
  16886.  8. The library manager will create the library that you named in the
  16887.     first step.
  16888.  
  16889.  Library Build Table
  16890.  -------------------
  16891.  
  16892.  Emulator Math Library:  ?LIBFORE.LIB  (where ? is M or L)
  16893.       OPERATIONS:    LIBH.LIB+?LIBFP.LIB+?LIBFOR.LIB+
  16894.                      ?LIBFOR1.LIB+EM.LIB+?CLIB1.LIB
  16895.  
  16896.  Coprocessor Math Library:  ?LIBFOR7.LIB
  16897.       OPERATIONS:    LIBH.LIB+?LIBFP.LIB+?LIBFOR.LIB+
  16898.                      ?LIBFOR1.LIB+87.LIB+?CLIB1.LIB
  16899.  
  16900.  Alternate Math Library:  ?LIBFORA.LIB
  16901.       OPERATIONS:    LIBH.LIB+?LIBFA.LIB+?LIBFOR.LIB+
  16902.                      ?LIBFOR1.LIB+?CLIB1.LIB
  16903.  
  16904.  Note: "M" is for building medium memory model libraries, while "L" is
  16905.  for large memory model libraries. "L" is the default.
  16906.  
  16907.  The following is an example of building a large-model Emulator Math
  16908.  Library:
  16909.  
  16910.  1. At the prompt, type the following:
  16911.  
  16912.        LIB  LLIBFORE.LIB <ENTER>
  16913.  
  16914.  2. The following prompt appears:
  16915.  
  16916.        LIBRARY DOES NOT EXIST, CREATE? (y/n)
  16917.  
  16918.  3. Type the following:
  16919.  
  16920.        Y <ENTER>
  16921.  
  16922.  4. The following prompt appears:
  16923.  
  16924.        OPERATIONS:
  16925.  
  16926.  5. Type the following at the prompt;
  16927.  
  16928.        +LIBH.LIB+LLIBFP.LIB+LLIBFOR.LIB+LLIBFOR1.LIB+EM.LIB+LCLIB1.LIB <ENTER>
  16929.  
  16930.  6. The following message appears:
  16931.  
  16932.        LIST FILE?
  16933.  
  16934.  7. Press ENTER.
  16935.  
  16936.  At this point, the Library Manager will create a large-model Emulator
  16937.  Math library named LLIBFORE.LIB. You then need to copy the library you
  16938.  just created onto your 3.5-inch compiler disk. The last part of setup
  16939.  involves setting up your environment variables. You need to add the
  16940.  following lines to the AUTOEXEC.BAT file that is located on your boot
  16941.  disk:
  16942.  
  16943.     PATH B:\
  16944.     SET LIB=B:\
  16945.     SET TMP=B:\
  16946.     SET INCLUDE=A:\
  16947.  
  16948.  The PATH statement tells the computer where to look for the compiler
  16949.  and linker files (here we assume that your 3.5-inch run disk is Drive
  16950.  B). The LIB statement tells the computer where your library will be,
  16951.  the TMP statement tells the computer where to write its temporary
  16952.  files, and the INCLUDE statement tells the computer where to look for
  16953.  include files.
  16954.  
  16955.  You also need to add the following lines to your CONFIG.SYS
  16956.  file:
  16957.  
  16958.     FILES=20
  16959.     BUFFERS=20
  16960.  
  16961.  
  16962.  440. No Utilities and Source Code Disk Shipped with FORTRAN
  16963.  
  16964.  Product Version(s):
  16965.  Operating System:   4.10   | 4.10
  16966.  Flags: MS-DOS | OS/2
  16967.  Last Modified: 10-APR-1989    ArticleIdent: Q39066
  16968.  ENDUSER | docerr
  16969.  
  16970.  Problem:
  16971.  
  16972.  Page 20 (section 2.4.3) of the "Microsoft FORTRAN 4.1 Optimizing
  16973.  Compiler User's Guide" incorrectly states the following:
  16974.  
  16975.     Source programs, including the DEMO.FOR demonstration program on
  16976.     the Utilities and Source Code distribution disk...
  16977.  
  16978.  This should read as follows:
  16979.  
  16980.     Source programs, including the DEMO.FOR demonstration program in
  16981.     the DEMOS subdirectory of the Setup distribution disk...
  16982.  
  16983.  There is no Utilities and Source Code distribution disk included with
  16984.  the FORTRAN package.
  16985.  
  16986.  
  16987.  441. Implied List in BLOCK DATA Generates Protection Violation
  16988.  
  16989.  Product Version(s): 5.00
  16990.  Operating System:   OS/2
  16991.  Flags: ENDUSER |
  16992.  Last Modified: 16-JUL-1990    ArticleIdent: Q63817
  16993.  
  16994.  The Microsoft FORTRAN Compiler version 5.00 generates a "Protection
  16995.  Violation" error under OS/2 when compiling the program below with the
  16996.  /4Ya switch. This problem does not occur under MS-DOS or in the DOS
  16997.  compatibility box of OS/2.
  16998.  
  16999.        block data
  17000.        integer var(2)
  17001.        common /test/ var
  17002.        data (var(i),i=1,2) /0, 1/
  17003.        end
  17004.        end
  17005.  
  17006.  This information applies to the Microsoft FORTRAN Compiler version
  17007.  5.00 for OS/2.
  17008.  
  17009.  The following are the workarounds to avoid the "Protection Violation"
  17010.  error:
  17011.  
  17012.  1. Do not use the /4Ya compiler option.
  17013.  
  17014.  2. Change all implied DO lists to lists of array elements and/or
  17015.     variables; for example:
  17016.  
  17017.         Change:     data (var(i),i=1,2) /0, 1/
  17018.         To:         data var(1), var(2) /0, 1/
  17019.  
  17020.  3. Compile the program in MS-DOS or the DOS compatibility box of OS/2.
  17021.  
  17022.  More information concerning the BLOCK DATA statement and implied DO
  17023.  lists can be found on Pages 123-124 and Page 141, respectively, in the
  17024.  "Microsoft FORTRAN Reference" manual.
  17025.  
  17026.  Microsoft is researching this problem and will post new information
  17027.  here as it becomes available.
  17028.  
  17029.  
  17030.  442. Complex Numbers and Error F2112
  17031.  
  17032.  Product Version(s): 4.10   | 4.10
  17033.  Operating System:   MS-DOS | OS/2
  17034.  Flags: ENDUSER |
  17035.  Last Modified:  4-MAY-1989    ArticleIdent: Q39068
  17036.  
  17037.  You cannot use variables directly while manipulating complex numbers.
  17038.  For example, the program below produces the following error:
  17039.  
  17040.     Error F2112 : I : not symbolic constant.
  17041.  
  17042.  The workaround is to use an intrinsic function CMPLX, as follows:
  17043.  
  17044.     Z = CMPLX(I,1.2).
  17045.  
  17046.  The following program demonstrates the problem:
  17047.  
  17048.  COMPLEX*8 Z
  17049.  REAL*4 I
  17050.  Z = (I,1.2)
  17051.  end
  17052.  
  17053.  Page 24 of the "Microsoft FORTRAN Version 4.1 Optimizing Compiler
  17054.  Language Reference and Mixed-Language Programmer's Guide" describes
  17055.  complex data types as follows:
  17056.  
  17057.     The COMPLEX or COMPLEX*8 data type is an ordered pair of single
  17058.     precision real numbers. COMPLEX*16 data type is an ordered pair of
  17059.     double-precision real numbers. The first number in the pair
  17060.     represents the real part of a complex number, and the second number
  17061.     represents the imaginary part.
  17062.  
  17063.  For example, the complex number (7,3.2) represents the number 7.0+3.2i
  17064.  
  17065.  
  17066.  443. FORTRAN Common Blocks Must Have Same Size if Same Name
  17067.  
  17068.  Product Version(s): 4.10   | 4.10
  17069.  Operating System:   MS-DOS | OS/2
  17070.  Flags: ENDUSER |
  17071.  Last Modified: 18-APR-1989    ArticleIdent: Q39069
  17072.  
  17073.  When you declare a FORTRAN common block and give it the name of a
  17074.  previously declared FORTRAN common block, you must be sure that the
  17075.  sizes of the two common blocks are exactly the same. If not, you will
  17076.  often receive the following error message:
  17077.  
  17078.     error F2323: "block name": COMMON: size changed
  17079.  
  17080.  This message is ANSI 77 FORTRAN standard as documented in the "American
  17081.  National Standard Programming Language FORTRAN" manual on Page 8-4. It
  17082.  states the following:
  17083.  
  17084.  "Within an executable program, all named common blocks that
  17085.  have the same name must be the same size."
  17086.  
  17087.  
  17088.  444. Calling C Graphics Routines From FORTRAN Example
  17089.  
  17090.  Product Version(s): 4.10
  17091.  Operating System:   MS-DOS
  17092.  Flags: ENDUSER | S_C S_QUICKC graphics
  17093.  Last Modified: 10-APR-1989    ArticleIdent: Q39231
  17094.  
  17095.  The Microsoft FORTRAN package does not include a graphics library. One
  17096.  effective method of getting Microsoft FORTRAN to do graphics is to
  17097.  interface to the graphics library included with either Microsoft
  17098.  Optimizing C or QuickC.
  17099.  
  17100.  This article presents an example FORTRAN program that demonstrates
  17101.  calling the C graphics library from FORTRAN. As written, this example
  17102.  will work correctly on a hercules-based system. The modification
  17103.  required for other graphics adapters is documented within the program
  17104.  below.
  17105.  
  17106.  For additional information, query the key words "Graphics For
  17107.  FORTRAN" on OnLine.
  17108.  
  17109.  The following is an example FORTRAN program:
  17110.  
  17111.  c**********************************************************************
  17112.  c This is an example FORTRAN program that demonstrates calling C      *
  17113.  c graphics library functions.  The interfacing examples presented     *
  17114.  c here may be used as a template for calling other graphics library   *
  17115.  c functions or other C Run-time Library functions from a FORTRAN      *
  17116.  c program.                                                            *
  17117.  c                                                                     *
  17118.  c To compile and link this program, issue the following command:      *
  17119.  c                                                                     *
  17120.  c      FL /FPi FGRDEMO.FOR GRAPHICS.LIB /link /NOI                    *
  17121.  c                                                                     *
  17122.  c The /FPi switch is included for machines that do not have a math    *
  17123.  c coprocessor.                                                        *
  17124.  c                                                                     *
  17125.  c                                                                     *
  17126.  c A few caveats of calling C from FORTRAN:                            *
  17127.  c                                                                     *
  17128.  c  - Every C function being called must have an interface statement   *
  17129.  c    because of reasons below.                                        *
  17130.  c                                                                     *
  17131.  c  - The 'C' attribute must appear in the interface.  This informs    *
  17132.  c    FORTRAN to use C calling conventions.                            *
  17133.  c                                                                     *
  17134.  c  - The alias attribute must appear in the interface.  This serves   *
  17135.  c    three purposes:                                                  *
  17136.  c     - This allows an underscore to be prepended to function         *
  17137.  c       names -- which is consistent with C naming conventions.       *
  17138.  c     - FORTRAN, by default, truncates identifiers to six characters. *
  17139.  c       An alias allows you to exceed this limit.                     *
  17140.  c     - FORTRAN converts all identifiers to uppercase.  An alias      *
  17141.  c       gives you the opportunity to declare a function in lower      *
  17142.  c       case.  This allows you to preserve case sensitivity during    *
  17143.  c       the link phase with /NOI.                                     *
  17144.  c                                                                     *
  17145.  c  - Any string being passed to C must be a C string (null            *
  17146.  c    terminated).                                                     *
  17147.  c                                                                     *
  17148.  c  - The manifest constants in the C include files are not available  *
  17149.  c    to FORTRAN programs.  Whenever a manifest constant is called     *
  17150.  c    for, its literal value must be substituted.                      *
  17151.  c**********************************************************************
  17152.  
  17153.  c
  17154.  c     Declare interfaces to C graphics library functions.
  17155.  c
  17156.        interface to subroutine outtext [C,alias:'__outtext'](string)
  17157.        character string [reference]
  17158.        end
  17159.  
  17160.        interface to integer*2 function setvid[C,alias:'__setvideomode']
  17161.       *(mode)
  17162.        integer*2 mode
  17163.        end
  17164.  
  17165.        interface to subroutine rectan [C,alias:'__rectangle']
  17166.       *(control,x1,y1,x2,y2)
  17167.        integer*2 control,x1,y1,x2,y2
  17168.        end
  17169.  
  17170.        interface to subroutine setpos [C,alias:'__settextposition']
  17171.       *(x,y)
  17172.        integer*2 x,y
  17173.        end
  17174.  
  17175.        Program FGRDEMO
  17176.  c
  17177.  c Define some variables.
  17178.  c
  17179.        character*50 greeting
  17180.        integer*2    ret
  17181.  c
  17182.  c The interface statement above is not enough.  We must again
  17183.  c state what type 'setvid' will return.
  17184.  c
  17185.        integer*2    setvid
  17186.  
  17187.  c
  17188.  c     The C attribute will null terminate this string for passing.
  17189.  c
  17190.        greeting = 'Hello, world!'C
  17191.  c
  17192.  c Switch to Hercules graphics mode.  Substitute other values as
  17193.  c appropriate (e.g. 16 for EGA/VGA).
  17194.  c
  17195.        ret = setvid(8)
  17196.  
  17197.        if (ret .eq. 0) then
  17198.  c
  17199.  c If the return value is zero, this mode is not supported.
  17200.  c
  17201.              write (*,*) 'Selected graphics mode not supported!'
  17202.           else
  17203.  c
  17204.  c Move cursor and display a greeting.
  17205.  c
  17206.              call setpos (2,5)
  17207.              call outtext (greeting)
  17208.  c
  17209.  c Draw a rectangle.
  17210.  c
  17211.              call rectan (2,10,5,220,90)
  17212.  c
  17213.  c Wait for user to hit <ENTER>.
  17214.  c
  17215.              call setpos (4,5)
  17216.              call outtext ('Hit enter to quit:'C)
  17217.              read (*,'(A)') ch
  17218.  c
  17219.  c Go back to the default video mode and terminate.
  17220.  c
  17221.              ret = setvid (-1)
  17222.           endif
  17223.        end
  17224.  
  17225.  
  17226.  445. Run Time "Please Insert Diskette...", "Cannot Load Overlay..."
  17227.  
  17228.  Product Version(s): 3.3x 4.00 4.01 4.10
  17229.  Operating System:   MS-DOS
  17230.  Flags: ENDUSER | s_link s_c
  17231.  Last Modified: 12-JAN-1989    ArticleIdent: Q39335
  17232.  
  17233.  When running a FORTRAN Version 3.3x program linked with overlays, the
  17234.  following message may be generated:
  17235.  
  17236.     Please insert diskette containing PROGNAME.EXE in drive C: and
  17237.     strike any key when ready.
  17238.  
  17239.  In FORTRAN Versions 4.00, 4.01, and 4.10, the following message may
  17240.  appear:
  17241.  
  17242.     Cannot load overlay:  too many open files
  17243.  
  17244.  The cause is probably a shortage of file handles. The overlay manager
  17245.  code didn't have a file handle available for the called overlay. Make
  17246.  sure the number of files set in CONFIG.SYS is correct, and close files
  17247.  when possible in the program. Resident software (TSR programs) also
  17248.  may use up file handles.
  17249.  
  17250.  DOS uses up the first five file handles, so the number available to
  17251.  the program is five less than the FILES= setting in CONFIG.SYS. If the
  17252.  version of DOS is one in which a files setting of greater than 20 is
  17253.  not supported (Versions 3.20 or earlier), and if FILES= is set to a
  17254.  number greater than 20, the actual files setting may revert to the
  17255.  default of 8 handles, leaving only 3 for the FORTRAN program.
  17256.  
  17257.  However, even if the DOS is a version that supports a files setting
  17258.  greater than 20 (Versions 3.30 and later), the FORTRAN program still
  17259.  recognizes only the limit of 20 handles (5 for DOS and 15 for the
  17260.  program). It is not possible to cause FORTRAN to recognize more than
  17261.  20 file handles.
  17262.  
  17263.  If the FILES= setting is correct, then using up all file handles in
  17264.  the course of the program will give this message. The program below,
  17265.  consisting of three source files, demonstrates this behavior. The
  17266.  object modules created from compiling these files should be linked
  17267.  using the overlay structure A+(B)+(C).
  17268.  
  17269.  The following is the sample program:
  17270.  
  17271.  C   This is file A.FOR, the main program.
  17272.        OPEN(1, FILE='TEST1')
  17273.        OPEN(2, FILE='TEST2')
  17274.        OPEN(3, FILE='TEST3')
  17275.        OPEN(4, FILE='TEST4')
  17276.        OPEN(5, FILE='TEST5')
  17277.        OPEN(6, FILE='TEST6')
  17278.        OPEN(7, FILE='TEST7')
  17279.        OPEN(8, FILE='TEST8')
  17280.        OPEN(9, FILE='TEST9')
  17281.        OPEN(10, FILE='TEST10')
  17282.        OPEN(11, FILE='TEST11')
  17283.        OPEN(12, FILE='TEST12')
  17284.        OPEN(13, FILE='TEST13')
  17285.        OPEN(14, FILE='TEST14')
  17286.        OPEN(15, FILE='TEST15')
  17287.        CALL X1()
  17288.        CALL X2()
  17289.        STOP
  17290.        END
  17291.  
  17292.  C   This is file B.FOR, in the first overlay.
  17293.        SUBROUTINE X1()
  17294.        WRITE(*,*) 'Here in X1'
  17295.        RETURN
  17296.        END
  17297.  
  17298.  C   This is file C.FOR, in the second overlay.
  17299.        SUBROUTINE X2()
  17300.        WRITE(*,*) 'Here in X2'
  17301.        RETURN
  17302.        END
  17303.  
  17304.  
  17305.  446. Using Properly Rated Numeric Coprocessors
  17306.  
  17307.  Product Version(s): 4.00 4.01 4.10 | 4.10
  17308.  Operating System:   MS-DOS         | OS/2
  17309.  Flags: ENDUSER | s_c s_quickc s_pascal h_masm b_basiccom b_quickbas
  17310.  Last Modified: 18-APR-1989    ArticleIdent: Q39348
  17311.  
  17312.  The rated clock speed on coprocessors (8087, 80287, 80387) must be
  17313.  greater than or equal to what is recommended on the hardware.
  17314.  Otherwise, data integrity will be lost during the use of a
  17315.  coprocessor.
  17316.  
  17317.  For example, a Compaq 386/20 (20 megahertz) requires a 20 megahertz
  17318.  80387 for proper operation. If a floating-point coprocessor rated at a
  17319.  slower clock speed is installed, unpredictable results occur. It also
  17320.  is possible to damage the coprocessor.
  17321.  
  17322.  On some machines, it is not uncommon for the rated speed of the
  17323.  numeric coprocessor to be less than the clock speed of the CPU. If you
  17324.  do not know the correct coprocessor speed for your machine, check with
  17325.  the OEM (Original Equipment Manufacturer) before installing a numeric
  17326.  coprocessor.
  17327.  
  17328.  
  17329.  
  17330.  447. Bibliography of References for FORTRAN
  17331.  
  17332.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  17333.  Operating System:   MS-DOS              | OS/2
  17334.  Flags: ENDUSER |
  17335.  Last Modified: 14-MAY-1990    ArticleIdent: Q61298
  17336.  
  17337.  The following is a list of useful references for FORTRAN programmers.
  17338.  This information applies to Microsoft FORTRAN Compiler versions 4.00,
  17339.  4.01, 4.10, and 5.00, which follow the ANSI 77 standard. This list can
  17340.  also be found on Page xxiv of the "Microsoft FORTRAN Reference" manual
  17341.  that comes with FORTRAN version 5.00.  A similar list can be found on
  17342.  page 13 of the "Microsoft FORTRAN Compiler User's Guide" for versions
  17343.  4.00 and 4.10.
  17344.  
  17345.     "Applied FORTRAN 77 featuring Structured Programming"
  17346.     by Roy Agelhoff and Richard Mojena,
  17347.     published by Wadsworth (1981)
  17348.  
  17349.     "Programming with FORTRAN 77"
  17350.     by J. Ashcroft, R.H. Eldridge, R.W. Paulson, and G.A. Wilson,
  17351.     published by Sheridan House (1981)
  17352.  
  17353.     "Problem Solving and Structured Programming in FORTRAN" (2nd ed.)
  17354.     by Frank Friedman and E. Koffman,
  17355.     published by Addison-Wesley (1981)
  17356.  
  17357.     "The Elements of Programming Style"
  17358.     by Brian W. Kernighan and P.J. Plauger,
  17359.     published by McGraw-Hill (1978)
  17360.  
  17361.     "FORTRAN with Style"
  17362.     by Henry F. Ledgard and L. Chmura,
  17363.     published by Hayden (1978)
  17364.  
  17365.     "FORTRAN 77: Principles of Programming"
  17366.     by Jerrold L. Wagener,
  17367.     published by Wiley (1980)
  17368.  
  17369.  
  17370.  448. Optimization Problem, Assignment Not Made, Write Fails
  17371.  
  17372.  Product Version(s): 4.10 5.00  | 4.10 5.00
  17373.  Operating System:   MS-DOS     | OS/2
  17374.  Flags: ENDUSER | buglist4.10 buglist5.00
  17375.  Last Modified:  6-NOV-1989    ArticleIdent: Q39514
  17376.  
  17377.  The code below produces a loop-optimization problem.
  17378.  
  17379.  In DOS, the assignment TMP(I,K)=RBAD(K,I) does not affect the value of
  17380.  TMP; it remains 0.0, and you receive the following from the write
  17381.  statement:
  17382.  
  17383.     F6000F"garbage here"illegal unit number
  17384.  
  17385.  In OS/2, the write statement causes a segment violation. The problem
  17386.  occurs when the program is compiled as follows:
  17387.  
  17388.     FL /FPi /Od /AL  test.for
  17389.  
  17390.  Note: Turning ON optimization corrects the problem.
  17391.  
  17392.  The following code demonstrates the problem:
  17393.  
  17394.        IMPLICIT DOUBLE PRECISION (A-H,O-Z)
  17395.        DIMENSION TMP(5000,1)
  17396.        COMMON/BAD/RBAD(3,3)
  17397.        RBAD(1,1)=1
  17398.        CALL TRY1(TMP)
  17399.        WRITE(0,*)TMP(1,1)
  17400.        END
  17401.        SUBROUTINE TRY1(TMP)
  17402.        IMPLICIT DOUBLE PRECISION (A-H,O-Z)
  17403.        DIMENSION TMP(5000,1)
  17404.        COMMON/BAD/RBAD(3,3)
  17405.        I=1
  17406.        K=1
  17407.        TMP(I,K)=RBAD(K,I)
  17408.        RETURN
  17409.        END
  17410.  
  17411.  Microsoft has confirmed to be a problem with the Microsoft FORTRAN
  17412.  Optimizing Compiler Version 4.10 and 5.00. Microsoft is researching
  17413.  this problem and will post new information as it becomes available.
  17414.  
  17415.  
  17416.  449. Different Defaults for "SHARE=" under DOS and OS/2
  17417.  
  17418.  Product Version(s): 4.10   | 4.10
  17419.  Operating System:   MS-DOS | OS/2
  17420.  Flags: ENDUSER |
  17421.  Last Modified: 19-APR-1989    ArticleIdent: Q39515
  17422.  
  17423.  The default value of the OPEN statement's "SHARE" argument is
  17424.  different under OS/2 protected mode and DOS (or real mode). The
  17425.  default value under DOS is "COMPAT"; under OS/2 protected mode it is
  17426.  "DENYNONE".
  17427.  
  17428.  
  17429.  450. Limit on Number of Assigned GOTO Statements in a Subprogram
  17430.  
  17431.  Product Version(s): 4.10 5.00 | 4.10 5.00
  17432.  Operating System:   MS-DOS    | OS/2
  17433.  Flags: ENDUSER |
  17434.  Last Modified:  1-SEP-1989    ArticleIdent: Q39516
  17435.  
  17436.  The limit on the number of assigned GOTO statements that can be used
  17437.  in any subprogram is 256 in FORTRAN 4.1 and 255 in FORTRAN 5.0.
  17438.  
  17439.  If this limit is exceeded, the following error will occur:
  17440.  
  17441.       F2842  too many assigned GOTO statements
  17442.  
  17443.  This information is documented on Page 23 in Section 6 of the "FORTRAN
  17444.  4.1 Update" section of the "Microsoft FORTRAN 4.1 Optimizing
  17445.  Compiler User's Guide" and on page 460 of the FORTRAN 5.0 Reference
  17446.  manual.
  17447.  
  17448.  There is a documentation error on page 402 of the FORTRAN 5.0
  17449.  Reference which indicates the limit to be 64.
  17450.  
  17451.  
  17452.  451. Creating Bound Executables with FL
  17453.  
  17454.  Product Version(s): 4.10   | 4.10
  17455.  Operating System:   MS-DOS | OS/2
  17456.  Flags: ENDUSER |
  17457.  Last Modified: 12-JAN-1989    ArticleIdent: Q39605
  17458.  
  17459.  You can use the FL command to create a bound program (a program that
  17460.  runs in either real or protected mode) by using the /Fb command-line
  17461.  option. For example, the following command creates a bound executable
  17462.  file, BESSELB.EXE, from the source file BESSEL.FOR:
  17463.  
  17464.     FL /Lp /FbBESSELB BESSEL.FOR
  17465.  
  17466.  Specifying a name causes FL to create a protected-mode executable file
  17467.  (BESSEL.EXE) in addition to the bound program (BESSELB.EXE).
  17468.  
  17469.  When you omit the extension for the bound program from the name,
  17470.  the bound program is automatically given the .EXE extension. If
  17471.  you omit the name altogether, the bound program has the same base
  17472.  name as the source file, but includes an .EXE extension. No
  17473.  protected-mode program is created when you omit the name. Using the /c
  17474.  (compile only) option overrides the /Fb option.
  17475.  
  17476.  For the /Fb option to work correctly, the files DOSCALLS.LIB,
  17477.  APILMR.OBJ, and API.LIB must be in the current directory or in one of
  17478.  the directories indicated by the LIB environment variable.
  17479.  
  17480.  The file APILMR.OBJ is always bound with the program unless the
  17481.  FL command includes the medium-memory model switch. If you are
  17482.  doing mixed-language programming using the medium-memory model
  17483.  and your routines allocate both near and far memory, you cannot
  17484.  bind your program through FL. Use the BIND command directly and
  17485.  include the /n switch and APILMR.OBJ.
  17486.  
  17487.  If you are binding mixed-language executable files that have non-
  17488.  Family API calls, you must use the BIND utility directly and include
  17489.  the /n switch. Please see Page 10 of the "Microsoft FORTRAN Optimizing
  17490.  Compiler for MS OS/2 and MS-DOS Operating Systems Version 4.1 Update"
  17491.  and section 5 of the "Microsoft CodeView and Utilities Software
  17492.  Development Tools for MS OS/2 and MS-DOS Operating Systems Update."
  17493.  
  17494.  
  17495.  452. FORTRAN: SAVE and Procedure and Function Names
  17496.  
  17497.  Product Version(s): 4.10   | 4.10
  17498.  Operating System:   MS-DOS | OS/2
  17499.  Flags: ENDUSER | buglist4.10 fixlist5.00
  17500.  Last Modified: 16-JUN-1989    ArticleIdent: Q39805
  17501.  
  17502.  The SAVE function in Microsoft FORTRAN causes variables to retain
  17503.  their values between invocations of the procedure in which they are
  17504.  defined.
  17505.  
  17506.  You cannot use any function or procedure names in the SAVE statement.
  17507.  
  17508.  In Microsoft FORTRAN, all function and procedure names are made
  17509.  global. The SAVE function forces variables to be static. If you are
  17510.  trying to force a global to be static, it will not be allowed.
  17511.  
  17512.  When attempting to do this under Microsoft FORTRAN Version 4.10, you
  17513.  receive the following error:
  17514.  
  17515.     Fatal Error : Error message too long
  17516.  
  17517.  This error message is incorrectly generated. Microsoft has confirmed
  17518.  this to be a problem in Version 4.10. This problem was corrected in
  17519.  Version 5.00.
  17520.  
  17521.  
  17522.  453. Declaring an External C Array from FORTRAN
  17523.  
  17524.  Product Version(s): 5.x    |  4.x
  17525.  Operating System:   MS-DOS | OS/2
  17526.  Flags: ENDUSER | s_c H_Fortran
  17527.  Last Modified: 19-APR-1989    ArticleIdent: Q39850
  17528.  
  17529.  If a FORTRAN module wants to access a C array, it must place the index
  17530.  of the array after the C external naming convention.
  17531.  
  17532.  Consider the following array declared in a C module:
  17533.  
  17534.     int test[5];
  17535.  
  17536.  If accessing this array from a FORTRAN module, the declaration is as
  17537.  follows, with the index of the array AFTER the external declaration
  17538.  brackets:
  17539.  
  17540.     INTEGER*2 TEST [C,EXTERN] (5)       <=== CORRECT
  17541.  
  17542.  If the index is placed directly after the variable name, as follows,
  17543.  
  17544.     INTEGER*2 TEST(5) [C,EXTERN]        <=== INCORRECT
  17545.  
  17546.  the compiler produces the following error:
  17547.  
  17548.     F2115   SYNTAX ERROR
  17549.  
  17550.  If FORTRAN tries to access any element of the array, such as TEST(1) =
  17551.  6, the compiler produces the following error:
  17552.  
  17553.     F2515   LEFT SIDE OF ASSIGNMENT ILLEGAL.
  17554.  
  17555.  
  17556.  454. Setting an Array Equal to Another Array
  17557.  
  17558.  Product Version(s): 5.00   | 5.00
  17559.  Operating System:   MS-DOS | OS/2
  17560.  Flags: ENDUSER |
  17561.  Last Modified:  9-MAY-1990    ArticleIdent: Q61441
  17562.  
  17563.  The quickest and easiest way to set an array equal to another array of
  17564.  the same dimension is to just set them equal to each other; that is,
  17565.  ARRAY1 = ARRAY2.
  17566.  
  17567.  This is a new feature that is non-ANSI Standard. This feature was
  17568.  added to FORTRAN version 5.00; therefore, it is not compatible with earlier
  17569.  versions of the compiler.
  17570.  
  17571.  This information can be found in Section 1.7.5, "Array Expressions,"
  17572.  on Page 40 in the "Microsoft FORTRAN Reference" version 5.0 manual.
  17573.  
  17574.  Note: You can perform other operations with arrays. See the above
  17575.  section of the reference manual for more details.
  17576.  
  17577.  The following is an example of setting two arrays equal:
  17578.  
  17579.        INTEGER ONE(5),TWO(5)
  17580.  
  17581.        DATA ONE /1,2,3,4,5/
  17582.  
  17583.        TWO=ONE
  17584.  
  17585.        WRITE (*,*) ONE(5)
  17586.        WRITE (*,*) TWO(5)
  17587.  
  17588.        END
  17589.  
  17590.  
  17591.  455. Equivalencing Variables in Same Named Common Block
  17592.  
  17593.  Product Version(s): 5.00   | 5.00
  17594.  Operating System:   MS-DOS | OS/2
  17595.  Flags: ENDUSER | buglist5.00
  17596.  Last Modified: 23-MAY-1990    ArticleIdent: Q61442
  17597.  
  17598.  In Microsoft FORTRAN version 5.00, errors are generated when compiling
  17599.  a program that uses an EQUIVALENCE statement to associate variables
  17600.  declared in the same named common block.
  17601.  
  17602.  Under OS/2, a "SYS1943: A program caused a protection violation" error
  17603.  occurs.
  17604.  
  17605.  Under DOS, a "fatal error : error message too long" error occurs.
  17606.  
  17607.  The compiler should generate an "error F2317: VAR2, VAR1 :
  17608.  EQUIVALENCE : both in common block COMN" compilation error message
  17609.  when compiling the following program:
  17610.  
  17611.        PROGRAM HELLO
  17612.        COMMON /COMN/ VAR1, VAR2
  17613.        EQUIVALENCE (VAR1, VAR2)
  17614.        END
  17615.  
  17616.  Microsoft is currently researching the problem and will post new
  17617.  information here as it becomes available.
  17618.  
  17619.  The EQUIVALENCE statement causes two or more variables or arrays to
  17620.  occupy the same memory location. More information about the
  17621.  EQUIVALENCE statement can be found on Pages 164-166 in the "Microsoft
  17622.  FORTRAN Reference" version 5.0 manual.
  17623.  
  17624.  Compiler compilation error message F2317 is described on Page 432 of
  17625.  the "Microsoft FORTRAN Reference: Error Messages" manual and has the
  17626.  following explanation:
  17627.  
  17628.     Two items specified in an EQUIVALENCE statement at different
  17629.     offsets were both in a named common block. These items were
  17630.     specified in the EQUIVALENCE statement to be at the same location
  17631.     in memory.
  17632.  
  17633.  
  17634.  456. Accessing Command Line Arguments and Finding psp Appnote
  17635.  
  17636.  Product Version(s): 4.10   | 4.10
  17637.  Operating System:   MS-DOS | OS/2
  17638.  Flags: ENDUSER |
  17639.  Last Modified: 10-APR-1989    ArticleIdent: Q40097
  17640.  
  17641.  The accessing the command line appnote that uses the psp to determine
  17642.  the location of the command line arguments in memory do not work
  17643.  correctly in the OS/2 operating system. This behavior occurs because
  17644.  OS/2 does not implement the psp. This situation also leads to not
  17645.  being able to access the environment that is also performed through
  17646.  the psp.
  17647.  
  17648.  
  17649.  457. FORTRAN Does Not Output ASCII 26 (EOF) to LPTx: or COMx:
  17650.  
  17651.  Product Version(s): 3.10 3.13 3.20 3.30 3.31 4.00 4.01 4.10 5.00
  17652.  Operating System:   MS-DOS
  17653.  Flags: ENDUSER | buglist3.x buglist4.00 buglist4.01 buglist4.10 buglist5.00
  17654.  Last Modified:  2-AUG-1989    ArticleIdent: Q44472
  17655.  
  17656.  Microsoft FORTRAN Versions 3.x, 4.x, and 5.00 does not output ASCII 26
  17657.  (EOF) to LPTx: or COMx: devices. It does output ASCII 26 to a file.
  17658.  Because ASCII 26 is nonprintable on most printers, this problem is
  17659.  difficult to demonstrate.
  17660.  
  17661.  There are two workarounds for this problem:
  17662.  
  17663.  1. Send the output to a file and then copy the file to the output
  17664.     device desired.
  17665.  
  17666.  2. Send the output to the screen and redirect screen output to the
  17667.     serial or parallel port.
  17668.  
  17669.  Microsoft has confirmed this to be a problem in Versions 3.x, 4.x,
  17670.  and 5.00. We are researching this problem and will post new
  17671.  information as it becomes available.
  17672.  
  17673.  
  17674.  458. Docerr: Passing FORTRAN Strings to BASIC
  17675.  
  17676.  Product Version(s): 4.10   | 4.10
  17677.  Operating System:   MS-DOS | OS/2
  17678.  Flags: ENDUSER | docerr B_QuickBas B_BasicCom mixed-language
  17679.  Last Modified: 10-APR-1989    ArticleIdent: Q40099
  17680.  
  17681.  There is an error in the "Microsoft Mixed-Language Programming Guide"
  17682.  on Pages 118-119 in the section labeled "Passing FORTRAN Strings to
  17683.  BASIC."
  17684.  
  17685.  In the documentation, the positions of the address and length are
  17686.  reversed. The following sentence is incorrect:
  17687.  
  17688.     Next, assign the address of the string to the first element (using
  17689.     the LOC function), and assign the length of the string to the
  17690.     second element.
  17691.  
  17692.  The correct sentence should read as follows:
  17693.  
  17694.     Next, assign to the first element the LENGTH of the string, and
  17695.     assign the second element the ADDRESS of the string (using the
  17696.     LOC function).
  17697.  
  17698.  The following programs demonstrate the procedure.
  17699.  ----------------------------------------------------------------------
  17700.  
  17701.  The Basic main program:
  17702.  
  17703.  DECLARE SUB fsub ()
  17704.  
  17705.  CALL fsub                               'Call the FORTRAN subroutine
  17706.  END
  17707.  
  17708.  SUB pass (a$)
  17709.    PRINT a$
  17710.  END SUB                                 'Print the passed string
  17711.  
  17712.  ----------------------------------------------------------------------
  17713.  
  17714.  The FORTRAN subprogram:
  17715.  c
  17716.  c Compile in Medium or Large Memory model
  17717.  c
  17718.        subroutine fsub()
  17719.        character*20 string
  17720.        integer*2    sdesc( 2 )
  17721.  
  17722.        string = 'hello world !'
  17723.  
  17724.        sdesc( 1 ) = 13
  17725.        sdesc( 2 ) = loc( string )
  17726.  
  17727.        call pass( sdesc )
  17728.  
  17729.        end
  17730.  
  17731.  
  17732.  459. FORTRAN on Two-Floppy System Does Not Prompt for Next Disk
  17733.  
  17734.  Product Version(s): 4.10   | 4.10
  17735.  Operating System:   MS-DOS | OS/2
  17736.  Flags: ENDUSER | dual floppy docerr
  17737.  Last Modified: 11-APR-1989    ArticleIdent: Q40100
  17738.  
  17739.  According to Page 20 of the "Microsoft FORTRAN Optimizing Compiler for
  17740.  MS OS/2 and MS-DOS Operating Systems: Version 4.1 Update Guide," you
  17741.  will be "prompted" when you should swap disks when running on a
  17742.  two-floppy system. This is not correct. The "prompt" is as follows:
  17743.  
  17744.     UNABLE TO EXECUTE F2.EXE, PLEASE ENTER NEW FILESPEC:
  17745.  
  17746.  This example is the prompt referred to in the manual. You must enter
  17747.  the disk that contains the second pass of the compiler, then type the
  17748.  following:
  17749.  
  17750.     A:F2.EXE
  17751.  
  17752.  The process must then be repeated for F3.EXE.
  17753.  
  17754.  
  17755.  460. Invalid Object Module Given when Extension Is Not .FOR
  17756.  
  17757.  Product Version(s): 4.10   | 4.10
  17758.  Operating System:   MS-DOS | OS/2
  17759.  Flags: ENDUSER | invalid object module
  17760.  Last Modified: 12-JAN-1989    ArticleIdent: Q40132
  17761.  
  17762.  If you attempt to compile a FORTRAN source that does not end in .FOR,
  17763.  an error regarding an invalid object module is generated.
  17764.  
  17765.  This is expected behavior. If a file does not have a .FOR extension,
  17766.  the compiler will treat it as an object file.  The linker will detect
  17767.  this difference and report it as an invalid object module.
  17768.  
  17769.  If the compile line is as follows
  17770.  
  17771.     fl for100.777
  17772.  
  17773.  The complete error message would be as follows:
  17774.  
  17775.     Microsoft (R) Segmented-Executable Linker  Version 5.01.21
  17776.     Copyright (C) Microsoft Corp 1984-1988.  All rights reserved.
  17777.  
  17778.     Object Modules [.OBJ]: FOR100.777
  17779.     Run File [FOR100.EXE]: FOR100.EXE
  17780.     List File [NUL.MAP]: NUL
  17781.     Libraries [.LIB]:
  17782.     Definitions File [NUL.DEF]: ;
  17783.     FOR100.777 : fatal error L1101: invalid object module
  17784.      pos: 1 Record type: 844E
  17785.  
  17786.  The workaround to this error is to either rename the program to have a
  17787.  .for extension or use the /Tf command line switch to indicate that the
  17788.  file is a FORTRAN source file.
  17789.  
  17790.  
  17791.  461. FORTRAN Quick Reference Guide Incorrectly Identifies /TF
  17792.  
  17793.  Product Version(s): 4.10   | 4.10
  17794.  Operating System:   MS-DOS | OS/2
  17795.  Flags: ENDUSER | docerr
  17796.  Last Modified: 11-APR-1989    ArticleIdent: Q40135
  17797.  
  17798.  The "Microsoft FORTRAN Quick Reference Guide" supplied with FORTRAN
  17799.  Version 4.10 incorrectly states that the /TF switch can be used to
  17800.  specify a FORTRAN source that does not end with the .for extension.
  17801.  However, the correct switch for this is /Tf. This switch is case
  17802.  sensitive.
  17803.  
  17804.  
  17805.  462. Problem with Floating-Point Accuracy with Minor Code Changes
  17806.  
  17807.  Product Version(s): 4.10   | 4.10
  17808.  Operating System:   MS-DOS | OS/2
  17809.  Flags: ENDUSER | precision
  17810.  Last Modified:  2-MAY-1989    ArticleIdent: Q41017
  17811.  
  17812.  If there appears to be a problem with floating-point accuracy with
  17813.  minor code changes, it may be due to the optimization of the code. In
  17814.  the example below, the change was the addition to the write statement
  17815.  in the DO loop.
  17816.  
  17817.  The workaround to this problem is to use the /Od switch and add the
  17818.  options back on one at a time. In the case below, all options were
  17819.  turned back on and the code then compiled perfectly.
  17820.  
  17821.  The following is the first example:
  17822.  
  17823.         PROGRAM TJ1
  17824.  
  17825.         REAL X,Y
  17826.  
  17827.         X = 20.00
  17828.         XL = 0.0
  17829.         DO 10 I = 0, 100
  17830.           Y = XL * X
  17831.           IF ((Y .GE. 0.0) .AND. (Y .LE. X)) THEN
  17832.             WRITE(*,*)'GO IN HERE FOR I = ',I,' Y = ',Y
  17833.           ELSE
  17834.             WRITE(*,*)'OUCH !!!!, HERE IS THE PROBLEM but Y = ', Y
  17835.           ENDIF
  17836.           XL = XL + 0.01
  17837.  10     CONTINUE
  17838.          pause' this one is no good, press a key to continue'
  17839.  
  17840.         XL = 1.0
  17841.         DO 20 I = 100,0, -1
  17842.           Y = XL * X
  17843.           IF ((Y .GE. 0.0) .AND. (Y .LE. X)) THEN
  17844.             WRITE(*,*)'GO IN HERE FOR I =',I,' Y = ',Y
  17845.           ELSE
  17846.             WRITE(*,*)'OUCH !!!!, HERE IS THE PROBLEM and Y = ',Y
  17847.           ENDIF
  17848.           XL = XL - 0.01
  17849.  20     CONTINUE
  17850.  
  17851.         END
  17852.  
  17853.  The following is the second example:
  17854.  
  17855.         PROGRAM TJ2
  17856.  
  17857.         REAL X,Y
  17858.  
  17859.         X = 20.00
  17860.         XL = 0.0
  17861.         DO 10 I = 0, 100
  17862.           Y = XL * X
  17863.           IF ((Y .GE. 0.0) .AND. (Y .LE. X)) THEN
  17864.             WRITE(*,*)'GO IN HERE FOR I = ',I,' Y = ',Y
  17865.           ELSE
  17866.             WRITE(*,*)'OUCH !!!!, HERE IS THE PROBLEM but Y = ', Y, 'X = ',X
  17867.           ENDIF
  17868.           XL = XL + 0.01
  17869.  10     CONTINUE
  17870.          pause' this one is no good, press a key to continue'
  17871.  
  17872.         XL = 1.0
  17873.         DO 20 I = 100,0, -1
  17874.           Y = XL * X
  17875.           IF ((Y .GE. 0.0) .AND. (Y .LE. X)) THEN
  17876.             WRITE(*,*)'GO IN HERE FOR I =',I,' Y = ',Y
  17877.           ELSE
  17878.             WRITE(*,*)'OUCH !!!!, HERE IS THE PROBLEM and Y = ',Y, 'X = ',X
  17879.           ENDIF
  17880.           XL = XL - 0.01
  17881.  20     CONTINUE
  17882.  
  17883.         END
  17884.  
  17885.  
  17886.  463. Carriage Control Works Correctly Only on Terminal Devices
  17887.  
  17888.  Product Version(s): 4.10   | 4.10
  17889.  Operating System:   MS-DOS | OS/2
  17890.  Flags: ENDUSER |
  17891.  Last Modified: 12-JUN-1989    ArticleIdent: Q41018
  17892.  
  17893.  Question:
  17894.  
  17895.  I would like to write to a disk file using carriage control so that
  17896.  the file can be printed later. Can this be done?
  17897.  
  17898.  Response:
  17899.  
  17900.  Not directly. Carriage control is performed only on a unit that is a
  17901.  terminal device. There is no way to have carriage control performed on
  17902.  a disk file. To accomplish the same effect, the CHAR function or '/' edit
  17903.  descriptor must be used to send the desired control codes.
  17904.  
  17905.  For more information, see Page 124 of the "Microsoft FORTRAN 4.1
  17906.  Optimizing Compiler: Language Reference."
  17907.  
  17908.  
  17909.  464. Read Right Justifies If Alphanumeric Field Width Too Large
  17910.  
  17911.  Product Version(s): 4.10   | 4.10
  17912.  Operating System:   MS-DOS | OS/2
  17913.  Flags: ENDUSER |
  17914.  Last Modified: 11-APR-1989    ArticleIdent: Q41019
  17915.  
  17916.  Problem:
  17917.  
  17918.  When I specify an alphanumeric field in a FORTRAN read format that is
  17919.  larger than the variable in which I try to store it, sometimes it
  17920.  reads blanks and at other times it doesn't read anything.
  17921.  
  17922.  Response:
  17923.  
  17924.  This is expected behavior according to the "American National Standard,
  17925.  Programming Language FORTRAN," approved April 3, 1978. On Page 13-13 it
  17926.  states the following:
  17927.  
  17928.  "Let len be the length of the input/output list item. If the specified
  17929.  field width w for A input is greater than or equal to len, the
  17930.  rightmost len characters will be taken from the input field."
  17931.  
  17932.  This means that if the alphanumeric format width is greater than the
  17933.  variable in which they will be stored, the read actually starts at
  17934.  width - variable length + 1. Therefore, as the example below shows, if
  17935.  the input record is shorter than the specified format width, the read
  17936.  may appear to read blanks or incorrect data.
  17937.  
  17938.  The following program shows this behavior (first create a data file to
  17939.  read):
  17940.  
  17941.  thisisthefirstlineofthefile
  17942.  thisisthesecondlineofthefile
  17943.  thisisthethirdlineofthefile
  17944.  thisisthelastlineofthefile
  17945.  
  17946.  Then type in and compile the following program:
  17947.  
  17948.        CHARACTER*20 STUFF
  17949.        OPEN(UNIT=1,FILE=' ')
  17950.        READ(1,'(A100)') STUFF
  17951.        WRITE(*,*) STUFF
  17952.        READ(1,'(A10)') STUFF
  17953.        WRITE(*,*) STUFF
  17954.        READ(1,'(A25)') STUFF
  17955.        WRITE(*,*) STUFF
  17956.        READ(1,'(A)') STUFF
  17957.        WRITE(*,*) STUFF
  17958.        CLOSE(1)
  17959.        STOP
  17960.        END
  17961.  
  17962.  When the program is run, the following is the output. The first line
  17963.  is blank because it starts to read at 100 - 20 + 1 = column 81, the
  17964.  second line gets the first 10 characters, the third line starts at 25
  17965.  - 20 + 1 = column 6, and the fourth line contains the first 20
  17966.  characters. The following is an example:
  17967.  
  17968.     thisisthes
  17969.     sthethirdlineofthefi
  17970.     thisisthefourthlineo
  17971.  
  17972.  
  17973.  465. FORTRAN Compiler Corrupts the Environment
  17974.  
  17975.  Product Version(s): 4.01 4.10 | 4.10
  17976.  Operating System:   MS-DOS    | OS/2
  17977.  Flags: ENDUSER | buglist4.01 buglist4.10 fixlist5.00
  17978.  Last Modified: 16-JUN-1989    ArticleIdent: Q41021
  17979.  
  17980.  The Microsoft FORTRAN Version 4.10 Optimizing Compiler generates the
  17981.  following error message:
  17982.  
  17983.     error F2836 : statement out of order
  17984.  
  17985.  Then, under DOS, it dumps some garbage control characters and corrupts
  17986.  the environment. As a result, DOS commands or programs run after the
  17987.  compilation do not behave correctly. Symptoms range from messages such
  17988.  as "bad file allocation table on drive C" to the machine hanging upon
  17989.  the next invocation of a command. Under Version 4.01, the compiler
  17990.  locks up.
  17991.  
  17992.  Under OS/2, after the F2836 message is displayed, you receive a
  17993.  general protection violation, as follows:
  17994.  
  17995.     SYS1942: A program attempted to reference storage outside the
  17996.     limits of a stack segment. The program was ended.
  17997.  
  17998.  The problem is that the DATA statement precedes the COMMON statement.
  17999.  This is not valid FORTRAN code. If the two statements are
  18000.  interchanged, the program compiles correctly.
  18001.  
  18002.  The following is the sample code that causes these problems:
  18003.  
  18004.        program foo
  18005.        complex*16 x, c
  18006.        data i/ 1 /
  18007.        common x(1), n(1,1)
  18008.        c=(x(n(1,i)) + x(n(1,1)) ) * ( x(n(1,1)) - x(n(1,1)))
  18009.        stop
  18010.        end
  18011.  
  18012.  Note: Once the DATA and COMMON statements are switched, the following
  18013.  line must be inserted before the assignment to the C variable for the
  18014.  code to run without a protection violation under OS/2:
  18015.  
  18016.        n(1,1) = 1
  18017.  
  18018.  Microsoft has confirmed this to be a problem in Versions 4.01 and
  18019.  4.10. This problem was corrected in Version 5.00.
  18020.  
  18021.  
  18022.  466. DNINT and ANINT Functions May Produce Unexpected Results
  18023.  
  18024.  Product Version(s): 4.10 5.00 | 4.10 5.00
  18025.  Operating System:   MS-DOS    | OS/2
  18026.  Flags: ENDUSER |
  18027.  Last Modified:  9-MAY-1990    ArticleIdent: Q61522
  18028.  
  18029.  The DNINT and ANINT intrinsic functions may return unexpected results
  18030.  if the decimal part of the argument passed is "exactly" 0.5.
  18031.  
  18032.  The problem is due to single-bit precision errors that occur because
  18033.  some values cannot be exactly represented in IEEE floating-point
  18034.  format. This is a limitation of the floating-point format, not a
  18035.  limitation of the functions.
  18036.  
  18037.  DNINT is an intrinsic FORTRAN function that returns the nearest
  18038.  integer value to the given argument. Its argument is a REAL*8, DOUBLE
  18039.  PRECISION number and it returns a REAL*8 number. ANINT is the same as
  18040.  DNINT except that it also accepts a REAL*4, SINGLE PRECISION argument.
  18041.  
  18042.  According to the FORTRAN-77 ANSI Standard, given a value of the form
  18043.  m.d, where m is the mantissa and d is the decimal part of the number,
  18044.  the following is true:
  18045.  
  18046.     if d <  0.5, the number returned should be m, and
  18047.     if d >= 0.5, the number returned should be m+1
  18048.  
  18049.  When compiled with the /Od switch, the following program demonstrates
  18050.  the unexpected results. The value returned is 141.52, where it is
  18051.  expected to be 141.53 ( DNINT(14152.5)/100.00 ).
  18052.  
  18053.       real*8 result,x,y
  18054.  
  18055.       x = 166.50d0
  18056.       y =   0.85d0
  18057.       result = DNINT(x * y * 100.00) / 100.00
  18058.       print *,result
  18059.  
  18060.       end
  18061.  
  18062.  In the example above, 0.85 could not be represented perfectly, thus
  18063.  leading to unexpected results. While the program above demonstrates
  18064.  the problem only when optimizations are disabled, this behavior is not
  18065.  directly related to optimization.
  18066.  
  18067.  
  18068.  467. FORTRAN Logic Precedence Example Error
  18069.  
  18070.  Product Version(s): 4.10
  18071.  Operating System:   MS-DOS
  18072.  Flags: ENDUSER | docerr
  18073.  Last Modified:  4-MAY-1989    ArticleIdent: Q41576
  18074.  
  18075.  There is a documentation error on Page 47 in the "Microsoft FORTRAN
  18076.  4.10 Mixed-Language Programming Guide." On the fourth line from the
  18077.  bottom of the page, an example demonstrates precedence in logical
  18078.  expressions. The incorrect line reads as follows:
  18079.  
  18080.            go = ((.NOT. a) .OR. b) .AND. c
  18081.  
  18082.  The line should read as follows:
  18083.  
  18084.            go = (.NOT. a) .OR. (b .AND. c)
  18085.  
  18086.  
  18087.  468. Floating Point Numbers in Text File Need .0
  18088.  
  18089.  Product Version(s): 4.10
  18090.  Operating System:   MS-DOS
  18091.  Flags: ENDUSER |
  18092.  Last Modified: 11-APR-1989    ArticleIdent: Q42358
  18093.  
  18094.  If an editor is used to create a data file in which some real numbers
  18095.  are to be read, you should always place a ".0" (without the quotation
  18096.  marks) after all the numbers to ensure that all numbers are read in
  18097.  correctly.
  18098.  
  18099.  The following is an example:
  18100.  
  18101.  Text File:
  18102.  
  18103.  1100110021004100  7576400.0   50000.0    6000.0    8000.0
  18104.  
  18105.  FORTRAN Code:
  18106.  
  18107.          PROGRAM example
  18108.  
  18109.          open(10,file='test.dat',form='formatted')
  18110.          read(10,100) a,b,c,d,e,f,g,h
  18111.          write(*,*) a,b,c,d,e,f,g,h
  18112.  100     format(4(F4.0),4(f10.5))
  18113.          close(10)
  18114.          end
  18115.  
  18116.  If the ".0" were taken off the number 7576400.0, an incorrect value
  18117.  would be placed in "h".
  18118.  
  18119.  
  18120.  469. CodeView and the $DEBUG Meta Command
  18121.  
  18122.  Product Version(s): 4.10   | 4.10
  18123.  Operating System:   MS-DOS | OS/2
  18124.  Flags: ENDUSER |
  18125.  Last Modified: 11-APR-1989    ArticleIdent: Q43066
  18126.  
  18127.  If the $DEBUG meta command is used in a FORTRAN program, it can cause
  18128.  CodeView to work incorrectly. Symptoms include execution when
  18129.  attempting to trace, inability to set either break or watch points,
  18130.  and hanging of the system.
  18131.  
  18132.  The workaround is to remove to meta command from the code and compile
  18133.  using the /Zi switch.
  18134.  
  18135.  
  18136.  470. Unresolved External _MAIN or ENTGQQ
  18137.  
  18138.  Product Version(s): 4.10   | 4.10
  18139.  Operating System:   MS-DOS | OS/2
  18140.  Flags: ENDUSER |
  18141.  Last Modified: 25-FEB-1991    ArticleIdent: Q43067
  18142.  
  18143.  When linking a program in FORTRAN Version 4.10, if the error message
  18144.  received is
  18145.  
  18146.      Link : error L2029: Unresolved External:  ENTGQQ
  18147.  
  18148.  or
  18149.  
  18150.      Link : error L2029: Unresolved External:  _main
  18151.  
  18152.  This may indicate that the FORTRAN compiler could not identify
  18153.  an entry point into the code.
  18154.  
  18155.  
  18156.  471. Intrinsic Functions in Substring Evaluation Not Working Right
  18157.  
  18158.  Product Version(s): 4.10  5.00  | 4.10  5.00
  18159.  Operating System:   MS-DOS | OS/2
  18160.  Flags: ENDUSER |
  18161.  Last Modified: 13-JUN-1989    ArticleIdent: Q43068
  18162.  
  18163.  The following program does not work correctly (the substring value
  18164.  does not evaluate properly):
  18165.  
  18166.          program string
  18167.          character *20 a,b
  18168.          b='abcdefghijklmnop'
  18169.          i=2
  18170.          j=6
  18171.          a=b(i:(i+idim(j,2)))
  18172.          write(*,*) a
  18173.          end
  18174.  
  18175.  The following is a workaround to the problem:
  18176.  
  18177.          program string
  18178.          character *20 a,b
  18179.          b='abcdefghijklmnop'
  18180.          i=2
  18181.          j=6
  18182.          k=i+idim(j,2)
  18183.          a=b(i:k)
  18184.          write(*,*) a
  18185.          end
  18186.  
  18187.  The workaround performs all computations with intrinsic functions
  18188.  before the substring operation.
  18189.  
  18190.  
  18191.  472. /Zi May Not Let Include File Open
  18192.  
  18193.  Product Version(s): 4.10   | 4.10
  18194.  Operating System:   MS-DOS | OS/2
  18195.  Flags: ENDUSER |
  18196.  Last Modified: 11-APR-1989    ArticleIdent: Q43069
  18197.  
  18198.  Problem:
  18199.  
  18200.  When I compile without the /Zi switch, my program compiles correctly.
  18201.  If I use the /Zi switch, my program can't open the include files.
  18202.  
  18203.  Response:
  18204.  
  18205.  The problem exists because not enough FILES have been specified in the
  18206.  CONFIG.SYS. The /Zi switch will use a file handle.
  18207.  
  18208.  
  18209.  473. D, E, F, and G Edit Descriptors and Integer Input Values
  18210.  
  18211.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  18212.  Operating System:   MS-DOS              | OS/2
  18213.  Flags: ENDUSER |
  18214.  Last Modified:  9-MAY-1990    ArticleIdent: Q61523
  18215.  
  18216.  The manner in which FORTRAN's real number edit descriptors (D, E, F,
  18217.  and G) handle integer input values may be less than straightforward
  18218.  unless the method of interpretation is understood. This method is
  18219.  described below.
  18220.  
  18221.  The interpretation of integer input is identical for the D, E, F, and
  18222.  G edit descriptors. The F edit descriptor is used for the example
  18223.  below.
  18224.  
  18225.  Syntax: Fw.d
  18226.  
  18227.  The input field is w characters wide, with a fractional part d digits
  18228.  wide.
  18229.  
  18230.  If the decimal point is omitted upon input (that is, the data is an
  18231.  integer), the rightmost d digits of the input string, with leading
  18232.  zeros assumed if necessary, are interpreted as the fractional part of
  18233.  the value represented.
  18234.  
  18235.  An example is the following READ statement:
  18236.  
  18237.        READ (*, '(F9.4)') xnum
  18238.  
  18239.  Input      Number Read
  18240.  -----      -----------
  18241.  
  18242.  5          .0005
  18243.  23456      2.3456
  18244.  27         .0027
  18245.  -98113     -9.8113
  18246.  -286401    -28.6401
  18247.  59381      5.9381
  18248.  -596E3     -59.6000
  18249.  
  18250.  For more information about the real number edit descriptors, see Pages
  18251.  90-94 in the "Microsoft FORTRAN Reference" version 5.0 manual, or
  18252.  Pages 137-141 of the "Microsoft FORTRAN Language Reference" versions
  18253.  4.0 and 4.1 manual.
  18254.  
  18255.  
  18256.  474. DPATH Does Not Work for Data Files
  18257.  
  18258.  Product Version(s): 4.10
  18259.  Operating System:   OS/2
  18260.  Flags: ENDUSER | dpath append
  18261.  Last Modified: 18-APR-1989    ArticleIdent: Q43292
  18262.  
  18263.  When in DOS and using file I/O with FORTRAN Version 4.10, the APPEND
  18264.  DOS command allows you to find your data files in other directories.
  18265.  However, using the equivalent DPATH command in OS/2 does not work. You
  18266.  must specify the proper directory.
  18267.  
  18268.  
  18269.  475. INTERFACE Statement May Not Force Data Type Checking
  18270.  
  18271.  Product Version(s): 4.10   | 4.10
  18272.  Operating System:   MS-DOS | OS/2
  18273.  Flags: ENDUSER |
  18274.  Last Modified: 18-APR-1989    ArticleIdent: Q43293
  18275.  
  18276.  When you use the INTERFACE keyword as in the example below, you must
  18277.  remember that data type checking for the specific function or
  18278.  subroutine may not be done. In the example below, the fact that the
  18279.  main is passing a real that is received as an integer in the function
  18280.  is a data mismatch that is not flagged by the compiler. If the
  18281.  interface statement is removed, then the data type mismatch is
  18282.  flagged.
  18283.  
  18284.       INTERFACE TO INTEGER FUNCTION EXAMPLE[C,VARYING] (A,B,C,D)
  18285.       INTEGER A,B,C,D
  18286.       END
  18287.  
  18288.       PROGRAM TEST
  18289.       INTEGER W,X,EXAMPLE
  18290.       K=EXAMPLE(W,X,Y,Z)
  18291.       END
  18292.  
  18293.       INTEGER FUNCTION EXAMPLE(E,F,G,H)
  18294.       INTEGER E,F,G,H
  18295.       EXAMPLE=3
  18296.       RETURN
  18297.       END
  18298.  
  18299.  
  18300.  476. Global Names Can Have Only One Global Definition in Program
  18301.  
  18302.  Product Version(s): 3.20 3.30 4.00 4.10 | 3.20 3.30 4.00 4.10
  18303.  Operating System:   MS-DOS              | OS/2
  18304.  Flags: ENDUSER |
  18305.  Last Modified:  2-MAY-1989    ArticleIdent: Q43607
  18306.  
  18307.  Because global names are recognized anywhere in a given program, they
  18308.  can have only one global definition anywhere in that program. All
  18309.  subroutine, function, common-block, and program names are global.
  18310.  
  18311.  The compiler recognizes the first six characters of a global name and
  18312.  disregards spaces, as in the following examples:
  18313.  
  18314.           Program foofar
  18315.           common/foofares/I,J,K
  18316.           INTEGER*2 I,J,K
  18317.           END
  18318.  
  18319.  In the above example, you will receive the error message
  18320.  "F2325:FOOFAR:COMMON:function or subroutine name".
  18321.  
  18322.            Subroutine Paint gate
  18323.                    .
  18324.                    .
  18325.            COMMON/PaintG/I,J,K
  18326.  
  18327.  In the above example, you will receive the error message
  18328.  "F2325:PAINTG:COMMON: function or subroutine name".
  18329.  
  18330.  
  18331.  477. Using Fortran for Floating-Point Exceptions on Clones
  18332.  
  18333.  Product Version(s): 4.10   | 4.10
  18334.  Operating System:   MS-DOS | OS/2
  18335.  Flags: ENDUSER |
  18336.  Last Modified:  4-MAY-1989    ArticleIdent: Q43768
  18337.  
  18338.  If floating-point exceptions are occurring during run time, there is a
  18339.  possible solution provided with FORTRAN. On the Setup disk is a file
  18340.  called EMOEM.ASM. This file can be used to modify the floating-point
  18341.  exception handler. The description of this file is located in the
  18342.  "Microsoft FORTRAN 4.1 Optimizing Compiler: User's Guide" under
  18343.  Floating Point Operations, Section 8.5, "Using Non-IBM Compatible
  18344.  Computers."
  18345.  
  18346.  Please note: Microsoft does not support the modification of this file.
  18347.  It is up to the manufacturer of the computer in question to provide
  18348.  the necessary modifications to correct any floating-point exceptions.
  18349.  
  18350.  
  18351.  478. FORTRAN: Division by .1 Yields Unexpected Result
  18352.  
  18353.  Product Version(s): 4.10
  18354.  Operating System:   MS-DOS | OS/2
  18355.  Flags: ENDUSER |
  18356.  Last Modified:  6-NOV-1989    ArticleIdent: Q45092
  18357.  
  18358.  The following code yields the expected result of 10 followed by
  18359.  significant zeros, as it should for a single-precision real:
  18360.  
  18361.                  X = 0
  18362.                  Y = 1
  18363.                  Z = .1
  18364.  
  18365.                  A = (Y - X)/Z
  18366.                  WRITE(*,*)' A  = ', A
  18367.  
  18368.  (OUTPUT)
  18369.            A = 10.000000
  18370.  
  18371.  However, if this expression is assigned to an integer as follows, the
  18372.  result can be varied:
  18373.  
  18374.                  I = (Y - X)/Z
  18375.             WRITE(*,*)' I  = ', I
  18376.  
  18377.  (OUTPUT)
  18378.                  I = 9
  18379.  
  18380.  The results are not correct because .1 is a nonterminating fraction in
  18381.  binary, and can never be represented exactly. This may result in an
  18382.  internal result of 9.99999... for the computation in the computer that
  18383.  is then rounded for use with real numbers but truncated at the decimal
  18384.  point for use with the integer representation. This is expected
  18385.  behavior.
  18386.  
  18387.  
  18388.  479. FORTRAN 5.00 Requires OS/2 1.10 or Later
  18389.  
  18390.  Product Version(s): 5.00
  18391.  Operating System:   OS/2
  18392.  Flags: ENDUSER | docerr
  18393.  Last Modified:  8-NOV-1989    ArticleIdent: Q45221
  18394.  
  18395.  There is a documentation error on Page vi of the "Microsoft FORTRAN
  18396.  Getting Started." The text states:
  18397.  
  18398.     Operating System and Hardware Requirements...the Microsoft FORTRAN
  18399.     Compiler, Version 5.0, operates on any IBM or IBM-compatible
  18400.     computer running MS-DOS Version 3.0 or later, or OS/2 Version 1.0
  18401.     or later.
  18402.  
  18403.  The manual should say that Version 5.00 of the Microsoft FORTRAN
  18404.  Compiler requires OS/2 Version 1.10 or later.
  18405.  
  18406.  
  18407.  480. Error C1041 Occurs Instead of F1041 in FORTRAN
  18408.  
  18409.  Product Version(s): 4.10   | 4.10
  18410.  Operating System:   MS-DOS | OS/2
  18411.  Flags: ENDUSER |
  18412.  Last Modified: 25-MAY-1990    ArticleIdent: Q45616
  18413.  
  18414.  FORTRAN version 4.10 may produce the error C1041 and/or the error
  18415.  message "Cannot open Compiler Intermediate File" if it does not have
  18416.  enough memory to compile. The error should be F1041 rather than C1041.
  18417.  
  18418.  This error may also be caused by an incorrectly set TMP environment
  18419.  variable or FILES= line in the CONFIG.SYS.
  18420.  
  18421.  The TMP environment variable must point to a directory that exists,
  18422.  and should not contain spaces around the equals (=) sign. For example,
  18423.  the following line points the TMP environment variable to the C:\TMP
  18424.  directory:
  18425.  
  18426.     SET TMP=C:\TMP
  18427.  
  18428.  The FILES= line in the CONFIG.SYS file should be set to a number such
  18429.  as 20. If the DOS version you use is earlier than DOS version 3.30 and
  18430.  the number of files is set to a number greater than 30, DOS defaults
  18431.  to eight. Five files are used by the operating system, so the default
  18432.  leaves three for use by the compiler, which may not be enough for any
  18433.  working files that must be created. The following line allows 20
  18434.  files to be open at one time:
  18435.  
  18436.     FILES=20
  18437.  
  18438.  
  18439.  
  18440.  481. CodeView Won't Recognize Non-Default File Extensions
  18441.  
  18442.  Product Version(s): 5.00
  18443.  Operating System:   MS-DOS
  18444.  Flags: ENDUSER | S_CodeView
  18445.  Last Modified:  8-DEC-1989    ArticleIdent: Q46929
  18446.  
  18447.  When debugging a FORTRAN program that has been compiled with a
  18448.  "non-.for" extension, CodeView sometimes displays the following
  18449.  message:
  18450.  
  18451.     Cannot display
  18452.  
  18453.  The default FORTRAN source file extension is ".for". CodeView
  18454.  uses the extension to determine the language being used. For instance,
  18455.  if the source file "test.77" is compiled with the FORTRAN compiler
  18456.  (using /Tf to tell the compiler that "test.77" is a FORTRAN file), you
  18457.  must ensure that CodeView is also aware that a FORTRAN program is being
  18458.  used.
  18459.  
  18460.  You can manually select the appropriate language by using the
  18461.  pull-down Language menu inside CodeView.
  18462.  
  18463.  This problem can occur with any language if the source program has an
  18464.  extension different from the default extension for each language (e.g.
  18465.  ".for", ".bas", ".c" or ".asm").  You must manually select the
  18466.  appropriate language to rectify this problem.
  18467.  
  18468.  This problem also can occur with the C compiler, if you use the /Tc
  18469.  option to specify that a "non-.c" source file should be accepted. The
  18470.  Microsoft FORTRAN compiler will accept a "non-.for" extension on the
  18471.  source file if /Tf is used at compile time.
  18472.  
  18473.  
  18474.  482. Inline 8087/80287 Assembly Listing Incorrect
  18475.  
  18476.  Product Version(s): 5.00   | 5.00
  18477.  Operating System:   MS-DOS | OS/2
  18478.  Flags: ENDUSER | docerr
  18479.  Last Modified: 30-NOV-1989    ArticleIdent: Q46961
  18480.  
  18481.  The assembly code listing is incorrect on Page 9 of the "Microsoft
  18482.  FORTRAN Advanced Topics" manual and on Page 323 of the "Microsoft
  18483.  FORTRAN Reference" manual.
  18484.  
  18485.  The incorrect information reads as follows:
  18486.  
  18487.        extrn  __fpmath:for
  18488.        extrn  __fpsignal:for
  18489.        extrn  __fptaskdata:for
  18490.  
  18491.        CDATA  segment  word  common  'DATA'
  18492.               dw  0
  18493.               dw  __fpmath
  18494.               dw  __fpsignal
  18495.               dw  __fptaskdata
  18496.        CDATA  ends
  18497.  
  18498.        end
  18499.  
  18500.  The corrected information should read as follows:
  18501.  
  18502.        extrn  __fpmath:far
  18503.        extrn  __fpsignal:far
  18504.        extrn  __fptaskdata:far
  18505.  
  18506.        CDATA  segment  word  common  'DATA'
  18507.               dw  0
  18508.               dd  __fpmath
  18509.               dd  __fpsignal
  18510.               dd  __fptaskdata
  18511.         CDATA  ends
  18512.  
  18513.         end
  18514.  
  18515.  
  18516.  483. FORTRAN 5.00 Err Msg: F1901 Program too Large for Memory
  18517.  
  18518.  Product Version(s): 5.00   | 5.00
  18519.  Operating System:   MS-DOS | OS/2
  18520.  Flags: ENDUSER |
  18521.  Last Modified: 24-JUL-1990    ArticleIdent: Q47500
  18522.  
  18523.  When compiling a large program using FORTRAN Version 5.00, you may
  18524.  receive the following error:
  18525.  
  18526.     F1901: program too large for memory
  18527.  
  18528.  This error can be caused because the symbol table is too big to be
  18529.  placed in NEAR HEAP.
  18530.  
  18531.  To correct this problem, perform the following:
  18532.  
  18533.  1. Copy F1L.EXE from DISK 13, High Capacity Compiler Disk into the
  18534.  \BIN directory.
  18535.  
  18536.  2. Compile the program using /B1, as shown in the following example:
  18537.  
  18538.     FL /B1 D:\FORTRAN\BIN\F1L.EXE
  18539.  
  18540.  The complete pathname and filename must follow the /B1 switch.
  18541.  
  18542.  Using the high capacity compiler F1L.EXE to compile the program places
  18543.  the symbol table into the FAR HEAP.
  18544.  
  18545.  The High Capacity Compiler is documented in the README.DOC file which
  18546.  is included on the FORTRAN version 5.00 Setup Disk.
  18547.  
  18548.  
  18549.  484. Abbreviation for /INFORMATION Is /INF, Not /I
  18550.  
  18551.  Product Version(s): 5.00   | 5.00
  18552.  Operating System:   MS-DOS | OS/2
  18553.  Flags: ENDUSER | docerr
  18554.  Last Modified:  6-DEC-1989    ArticleIdent: Q47640
  18555.  
  18556.  The following error message can be generated when using the incorrect
  18557.  abbreviation for the linker /INFORMATION switch:
  18558.  
  18559.     L1001 : I : option name ambiguous
  18560.  
  18561.  The "Microsoft FORTRAN 5.0 Quick Reference Guide" incorrectly states
  18562.  that the abbreviation for /INFORMATION is /I. The correct switch, as
  18563.  listed on page 243 of the "Microsoft FORTRAN 5.0 CodeView and
  18564.  Utilities User's Guide" is /INF.
  18565.  
  18566.  
  18567.  485. F2037: Asterisk with /4Ys, /4Yi, /4Yv Switches (Syntax Error)
  18568.  
  18569.  Product Version(s): 5.00
  18570.  Operating System:   MS-DOS
  18571.  Flags: ENDUSER | F2037 comment buglist5.00
  18572.  Last Modified: 18-OCT-1989    ArticleIdent: Q47722
  18573.  
  18574.   Summary:
  18575.  
  18576.  The compiler generates the error message "error F2037 : illegal label
  18577.  field" when an asterisk is used in Column 1 to indicate a comment line
  18578.  with FORTRAN Version 5.00, and you compile with one of the following
  18579.  switches:
  18580.  
  18581.     Switch     Description
  18582.     ------     -----------
  18583.  
  18584.     /4Ys       Strict syntax checking
  18585.     /4Yi       SAA extensions
  18586.     /4Yv       VAX FORTRAN extensions
  18587.  
  18588.  This message is incorrect because the asterisk should be allowed to
  18589.  indicate a comment.
  18590.  
  18591.  To work around this problem, replace the asterisk with a "C".
  18592.  
  18593.  Microsoft is researching this problem and will post new information as
  18594.  it becomes available.
  18595.  
  18596.  
  18597.  486. Suppressing an 8087/80287/80387 Coprocessor with FORTRAN
  18598.  
  18599.  Product Version(s): 3.20 4.00 4.01 4.10 5.00 | 4.10 5.00
  18600.  Operating System:   MS-DOS                   | OS/2
  18601.  Flags: ENDUSER |
  18602.  Last Modified:  6-DEC-1989    ArticleIdent: Q47749
  18603.  
  18604.  To prevent a FORTRAN program linked with the emulator library from
  18605.  using the math coprocessor, modify your environment so the math
  18606.  coprocessor is not recognized. You can type in the following line at
  18607.  the DOS prompt, or add it to your AUTOEXEC.BAT, and reboot:
  18608.  
  18609.     SET NO87=Use of coprocessor suppressed
  18610.  
  18611.  If NO87 is set equal to one or more characters, the usage of the
  18612.  coprocessor is suppressed. When a program executes and a math
  18613.  coprocessor is present, the message "Use of coprocessor suppressed" is
  18614.  displayed.
  18615.  
  18616.  For more information, consult Page 17 of the "Microsoft FORTRAN 5.0
  18617.  Advanced Topics" manual or Page 204 of the FORTRAN 4.X "User's Guide."
  18618.  It is listed in the index under Environment Variables, NO87.
  18619.  
  18620.  The FORTRAN 3.2 readme.doc also describes the NO87 environment
  18621.  variable.
  18622.  
  18623.  
  18624.  487. Internal Compiler Error:'@(#)srclist.c:1.59',line 1153
  18625.  
  18626.  Product Version(s): 4.10 5.00 | 4.10 5.00
  18627.  Operating System:   MS-DOS    | OS/2
  18628.  Flags: ENDUSER | buglist5.00
  18629.  Last Modified: 18-OCT-1989    ArticleIdent: Q47972
  18630.  
  18631.  If a non-existent common block name is placed in a SAVE statement, the
  18632.  following F1001 error can occur:
  18633.  
  18634.       fatal error F1001: Internal Compiler Error
  18635.       (compiler file '@(#)srclist.c:1.59', line 1153)
  18636.  
  18637.  To correct the problem, remove the name of the undeclared COMMON
  18638.  block.
  18639.  
  18640.  The following example demonstrates this situation:
  18641.  
  18642.            subroutine subr()
  18643.              save /c1/,/test/
  18644.              common /c1/ i,j,k
  18645.            end
  18646.  
  18647.  Remove /test/ from the second line to correct the problem.
  18648.  
  18649.  The following error is generated if the subroutine and common block
  18650.  have the same name and the /Fs switch is used:
  18651.  
  18652.       fatal error F1001: Internal Compiler Error
  18653.       (compiler file '@(#)p3io.c:1.93',line 605)
  18654.  
  18655.  
  18656.  488. Graphics Routines, Unresolved Externals and FGRAPH.FI & .FD
  18657.  
  18658.  Product Version(s): 5.00
  18659.  Operating System:   MS-DOS
  18660.  Flags: ENDUSER | L2029
  18661.  Last Modified: 13-FEB-1990    ArticleIdent: Q48025
  18662.  
  18663.  Problem:
  18664.  
  18665.  I have FGRAPH.FI at the start of my main file and FGRAPH.FD inside my
  18666.  subroutine that is in a separate file. When linking the main and the
  18667.  file with the graphics call, the graphics routines get flagged as
  18668.  unresolved externals.
  18669.  
  18670.  Response:
  18671.  
  18672.  Page 138 of the "Microsoft FORTRAN 5.0 Advanced Topics" manual states
  18673.  that for every file that makes a graphics call, you must have the
  18674.  INTERFACE statements at the beginning of that file (INCLUDE 'FGRAPH.FI').
  18675.  You then must include FGRAPH.FD (variable declarations) in every
  18676.  subroutine that calls a graphics routine. Note: The INTERFACE statement
  18677.  needs to be in EACH FILE in which a graphics routine is called.
  18678.  
  18679.  The following examples demonstrate this idea:
  18680.  
  18681.  -------EXAMPLE #1-------
  18682.  CC  Main program and subroutine in same file:
  18683.        INCLUDE 'FGRAPH.FI'   ! interface statements at file beginning
  18684.        PROGRAM GRAPH
  18685.        CALL DUMMY
  18686.        END
  18687.  
  18688.        SUBROUTINE DUMMY()
  18689.        INCLUDE 'FGRAPH.FD'   ! declarations within the subroutine
  18690.        CALL clearscreen( $GCLEARSCREEN )
  18691.        RETURN
  18692.        END
  18693.  
  18694.  -------EXAMPLE #2-------
  18695.  CC  Main program in a separate file:
  18696.        PROGRAM GRAPH    ! No graphics calls in this file, so include
  18697.        CALL DUMMY       ! files are not necessary in this file
  18698.        END
  18699.  
  18700.  CC  Subroutine in a separate file:
  18701.        INCLUDE 'FGRAPH.FI'  ! interface statements at file beginning
  18702.        SUBROUTINE DUMMY()
  18703.        INCLUDE 'FGRAPH.FD'  ! declarations within the subroutine
  18704.        CALL clearscreen( $GCLEARSCREEN )
  18705.        RETURN
  18706.        END
  18707.  
  18708.  
  18709.  489. Using NMAKE to Compile FORTRAN Programs in M Editor in OS/2
  18710.  
  18711.  Product Version(s): 5.00
  18712.  Operating System:   OS/2
  18713.  Flags: ENDUSER | S_EDITOR S_NMAKE
  18714.  Last Modified: 16-JUL-1990    ArticleIdent: Q63818
  18715.  
  18716.  To compile Microsoft FORTRAN version 5.00 programs using the NMAKE
  18717.  utility in the M Editor under OS/2, add the following line to the
  18718.  TOOLS.INI file:
  18719.  
  18720.     extmake: text nmake /f %s
  18721.  
  18722.  This information applies to the Microsoft FORTRAN Compiler version
  18723.  5.00 for OS/2, the Microsoft Editor version 1.02 for OS/2, and NMAKE
  18724.  version 1.01 for OS/2.
  18725.  
  18726.  The NMAKE utility (also known as the Microsoft Program-Maintenance
  18727.  Utility) interprets a text file of commands, the description file, to
  18728.  compare dates of files and carry out other operations on the basis of
  18729.  the comparison. That is, NMAKE will check to see if any of the FORTRAN
  18730.  programs listed in the description file have been modified. If any
  18731.  have, NMAKE will issue commands to recompile and relink the modified
  18732.  programs.
  18733.  
  18734.  More information regarding the NMAKE utility and the description file
  18735.  required by this utility can be found on Pages 285-306 in the
  18736.  "Microsoft CodeView and Utilities User's Guide."
  18737.  
  18738.  NMAKE is often utilized to compile and link several FORTRAN programs
  18739.  at once. For simplicity, only one FORTRAN program will be used here
  18740.  to demonstrate how to use NMAKE to compile FORTRAN programs in the M
  18741.  Editor.
  18742.  
  18743.  The extmake switch above indicates that the text setting, the %s
  18744.  symbol, should be used when a compilation is run. When running a
  18745.  compilation you pass the text argument to the COMPILE function and the
  18746.  editor executes the NMAKE utility according to this text argument.
  18747.  
  18748.  For more information about running a compilation according to the
  18749.  extmake switch, see Pages 44-45 in the "Microsoft Editor User's
  18750.  Guide."
  18751.  
  18752.  NMAKE uses the text argument, %s, as the description file because the
  18753.  /F option is used. The /F option specifies that the filename following
  18754.  it is the description file to use. Additional information about
  18755.  the /F option can be found on Page 287 of the "Microsoft CodeView
  18756.  and Utilities User's Guide."
  18757.  
  18758.  To compile a FORTRAN program, TEST.FOR, using the NMAKE utility in the
  18759.  M Editor under OS/2, do the following:
  18760.  
  18761.  1. Invoke the M Editor by typing "MEP TEST.FOR" (without the quotation
  18762.     marks) at the OS/2 prompt.
  18763.  
  18764.  2. If desired, add the following macro and keystroke definitions  to
  18765.     the TOOLS.INI file, and then press ALT+C to generate a compile
  18766.     window:
  18767.  
  18768.     CompWindow:= savecur home meta down  \   ;open compile log window
  18769.                  up up up up arg window  \
  18770.                  window arg "<compile>" setfile  \
  18771.                  window restcur
  18772.     CompWindow: alt+c       ;MACRO open compile window
  18773.  
  18774.  3. Run NMAKE according to the extmake switch above by pressing ALT+A,
  18775.     entering "MAKEFILE" or the appropriate description filename, and
  18776.     pressing SHIFT+F3.
  18777.  
  18778.  The following is the description file MAKEFILE for the FORTRAN program
  18779.  TEST.FOR:
  18780.  
  18781.  all : test
  18782.  test.obj : test.for
  18783.     fl /c $**
  18784.  test : test.obj
  18785.     link $**;
  18786.  
  18787.  The following is the FORTRAN program TEST.FOR compiled using NMAKE in
  18788.  the M Editor:
  18789.  
  18790.        write(*,*) ' It works!'
  18791.        end
  18792.  
  18793.  Compiling FORTRAN programs using the NMAKE utility in the M Editor
  18794.  in DOS or the DOS compatibility box of OS/2 is not possible because there
  18795.  is not enough memory to load all the files needed. For more
  18796.  information on this subject, query in this Knowledge Base on the
  18797.  following words:
  18798.  
  18799.     D2027 and M EDITOR
  18800.  
  18801.  
  18802.  490. FORTRAN Err Msg: F2348: Already Declared SAVE
  18803.  
  18804.  Product Version(s): 5.00
  18805.  Operating System:   MS-DOS | OS/2
  18806.  Flags: ENDUSER | buglist5.00 appnote
  18807.  Last Modified: 23-JUL-1990    ArticleIdent: Q48624
  18808.  
  18809.  The SAVE statement cannot be used on any item more than twice in any
  18810.  source file. You will receive a message stating that SAVE is already
  18811.  declared.
  18812.  
  18813.  This problem has been corrected with an application note which is
  18814.  available from Microsoft Product Support Services at (206) 454-2030.
  18815.  The application note is called "FORTRAN 5.0 F1.EXE and F1L.EXE
  18816.  Patch."
  18817.  
  18818.  The following is an example:
  18819.  
  18820.           subroutine a
  18821.           common /a/
  18822.           save /a/
  18823.           end
  18824.  
  18825.           subroutine b
  18826.           common /a/
  18827.           save /a/
  18828.           end
  18829.  
  18830.           subroutine c
  18831.           common /a/
  18832.           save /a/
  18833.           end
  18834.  
  18835.  You receive the following message:
  18836.  
  18837.     ERROR:
  18838.  
  18839.     F2348: a: already declared SAVE
  18840.  
  18841.  
  18842.  
  18843.  491. FORTRAN 5.0 Compiler Error F1001: omf_ms.c:1.118, line 1093
  18844.  
  18845.  Product Version(s): 5.00   | 5.00
  18846.  Operating System:   MS-DOS | OS/2
  18847.  Flags: ENDUSER | buglist5.00
  18848.  Last Modified:  7-NOV-1989    ArticleIdent: Q48632
  18849.  
  18850.  The "F1001: omf_ms.c:1.118, line 1093" internal compiler error is most
  18851.  often created in FORTRAN 5.0 by passing a structure to a subroutine
  18852.  and trying to use an item in that structure in a READ or WRITE operation.
  18853.  
  18854.  An application note called "F1.EXE and F1L.EXE PATCH" is available from
  18855.  Microsoft Product Support which corrects this problem.
  18856.  
  18857.  The following code produces the above error in DOS and produces a
  18858.  protection violation under OS/2:
  18859.  
  18860.           subroutine a(ms)
  18861.           structure /dataset/
  18862.             integer*2 number
  18863.           end structure
  18864.  
  18865.           record /dataset/ ms
  18866.  
  18867.           read(*,10) ms.number
  18868.   10   format(i2)
  18869.           end
  18870.  
  18871.  Another way to alleviate this problem is to use a temporary structure,
  18872.  as in the following:
  18873.  
  18874.           subroutine a(ms)
  18875.           structure /dataset/
  18876.             integer*2 number
  18877.           end structure
  18878.  
  18879.           record /dataset/ ms,fs
  18880.           read(*,10) fs.number  ! Read into fs which was not passed
  18881.           ms=fs                 ! Assign temp struct. to passed struct.
  18882.   10      format(i2)
  18883.           end
  18884.  
  18885.  
  18886.  492. Deallocating Memory to DOS
  18887.  
  18888.  Product Version(s): 5.00
  18889.  Operating System:   MS-DOS
  18890.  Flags: ENDUSER |
  18891.  Last Modified:  7-DEC-1989    ArticleIdent: Q48636
  18892.  
  18893.  When using the DEALLOCATE command with FORTRAN Version 5.00, the
  18894.  storage space reserved by ALLOCATE is not returned to the system. Yet,
  18895.  the space is free for use inside of the FORTRAN program.
  18896.  
  18897.  To clarify Page 143 of the "Microsoft FORTRAN Reference" manual, the
  18898.  memory allocated by the ALLOCATE instruction is held by the program
  18899.  until the program terminates. The DEALLOCATE instruction frees the
  18900.  memory for use inside the main program. The space is not returned to
  18901.  DOS.
  18902.  
  18903.  If you must have the memory deallocate back to DOS, you can spawn to a
  18904.  child process where you ALLOCATE and DEALLOCATE. When the child
  18905.  process terminates, the memory that was claimed by the FORTRAN child
  18906.  process will be returned to DOS.
  18907.  
  18908.  The following code demonstrates this process:
  18909.  
  18910.  C----------------------------------------------------------
  18911.  C Main file.
  18912.  C
  18913.        interface to integer*2 function spawnlp
  18914.       + [C,VARYING] (mode)
  18915.        integer*2 mode
  18916.        end
  18917.  C
  18918.        integer*2 spawnlp
  18919.  C
  18920.        I=spawnlp(0,loc('child.exe'C),loc('child.exe'C),
  18921.       Xint4(0))
  18922.        end
  18923.  C----------------------------------------------------------
  18924.  
  18925.  C----------------------------------------------------------
  18926.  C Child process (separate file), called by spawnlp in
  18927.  C parent.
  18928.  C
  18929.        integer size
  18930.        character*1 arr1[allocatable] ()
  18931.        parameter (size=20000)
  18932.  C
  18933.        allocate (arr1(size))
  18934.        DEALLOCATE (arr1)
  18935.        end
  18936.  C----------------------------------------------------------
  18937.  
  18938.  
  18939.  493. FORTRAN 5.00 Error F2124: CODE GENERATION ERROR
  18940.  
  18941.  Product Version(s): 5.00   | 5.00
  18942.  Operating System:   MS-DOS | OS/2
  18943.  Flags: ENDUSER | buglist5.00
  18944.  Last Modified: 31-OCT-1989    ArticleIdent: Q48637
  18945.  
  18946.  The following code example generates an F2124 ERROR: CODE GENERATION
  18947.  ERROR. The error is caused by using an integer as the argument to the
  18948.  AINT() function. The code should cause a syntax error because the
  18949.  argument for the AINT() function should only be a real.
  18950.  
  18951.  The same code compiles with no errors in FORTRAN Version 4.10.
  18952.  
  18953.  Code Example
  18954.  ------------
  18955.  
  18956.           real*4    x,y
  18957.           integer*4 i
  18958.  
  18959.           x=aint(y)
  18960.           y=aint(i)             <--- causes error
  18961.           end
  18962.  
  18963.  The following functions also generate the F2124 error when compiled
  18964.  with FORTRAN 5.0 and an integer is used as a parameter instead of a
  18965.  real variable:  AINT(), ANINT(), ASIN(), ACOS(), ATAN(), ATAN2(),
  18966.  COTAN(), AND TAN().
  18967.  
  18968.  
  18969.  494. First Error Message Doesn't Appear in M
  18970.  
  18971.  Product Version(s): 5.00
  18972.  Operating System:   MS-DOS
  18973.  Flags: ENDUSER | mangled merged message S_EDITOR
  18974.  Last Modified: 30-APR-1990    ArticleIdent: Q48638
  18975.  
  18976.  The following information is true for MS-DOS only.
  18977.  
  18978.  Version 1.02 of the M Editor, which is supplied with FORTRAN version
  18979.  5.00, does not display the first error message when compiling a
  18980.  FORTRAN version 5.00 program from within M. The M.MSG file displays a
  18981.  mixed-up message for the first line. The problem is solved by using
  18982.  the /nologo switch for compilation. The compilation line will read as
  18983.  follows:
  18984.  
  18985.     FL /nologo test.for
  18986.  
  18987.  The /nologo switch is an undocumented switch that stops the Microsoft
  18988.  copyright logo from appearing when you compile.
  18989.  
  18990.  If the Quick or Epsilon configurations have been chosen for the
  18991.  Editor, a line must also be added to the TOOLS.INI to define the
  18992.  keystrokes for viewing the next error message.
  18993.  
  18994.  The following example assigns SHIFT+F3 to NextMsg:
  18995.  
  18996.     NextMsg:shift+F3
  18997.  
  18998.  
  18999.  495. Library Manager Failure During Installation
  19000.  
  19001.  Product Version(s): 5.00   | 5.00
  19002.  Operating System:   MS-DOS | OS/2
  19003.  Flags: ENDUSER | LIB.EXE tmp components manual build
  19004.  Last Modified:  6-DEC-1989    ArticleIdent: Q49253
  19005.  
  19006.  If the LIBRARY MANAGER fails during installation of the FORTRAN
  19007.  product, check for TSRs (terminate-and-stay-resident software) and
  19008.  available RAM memory. If your investigation proves sound (no TSRs,
  19009.  and as much free memory as possible), but the LIBRARY MANAGER
  19010.  continues to fail, you need to build the libraries manually.
  19011.  
  19012.  The easiest method is to create a temporary directory on your hard
  19013.  disk. Copy the contents of the appropriate library distribution disk
  19014.  (Large or Medium Model Libraries Disk) and the file LIB.EXE into this
  19015.  directory. LIB.EXE can be found on the Utilities distribution disk.
  19016.  You now can create the necessary library without concern for path
  19017.  environments or file locations.
  19018.  
  19019.  Upon completion, copy the created library into the \LIB directory and
  19020.  then delete the contents of the temporary directory.
  19021.  
  19022.  
  19023.  496. FORTRAN 5.00 SYSTEM and SPAWNLP Functions
  19024.  
  19025.  Product Version(s): 5.00
  19026.  Operating System:   MS-DOS
  19027.  Flags: ENDUSER | docerr sample demo
  19028.  Last Modified:  9-JUL-1990    ArticleIdent: Q48691
  19029.  
  19030.  The SYSTEM and SPAWNLP functions are included as part of the FORTRAN
  19031.  run-time library. The use of these two functions is demonstrated in a
  19032.  program included on the distribution disk labeled SOURCE. The program
  19033.  is in the DEMOS directory under the name DEMOEXEC.FOR.
  19034.  
  19035.  The comments in this program (and in the include file EXEC.FI)
  19036.  incorrectly state that more information is available in Chapter 3 of
  19037.  the "Advanced Topics" manual.
  19038.  
  19039.  The information is on Page 86 of Chapter 4 of the "Advanced Topics"
  19040.  manual under Section 4.2.5.
  19041.  
  19042.  
  19043.  497. F2225, NEAR/FAR Attribute Mismatch
  19044.  
  19045.  Product Version(s): 4.00 4.10 5.00 | 4.00 4.10 5.00
  19046.  Operating System:   MS-DOS         | OS/2
  19047.  Flags: ENDUSER | f2225 addressing
  19048.  Last Modified:  6-DEC-1989    ArticleIdent: Q48787
  19049.  
  19050.  When using FORTRAN in the large model and calling a subroutine that is
  19051.  declared as NEAR, error F2225 "NEAR/FAR attribute mismatch" is
  19052.  generated if no INTERFACE statement exists for that subroutine.
  19053.  
  19054.  When the compiler passes a CALL instruction in a large model FORTRAN
  19055.  program, it reserves 4 bytes for the address of the subroutine. If you
  19056.  use the NEAR attribute on the subroutine, only 2 bytes are needed for
  19057.  the subroutine address.
  19058.  
  19059.  The problem occurs because the compiler assumes the subroutine is type
  19060.  FAR if the compiler reaches the call to the subroutine before the
  19061.  subroutine declaration. If you then specify the subroutine as NEAR,
  19062.  you get the attribute mismatch error.
  19063.  
  19064.  To eliminate this mismatch, you must use the interface statement at
  19065.  the beginning of the file to explicitly define the subroutine as NEAR,
  19066.  as shown in the following example:
  19067.  
  19068.        interface to subroutine foo [NEAR] ()
  19069.        end
  19070.  
  19071.  This procedure lets the compiler know that when it comes across a call
  19072.  to the subroutine foo, 2 bytes should be reserved for the address
  19073.  instead of 4 bytes.
  19074.  
  19075.  
  19076.  498. Increasing Maximum Number of Open Files in FORTRAN 5.00
  19077.  
  19078.  Product Version(s): 5.00   | 5.00
  19079.  Operating System:   MS-DOS | OS/2
  19080.  Flags: ENDUSER  | hard-coded
  19081.  Last Modified: 10-NOV-1989    ArticleIdent: Q48797
  19082.  
  19083.  To increase the limit on the number of open files under FORTRAN
  19084.  Version 5.00, follow the steps outlined below. Most of this
  19085.  information is also documented on Pages 405-407 of the "Microsoft
  19086.  FORTRAN Reference" manual for Version 5.00 and in the file UNIT.ASM,
  19087.  which is on the Source Code disk in the STARTUP subdirectory.
  19088.  
  19089.  The key point to note in the outline below is that CRT0DAT.ASM must be
  19090.  assembled with the following line [where the "l" in /Dmem_l is the
  19091.  lowercase letter "l", not the number 1 (one)]:
  19092.  
  19093.     MASM /Dmem_l CRT0DAT.ASM
  19094.  
  19095.  These alterations require DOS 3.30 or later, or OS/2. The use of
  19096.  Microsoft Macro Assembler Version 5.10 or later is also required.
  19097.  
  19098.  1. Edit the file CRT0DAT.ASM found on the Source Code disk in the
  19099.     \STARTUP\DOS directory (or \STARTUP\OS2 if working under OS/2).
  19100.  
  19101.     Change the following line
  19102.  
  19103.        _NFILE_=20
  19104.  
  19105.     to the following:
  19106.  
  19107.     _NFILE_=xx (up to 256)
  19108.  
  19109.     You also should delete the comment marks (;) from the following
  19110.     lines in CRT0DAT.ASM:
  19111.  
  19112.     ;     mov ah,67H
  19113.     ;     mov bx,_NFILE_
  19114.     ;     callos
  19115.  
  19116.     After you delete the comment marks, the lines should read as follows:
  19117.  
  19118.        mov ah,67H
  19119.        mov bx,_NFILE_
  19120.        callos
  19121.  
  19122.  2. Edit the UNIT.ASM file on the Source Code disk in the \STARTUP
  19123.     directory. Change the following line
  19124.  
  19125.        _NFILE_   equ 20
  19126.  
  19127.     to the following:
  19128.  
  19129.        _NFILE_   equ xx (same as specified in the CRT0DAT.ASM file)
  19130.  
  19131.  3. Edit the following line in the CONFIG.SYS file
  19132.  
  19133.        FILES=20
  19134.  
  19135.     to read as follows:
  19136.  
  19137.        FILES=xx (the same number as specified in UNIT.ASM and
  19138.                 CRT0DAT.ASM files)
  19139.  
  19140.     Reboot the machine so the new FILES= statement takes effect.
  19141.  
  19142.  4. Assemble the UNIT.ASM and CRT0DAT.ASM files with the following
  19143.     lines [note that in mem_l, the last character is the lowercase
  19144.     letter "l", not the number 1 (one)]:
  19145.  
  19146.        MASM /Dmem_l CRT0DAT.ASM
  19147.  
  19148.        MASM UNIT.ASM
  19149.  
  19150.  5. Link the .OBJ files with the FORTRAN .OBJ file in the following
  19151.     statement:
  19152.  
  19153.        LINK /NOE FOO.OBJ + UNIT.OBJ + CRT0DAT.OBJ;
  19154.  
  19155.     (where FOO.OBJ is the FORTRAN object code)
  19156.  
  19157.  
  19158.  499. /Gt Switch Not Listed in FORTRAN 5.00 Manual Index
  19159.  
  19160.  Product Version(s): 4.00 4.10 5.00 | 4.00 4.10 5.00
  19161.  Operating System:   MS-DOS         | OS/2
  19162.  Flags: ENDUSER | docerr
  19163.  Last Modified: 24-JUL-1990    ArticleIdent: Q48866
  19164.  
  19165.  The index for the "Microsoft FORTRAN Reference" manual for Version
  19166.  5.00 omits the listing for the /Gt Data Threshold switch. Information
  19167.  about the /Gt switch can be found on Pages 326-327 in Section 7.6 of
  19168.  the manual.
  19169.  
  19170.  The manual should have included the index listing under the topic
  19171.  "FL options."
  19172.  
  19173.  The /Gt switch places data exceeding a specified threshold into the
  19174.  far heap.
  19175.  
  19176.  The /Gt switch is documented on Page 232 of the "Microsoft FORTRAN
  19177.  Optimizing Compiler: User's Guide" for Versions 4.00 and 4.10.
  19178.  
  19179.  /Gt is not available in the FORTRAN Versions 3.x (3.10, 3.13, 3.20,
  19180.  3.30, and 3.31).
  19181.  
  19182.  
  19183.  500. Allocatable Arrays Not Allowed in Structures in FORTRAN 5.00
  19184.  
  19185.  Product Version(s): 5.00   | 5.00
  19186.  Operating System:   MS-DOS | OS/2
  19187.  Flags: ENDUSER | docerr
  19188.  Last Modified:  6-DEC-1989    ArticleIdent: Q48867
  19189.  
  19190.  Page 113 of the "Microsoft FORTRAN Reference" for Version 5.00 states
  19191.  that allocatable arrays may not appear in AUTOMATIC, COMMON, DATA, or
  19192.  EQUIVALENCE statements. This list is incomplete; it should also
  19193.  include STRUCTURES.
  19194.  
  19195.  Page 228 of the "Microsoft FORTRAN Reference" for Version 5.00 states
  19196.  that "Elements cannot be declared with attributes. For example,
  19197.  INTEGER var[FAR] is not permitted." Since allocatable arrays must be
  19198.  declared with attributes, they can't be used in structures.
  19199.  
  19200.  
  19201.  501. Sample Code on Page 165 in FORTRAN 5.00 Reference Is Correct
  19202.  
  19203.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.00 4.01 4.10 5.00
  19204.  Operating System:   MS-DOS              | OS/2
  19205.  Flags: ENDUSER | docerr
  19206.  Last Modified:  6-DEC-1989    ArticleIdent: Q48868
  19207.  
  19208.  The sample code on Page 165 of the "Microsoft FORTRAN Reference" for
  19209.  Version 5.00 incorrectly states that when you equivalence a real and a
  19210.  character array so that the real falls onto an odd byte, the compiler
  19211.  generates an error. However, the sample code that is given compiles
  19212.  properly.
  19213.  
  19214.  The documentation states the following on Page 165 of the "Microsoft FORTRAN
  19215.  Reference" manual for Version 5.00 (and Page 211 of the "Microsoft
  19216.  FORTRAN Optimizing Compiler: Language Reference" for Versions 4.01 and
  19217.  4.10):
  19218.  
  19219.     Microsoft FORTRAN permits character and noncharacter entities to be
  19220.     associated, but not in such a way that noncharacter entities start
  19221.     on an odd-byte boundary. If necessary, the compiler adjusts the
  19222.     storage location of the character entity so the noncharacter entity
  19223.     begins on an even byte. The following example causes a compile-time
  19224.     error:
  19225.  
  19226.        CHARACTER 1 char1(10)
  19227.        REAL reala, realb
  19228.        EQUIVALENCE (reala, char1(1))
  19229.        EQUIVALENCE (realb, char1(2))
  19230.  
  19231.  (Also note that the asterisk is missing in the character declaration.
  19232.  It should read "CHARACTER*1").
  19233.  
  19234.  If you compile the above code, not only does it compile properly,
  19235.  the following will be true if you create a listing:
  19236.  
  19237.  1. char1 has the offset 0000h.
  19238.  
  19239.  2. reala has the offset 0000h.
  19240.  
  19241.  3. realb has the offset 0001h.
  19242.  
  19243.  The equivalence statement appears to work correctly.
  19244.  
  19245.  
  19246.  502. F2836: "Statement Out of Order" for DATA Statement
  19247.  
  19248.  Product Version(s): 5.00   | 5.00
  19249.  Operating System:   MS-DOS | OS/2
  19250.  Flags: ENDUSER |
  19251.  Last Modified:  6-DEC-1989    ArticleIdent: Q49730
  19252.  
  19253.  The first paragraph on Page 48 of the Version 5.00 "Microsoft FORTRAN
  19254.  Reference" states "All specification statements must precede all DATA
  19255.  statements, statement-function statements, and executable statements."
  19256.  If you do not follow this format, the compiler generates the following
  19257.  error message:
  19258.  
  19259.     F2836: statement out of order
  19260.  
  19261.  The following example generates the "statement out of order" error
  19262.  because a DATA statement precedes an integer declaration statement:
  19263.  
  19264.        integer n
  19265.        data n /1/
  19266.        integer m
  19267.        end
  19268.  
  19269.  The table on Page 47 of the "Microsoft FORTRAN Reference" outlines the
  19270.  order that statements must be in for the code to compile correctly.
  19271.  
  19272.  Consider the following rules when using the DATA instruction:
  19273.  
  19274.  1. The DATA statement must follow COMMON, DIMENSION, EQUIVALENCE,
  19275.     EXTERNAL, INTRINSIC, and SAVE instructions.
  19276.  
  19277.  2. The DATA statement can work in conjunction with the following:
  19278.  
  19279.        Executable statements
  19280.        Statement function statements
  19281.        ENTRY and FORMAT statements
  19282.        All metacommands except the following:
  19283.  
  19284.           $DO66,
  19285.           $[NO]FLOATCALLS
  19286.           $[NO]FREEFORM
  19287.           $STORAGE
  19288.  
  19289.  3. The DATA statement must follow every other command.
  19290.  
  19291.  4. The DATA statement must precede the END instruction.
  19292.  
  19293.  
  19294.  503. EXAMPLE Output Incorrect on Page 201 of FORTRAN 5.00 Reference
  19295.  
  19296.  Product Version(s): 5.00   | 5.00
  19297.  Operating System:   MS-DOS | OS/2
  19298.  Flags: ENDUSER | docerr
  19299.  Last Modified: 24-JUL-1990    ArticleIdent: Q48943
  19300.  
  19301.  The EXAMPLE output for the NAMELIST operation on Page 201 of the
  19302.  "Microsoft FORTRAN Reference" manual for Version 5.00 is incorrect.
  19303.  
  19304.  All NAMELIST interactions require the forward slash (/) to terminate
  19305.  the interaction.
  19306.  
  19307.  To correct the problem, add a line to the end of the example that
  19308.  contains only a forward slash. The example should read as follows:
  19309.  
  19310.         &EXAMPLE
  19311.         I1 =      11
  19312.         I2 =      12
  19313.  
  19314.         .
  19315.         .
  19316.         .
  19317.  
  19318.         C10 = '0123456789'
  19319.         IARRAY =      41      42      43
  19320.         /
  19321.  
  19322.  
  19323.  504. Reading Environment Variables from FORTRAN 5.00
  19324.  
  19325.  Product Version(s): 5.00
  19326.  Operating System:   MS-DOS
  19327.  Flags: ENDUSER |
  19328.  Last Modified: 23-JAN-1990    ArticleIdent: Q48957
  19329.  
  19330.  The program shown below demonstrates how to obtain environment
  19331.  variables from the MS-DOS environment. The program calls the C
  19332.  getenv() function, which is a built-in part of the FORTRAN Version
  19333.  5.00 Library.
  19334.  
  19335.  The interface statement and the character function GETENV are the
  19336.  required portions, while the main program is for demonstration
  19337.  purposes.
  19338.  
  19339.  The problem occurs because the C function is designed to return a
  19340.  pointer to the contents of the variable. The function does not find
  19341.  the variable; it returns a NULL, which causes a problem under FORTRAN
  19342.  because there is no way to check for a NULL.
  19343.  
  19344.  To correct this problem, you need to look for a variable that does not
  19345.  exist. Use the following procedure:
  19346.  
  19347.  1. Call getenv() on non-existent variable.
  19348.  
  19349.  2. Call getenv(VAR) where VAR is what you want to find.
  19350.  
  19351.  3. If the results match, VAR does not exist.
  19352.  
  19353.  4. If the results do not match, you have a return value.
  19354.  
  19355.  Sample Program
  19356.  --------------
  19357.  
  19358.         program environment
  19359.         character name*20,  string*128, fgetenv*128
  19360.         write (*,*) ' Enter name of environment variable'
  19361.         read (*,'(A)') name
  19362.         string = fgetenv(name)
  19363.         write (*,*) 'Value is: ',string
  19364.         stop
  19365.         end
  19366.  
  19367.         interface to character*128 function getenv [c] (var)
  19368.         character*21 var [reference]
  19369.         end
  19370.  
  19371.         character*128 function fgetenv(var)
  19372.         character getenv*128, dummy*128, var*20, cvar*21
  19373.         integer n
  19374.         n = len_trim(var)
  19375.         cvar = var(1:n)//char(0)
  19376.         fgetenv = char(0)
  19377.         dummy = getenv(fgetenv)
  19378.         fgetenv = getenv(cvar)
  19379.         if (fgetenv.eq.dummy) then
  19380.             fgetenv = ' '
  19381.         end if
  19382.         fgetenv = fgetenv(1:index(fgetenv,char(0)))
  19383.         return
  19384.         end
  19385.  
  19386.  
  19387.  505. VERIFY Function Returns an Integer, Not a Logical
  19388.  
  19389.  Product Version(s): 5.00   | 5.00
  19390.  Operating System:   MS-DOS | OS/2
  19391.  Flags: ENDUSER | docerr
  19392.  Last Modified:  6-DEC-1989    ArticleIdent: Q48984
  19393.  
  19394.  The table of Intrinsic Character Functions on Page 256 of the
  19395.  "Microsoft FORTRAN Reference" manual for Version 5.00 incorrectly
  19396.  lists the VERIFY function as type logical. The VERIFY function is an
  19397.  integer function.
  19398.  
  19399.  The examples of the use of the VERIFY function on Pages 257 and 268 of
  19400.  the FORTRAN reference correctly show that VERIFY returns an integer.
  19401.  
  19402.  
  19403.  506. Syntax, Description of NAMELIST Instruction in FORTRAN 5.00
  19404.  
  19405.  Product Version(s): 5.00   | 5.00
  19406.  Operating System:   MS-DOS | OS/2
  19407.  Flags: ENDUSER |
  19408.  Last Modified:  7-DEC-1989    ArticleIdent: Q49254
  19409.  
  19410.  The NAMELIST instruction was introduced in FORTRAN Version 5.00.
  19411.  
  19412.  As stated on Page 200 of the "Microsoft FORTRAN Reference" for Version
  19413.  5.00, a NAMELIST "declares a group name for a set of variables so they
  19414.  may be read or written with a single namelist-directed READ or WRITE
  19415.  statement."
  19416.  
  19417.     SYNTAX:    NAMELIST /namelst/ varlst [/namelst/ varlst]
  19418.  
  19419.  namelst is the name for a group of variables (the name of the
  19420.  namelist), and varlst is all the variables in the NAMELIST.
  19421.  
  19422.  The main purpose of NAMELIST is to allow you to READ or WRITE groups
  19423.  of data with one READ or WRITE instruction.
  19424.  
  19425.  When a NAMELIST READ (or WRITE) is performed, the information is read
  19426.  (or written) in a specific format. This format has three parts: a
  19427.  header, the body, and the terminator. The header consists of the name
  19428.  of the NAMELIST preceded by an ampersand (&). The body consists of any
  19429.  of the NAMELIST variables you want to READ or WRITE. The terminator is
  19430.  a forward slash (/).
  19431.  
  19432.  The following code (where "example" is the name of the namelist):
  19433.  
  19434.     WRITE (*,example)
  19435.  
  19436.  produces output as follows:
  19437.  
  19438.  &example
  19439.  thischar = 'a'
  19440.  numint  = 256
  19441.  realval = 3.14
  19442.  /
  19443.  
  19444.  When reading a NAMELIST, start the READ with the header and then
  19445.  explicitly READ each variable. Because a NAMELIST allows you to read
  19446.  less then the total number of variables in the list, you must use the
  19447.  variable name as you enter the data. This allows the NAMELIST to fill
  19448.  that particular variable. If you leave off this assignment, you get
  19449.  the run-time error F6511 "variable name not found".
  19450.  
  19451.  The following is typical data that would be entered from the keyboard
  19452.  in response to the line "READ (*,example)":
  19453.  
  19454.  &example
  19455.  thischar = 'a'
  19456.  numint  = 256
  19457.  realval = 3.14
  19458.  /
  19459.  
  19460.  The header (&example) and terminator (/) must both be entered.
  19461.  
  19462.  
  19463.  507. FORTRAN: Internal Compiler Error: @(#)p2symtab.c:1.4 line 939
  19464.  
  19465.  Product Version(s): 5.00   | 5.00
  19466.  Operating System:   MS-DOS | OS/2
  19467.  Flags: ENDUSER | buglist5.00
  19468.  Last Modified:  6-DEC-1989    ArticleIdent: Q49374
  19469.  
  19470.  The code below produces the following error:
  19471.  
  19472.   fatal error F1001: Internal Compiler Error
  19473.          (compiler file '@(#)p2symtab.c:1.4', line 939)
  19474.          Contact Microsoft Technical Support
  19475.  
  19476.  The code below should produce a syntax error because, according to the
  19477.  last paragraph on Page 135 in the "Microsoft FORTRAN Reference" manual
  19478.  for Version 5.00, "An item that appears in 'nlist' cannot be
  19479.  initialized in a type statement."
  19480.  
  19481.  Code
  19482.  ----
  19483.  
  19484.           integer*1 a(1,1) /10/
  19485.           common /st/a
  19486.           end
  19487.  
  19488.  
  19489.  508. Spaces Converted to Zeros; BZ Edit Descriptor
  19490.  
  19491.  Product Version(s): 5.00
  19492.  Operating System:   MS-DOS
  19493.  Flags: ENDUSER | docerr BN BZ
  19494.  Last Modified:  6-DEC-1989    ArticleIdent: Q49430
  19495.  
  19496.  The last paragraph on Page 86 of the "Microsoft FORTRAN Reference"
  19497.  manual for Version 5.00 incorrectly states the following:
  19498.  
  19499.     ...so the first thing the I/O system does is to pad
  19500.     the record 502 on the right with two blanks. If BZ
  19501.     editing were in effect, those two blanks would be
  19502.     interpreted as zeros,and the record would be equal
  19503.     to 50200.
  19504.  
  19505.  This is a documentation error. The BZ edit descriptor is designed to
  19506.  replace any spaces in the input with zeros, provided the space is not
  19507.  a leading space.
  19508.  
  19509.  Contrary to Page 86, the I/O system does not pad spaces to the right
  19510.  of the two; therefore, the BZ edit descriptor does not add zeros to
  19511.  the end of the number.
  19512.  
  19513.  With BZ editing, if the user types "502" (without the quotation marks)
  19514.  and presses ENTER, the variable that is being read equals 502, not
  19515.  50200.
  19516.  
  19517.  In contrast, if the user enters "502" followed by two spaces, then
  19518.  presses ENTER, the variable is read as 50200.
  19519.  
  19520.  
  19521.  509. SPAWNLP and Unresolved External: CLOC
  19522.  
  19523.  Product Version(s): 5.00   | 5.00
  19524.  Operating System:   MS-DOS | OS/2
  19525.  Flags: ENDUSER | docerr
  19526.  Last Modified:  6-DEC-1989    ArticleIdent: Q49432
  19527.  
  19528.  On Page 88 in the "Microsoft FORTRAN Advanced Topics" manual for
  19529.  Version 5.00, the code sample for calling SPAWNLP incorrectly has a
  19530.  lowercase  "c" on the end of the line. The "c" must be removed to
  19531.  properly LINK the program.
  19532.  
  19533.  If the "c" is included in the code, you get a link error regarding an
  19534.  unknown function called CLOC because the "c" is concatenated with
  19535.  "LOC" on the following line.
  19536.  
  19537.  The following error is generated:
  19538.  
  19539.      error L2029 : 'CLOC' : unresolved external
  19540.  
  19541.  The "c" should be removed from the end of the following line:
  19542.  
  19543.        I = SPAWNLP(0, LOC('EXEMOD'C), LOC('EXEMOD'C), c
  19544.       + LOC('DEMOEXEC.EXE'C), INT4(0))
  19545.  
  19546.  
  19547.  510. SHARE Not Installed in OS/2 with FORTRAN 4.10
  19548.  
  19549.  Product Version(s): 4.10
  19550.  Operating System:   OS/2
  19551.  Flags: ENDUSER |
  19552.  Last Modified:  6-DEC-1989    ArticleIdent: Q49433
  19553.  
  19554.  The following error message incorrectly occurs if a program compiled
  19555.  with FORTRAN Version 4.10 is run under OS/2, and if an existing file
  19556.  is OPENed as NEW:
  19557.  
  19558.     run-time error F6412: OPEN(filename) - SHARE not installed
  19559.  
  19560.  The following is the correct error message generated under FORTRAN
  19561.  5.00:
  19562.  
  19563.     run-time error F6415: OPEN(filename) - file already exists
  19564.  
  19565.  The following code demonstrates the problem if the file TRY.DAT
  19566.  exists:
  19567.  
  19568.         OPEN (1,FILE = 'TRY.DAT',STATUS = 'NEW')
  19569.         AB = 15
  19570.         WRITE (1,*) AB
  19571.         END
  19572.  
  19573.  
  19574.  511. Order of C and FORTRAN Libraries at LINK time
  19575.  
  19576.  Product Version(s): 5.00   | 5.00
  19577.  Operating System:   MS-DOS | OS/2
  19578.  Flags: ENDUSER | docerr
  19579.  Last Modified:  6-DEC-1989    ArticleIdent: Q49446
  19580.  
  19581.  In the second paragraph under Specifying Libraries on Page 79 of the
  19582.  "Microsoft FORTRAN Advanced Topics" manual for Version 5.00, the
  19583.  following statement is made:
  19584.  
  19585.     If your program uses both FORTRAN and C, then specify the library
  19586.     for the most recent of the two language products first.
  19587.  
  19588.  The above information is correct; however, the following later
  19589.  sentence is incorrect:
  19590.  
  19591.     If you use C 5.1 or later, specify the C library first.
  19592.  
  19593.  The FORTRAN 5.00 library should come before the C 5.10 library because
  19594.  the FORTRAN 5.00 library is newer. The next line states that you
  19595.  should "...make sure you choose a C-compatible library when you
  19596.  install FORTRAN."
  19597.  
  19598.  In reality, if the FORTRAN is newer than the C, (e.g. FORTRAN 5.00
  19599.  being newer than C 5.10), FORTRAN should NOT be installed with C
  19600.  compatibility, and the LINK options /NOD and /NOE should be used to
  19601.  avoid errors about multiply defined symbols.
  19602.  
  19603.  
  19604.  512. /Fo Compiler Switch Moves Only the First Object File
  19605.  
  19606.  Product Version(s): 5.00   | 5.00
  19607.  Operating System:   MS-DOS | OS/2
  19608.  Flags: ENDUSER | docerr buglist5.00
  19609.  Last Modified: 18-OCT-1989    ArticleIdent: Q49447
  19610.  
  19611.  The /Fo compiler switch doesn't produce any error messages; it also
  19612.  doesn't work as indicated on Pages 338-339 in the "Microsoft FORTRAN
  19613.  Reference" manual for Version 5.00:
  19614.  
  19615.     C:\> FL /FoD:\OBJECT\  *.FOR
  19616.  
  19617.  The above command line should place all the .obj files in the
  19618.  directory OBJECT on the D drive. Instead, it incorrectly places only
  19619.  the .obj of the first file it compiles in the directory OBJECT, while
  19620.  placing the remainder of the files in the current directory (i.e., the
  19621.  root directory on the C drive in the above example).
  19622.  
  19623.  
  19624.  513. $PACK Metacommand Syntax Incorrect in FORTRAN 5.00 Manual
  19625.  
  19626.  Product Version(s): 5.00   | 5.00
  19627.  Operating System:   MS-DOS | OS/2
  19628.  Flags: ENDUSER | docerr buglist5.00
  19629.  Last Modified:  6-DEC-1989    ArticleIdent: Q49450
  19630.  
  19631.  Contrary to statements made on Page 305 of the "Microsoft FORTRAN
  19632.  Reference" manual for Version 5.00, the syntax for the $PACK
  19633.  metacommand must include a colon, as shown in the following:
  19634.  
  19635.     $PACK:
  19636.  
  19637.  If a colon is not used, the following error occurs:
  19638.  
  19639.     F2030: unrecognized metacommand
  19640.  
  19641.  The following three documentation errors occur on Page 305:
  19642.  
  19643.  1. The first error pertains to the following syntax statement:
  19644.  
  19645.        $PACK[:{1|2|3}]
  19646.  
  19647.     This incorrect statement shows the colon as an optional character;
  19648.     it is not an optional character. It should read as follows:
  19649.  
  19650.        $PACK:[{1|2|3}]
  19651.  
  19652.     If the colon is left out, the compiler does not recognize "$PACK"
  19653.     as a metacommand.
  19654.  
  19655.  2. The second-to-last paragraph is also incorrect. It states the
  19656.     following:
  19657.  
  19658.        If $PACK is specified (no colon or number), packing reverts to
  19659.        whatever mode was specified in the command-line /Zp option.
  19660.  
  19661.     Because the $PACK metacommand must contain a colon, the sentence
  19662.     should instead read something similar to the following:
  19663.  
  19664.        If $PACK is specified (without a number)...
  19665.  
  19666.  3. In the example, the use of the metacommand is incorrect. The first
  19667.     line should read as follows:
  19668.  
  19669.        $PACK:
  19670.  
  19671.  
  19672.  514. Conditional Compiling with /4cc"string"
  19673.  
  19674.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  19675.  Operating System:   MS-DOS              | OS/2
  19676.  Flags: ENDUSER |
  19677.  Last Modified:  6-DEC-1989    ArticleIdent: Q49451
  19678.  
  19679.  /4cc<string> permits conditional compilation of a source file. Page
  19680.  335 of the "Microsoft FORTRAN Reference" manual for Version 5.00
  19681.  states the following:
  19682.  
  19683.     The /4cc option permits conditional compilation of a source file.
  19684.     The string is a set of alphabetic characters controlling which
  19685.     lines in the source file are to be compiled.
  19686.  
  19687.  A similar paragraph is located on page 93 of the FORTRAN 4.00 and 4.10
  19688.  User's Guide.
  19689.  
  19690.  An example of code that can be conditionally compiled is shown below.
  19691.  
  19692.        program test
  19693.  L     integer*4 num
  19694.  S     integer*2 num
  19695.  R     real*4 number
  19696.        end
  19697.  
  19698.  When compiling this code, if you compile with /4ccL, the compiler
  19699.  reserves 4 bytes for num. If you compile with /4ccS, num is 2 bytes.
  19700.  
  19701.  If you leave off the /4cc switch, the L, S, and R lines are considered
  19702.  comment lines. Or, if you compile with /4ccLS, you get a multiple
  19703.  defined symbol error because num is defined twice. /4ccLR or /4ccSR
  19704.  define num as the appropriate size, and define number as a real.
  19705.  
  19706.  
  19707.  515. Conditional Compilation of Metacommands in FORTRAN 5.00
  19708.  
  19709.  Product Version(s): 5.00   | 5.00
  19710.  Operating System:   MS-DOS | OS/2
  19711.  Flags: ENDUSER |
  19712.  Last Modified:  6-DEC-1989    ArticleIdent: Q49466
  19713.  
  19714.  Question:
  19715.  
  19716.  How can I conditionally compile Metacommands? Metacommands require the
  19717.  "$" in the first column of the source line, and the /4cc switch also
  19718.  requires a character in the first column.
  19719.  
  19720.  Response:
  19721.  
  19722.  You cannot use the /4cc switch to conditionally compile metacommands.
  19723.  The metacommands $IF, $ELSE, $ELSEIF, and $ENDIF, as well as $DEFINE
  19724.  and /D, are designed for the conditional compiling of metacommands.
  19725.  Pages 281-284 and 335 of the "Microsoft FORTRAN Reference" manual for
  19726.  Version 5.00 cover the use of these commands.
  19727.  
  19728.  The following example demonstrates how to conditionally compile using
  19729.  these commands:
  19730.  
  19731.  $IF DEFINED (L)
  19732.  $INCLUDE 'large.inc'
  19733.  $ELSE
  19734.  $INCLUDE 'medium.inc'
  19735.  $ENDIF
  19736.  
  19737.  If the source file does not contain the line "$DEFINE L" preceding
  19738.  this $IF block, the $ELSE half is compiled and the file MEDIUM.INC is
  19739.  included. If "$DEFINE L" precedes this $IF block, the file LARGE.INC
  19740.  is included; this gives you the ability to hard code the conditional
  19741.  changes.
  19742.  
  19743.  If you'd like to change the compilation without hard coding it, the /D
  19744.  option on the command line allows you to define the variable that is
  19745.  used with the $IF block. This action eliminates the need for the
  19746.  $DEFINE metacommand. In the previous example, if you wanted to include
  19747.  the file LARGE.INC, you'd compile with a line such as the following:
  19748.  
  19749.     fl /DL name.ext
  19750.  
  19751.  
  19752.  516. FORTRAN Err Msg F3606, F3607: Type and Length Mismatch
  19753.  
  19754.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  19755.  Operating System:   MS-DOS              | OS/2
  19756.  Flags: ENDUSER |
  19757.  Last Modified:  6-DEC-1989    ArticleIdent: Q49467
  19758.  
  19759.  When calling a subroutine or function on a VAX with FORTRAN Versions
  19760.  4.x or 5.00, you don't need to be consistent when passing formal
  19761.  arguments. When porting VAX code down to a PC, the FORTRAN 5.00
  19762.  compiler catches this inconsistency with the errors F3606 (type
  19763.  mismatch) and F3607 (length mismatch).
  19764.  
  19765.  F3606 and F3607 are recoverable errors; the compiler produces an OBJ
  19766.  file. You can either ignore the errors or be consistent when passing
  19767.  formal arguments.
  19768.  
  19769.  For more information, see Page 462 in the "Microsoft FORTRAN
  19770.  Reference" manual for Version 5.00.
  19771.  
  19772.  The following code generates the errors:
  19773.  
  19774.        integer*4 intX
  19775.        logical*1 logic
  19776.        call sub1(logic)
  19777.        call sub1(intX)
  19778.        end
  19779.  c
  19780.        subroutine sub1 (intY)
  19781.        integer*4 intY
  19782.        end
  19783.  
  19784.  When the compiler interprets this code, it reserves 4 bytes for the
  19785.  intX variable and 1 byte for logic. It then finds the "call
  19786.  sub1(logic)" line and assumes the formal argument needs only 1 byte.
  19787.  When it comes across the next call to sub1, the compiler finds the
  19788.  formal argument has changed and flags the errors. Not only has the
  19789.  length of the formal argument changed, the type has also changed.
  19790.  
  19791.  
  19792.  517. Using FORTRAN to Check Syntax, /Zi and /Fs
  19793.  
  19794.  Product Version(s): 4.00 4.01 4.10 5.00 |4.00 4.01 4.10 5.00
  19795.  Operating System:   MS-DOS              | OS/2
  19796.  Flags: ENDUSER |
  19797.  Last Modified:  6-DEC-1989    ArticleIdent: Q49493
  19798.  
  19799.  If you compile with /Zs using FORTRAN Versions 4.x or 5.00, the
  19800.  FORTRAN compiler checks only the syntax of the source file.
  19801.  
  19802.  Using /Zs eliminates the bulk of the compiler's work, thus saving time
  19803.  during compilation. Using /Fs in conjunction with /Zs prompts the
  19804.  compiler to record the error messages to a file.
  19805.  
  19806.  The /Zs option should be used for the first few compilations. After
  19807.  the majority of the syntax errors are corrected, compile without /Zs.
  19808.  
  19809.  
  19810.  518. END DO Example Incorrect in FORTRAN 5.00 Reference Manual
  19811.  
  19812.  Product Version(s): 5.00   | 5.00
  19813.  Operating System:   MS-DOS | OS/2
  19814.  Flags: ENDUSER | docerr
  19815.  Last Modified:  6-DEC-1989    ArticleIdent: Q49496
  19816.  
  19817.  If you compile the example on Page 159 of the "Microsoft FORTRAN
  19818.  Reference" manual for Version 5.00, an F2115 syntax error occurs.
  19819.  
  19820.  This error occurs because the second print statement incorrectly
  19821.  contains a comma.
  19822.  
  19823.  The example from page 159 follows:
  19824.  
  19825.        Do ivar = 1, 10
  19826.           PRINT ivar
  19827.        END DO
  19828.  
  19829.        ivar = 0
  19830.        DO WHILE (ivar .LT. 10)
  19831.           ivar = ivar + 1
  19832.           Print , ivar     ! delete the comma in this line
  19833.        END DO
  19834.  
  19835.  
  19836.  519. FORTRAN Err Msg: D2027: Could Not Execute 'Filename'
  19837.  
  19838.  Product Version(s): 5.00   | 5.00
  19839.  Operating System:   MS-DOS | OS/2
  19840.  Flags: ENDUSER |
  19841.  Last Modified:  6-DEC-1989    ArticleIdent: Q49497
  19842.  
  19843.  When invoking the FORTRAN compiler, I get the following error:
  19844.  
  19845.     D2027: could not execute F1.EXE
  19846.  
  19847.  This error very likely occurs because the system doesn't have enough
  19848.  memory to load the file F1.EXE (the first pass of the compiler).
  19849.  FORTRAN requires 320K of free memory to load (512K is recommended).
  19850.  
  19851.  To work around this problem, try to eliminate other programs [e.g.
  19852.  terminate-and-stay-resident programs (TSRs)] from memory, thereby
  19853.  making that memory available for FORTRAN.
  19854.  
  19855.  The "Microsoft FORTRAN Reference" manual for Version 5.00 states the
  19856.  following on Page 411:
  19857.  
  19858.     The specified file containing a compiler pass or the linker was
  19859.     found but for some reason could not be executed. An illegal EXE
  19860.     file format is the most likely cause.
  19861.  
  19862.  
  19863.  520. FORTRAN Err Msg: QuickBASIC Calling FORTRAN Error F6700
  19864.  
  19865.  Product Version(s): 4.10 5.00
  19866.  Operating System:   MS-DOS
  19867.  Flags: ENDUSER |
  19868.  Last Modified:  6-DEC-1989    ArticleIdent: Q49498
  19869.  
  19870.  Question:
  19871.  
  19872.  When I compile and link a QuickBASIC program calling a FORTRAN
  19873.  subroutine, I get the following error message:
  19874.  
  19875.     F6700: Heap Space Limit Exceeded error
  19876.  
  19877.  Response:
  19878.  
  19879.  This error occurs because QuickBASIC needs to define a stack that
  19880.  FORTRAN can use, as demonstrated by the following code:
  19881.  
  19882.  QuickBASIC Code
  19883.  ---------------
  19884.  
  19885.      DIM heap%(2048)
  19886.      COMMON SHARED /nmalloc/ heap%()
  19887.  
  19888.      REM ** TO DECLARE 2K OF HEAP SPACE THE FORTRAN
  19889.      REM ** CAN USE
  19890.  
  19891.      DECLARE SUB ftest ALIAS "ftest"
  19892.      CALL ftest
  19893.      PRINT ""
  19894.      PRINT "Return from Fortran subroutine"
  19895.      END
  19896.  
  19897.  FORTRAN Code
  19898.  ------------
  19899.  
  19900.      SUBROUTINE ftest
  19901.      WRITE (*,*) 'Into the Fortran subroutine'
  19902.      RETURN
  19903.      END
  19904.  
  19905.  The QuickBASIC code must be compiled as stand-alone code. To compile
  19906.  and link, do the following:
  19907.  
  19908.  BC /o basic.bas
  19909.  
  19910.  FL /c fortran.for
  19911.  
  19912.  LINK /NOE basic+fortran,,,bcom45 llibfore;
  19913.  
  19914.     (Where basic.bas is the basic source code and fortran.for
  19915.     is the fortran source code.)
  19916.  
  19917.     You should link with the QuickBasic BCOM45 library first
  19918.     and specify which Fortran library to use (LLIBFOR7,
  19919.     LLIBFORE,...)
  19920.  
  19921.  
  19922.  521. Ways to Open a File from the Command Line in FORTRAN
  19923.  
  19924.  Product Version(s): 4.00 4.10 5.00 | 4.00 4.10 5.00
  19925.  Operating System:   MS-DOS         | OS/2
  19926.  Flags: ENDUSER |
  19927.  Last Modified:  6-DEC-1989    ArticleIdent: Q49507
  19928.  
  19929.  FORTRAN allows the following three different ways to open files:
  19930.  
  19931.  1. Hard coding the filename.
  19932.  
  19933.  2. Allowing the user to enter the filename.
  19934.  
  19935.  3. Letting the program create a temporary file.
  19936.  
  19937.  All of these options are covered on Pages 203-204 of the "Microsoft
  19938.  FORTRAN Reference" manual for Version 5.00 and Page 249 of the
  19939.  "Microsoft FORTRAN Optimizing Compiler: Language Reference" for
  19940.  Versions 4.x.
  19941.  
  19942.  To open a file from the command line, you must do the following:
  19943.  
  19944.  1. Set the FILE parameter in the OPEN statement equal to a blank
  19945.     (FILE=' ').
  19946.  
  19947.  2. Specify the full filename of the file to be opened on the command
  19948.     line when activating the program.
  19949.  
  19950.  Consider the following code as an example. The source file is called
  19951.  "test.for" and appears as follows:
  19952.  
  19953.        PROGRAM test
  19954.        OPEN (10,FILE=' ')
  19955.        END
  19956.  
  19957.  The data file to be opened is called "test.dat". To open the file from
  19958.  the command line, type the following:
  19959.  
  19960.        test test.dat
  19961.  
  19962.  If you fail to specify the data filename on the command line, the
  19963.  program prompts you for the file to be opened.
  19964.  
  19965.  
  19966.  522. FORTRAN Err Msg: F1050: Code Segment Too Large (4718)
  19967.  
  19968.  Product Version(s): 3.30 3.31 4.00 4.01 4.10 5.00 | 4.10 5.00
  19969.  Operating System:   MS-DOS                        | OS/2
  19970.  Flags: ENDUSER | VAX port
  19971.  Last Modified:  6-DEC-1989    ArticleIdent: Q49515
  19972.  
  19973.  When I download a FORTRAN source code that contains 5878 lines of code
  19974.  from the Prime Mini-Computer and the entire source is contained within
  19975.  one module, the following error is generated during compilation:
  19976.  
  19977.     F1050: CODE SEGMENT TOO LARGE (4718)
  19978.  
  19979.  The amount of code within the one module exceeds 64K in size, so you
  19980.  need to modularize this program source code. Break the code into
  19981.  subroutines and place some of these subroutines into another file.
  19982.  This procedure results in several .FOR files, which can be compiled
  19983.  separately and then linked together to form one .EXE file.
  19984.  
  19985.  The limitation on the size of a code segment also applies to OS/2
  19986.  because OS/2 is based upon the segmented architecture of the 80286.
  19987.  
  19988.  
  19989.  523. L2029: Unresolved External _main in crt0.asm
  19990.  
  19991.  Product Version(s): 4.10 5.00 | 4.10 5.00
  19992.  Operating System:   MS-DOS    | OS/2
  19993.  Flags: ENDUSER | L2029 F2830
  19994.  Last Modified:  6-DEC-1989    ArticleIdent: Q49526
  19995.  
  19996.  UNRESOLVED EXTERNALS referencing "crt0.asm in _main", "end not found"
  19997.  or ENTGQQ can occur because the compiler or linker cannot determine an
  19998.  entry point into the program.
  19999.  
  20000.  To correct this problem, make sure that the FORTRAN source code begins
  20001.  in column seven and that the program has an END statement.
  20002.  
  20003.  Each line of the following program starts in column one. The compiler
  20004.  views these lines as comments, and does not flag an error. However, at
  20005.  link time, the LINKer cannot find the end statement, and therefore
  20006.  cannot identify the main program. Thus, the unresolved external
  20007.  _main occurs.
  20008.  
  20009.  integer*4 i
  20010.  i=5
  20011.  write(*,*) i
  20012.  end
  20013.  
  20014.  ... crt0.asm) : error L2029 : '_main' : unresolved external
  20015.  
  20016.  If the same code is moved to column seven, but the end statement is
  20017.  removed, the following compiler error occurs:
  20018.  
  20019.     error F2830: END missing
  20020.  
  20021.  
  20022.  524. Writing Nonprintable Characters with FORTRAN
  20023.  
  20024.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.00 4.01 4.10 5.00
  20025.  Operating System:   MS-DOS              | OS/2
  20026.  Flags: ENDUSER | ascii ctrl-z escape esc lf linefeed
  20027.  Last Modified:  6-DEC-1989    ArticleIdent: Q49528
  20028.  
  20029.  If you need to print a nonprintable character with FORTRAN, you can
  20030.  use the CHAR intrinsic function. The CHAR intrinsic function accepts
  20031.  an integer and converts it to a character. The following code
  20032.  demonstrates this idea:
  20033.  
  20034.        write (*,'(A1)') CHAR(13)
  20035.  
  20036.  This line of code writes the nonprintable character, carriage return,
  20037.  to the screen.
  20038.  
  20039.  
  20040.  525. FORTRAN Err Msg D2027 When Compiling with FORTRAN, M Editor
  20041.  
  20042.  Product Version(s): 5.00
  20043.  Operating System:   MS-DOS
  20044.  Flags: ENDUSER |
  20045.  Last Modified:  6-DEC-1989    ArticleIdent: Q49534
  20046.  
  20047.  Problem:
  20048.  
  20049.  I tried to compile FORTRAN Version 5.00 source code while using the M
  20050.  Editor Version 1.02. M issued a beep almost instantly, and did not
  20051.  display any error messages.
  20052.  
  20053.  Examination of the M.MSG file located in the TMP directory revealed
  20054.  the following error message:
  20055.  
  20056.     Command line error D2027 : could not execute 'C:\BIN\f1.exe'
  20057.  
  20058.  Prior to entering the editor, a CHKDSK revealed 445,000 bytes of
  20059.  available RAM.
  20060.  
  20061.  Response:
  20062.  
  20063.  This error message occurs because of the lack of available memory to
  20064.  run the entire FORTRAN compilation process. If you want to compile
  20065.  from within the Editor, you need at least 480K free before invoking M,
  20066.  depending on the size of the source code. Larger programs consequently
  20067.  require more free memory.
  20068.  
  20069.  
  20070.  526. Conditional Compiling with $DEBUG
  20071.  
  20072.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.00 4.01 4.10 5.00
  20073.  Operating System:   MS-DOS              | OS/2
  20074.  Flags: ENDUSER |
  20075.  Last Modified:  6-DEC-1989    ArticleIdent: Q49670
  20076.  
  20077.  Page 286 of the "Microsoft FORTRAN Reference" manual for Version 5.00
  20078.  and Page 289 of the Microsoft FORTRAN Optimizing Compiler: Language
  20079.  Reference" for Versions 4.00 and 4.10 state that the $DEBUG
  20080.  metacommand can be used for conditional compilation. The example
  20081.  below demonstrates this.
  20082.  
  20083.  In the following code fragment, only the lines that start with either
  20084.  the letter "A" or "B" are compiled; the other lines are considered
  20085.  comments:
  20086.  
  20087.  $DEBUG:'AB'
  20088.  A     integer*2 N
  20089.  B     integer*2 M
  20090.  C     integer*4 N
  20091.  D     integer*4 M
  20092.  A     real*4 R
  20093.  C     real*8 R
  20094.  C
  20095.  
  20096.  The last paragraph on Page 286 of the "Microsoft FORTRAN Reference"
  20097.  for Version 5.00 states the following:
  20098.  
  20099.       If the optional string is specified, the characters
  20100.       in string specify that lines with those characters in
  20101.       column 1 are to be compiled into the program. Case is
  20102.       not significant. Note that the letter C always
  20103.       indicates a comment line; therefore, if string contains
  20104.       a C, the C is ignored.
  20105.  
  20106.  Page 290 of the "Microsoft FORTRAN Optimizing Compiler: Language
  20107.  Reference" for Versions 4.00 and 4.10 has a similar paragraph.
  20108.  
  20109.  For more information on conditional compiling, see the /4cc compile
  20110.  option on Page 335 of the FORTRAN 5.00 reference manual and Page 93 of
  20111.  the FORTRAN 4.00/4.10 user's guide mentioned above.
  20112.  
  20113.  
  20114.  527. FORTRAN Err Msg: F1901: Program Too Large for Memory
  20115.  
  20116.  Product Version(s): 5.00   | 5.00
  20117.  Operating System:   MS-DOS | OS/2
  20118.  Flags: ENDUSER |
  20119.  Last Modified:  6-DEC-1989    ArticleIdent: Q49708
  20120.  
  20121.  If a program uses a DATA statement that contains an extensive amount
  20122.  of data, the compiler may generate the following fatal error:
  20123.  
  20124.     F1901: program too large for memory
  20125.  
  20126.  The FORTRAN compiler uses the near heap to store data during
  20127.  compilation. This space can be exceeded. To free up near heap memory,
  20128.  use the high capacity compiler, which became available with FORTRAN
  20129.  Version 5.00.
  20130.  
  20131.  To use the high capacity compiler, copy the file F1L.EXE from the
  20132.  FORTRAN 5.00 High Capacity Compiler Disk to the FORTRAN BIN directory
  20133.  and compile with the /B1 switch.
  20134.  
  20135.  For example, if the source file is TEST.FOR and the high capacity
  20136.  Compiler is in the C:\FORTRAN\bin directory, compile using the
  20137.  following line:
  20138.  
  20139.  FL /B1 C:\FORTRAN\BIN\F1L.EXE TEST.FOR
  20140.  
  20141.  The following source code demonstrates this problem. If the array
  20142.  subscript for tmp changes from 254 to 256, or if another data item is
  20143.  added to the file, the program is too large for memory. The problem is
  20144.  corrected by using the high capacity compiler.
  20145.  
  20146.        subroutine test ()
  20147.        real tmp(254) ! low cc limit 254
  20148.        DATA tmp / 0.0, .035, .049, .049, 0.0, 0.0, .068, .068, 0.0,
  20149.       Z            .095, .095, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049,
  20150.       Z            .065, .065, 0.0, 0.0, .088, .088, 0.0, .119, .119,
  20151.       Z            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049, .065, .065,
  20152.       Z            0.0, 0.0, .091, .091, 0.0, .126, .126, 0.0, 0.0,
  20153.       Z            0.0, 0.0, 0.0, .065, .065, .083, .083, 0.0, 0.0,
  20154.       Z            .109, .109, 0.0, .147, .147, 0.0, 0.0, 0.0, .187,
  20155.       Z            .294, .065, .065, .083, .083, 0.0, 0.0, .113, .113,
  20156.       Z            0.0, .154, .154, 0.0, 0.0, 0.0, .218, .308, .065,
  20157.       Z            .065, .109, .109, 0.0, 0.0, .133, .133, 0.0, .179,
  20158.       Z            .179, 0.0, 0.0, 0.0, .250, .358, .065, .065, .109,
  20159.       Z            .109, 0.0, 0.0, .140, .140, 0.0, .191, .191, 0.0,
  20160.       Z            0.0, 0.0, .250, .382, .065, .065, .109, .109, 0.0,
  20161.       Z            .095, .095, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049,
  20162.       Z            .065, .065, 0.0, 0.0, .088, .088, 0.0, .119, .119,
  20163.       Z            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049, .065, .065,
  20164.       Z            0.0, 0.0, .091, .091, 0.0, .126, .126, 0.0, 0.0,
  20165.       Z            0.0, 0.0, 0.0, .065, .065, .083, .083, 0.0, 0.0,
  20166.       Z            .109, .109, 0.0, .147, .147, 0.0, 0.0, 0.0, .187,
  20167.       Z            .294, .065, .065, .083, .083, 0.0, 0.0, .113, .113,
  20168.       Z            0.0, .154, .154, 0.0, 0.0, 0.0, .218, .308, .065,
  20169.       Z            .065, .109, .109, 0.0, 0.0, .133, .133, 0.0, .179,
  20170.       Z            .179, 0.0, 0.0, 0.0, .250, .358, .065, .065, .109,
  20171.       Z            .109, 0.0, 0.0, .140, .140, 0.0, .191, .191, 0.0,
  20172.       Z            0.0, 0.0, .250, .382, .065, .065, .109, .109, 0.0,
  20173.       Z            .095, .095, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049,
  20174.       Z            0.0, 0.0, .091, .091, 0.0, .126, .126, 0.0, 0.0,
  20175.       Z            0.0, 0.0, 0.0, .065, .065, .083, .083, 0.0, 0.0,
  20176.       Z            .109, .109, 0.0, .147, .147, 0.0, 0.0, 0.0, .187,
  20177.       Z            .294, .065, .065, .083, .083, 0.0, 0.0, .113, .113,
  20178.       Z            0.0, .154, .154, 0.0, 0.0, 0.0, .218, .308, .065,
  20179.       Z            .065, .109, .109, 0.0, 0.0, .133, .133, 0.0, .179,
  20180.       Z            .179, 0.0, 0.0, 0.0, .250, .358, .065, .065, .109,
  20181.       Z            .109, 0.0, 0.0, .140, .140, 0.0, .191, .191, 0.0,
  20182.       Z            0.0, 0.0, .250, .382, .065, .065, .109, .109, 0.0,
  20183.       Z            .095, .095, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049,
  20184.       Z            .065, .065, 0.0, 0.0, .088, .088, 0.0, .119, .119,
  20185.       Z            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049, .065, .065,
  20186.       Z            0.0, 0.0, .091, .091, 0.0, .126, .126, 0.0, 0.0,
  20187.       Z            0.0, 0.0, 0.0, .065, .065, .083, .083, 0.0, 0.0,
  20188.       Z            .109, .109, 0.0, .147, .147, 0.0, 0.0, 0.0, .187,
  20189.       Z            .294, .065, .065, .083, .083, 0.0, 0.0, .113, .113,
  20190.       Z            0.0, .154, .154, 0.0, 0.0, 0.0, .218, .308, .065,
  20191.       Z            .065, .109, .109, 0.0, 0.0, .133, .133, 0.0, .179,
  20192.       Z            .179, 0.0, 0.0, 0.0, .250, .358, .065, .065, .109,
  20193.       Z            .109, 0.0, 0.0, .140, .140, 0.0, .191, .191, 0.0,
  20194.       Z            0.0, 0.0, .250, .382, .065, .065, .109, .109, 0.0,
  20195.       Z            .095, .095, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049,
  20196.       Z            .065, .065, 0.0, 0.0, .088, .088, 0.0, .119, .119,
  20197.       Z            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049, .065, .065,
  20198.       Z            0.0, 0.0, .091, .091, 0.0, .126, .126, 0.0, 0.0,
  20199.       Z            0.0, 0.0, 0.0, .065, .065, .083, .083, 0.0, 0.0,
  20200.       Z            .109, .109, 0.0, .147, .147, 0.0, 0.0, 0.0, .187,
  20201.       Z            .294, .065, .065, .083, .083, 0.0, 0.0, .113, .113,
  20202.       Z            0.0, .154, .154, 0.0, 0.0, 0.0, .218, .308, .065,
  20203.       Z            .065, .109, .109, 0.0, 0.0, .133, .133, 0.0, .179,
  20204.       Z            .179, 0.0, 0.0, 0.0, .250, .358, .065, .065, .109,
  20205.       Z            .109, 0.0, 0.0, .140, .140, 0.0, .191, .191, 0.0,
  20206.       Z            0.0, 0.0, .250, .382, .065, .065, .109, .109, 0.0,
  20207.       Z            0.0, .145, .145, 0.0, .200, .200, 0.0, 0.0, 0.0, .281/
  20208.        write (*,*) tmp
  20209.        end
  20210.  
  20211.  
  20212.  528. Optimizing Logical IF Statements with FORTRAN
  20213.  
  20214.  Product Version(s): 4.00 4.10 5.00 | 4.10 5.00
  20215.  Operating System:   MS-DOS         | OS/2
  20216.  Flags: ENDUSER | label run run-time buglist5.00
  20217.  Last Modified: 16-JUL-1990    ArticleIdent: Q49731
  20218.  
  20219.  FORTRAN may not correctly optimize some logical IF statements inside
  20220.  GOTO loops. The result is execution of a different branch of code than
  20221.  expected. Try compiling without optimization (/Od).
  20222.  
  20223.  If optimization is required, one solution is to change a logical IF
  20224.  statement to a standard IF statement. The following is an example:
  20225.  
  20226.         if (j .GE. 3) GOTO 3100    ! logical IF statement
  20227.  
  20228.  Change to the following:
  20229.  
  20230.         if (j .GE. 3) then         ! standard IF statement
  20231.           GOTO 3100
  20232.         endif
  20233.  
  20234.  When the compiler encounters the logical IF and GOTO loop, as shown in
  20235.  the code shown below, it compiles and runs without errors, but the
  20236.  correct lines are not executed.
  20237.  
  20238.  When the code is optimized, the GOTO 3100 statement in the logical IF
  20239.  is ignored and the program prints "at 3200, loop failed".
  20240.  
  20241.  When the same file is compiled without optimization, the logical if
  20242.  statement works correctly and the program prints "at 3100, loop
  20243.  worked".
  20244.  
  20245.  Sample Code
  20246.  -----------
  20247.  
  20248.        j=0
  20249.  3190  continue
  20250.        if (j .ge. 3) Goto 3100       ! The logical IF
  20251.        j=j+1
  20252.        Goto 3190                     ! The Goto loop
  20253.  3200  continue
  20254.        write (*,*) 'at 3200, loop failed'
  20255.        stop
  20256.  3100  continue
  20257.        write (*,*) 'at 3100, loop worked'
  20258.        stop
  20259.        end
  20260.  
  20261.  
  20262.  529. Compiler Error in p2symtab.c at Line 939 in FORTRAN 5.00
  20263.  
  20264.  Product Version(s): 5.00   | 5.00
  20265.  Operating System:   MS-DOS | OS/2
  20266.  Flags: ENDUSER | buglist5.00
  20267.  Last Modified:  6-DEC-1989    ArticleIdent: Q49761
  20268.  
  20269.  The following error occurs when a variable is initialized in a type
  20270.  statement and then accessed with a COMMON or EQUIVALENCE statement.
  20271.  An F2311: 'COMMON or EQUIVALENCE preinitialization illegal' should be
  20272.  generated instead.
  20273.  
  20274.  The variable should be initialized within the body of the program
  20275.  rather than with the type statement if COMMON or EQUIVALENCE is to be
  20276.  used.
  20277.  
  20278.  fatal error F1001: Internal Compiler Error
  20279.                (compiler file '@(#)p2symtab.c:1.4', line 939)
  20280.                Contact Microsoft Technical Support
  20281.  
  20282.  Remove the /100/ from the following line, and the code compiles
  20283.  properly:
  20284.  
  20285.        integer*4 i/100/      !preinitialization illegal
  20286.        integer*4 j
  20287.  
  20288.        common /dow/i
  20289.  C     equivalence(i,j)
  20290.        i=100            !initialize the variable here instead
  20291.        j=3
  20292.        end
  20293.  
  20294.  The code should generate the following error:
  20295.  
  20296.     error F2311: I : COMMON (or EQUIVALENCE or STRUCTURE):
  20297.     preinitialization illegal
  20298.  
  20299.  Page 135 of the "Microsoft FORTRAN Reference" manual for Version 5.00
  20300.  states that the following example causes a compile-time error:
  20301.  
  20302.        INTEGER i /1/
  20303.        COMMON i
  20304.  
  20305.  Page 165 of the same manual includes a similar statement about the
  20306.  EQUIVALENCE statement:
  20307.  
  20308.        INTEGER i /1/
  20309.        EQUIVALENCE (i, j)
  20310.  
  20311.  
  20312.  530. Increasing Units Documentation Error in FORTRAN Reference
  20313.  
  20314.  Product Version(s): 5.00   | 5.00
  20315.  Operating System:   MS-DOS | OS/2
  20316.  Flags: ENDUSER | docerr
  20317.  Last Modified:  6-DEC-1989    ArticleIdent: Q49894
  20318.  
  20319.  The information on Page 405, Section C.3.1.2, "Increasing Units," in
  20320.  the "Microsoft FORTRAN Reference" manual for Version 5.00 incorrectly
  20321.  states the following:
  20322.  
  20323.     ...so that the number in the line
  20324.  
  20325.        _NFILE_ = 20
  20326.  
  20327.     equals the same value...
  20328.  
  20329.  The correct information should be as follows:
  20330.  
  20331.     ...so that the numbers in the lines
  20332.  
  20333.           _NFILE_  equ 20
  20334.        else
  20335.           _NFILE_  equ 40
  20336.        endif
  20337.  
  20338.     both equal the value...
  20339.  
  20340.  
  20341.  531. F6405, End-of-File and the BACKSPACE Command
  20342.  
  20343.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  20344.  Operating System:   MS-DOS              | OS/2
  20345.  Flags: ENDUSER | buglist5.00
  20346.  Last Modified: 25-FEB-1991    ArticleIdent: Q49896
  20347.  
  20348.  The BACKSPACE command may not work correctly if used in conjunction
  20349.  with the END parameter in a READ statement. To solve this problem, use
  20350.  the EOF intrinsic function.
  20351.  
  20352.  One situation that demonstrates this problem is when reading through a
  20353.  file with the lines
  20354.  
  20355.  50    read(10,20,err=30,end=40) variable
  20356.        goto 50
  20357.  
  20358.  and you try to BACKSPACE command after encountering the end-of-file
  20359.  character. The BACKSPACE command will not work in this situation, and
  20360.  F6405 "external I/O illegal beyond end of file" will be generated
  20361.  because no BACKSPACING has occurred.
  20362.  
  20363.  To work around this problem, use the EOF intrinsic function instead of
  20364.  the END parameter. Try reading the file with the following code
  20365.  instead:
  20366.  
  20367.        do while ( .not. EOF(10))
  20368.          read(10,20,err=30) variable
  20369.        end do
  20370.  
  20371.  Microsoft has confirmed this to be a problem in FORTRAN Version 5.00.
  20372.  We are researching this problem and will post new information as it
  20373.  becomes available.
  20374.  
  20375.  
  20376.  532. The SYSTEM Function Won't Execute SET string=string
  20377.  
  20378.  Product Version(s): 4.10 5.00 | 4.10 5.00
  20379.  Operating System:   MS-DOS    | OS/2
  20380.  Flags: ENDUSER |
  20381.  Last Modified:  6-DEC-1989    ArticleIdent: Q49921
  20382.  
  20383.  The SYSTEM function included with the FORTRAN library will not execute
  20384.  the DOS command SET string=string. This limitation preserves the
  20385.  environment of the calling program, preventing it from being corrupted
  20386.  by the SYSTEM call.
  20387.  
  20388.  The following code will compile and run, and the line SET CL=/FPi /Lr
  20389.  appears on the screen, but the environment is not altered to set CL:
  20390.  
  20391.        INTERFACE TO FUNCTION SYSTEM[C] (STRING)
  20392.        INTEGER*2 SYSTEM
  20393.        CHARACTER*1 STRING[REFERENCE]
  20394.        END
  20395.  
  20396.        INTEGER*2 SYSTEM
  20397.        I=SYSTEM('SET CL=/FPi /Lr'C)
  20398.        END
  20399.  
  20400.  
  20401.  533. General Differences between /FPi, /FPc, /FPa Compile Options
  20402.  
  20403.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.00 4.01 4.10 5.00
  20404.  Operating System:   MS-DOS              | OS/2
  20405.  Flags: ENDUSER |
  20406.  Last Modified:  7-DEC-1989    ArticleIdent: Q50320
  20407.  
  20408.  The compile options /FPi, /FPc, and /FPa instruct the FORTRAN compiler
  20409.  to generate an executable program in different ways.
  20410.  
  20411.  The /FPi option generates in-line instructions for a math coprocessor
  20412.  and places the name of the emulator library in the object file. If a
  20413.  math coprocessor is present at run time, the program uses the
  20414.  coprocessor, If it's not available, it simulates the coprocessor. The
  20415.  object file must be linked with the emulator library.
  20416.  
  20417.  The /FPc option generates floating-point calls to the emulator library
  20418.  and allows linking with either the 8087/287/387, alternate, or
  20419.  emulator libraries.
  20420.  
  20421.  The /FPa option generates floating-point calls and places
  20422.  the name of the alternate library in the object file.
  20423.  
  20424.  The above information is found in Chapter 1 of the "Microsoft FORTRAN
  20425.  Advanced Topics" manual for FORTRAN 5.0 and Chapter 8 of the FORTRAN
  20426.  4.X User's Guide.
  20427.  
  20428.  
  20429.  534. Precision of Reals with FORTRAN
  20430.  
  20431.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.00 4.01 4.10 5.00
  20432.  Operating System:   MS-DOS              | OS/2
  20433.  Flags: ENDUSER |
  20434.  Last Modified:  7-DEC-1989    ArticleIdent: Q50325
  20435.  
  20436.  When using Microsoft FORTRAN, the precision of a REAL*4 variable is
  20437.  six or seven decimal places. The precision of a REAL*8 is fifteen or
  20438.  sixteen places.
  20439.  
  20440.  The "Microsoft FORTRAN Reference" manual for Version 5.00 covers
  20441.  single- and double-precision IEEE real data types on Pages 12 and 13.
  20442.  (For Versions 4.00, 4.01, and 4.10, please see Pages 22, 23, and 24 of
  20443.  the "Microsoft FORTRAN Optimizing Compiler: Language Reference."
  20444.  
  20445.  
  20446.  535. Spawnlp and Overlaying the Parent Process
  20447.  
  20448.  Product Version(s): 5.00
  20449.  Operating System:   MS-DOS
  20450.  Flags: ENDUSER | S_C S_QuickC
  20451.  Last Modified:  7-DEC-1989    ArticleIdent: Q50331
  20452.  
  20453.  While the Spawnlp function included with FORTRAN Version 5.00 supports
  20454.  the option of suspending the parent process, it does not support the
  20455.  option of overlaying (terminating) the parent process. This
  20456.  information is documented on Page 87 of the "Microsoft FORTRAN
  20457.  Advanced Topics" manual for Version 5.00.
  20458.  
  20459.  To overlay the parent process, write a dummy C routine that calls the
  20460.  Spawnlp function with the P_OVERLAY parameter. See the C documentation
  20461.  for more information about Spawnlp and P_OVERLAY.
  20462.  
  20463.  The sample code below illustrates the process that terminates the
  20464.  parent so the second message is not printed:
  20465.  
  20466.  The following is the FORTRAN parent process:
  20467.  
  20468.        INTERFACE TO SUBROUTINE SPC [C]
  20469.        END
  20470.  
  20471.        WRITE(*,*) 'I AM A PARENT. I AM ALIVE.'
  20472.        CALL SPC
  20473.        WRITE(*,*) 'PARENT STILL ALIVE'   !not printed
  20474.        END
  20475.  
  20476.  The following is a dummy C routine (this routine has been successfully
  20477.  tested with C 5.10 and QuickC 2.01):
  20478.  
  20479.   #include <process.h>
  20480.   #include <stdio.h>
  20481.   spc()
  20482.   {
  20483.    spawnlp (P_OVERLAY,"FORM.EXE","FORM.EXE",NULL);
  20484.   }
  20485.  
  20486.   File FORM.FOR:
  20487.  
  20488.        WRITE (*,*) 'HI THERE ! I AM A CHILD PROCESS...'
  20489.        END
  20490.  
  20491.  The following is the program output:
  20492.  
  20493.  I AM A PARENT. I AM ALIVE.HI THERE ! I AM A CHILD PROCESS...
  20494.  
  20495.  Make sure that you compile FORTRAN and C routines using the same
  20496.  memory model (FORTRAN and C have different defaults). When linking C
  20497.  and FORTRAN modules, use the /NOE switch and list the FORTRAN 5.00
  20498.  library first.
  20499.  
  20500.  
  20501.  536. FORTRAN Reserved File Names
  20502.  
  20503.  Product Version(s): 5.00   | 5.00
  20504.  Operating System:   MS-DOS | OS/2
  20505.  Flags: PSSONLY | ENDUSER
  20506.  Last Modified: 30-OCT-1990    ArticleIdent: Q50332
  20507.  
  20508.  The following is a list of reserved file names in Microsoft FORTRAN.
  20509.  This information is from the FORTRAN 5.0 README.DOC.
  20510.  
  20511.     Reserved word     Description
  20512.     -------------     -----------
  20513.  
  20514.     CON               Keyboard and screen
  20515.     USER              Keyboard and screen
  20516.     PRN               Printer (LPT1)
  20517.     COM1              Communications port 1
  20518.     LPT1              Printer
  20519.     NUL               Null device
  20520.     AUX               Communications port (COM1)
  20521.     ERR               Standard error output (screen)
  20522.     LINE              Communications port (COM1)
  20523.  
  20524.  You can use READ, WRITE, and OPEN statements (as appropriate) to
  20525.  access these devices, and CLOSE statements to disconnect them, just as
  20526.  you would with other files. FORTRAN carriage-control characters are
  20527.  recognized for these devices.
  20528.  
  20529.  Problems can occur if you use these reserved words incorrectly (e.g.
  20530.  if you try to use one as a regular disk filename). For example, if you
  20531.  open a file called LINE.DOC, reading from that file can cause your
  20532.  computer to lock unless there is an active data transmitting device
  20533.  connected to COM1.
  20534.  
  20535.  
  20536.  537. Parameter Syntax Not Correctly Interpreted
  20537.  
  20538.  Product Version(s): 5.00   | 5.00
  20539.  Operating System:   MS-DOS | OS/2
  20540.  Flags: ENDUSER | buglist5.00
  20541.  Last Modified:  6-DEC-1989    ArticleIdent: Q49976
  20542.  
  20543.  Microsoft FORTRAN Version 5.00 does not correctly interpret the syntax
  20544.  of the parameter statement. If the parentheses are left off, either
  20545.  the compiler does not generate an error or, if there are any
  20546.  statements that follow the parameter statement, the compiler generates
  20547.  the error "F2836: statement out of order."
  20548.  
  20549.  The compiler does not catch the syntax error in the following program.
  20550.  The parameter statement should be "parameter (n=1)":
  20551.  
  20552.        integer*2 n
  20553.        parameter n=1
  20554.        end
  20555.  
  20556.  The compiler incorrectly generates the error F2836 when compiling the
  20557.  following code, not because the third line is out of order, but
  20558.  because of the improper syntax in the parameter statement:
  20559.  
  20560.        integer*2 n
  20561.        parameter n=1
  20562.        integer*2 m
  20563.        end
  20564.  
  20565.  
  20566.  538. EXEPACK.EXE Not Included with FORTRAN 5.00; Use Link /E
  20567.  
  20568.  Product Version(s): 5.00   | 5.00
  20569.  Operating System:   MS-DOS | OS/2
  20570.  Flags: ENDUSER | exepack
  20571.  Last Modified: 31-OCT-1989    ArticleIdent: Q50053
  20572.  
  20573.  The EXEPACK Utility is not included with FORTRAN Version 5.00. To pack
  20574.  an object file, use the linker /E switch.
  20575.  
  20576.  The above information is documented in the FORTRAN 5.0 README.DOC.
  20577.  A description of the /E switch is located on page 241 of the FORTRAN
  20578.  5.0 CodeView and Utilities User's Guide.
  20579.  
  20580.  
  20581.  539. Concatenation with /Gr switch Works Incorrectly
  20582.  
  20583.  Product Version(s): 4.00 4.01 4.10 | 4.10
  20584.  Operating System:   MS-DOS         | OS/2
  20585.  Flags: ENDUSER |
  20586.  Last Modified:  7-DEC-1989    ArticleIdent: Q50573
  20587.  
  20588.  When using the /Gr switch to enable FORTRAN code compiled with a
  20589.  FORTRAN compiler Version 4.x to be compatible with the code from
  20590.  FORTRAN Version 3.20, the character concatenation operator does not
  20591.  function correctly with variables.
  20592.  
  20593.  When attempting to concatenate two character strings using the
  20594.  following format
  20595.  
  20596.  j=4
  20597.  foo='test'
  20598.  foo2=foo(1:j)//'.one'
  20599.  
  20600.  the concatenation operation is ignored and foo2 equals 'test' if the
  20601.  /Gr switch, which enables backward compatibility to FORTRAN Version
  20602.  3.20, is used.
  20603.  
  20604.  When an explicit value is used in place of the variable "j", the
  20605.  concatenation operation is successful, as shown in the following
  20606.  example:
  20607.  
  20608.  foo='test'
  20609.  foo2='foo(1:4)//'.one'
  20610.  
  20611.  In this case, foo2 equals 'test.one'.
  20612.  
  20613.  
  20614.  540. FORTRAN Index Listing for Binary Records Incorrect
  20615.  
  20616.  Product Version(s): 5.00   | 5.00
  20617.  Operating System:   MS-DOS | OS/2
  20618.  Flags: ENDUSER | docerr
  20619.  Last Modified:  7-DEC-1989    ArticleIdent: Q50574
  20620.  
  20621.  The index of the "Microsoft FORTRAN Advanced Topics" manual for
  20622.  Version 5.00 incorrectly states that information on binary records is
  20623.  on Pages 119-120.
  20624.  
  20625.  The information actually appears on Pages 122-124.
  20626.  
  20627.  
  20628.  541. "Issuing Fixup Warnings" Section Is 13.3.32 in FORTRAN Manual
  20629.  
  20630.  Product Version(s): 5.00   | 5.00
  20631.  Operating System:   MS-DOS | OS/2
  20632.  Flags: ENDUSER | /WARNFIXUP docerr
  20633.  Last Modified:  7-DEC-1989    ArticleIdent: Q50575
  20634.  
  20635.  Under the Link warning message L4000 on Page 386 in the "Microsoft
  20636.  FORTRAN CodeView and Utilities User's Guide" for Version 5.00, the
  20637.  documentation incorrectly states that Section 13.3.31 is the "Issuing
  20638.  Fixup Warnings" section.
  20639.  
  20640.  The "Issuing Fixup Warnings" section actually is 13.3.32.
  20641.  
  20642.  
  20643.  542. \s Format Switch Information in MS-DOS, Not FORTRAN, Manual
  20644.  
  20645.  Product Version(s): 5.00   | 5.00
  20646.  Operating System:   MS-DOS | OS/2
  20647.  Flags: ENDUSER | docerr
  20648.  Last Modified:  7-DEC-1989    ArticleIdent: Q50576
  20649.  
  20650.  On Page 16 of the "Microsoft FORTRAN Advanced Topics" manual for
  20651.  Version 5.00, the first step suggests formatting a blank floppy disk
  20652.  without the /s option. It then incorrectly states that more
  20653.  information is available on the /s switch in the "Microsoft FORTRAN
  20654.  Reference" manual.
  20655.  
  20656.  For more information on the /s switch, you should consult an MS-DOS
  20657.  manual.
  20658.  
  20659.  
  20660.  543. Example of Using EXTERNAL for User-Defined Function
  20661.  
  20662.  Product Version(s): 5.00   | 5.00
  20663.  Operating System:   MS-DOS | OS/2
  20664.  Flags: ENDUSER |
  20665.  Last Modified:  7-DEC-1989    ArticleIdent: Q50401
  20666.  
  20667.  The following is an example of how to use the EXTERNAL command in
  20668.  FORTRAN Version 5.00 to specify a user-defined function:
  20669.  
  20670.        function fn (x)
  20671.          real fn,x
  20672.          fn=x
  20673.        end
  20674.  
  20675.        subroutine s2 (f,x,y)
  20676.          real   f,x,y
  20677.          x=f(y)
  20678.        end
  20679.  
  20680.  The following is the main program:
  20681.  
  20682.        real      y,z,fn
  20683.          external  fn
  20684.          z=10.0
  20685.          call s2(fn,y,z)
  20686.          write (*,*) y
  20687.        end
  20688.  
  20689.  
  20690.  544. Compiling with /ND Option Causes Hang at Run Time
  20691.  
  20692.  Product Version(s): 4.10 5.00 | 4.10 5.00
  20693.  Operating System:   MS-DOS    | OS/2
  20694.  Flags: ENDUSER |
  20695.  Last Modified: 19-JUL-1990    ArticleIdent: Q50402
  20696.  
  20697.  Compiling the program below with /ND and FORTRAN Version 4.10 generates
  20698.  an internal compiler error and using /ND with FORTRAN 5.00 hangs the
  20699.  machine at run time.  No errors occur when the WRITE statement is
  20700.  removed.
  20701.  
  20702.  The /ND switch is used to name the data segment.
  20703.  
  20704.  The following code demonstrates both situations when compiled with the
  20705.  /ND switch.  No errors occur when the module does not perform I/O
  20706.  operations.
  20707.  
  20708.        integer*2 n
  20709.        n=1
  20710.        write (*,*) n
  20711.        end
  20712.  
  20713.  Microsoft is researching this problem and will post new information
  20714.  here as it becomes available.
  20715.  
  20716.  
  20717.  545. Using an Internal Write and outtext/outgtext for Numeric Data
  20718.  
  20719.  Product Version(s): 5.00   | 5.00
  20720.  Operating System:   MS-DOS | OS/2
  20721.  Flags: ENDUSER | internal files
  20722.  Last Modified:  9-MAY-1990    ArticleIdent: Q61524
  20723.  
  20724.  Below is an example of an internal write to a character variable. This
  20725.  is useful when outputting numerical data in a graphics mode by using
  20726.  the functions outtext or outgtext.
  20727.  
  20728.  C Example of an internal write in FORTRAN
  20729.  C
  20730.        include 'fgraph.fi'
  20731.        include 'fgraph.fd'
  20732.        integer*4 var1
  20733.        character*15 output
  20734.        var1 = 1234
  20735.        write (output,100) var1 ! write var1 to output variable
  20736.        call outtext(output)    ! use outtext to write output to screen
  20737.  100   format ('VAR1 = ', I4)
  20738.        end
  20739.  
  20740.  The above code shows how an internal write can be used to write
  20741.  numerical data (formatted or unformatted) to a character string. The
  20742.  character string variable name is given as the unitspec for the WRITE
  20743.  statement. The formatspec and iolist are used normally. After the
  20744.  WRITE statement is executed the character string output contains the
  20745.  ASCII characters listed below in single quotation marks:
  20746.  
  20747.     output = 'VAR1 = 1234    '
  20748.  
  20749.  The graphics functions outtext and outgtext will only output character
  20750.  strings to the screen. This poses a problem when outputting integer
  20751.  and real values. An internal write will solve the problem.
  20752.  
  20753.  Internal files are explained on Pages 77-78 of the "Microsoft FORTRAN
  20754.  Reference" manual. Using the WRITE statement with internal files is
  20755.  explained on Pages 234-235 of the "Microsoft FORTRAN Reference"
  20756.  manual. Outtext and outgtext are explained on Pages 231-232 of the
  20757.  "Microsoft FORTRAN Advanced Topics" manual.
  20758.  
  20759.  
  20760.  546. Enabling/Disabling FORTRAN SAA, VAX Extensions
  20761.  
  20762.  Product Version(s): 5.00   | 5.00
  20763.  Operating System:   MS-DOS | OS/2
  20764.  Flags: ENDUSER |
  20765.  Last Modified:  7-DEC-1989    ArticleIdent: Q50480
  20766.  
  20767.  The /4Ys, /4Yi, and /4Yv compiler switches control the use of
  20768.  Microsoft's non-ANSI standard (FORTRAN 77) options:
  20769.  
  20770.     Switch     Description
  20771.     ------     -----------
  20772.  
  20773.     /4Ys       Disables the use of all Microsoft FORTRAN extensions
  20774.  
  20775.     /4Yi       Disables all extensions except the IBM SAA extensions
  20776.  
  20777.     /4Yv       Disables all but the VAX extensions
  20778.  
  20779.  The following contains lists of supported IBM SAA and VAX extensions.
  20780.  Most of the information in these lists is located on Pages 330-332 of
  20781.  the "Microsoft FORTRAN Reference" manual for Version 5.00. See
  20782.  Appendix B in this reference manual for additional features new to
  20783.  FORTRAN 5.00.
  20784.  
  20785.  Microsoft FORTRAN includes all SAA extensions that are listed below:
  20786.  
  20787.   1. 31 character names
  20788.  
  20789.   2. Bit manipulation intrinsic
  20790.  
  20791.   3. Case insensitive source
  20792.  
  20793.   4. COMMON that allows character and noncharacter in same block
  20794.  
  20795.   5. CONJG, HFIX, IMAG intrinsic functions
  20796.  
  20797.   6. Data initialization in type statements
  20798.  
  20799.   7. EQUIVALENCE allows association of character and noncharacter
  20800.  
  20801.   8. Functions IOR, IAND, NOT IEOR, ISHFT, BTEST, IBSET, and IBCLR
  20802.  
  20803.   9. IMPLICIT NONE
  20804.  
  20805.  10. INCLUDE compiler directive
  20806.  
  20807.  11. INTEGER*2, COMPLEX*16, and LOGICAL*1 data types
  20808.  
  20809.  12. Optional length specifications in INTEGER, REAL, COMPLEX, and
  20810.      LOGICAL type statements
  20811.  
  20812.  13. Use of underscore (_) in names
  20813.  
  20814.  14. Z edit descriptor
  20815.  
  20816.  Microsoft FORTRAN also includes many, but not all, VAX extension as
  20817.  listed below:
  20818.  
  20819.   1. 31 character names
  20820.  
  20821.   2. ACCESS selector 'APPEND' in the OPEN statement
  20822.  
  20823.   3. Allowing integer arrays to contain FORMAT statements
  20824.  
  20825.   4. BLOCKSIZE and NML I/O keywords
  20826.  
  20827.   5. Debug comment lines
  20828.  
  20829.   6. DO statements without specified labels
  20830.  
  20831.   7. DO WHILE statement
  20832.  
  20833.   8. END DO statement
  20834.  
  20835.   9. EQUIVALENCE of character and noncharacter items
  20836.  
  20837.  10. EQUIVALENCE to a multi-dimensional array with only one subscript
  20838.  
  20839.  11. Exponentiation of REAL and COMPLEX statements
  20840.  
  20841.  12. IMPLICIT NONE
  20842.  
  20843.  13. INCLUDE compiler directive
  20844.  
  20845.  14. Initialization on the declaration line
  20846.  
  20847.  15. In-line comments
  20848.  
  20849.  16. Length specification within the FUNCTION statement
  20850.  
  20851.  17. Length specifications within type declarations
  20852.  
  20853.  18. Mixing of character and noncharacter items in COMMON statements
  20854.  
  20855.  19. NAMELIST
  20856.  
  20857.  20. Noninteger alternate return values
  20858.  
  20859.  21. Noninteger array subscripts
  20860.  
  20861.  22. Numeric operands for .AND., .OR., etc.
  20862.  
  20863.  23. Specified common-block variables in DATA statements outside a
  20864.      BLOCK DATA subroutine
  20865.  
  20866.  24. STRUCTURE, UNION, MAP statements
  20867.  
  20868.  25. Up to 99 continuation lines
  20869.  
  20870.  26. Use of dollar sign ($) in names
  20871.  
  20872.  27. .XOR. operator
  20873.  
  20874.  
  20875.  547. VAX Extensions Available with FORTRAN 5.00
  20876.  
  20877.  Product Version(s): 5.00   | 5.00
  20878.  Operating System:   MS-DOS | OS/2
  20879.  Flags: ENDUSER |
  20880.  Last Modified:  7-DEC-1989    ArticleIdent: Q50504
  20881.  
  20882.  Microsoft FORTRAN includes many, but not all, VAX extensions. Most of
  20883.  these extensions are found on Pages  331-332 of the "Microsoft FORTRAN
  20884.  Reference" manual for Version 5.00. Appendix B of the same manual
  20885.  lists additional features that are new in FORTRAN 5.00.
  20886.  
  20887.  The supported VAX extensions are listed below:
  20888.  
  20889.   1. 31 character names
  20890.  
  20891.   2. ACCESS selector 'APPEND' in the OPEN statement
  20892.  
  20893.   3. Allowing integer arrays to contain FORMAT statements
  20894.  
  20895.   4. BLOCKSIZE and NML I/O keywords
  20896.  
  20897.   5. Debug comment lines
  20898.  
  20899.   6. DO statements without specified labels
  20900.  
  20901.   7. DO WHILE statement
  20902.  
  20903.   8. END DO statement
  20904.  
  20905.   9. EQUIVALENCE of character and noncharacter items
  20906.  
  20907.  10. EQUIVALENCE to a multi-dimensional array with only one subscript
  20908.  
  20909.  11. Exponentiation of REAL and COMPLEX statements
  20910.  
  20911.  12. IMPLICIT NONE
  20912.  
  20913.  13. INCLUDE compiler directive
  20914.  
  20915.  14. Initialization on the declaration line
  20916.  
  20917.  15. In-line comments
  20918.  
  20919.  16. Length specification within the FUNCTION statement
  20920.  
  20921.  17. Length specifications within type declarations
  20922.  
  20923.  18. Mixing of character and noncharacter items in COMMON statements
  20924.  
  20925.  19. NAMELIST
  20926.  
  20927.  20. Noninteger alternate return values
  20928.  
  20929.  21. Noninteger array subscripts
  20930.  
  20931.  22. Numeric operands for .AND., .OR., etc.
  20932.  
  20933.  23. Specified common-block variables in DATA statements outside a BLOCK
  20934.      DATA subroutine
  20935.  
  20936.  24. STRUCTURE, UNION, MAP statements
  20937.  
  20938.  25. Up to 99 continuation lines
  20939.  
  20940.  26. Use of dollar sign ($) in names
  20941.  
  20942.  27. .XOR. operator
  20943.  
  20944.  
  20945.  548. IBM SAA Extensions Available with FORTRAN 5.00
  20946.  
  20947.  Product Version(s): 5.00   | 5.00
  20948.  Operating System:   MS-DOS | OS/2
  20949.  Flags: ENDUSER |
  20950.  Last Modified:  7-DEC-1989    ArticleIdent: Q50505
  20951.  
  20952.  Microsoft FORTRAN 5.00 includes all IBM SAA extensions. These
  20953.  extensions are listed below (this list can also be found on Pages
  20954.  330-331 of the "Microsoft FORTRAN Reference" manual for Version 5.00):
  20955.  
  20956.   1. 31 character names
  20957.  
  20958.   2. Bit manipulation intrinsic
  20959.  
  20960.   3. Case insensitive source
  20961.  
  20962.   4. COMMON allows character and noncharacter in same block
  20963.  
  20964.   5. CONJG, HFIX, IMAG intrinsic functions
  20965.  
  20966.   6. Data initialization in type statements
  20967.  
  20968.   7. EQUIVALENCE allows association of character and noncharacter
  20969.  
  20970.   8. Functions IOR, IAND, NOT IEOR, ISHFT, BTEST, IBSET, and IBCLR
  20971.  
  20972.   9. IMPLICIT NONE
  20973.  
  20974.  10. INCLUDE compiler directive
  20975.  
  20976.  11. INTEGER*2, COMPLEX*16, and LOGICAL*1 data types
  20977.  
  20978.  12. Optional length specifications in INTEGER, REAL, COMPLEX, and
  20979.      LOGICAL type statements
  20980.  
  20981.  13. Use of underscore (_) in names
  20982.  
  20983.  14. Z edit descriptor
  20984.  
  20985.  
  20986.  549. FORTRAN Err Msg: Cannot Open Module Definitions Field
  20987.  
  20988.  Product Version(s): 5.00   | 5.00
  20989.  Operating System:   MS-DOS | OS/2
  20990.  Flags: ENDUSER | def file
  20991.  Last Modified:  7-DEC-1989    ArticleIdent: Q50583
  20992.  
  20993.  The L1092 'cannot open module-definitions file' link error occurs if
  20994.  some input is inadvertently given on the Definitions File prompt
  20995.  during linking, or if a response file inadvertently feeds input to the
  20996.  Definitions File prompt.
  20997.  
  20998.  The Definitions File field in the linker prompt should be used only
  20999.  when working with DLL's under OS/2. If the program is to be run under
  21000.  DOS, this field should be left blank.
  21001.  
  21002.  A semicolon at this prompt is treated as a null input.
  21003.  
  21004.  Section 13.2.2 of the "Microsoft FORTRAN CodeView and Utilities User's
  21005.  Guide" for Version 5.00 contains more information about linking with
  21006.  the LINK Command Line.
  21007.  
  21008.  
  21009.  550. FORTRAN Err Msg: "L1093 Object Not Found", Wrong Environment
  21010.  
  21011.  Product Version(s): 4.00 4.01 4.10 | 5.00
  21012.  Operating System:   MS-DOS         | OS/2
  21013.  Flags: ENDUSER |
  21014.  Last Modified:  7-DEC-1989    ArticleIdent: Q50585
  21015.  
  21016.  The L1093 error "object not found" can occur if the environment is
  21017.  incorrectly set. For example, the L1093 error occurs if the fl
  21018.  environment variable is specified as follows:
  21019.  
  21020.  set fl=options
  21021.  
  21022.  or
  21023.  
  21024.  set fl=\FPi \Zi
  21025.  
  21026.  In the first case, the linker thinks it needs to link in an
  21027.  OPTIONS.OBJ file. In the second case, backslashes were used for the
  21028.  command switches instead of forward slashes. In the second case, the
  21029.  linker also thinks it needs to link in the \FPi.obj and \Zi.obj files.
  21030.  
  21031.  
  21032.  551. Compilation Errors with FORTRAN 5.00, $FREEFORM, Graphics
  21033.  
  21034.  Product Version(s): 5.00   | 5.00
  21035.  Operating System:   MS-DOS | OS/2
  21036.  Flags: ENDUSER |
  21037.  Last Modified:  8-DEC-1989    ArticleIdent: Q50595
  21038.  
  21039.  If the $FREEFORM metacommand is placed at the top of a FORTRAN Version
  21040.  5.00 file that makes calls to the FORTRAN graphics library, you get
  21041.  compilation errors. The files FGRAPH.FI and FGRAPH.FD are not written
  21042.  to conform to the $FREEFORM format.
  21043.  
  21044.  If you must use the $FREEFORM metacommand, you must modify these two
  21045.  files. We recommend that you create customized include files that
  21046.  contain only the information that pertains to the graphics routines
  21047.  you are calling.
  21048.  
  21049.  The following is an example of a subroutine that uses the $FREEFORM
  21050.  metacommand and calls a subroutine in the FORTRAN graphics library:
  21051.  
  21052.  $FREEFORM
  21053.  include 'OHMAN.FI'
  21054.  subroutine foo()
  21055.  include 'OHMAN.FD'
  21056.  call setlinestyle(#AA3C)
  21057.  end
  21058.  
  21059.  For this particular example, the file OHMAN.FI contains information
  21060.  from the file FGRAPH.FI that pertains to the subroutine setlinestyle.
  21061.  This file, OHMAN.FI, looks like the following:
  21062.  
  21063.  INTERFACE TO SUBROUTINE setlinestyle[FAR,C,ALIAS:"__setlinestyle"] (mask)
  21064.  INTEGER*2 mask
  21065.  END
  21066.  
  21067.  Likewise, the file OHMAN.FD contains information from the file
  21068.  FGRAPH.FD that pertains to the subroutine setlinestyle. It looks like
  21069.  the following:
  21070.  
  21071.        EXTERNAL setlinestyle
  21072.  
  21073.  
  21074.  552. OS/2 Graphic Routines Available with FORTRAN 5.00 GRTEXTP.LIB
  21075.  
  21076.  Product Version(s): 5.00
  21077.  Operating System:   OS/2
  21078.  Flags: ENDUSER | Advanced Topics Manual Page 148
  21079.  Last Modified:  7-DEC-1989    ArticleIdent: Q50600
  21080.  
  21081.  The OS/2 graphics library GRTEXTP.LIB supports the following routines:
  21082.  
  21083.     clearscreen         getvisualpage       settextwindow
  21084.     displaycursor       outtext             setvideomode
  21085.     getactivepage       setactivepage       setvideomoderows
  21086.     getbkcolor          setbkcolor          setvisualpage
  21087.     gettextcolor        settextcolor        wrapon
  21088.     gettextcursor       settextcursor
  21089.     gettextposition     settextposition
  21090.     getvideoconfig      settextrows
  21091.  
  21092.  This library must be linked instead of GRAPHICS.LIB to use these
  21093.  routines under OS/2. Routines not included in the above list are not
  21094.  available under OS/2.
  21095.  
  21096.  The OS/2 Presentation Manager can be programmed to use additional
  21097.  graphics routines under OS/2.
  21098.  
  21099.  
  21100.  553. Need INTERFACE Statement to Pass Address of Common Block to C
  21101.  
  21102.  Product Version(s): 5.00   | 5.00
  21103.  Operating System:   MS-DOS | OS/2
  21104.  Flags: ENDUSER | docerr
  21105.  Last Modified:  7-DEC-1989    ArticleIdent: Q51245
  21106.  
  21107.  Section 5.3.5.1 on Page 111 of "Microsoft FORTRAN Advanced Topics"
  21108.  manual for Version 5.00 shows a code fraction, which demonstrates
  21109.  passing of the address of a FORTRAN Common Block to C. However, the
  21110.  requirement that you must also write an INTERFACE statement to the C
  21111.  subroutine to successfully pass the address is omitted in the manual.
  21112.  
  21113.  For the example on Page 111, either one of the following INTERFACE
  21114.  statements works correctly:
  21115.  
  21116.             INTERFACE TO SUBROUTINE INITCB [C] (N)
  21117.             INTEGER*2 N [REFERENCE]
  21118.             END
  21119.  
  21120.  or
  21121.  
  21122.             INTERFACE TO SUBROUTINE INITCB [ALIAS:_initcb]
  21123.             INTEGER*2 N
  21124.             END
  21125.  
  21126.  In the first INTERFACE statement, the REFERENCE attribute must be
  21127.  included because C attribute otherwise causes parameter N to be passed
  21128.  by value.
  21129.  
  21130.  
  21131.  554. FORTRAN Err Msg: Filename.for(9): Error F2725 Illegal Input...
  21132.  
  21133.  Product Version(s): 5.00   | 5.00
  21134.  Operating System:   MS-DOS | OS/2
  21135.  Flags: ENDUSER |
  21136.  Last Modified:  7-DEC-1989    ArticleIdent: Q51284
  21137.  
  21138.  The code below produces the following error on the READ line:
  21139.  
  21140.     filename.for(9) : error F2725 illegal input list item
  21141.  
  21142.  According to Page 218 of the "Microsoft FORTRAN Reference" for Version
  21143.  5.00, declaration of an array of records is allowed. Page 214 states
  21144.  that the iolist may contain structure elements. If LIMIT is changed to
  21145.  a single structure instead of an array of structures, the code
  21146.  compiles correctly.
  21147.  
  21148.  Microsoft has confirmed this to be a problem in Version 5.00 of the
  21149.  compiler and will post new information as it becomes available.
  21150.  
  21151.  Code Example
  21152.  ------------
  21153.  
  21154.        structure /speclimit/
  21155.        real*4  a
  21156.        end structure
  21157.  
  21158.        record /speclimit /limit(5)
  21159.        n=1
  21160.        limit(N).a=34.56
  21161.        read (*,1000) limit(N).a    !array causes error
  21162.  1000  format (f6.2)
  21163.        end
  21164.  
  21165.  
  21166.  555. Monitoring the Stack Using Assembly or C
  21167.  
  21168.  Product Version(s): 4.00 4.10 5.00 | 4.00 4.10 5.00
  21169.  Operating System:   MS-DOS         | OS/2
  21170.  Flags: ENDUSER | debug watch view
  21171.  Last Modified:  7-DEC-1989    ArticleIdent: Q51294
  21172.  
  21173.  If, for any reason, you believe that the stack in a FORTRAN program is
  21174.  being corrupted, you can monitor the stack segment (SS) register and
  21175.  stack pointer (SP) register by using either the Microsoft Assembler or
  21176.  the QuickC with Assembler package. Since CodeView may use the stack
  21177.  for its own purposes, this allows a more direct monitoring method.
  21178.  
  21179.  A function for each package is shown below along with the appropriate
  21180.  interface statement. Each function returns an integer*4 to FORTRAN.
  21181.  
  21182.  To extract the hexadecimal values from that integer, use a format
  21183.  statement something similar to the following example:
  21184.  
  21185.        write (*,'(1x,A7,1x,4Z,A1,4Z)')
  21186.       + 'seg:off',stackloc(),':',ISHC(stackloc(),16)
  21187.  
  21188.  This write statement produces video output of the following form:
  21189.  
  21190.   seg:off 2BC0:111A
  21191.  
  21192.  The assembly code and interface statement are shown below.
  21193.  
  21194.        interface to integer*4 function stackloc()
  21195.        end
  21196.        integer*4 stackloc
  21197.  
  21198.  .model large
  21199.  .code
  21200.  public stackloc
  21201.  stackloc proc
  21202.         mov dx,ss
  21203.         mov ax,sp
  21204.         ret
  21205.  stackloc endp
  21206.         end
  21207.  
  21208.  The equivalent interface for the following QuickC with Assembler code
  21209.  is also listed below (keep in mind that this code must be compiled
  21210.  with the /AL switch for memory model compatibility):
  21211.  
  21212.        interface to integer*4 function stackloc [C,
  21213.       + alias:'_stackloc'] ()
  21214.        end
  21215.        integer*4 stackloc
  21216.  
  21217.  int * stackloc(void)
  21218.  {
  21219.          int j[2];
  21220.  
  21221.          _asm {
  21222.                  mov     j[0],ss
  21223.                  mov     j[1],sp
  21224.          }
  21225.          return j;
  21226.  }
  21227.  
  21228.  
  21229.  556. FORTRAN Err Msg: F4998: Variable Used But Not Defined
  21230.  
  21231.  Product Version(s): 5.00   | 5.00
  21232.  Operating System:   MS-DOS | OS/2
  21233.  Flags: ENDUSER |
  21234.  Last Modified:  7-DEC-1989    ArticleIdent: Q51295
  21235.  
  21236.  The FORTRAN Version 5.00 compiler will produce the following error
  21237.  when the variable is defined yet not used anywhere in the program
  21238.  other than in an intrinsic function:
  21239.  
  21240.     F4998: variable used but not defined
  21241.  
  21242.  To eliminate this warning, use the variable somewhere in the program
  21243.  other than just in the intrinsic function.
  21244.  
  21245.  The following program generates this warning error.
  21246.  
  21247.        integer tmp
  21248.        write (*,*) locfar(tmp)
  21249.  
  21250.  To eliminate this warning, set tmp equal to something before it is
  21251.  used in the program.
  21252.  
  21253.        integer tmp
  21254.        tmp=1
  21255.        write (*,*) locfar(tmp)
  21256.  
  21257.  The following is the current list of tested intrinsic functions that
  21258.  generate this error, although many more intrinsic functions are
  21259.  believed to generate this warning:
  21260.  
  21261.     locfar, loc, locnear, not, ior, sin, tan, exp, log, sqrt, max, mod,
  21262.     abs
  21263.  
  21264.  Microsoft is researching this problem and will post new information as
  21265.  it becomes available.
  21266.  
  21267.  
  21268.  557. String Replacement Macro for M Editor
  21269.  
  21270.  Product Version(s): 5.00
  21271.  Operating System:   MS-DOS
  21272.  Flags: ENDUSER |
  21273.  Last Modified:  7-DEC-1989    ArticleIdent: Q51296
  21274.  
  21275.  The following example illustrates a macro that can be placed within
  21276.  the TOOLS.INI file to enable the replacement of a string(string1) with
  21277.  another string(string2). The macro is assigned to a function key (F5).
  21278.  
  21279.  The search and replace is conducted from the position of the cursor
  21280.  down through the end of the file.
  21281.  
  21282.  Macro
  21283.  -----
  21284.  
  21285.       MacRep:=Replace "string1" newline "string2" newline
  21286.       MacRep:F5
  21287.  
  21288.  
  21289.  558. FORPATCH Available in Software/Data Library
  21290.  
  21291.  Product Version(s): 5.00   | 5.00
  21292.  Operating System:   MS-DOS | OS/2
  21293.  Flags: ENDUSER | softlib FORPATCH.ARC
  21294.  Last Modified:  7-DEC-1989    ArticleIdent: Q51298
  21295.  
  21296.  There is a file in the Software/Data Library called FORPATCH that
  21297.  consists of a README file and a patched version of the first pass of
  21298.  the FORTRAN Version 5.00 compiler (F1.EXE) and a patched,
  21299.  high-capacity compiler (F1L.EXE).
  21300.  
  21301.  This update corrects the following problems:
  21302.  
  21303.  1. The I/O of the STRUCTURE element generates an F1001 Internal
  21304.     Compiler Error in omf_ms.c:1.118, line 1093, or a protection
  21305.     violation.
  21306.  
  21307.  2. NAMELIST statements in multiple subprograms in one file cause the
  21308.     machine to hang.
  21309.  
  21310.  3. SAVEing a common block in multiple subprograms causes a compiler
  21311.     error F2348: already declared SAVE.
  21312.  
  21313.  4. Using /4Yi, /4Ys, or /4Yv, and an asterisk in column one to
  21314.     indicate a comment generates a compiler error F2037: illegal label
  21315.     field.
  21316.  
  21317.  This file can be found in the Software/Data Library by searching on
  21318.  the keyword FORPATCH, the Q number of this article, or S12450.
  21319.  FORPATCH was archived using the PKware file-compression utility.
  21320.  
  21321.  This patch, called "FORTRAN 5.0 F1.EXE and F1L.EXE Patch," is also
  21322.  available from Microsoft Product Support Services at (206) 454-2030.
  21323.  
  21324.  
  21325.  559. F1001 Error 'getattrib.c:1.4' line 174, Using LOC Functions
  21326.  
  21327.  Product Version(s): 5.00   | 5.00
  21328.  Operating System:   MS-DOS | OS/2
  21329.  Flags: ENDUSER | buglist5.00
  21330.  Last Modified: 31-AUG-1990    ArticleIdent: Q65261
  21331.  
  21332.  The following error
  21333.  
  21334.     fatal error F1001: Internal Compiler Error
  21335.     (compiler file '@(#)getattrib.c:1.4', line 174)
  21336.  
  21337.  occurs when using the LOC, LOCNEAR, or LOCFAR intrinsic function with
  21338.  a Structure-Type as an argument. This should produce a compiler error
  21339.  because Structure-Types are used to define new data types and are not
  21340.  variables. Structure Variables are defined by a RECORD statement, and
  21341.  are legal arguments to a LOC function.
  21342.  
  21343.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  21344.  We are researching this problem and will post new information here as
  21345.  it becomes available.
  21346.  
  21347.  The following sample code generates an internal compiler error:
  21348.  
  21349.        STRUCTURE /smallst/
  21350.          CHARACTER*1 letter
  21351.        END STRUCTURE
  21352.  
  21353.        i = LOC(smallst)
  21354.        END
  21355.  
  21356.  The correct use of the LOC function is as follows:
  21357.  
  21358.        STRUCTURE /smallst/
  21359.          CHARACTER*1 letter
  21360.        END STRUCTURE
  21361.        RECORD /smallst/ alphabet
  21362.  
  21363.        i = LOC(alphabet)
  21364.        END
  21365.  
  21366.  
  21367.  560. Data Type Conversion Utilities in FORTRAN 5.00
  21368.  
  21369.  Product Version(s): 5.00   | 5.00
  21370.  Operating System:   MS-DOS | OS/2
  21371.  Flags: ENDUSER |
  21372.  Last Modified:  2-MAR-1990    ArticleIdent: Q51471
  21373.  
  21374.  This article lists FORTRAN 5.00 data type conversion utilities. It
  21375.  includes information on the following:
  21376.  
  21377.  1. Intrinsic functions dealing with data type conversions, documented
  21378.     on Pages 240-241 of the "Microsoft FORTRAN Reference" manual for
  21379.     Version 5.00
  21380.  
  21381.  2. The $STORAGE metacommand, documented on Pages 34 and 308 of the
  21382.     "Microsoft FORTRAN Reference" manual for Version 5.00
  21383.  
  21384.  3. The IMPLICIT statement, documented on Pages 8 and 181-182 of the
  21385.     "Microsoft FORTRAN Reference" manual for Version 5.00
  21386.  
  21387.  4. Internal READ and WRITE, documented on Pages 77-78 of the
  21388.     "Microsoft FORTRAN Reference" manual for Version 5.00
  21389.  
  21390.  1. Intrinsic Functions
  21391.     -------------------
  21392.  
  21393.        Function   Description
  21394.        --------   -----------
  21395.  
  21396.        INT        Converts integer, real or complex arguments to
  21397.                   integers
  21398.  
  21399.        INT1       Converts integer, real or complex arguments to
  21400.                   INTEGER*1
  21401.  
  21402.        INT2       Converts integer, real or complex arguments to
  21403.                   INTEGER*2
  21404.  
  21405.        INT4       Converts integer, real or complex arguments to
  21406.                   INTEGER*4
  21407.  
  21408.        INTC       Converts integer, real or complex arguments to
  21409.                   C language integers
  21410.  
  21411.        IFIX       Converts REAL*4 arguments to integers
  21412.  
  21413.        HFIX       Converts integer, real or complex arguments to
  21414.                   INTEGER*2
  21415.  
  21416.        JFIX       Converts integer, real or complex arguments to
  21417.                   INTEGER*4
  21418.  
  21419.        IDINT      Converts DOUBLE PRECISION or REAL*8 arguments to
  21420.                   integers
  21421.  
  21422.        REAL       Converts integer, real or complex arguments to
  21423.                   REAL*4
  21424.  
  21425.        DREAL      Converts COMPLEX*16 arguments to REAL*8
  21426.  
  21427.        FLOAT      Converts integer arguments to REAL*4
  21428.  
  21429.        SNGL       Converts REAL*8 arguments to REAL*4
  21430.  
  21431.        DBLE       Converts integer, real or complex arguments to
  21432.                   DOUBLE PRECISION
  21433.  
  21434.        DFLOAT     Converts integer, real or complex arguments to
  21435.                   DOUBLE PRECISION
  21436.  
  21437.        CMPLX      Converts integer, real or complex arguments to
  21438.                   COMPLEX*8
  21439.  
  21440.        DCMPLX     Converts integer, real or complex arguments to
  21441.                   COMPLEX*16
  21442.  
  21443.        ICHAR      Converts character arguments to integers (ASCII
  21444.                   value)
  21445.  
  21446.        CHAR       Converts integer arguments to characters (ASCII
  21447.                   equivalent)
  21448.  
  21449.        The documentation on the data type conversion intrinsic
  21450.        functions can be found on Pages 240-241 in the "Microsoft
  21451.        FORTRAN Reference" manual for Version 5.00.
  21452.  
  21453.  2. $STORAGE Metacommand
  21454.     --------------------
  21455.  
  21456.     $STORAGE:n allocates n bytes of memory for all variables declared
  21457.     as INTEGER or LOGICAL. For example, if INTEGER B variable
  21458.     declaration is used and the $STORAGE:2 metacommand is specified, B
  21459.     will be allocated 2 bytes instead of 4. $STORAGE does not affect
  21460.     the allocation of memory for variables declared with an explicit
  21461.     length specification, such as INTEGER*2 or INTEGER*4. The $STORAGE
  21462.     metacommand is documented on Pages 34 and 308 of the "Microsoft
  21463.     FORTRAN Reference" manual for Version 5.00.
  21464.  
  21465.  3. IMPLICIT Statement
  21466.     ------------------
  21467.  
  21468.     If a name is not explicitly defined, the first letter of a variable
  21469.     or function determines its type. By default, names starting with I,
  21470.     J, K, L, M, or N are given the type INTEGER, while variables
  21471.     starting with any other letter or a dollar sign are given the type
  21472.     REAL. An IMPLICIT statement can be used to override the default. An
  21473.     explicit type declaration overrides the type established by the
  21474.     IMPLICIT statement. The IMPLICIT statement is documented on Pages
  21475.     8 and 181-182 of the "Microsoft FORTRAN Reference" manual for
  21476.     Version 5.00.
  21477.  
  21478.  4. Internal READ and WRITE
  21479.     -----------------------
  21480.  
  21481.     Reading from an internal file converts the ASCII values into
  21482.     numeric, logical, or character values, and writing to an internal
  21483.     file converts values into their ASCII representations. Internal
  21484.     READ and WRITE are documented on Pages 77-78 of the "Microsoft
  21485.     FORTRAN Reference" manual for Version 5.00. The following code
  21486.     sample converts a character variable into an integer:
  21487.  
  21488.        character*5 num
  21489.        integer test
  21490.        num='12345'
  21491.        read(num,'(i5)') test
  21492.        write (*,*) test
  21493.        end
  21494.  
  21495.  
  21496.  561. Incorrect INTEGER Size Listed in Reference Manual, Page 191
  21497.  
  21498.  Product Version(s): 5.00   | 5.00
  21499.  Operating System:   MS-DOS | OS/2
  21500.  Flags: ENDUSER | docerr
  21501.  Last Modified:  7-DEC-1989    ArticleIdent: Q51492
  21502.  
  21503.  The last line on Page 191 of the "Microsoft FORTRAN Reference" manual
  21504.  for Version 5.00 incorrectly reads as follows:
  21505.  
  21506.         INTEGER*22 q, m12*24, ivec(10)*24, z*24(10)
  21507.  
  21508.  Four extraneous 2s should be removed from the line as follows:
  21509.  
  21510.         INTEGER*2 q, m12*4, ivec(10)*4, z*4(10)
  21511.  
  21512.  
  21513.  562. Including BSE.FD Twice Causes Protection Violation
  21514.  
  21515.  Product Version(s): 5.00
  21516.  Operating System:   OS/2
  21517.  Flags: ENDUSER | buglist5.00
  21518.  Last Modified:  7-DEC-1989    ArticleIdent: Q51494
  21519.  
  21520.  The FORTRAN Version 5.00 compiler causes a protection violation, after
  21521.  a number of other errors, when the following code is compiled. It
  21522.  seems to have problems with the include files. If the files were
  21523.  entered properly, there would be both an "fi" and an "fd" include
  21524.  file. BSE.FD is included on the FORTRAN 5.00 OS/2 Support Disk 2.
  21525.  
  21526.  Example
  21527.  -------
  21528.  
  21529.  C **************************
  21530.        include 'bse.fd'
  21531.        include 'bse.fd'
  21532.        x = dosbeep(200,200)
  21533.        write (*,*) x
  21534.        stop
  21535.        end
  21536.  
  21537.  
  21538.  563. Use of ICHAR and CHAR Intrinsic Functions
  21539.  
  21540.  Product Version(s): 4.10 5.00 | 4.10 5.00
  21541.  Operating System:   MS-DOS    | OS/2
  21542.  Flags: ENDUSER | type conversion
  21543.  Last Modified:  7-DEC-1989    ArticleIdent: Q51495
  21544.  
  21545.  The ICHAR intrinsic function converts a single character to the
  21546.  integer ASCII value of that character.
  21547.  
  21548.  The CHAR intrinsic function converts an integer to the corresponding
  21549.  ASCII character.
  21550.  
  21551.  In both cases, ICHAR and CHAR use decimal integer values and the
  21552.  Extended ASCII Character Set.
  21553.  
  21554.  The ICHAR function will not directly convert a number that is stored
  21555.  as a character to the same number stored as an integer.
  21556.  
  21557.  The integer in both cases must be between 0 and 255. A number larger
  21558.  than 255 will "wrap around" to a value between 0 and 255, e.g. 256
  21559.  would be interpreted as 0, 257 as 1, 511 as 255, etc.
  21560.  
  21561.  The character string in both cases must be a single character
  21562.  (CHARACTER*1). If the character string is longer than one (CHARACTER*2
  21563.  or more), the functions will recognize only the first character
  21564.  position and ignore the rest.
  21565.  
  21566.  Example of ICHAR and CHAR
  21567.  -------------------------
  21568.  
  21569.        PROGRAM example
  21570.  
  21571.        INTEGER*2   int1, int2
  21572.        CHARACTER*1 char1, char2
  21573.  
  21574.        char1 = 'A'
  21575.        int1  = ICHAR(char1)
  21576.  
  21577.        int2  = 90
  21578.        char2 = CHAR(int2)
  21579.  
  21580.        write(*,*) 'char1 = ',char1,' and int1 = ',int1
  21581.        write(*,*) 'char2 = ',char2,' and int2 = ',int2
  21582.  
  21583.        end
  21584.  
  21585.  The output of program example is as follows:
  21586.  
  21587.     char1 = A and int1 =          65
  21588.     char2 = Z and int2 =          90
  21589.  
  21590.  The values 65 and 90 are the corresponding ASCII decimal values for
  21591.  the capital characters A and Z, respectively.
  21592.  
  21593.  The ICHAR and CHAR intrinsic functions are described on Pages 240-241
  21594.  of the "Microsoft FORTRAN Reference" manual for Version 5.00 and on
  21595.  Pages 323 and 325 of the "Microsoft FORTRAN 4.1 Optimizing Compiler:
  21596.  Language Reference."
  21597.  
  21598.  
  21599.  564. Example of Using a BLOCK DATA Subprogram
  21600.  
  21601.  Product Version(s): 5.00   | 5.00
  21602.  Operating System:   MS-DOS | OS/2
  21603.  Flags: ENDUSER | docerr
  21604.  Last Modified:  7-DEC-1989    ArticleIdent: Q51496
  21605.  
  21606.  A BLOCK DATA subprogram must come at the beginning of a main program
  21607.  file prior to the PROGRAM statement or at the end of the file after
  21608.  the END statement closing the main program.
  21609.  
  21610.  The variables initialized by the BLOCK DATA subprogram must be typed
  21611.  within the subprogram. The BLOCK DATA examples on Page 124 in the
  21612.  "Microsoft FORTRAN Reference" manual for Version 5.00 are incorrect
  21613.  because they do not type the variables prior to initialization.
  21614.  
  21615.  Below is an example of a program that uses BLOCK DATA.
  21616.  
  21617.  The following program shows how a BLOCK DATA subprogram can be used to
  21618.  initialize variables grouped within a named common block:
  21619.  
  21620.  C ******** BLOCK DATA statement at beginning of file ***
  21621.  
  21622.        BLOCK DATA foo
  21623.          integer*2   int1
  21624.          real*4      real1
  21625.          character*2 char1
  21626.          logical     log1
  21627.          common /test/ int1, real1, char1, log1
  21628.          data int1, real1, char1, log1 /1,4.0,'ZZ',.true./
  21629.        END
  21630.  
  21631.  C ******** Beginning of main program *******************
  21632.  
  21633.        PROGRAM block
  21634.  
  21635.        integer*2   int1
  21636.        real*4      real1
  21637.        character*2 char1
  21638.        logical     log1
  21639.  
  21640.        common /test/ int1, real1, char1, log1
  21641.  
  21642.        write (*,100) int1, real1, char1, log1
  21643.  100   format (1X, I1, 3X, F3.1, 3X, A2, 3X, L1)
  21644.  
  21645.        end
  21646.  
  21647.  The output of the program BLOCK is as follows:
  21648.  
  21649.     1   4.0   ZZ   T
  21650.  
  21651.  In the above program example, the BLOCK DATA subprogram could have
  21652.  been placed AFTER the END statement of the main program, producing the
  21653.  same results.
  21654.  
  21655.  
  21656.  565. Fatal Error F1001: compiler file'@(#)ctypes.c:1.11', line 448
  21657.  
  21658.  Product Version(s): 5.00   | 5.00
  21659.  Operating System:   MS-DOS | OS/2
  21660.  Flags: ENDUSER | buglist5.00
  21661.  Last Modified:  7-DEC-1989    ArticleIdent: Q51507
  21662.  
  21663.  The following example using double parentheses causes an internal
  21664.  compiler error. To work around the problem, remove the double
  21665.  parentheses.
  21666.  
  21667.  If the /Fs switch is used on the FORTRAN command line, a protection
  21668.  violation is generated under OS/2, or a system lockup occurs under
  21669.  DOS.
  21670.  
  21671.  Example
  21672.  -------
  21673.  
  21674.        program papa
  21675.        character*10 a
  21676.        a='1234567890'
  21677.        call mama((a(4:8)))  ! Remove the outer parenthesis
  21678.        stop
  21679.        end
  21680.  
  21681.        subroutine mama(b)
  21682.        character*5 b
  21683.        write (*,*) b
  21684.        return
  21685.        end
  21686.  
  21687.  The errors generated are similar to the following (this file was named
  21688.  subroti.for):
  21689.  
  21690.     subroti.for(5) : fatal error F1001: Internal Compiler Error
  21691.               (compiler file '@(#)ctypes.c:1.11', line 448)
  21692.               Contact Microsoft Technical Support
  21693.  
  21694.  
  21695.  566. Creating a Pointer in FORTRAN
  21696.  
  21697.  Product Version(s): 5.00   | 5.00
  21698.  Operating System:   MS-DOS | OS/2
  21699.  Flags: ENDUSER |
  21700.  Last Modified:  2-MAR-1990    ArticleIdent: Q51607
  21701.  
  21702.  The two sample programs below demonstrate a way to simulate pointers
  21703.  in FORTRAN. The first is for DOS and the second is for OS/2.
  21704.  
  21705.  Example 1
  21706.  ---------
  21707.  
  21708.  c This program demonstrates the use of a pointer in FORTRAN
  21709.  c 5.00 in DOS. This program loads a far address into an
  21710.  c integer*4 and passes that to a subroutine.
  21711.  c
  21712.  c Next, an INTERFACE TO SUBROUTINE is used to "lie" to FORTRAN
  21713.  c about what is being passed. The interface tells FORTRAN
  21714.  c that it is passing an integer*4 by value. The actual
  21715.  c subroutine, which is referred to by the ALIAS attribute,
  21716.  c expects a far address to an array. The value of the
  21717.  c integer*4 is that address. Once inside that subroutine,
  21718.  c The entire segment can be accessed by specifying the
  21719.  c correct index to the array.
  21720.  c
  21721.  c The subroutine SETPOINT2 changes the screen attribute byte
  21722.  c to cause the characters on the video display to blink.
  21723.  
  21724.           interface to subroutine setpoint[alias:'setpoint2'] (abc)
  21725.             integer*4   abc  [value]
  21726.           end
  21727.  
  21728.           subroutine setpoint2 (abc)
  21729.              integer*2   abc(*),n
  21730.  
  21731.              do 100,n=1,2000
  21732.              abc(n)=ior(abc(n),#8000)
  21733.  100         continue
  21734.           end
  21735.  
  21736.           program graphtest
  21737.              integer*4      ptr
  21738.  
  21739.              ptr=#0b8000000
  21740.              write (*,'(z9)') ptr
  21741.              call setpoint (ptr)
  21742.           end
  21743.  
  21744.  Example 2
  21745.  ---------
  21746.  
  21747.  c This program demonstrates the use of a pointer in FORTRAN
  21748.  c 5.00 in OS/2. This particular program gets a selector to
  21749.  c the video buffer from the DOS function call VioGetPhysBuf().
  21750.  c Once the selector is acquired, it is converted to a far
  21751.  c pointer by shifting it 16 positions to the left.
  21752.  c
  21753.  c Next, an interface to subroutine is used to lie to FORTRAN
  21754.  c about what it is passing. The interface tells FORTRAN that
  21755.  c it is passing an integer*4 by value. The actual
  21756.  c subroutine, which is referred to by the ALIAS attribute,
  21757.  c expects a far address to an array. The value of the
  21758.  c integer*4 is that address. Once inside that subroutine,
  21759.  c The entire segment can be accessed by specifying the
  21760.  c correct index to the array.
  21761.  c
  21762.  c The subroutine SETPOINT2 changes the attribute byte to
  21763.  c cause the characters on the video display to blink.
  21764.  
  21765.           interface to function viogetphysbuf (buffer,handle)
  21766.               structure/buffstrc/
  21767.                 integer*4  address
  21768.                 integer*4  length
  21769.                 integer*2  selector
  21770.               end structure
  21771.               record/buffstrc/buffer
  21772.               integer*2    handle   [value]
  21773.               integer*2    viogetphysbuf
  21774.           end
  21775.  
  21776.           interface to subroutine setpoint[alias:'setpoint2'] (abc)
  21777.             integer*4   abc  [value]
  21778.           end
  21779.  
  21780.           subroutine setpoint2 (abc)
  21781.              integer*2   abc(*),n
  21782.  
  21783.              do 100,n=1,2000
  21784.              abc(n)=ior(abc(n),#8000)
  21785.  100         continue
  21786.  
  21787.           end
  21788.  
  21789.           program graphtest
  21790.  
  21791.              structure/buffstrc/
  21792.                 integer*4  address
  21793.                 integer*4  length
  21794.                 integer*2  selector
  21795.              end structure
  21796.              record/buffstrc/buffer
  21797.  
  21798.              integer*2      error,viogetphysbuf
  21799.              integer*4      ptr
  21800.  
  21801.              buffer.address = #0b8000
  21802.              buffer.length  = 4000
  21803.  
  21804.              error=viogetphysbuf (buffer,0)
  21805.  
  21806.              ptr=isha(buffer.selector,16)
  21807.              write (*,'(z10,i3)') ptr,error
  21808.              call setpoint (ptr)
  21809.           end
  21810.  
  21811.  
  21812.  567. Entry Point and F1001 in omf_ms.c, Line 1093
  21813.  
  21814.  Product Version(s): 4.10   | 5.00
  21815.  Operating System:   MS-DOS | OS/2
  21816.  Flags: ENDUSER | buglist4.10 buglist5.00
  21817.  Last Modified:  2-MAR-1990    ArticleIdent: Q51608
  21818.  
  21819.  Microsoft FORTRAN Versions 4.10 and 5.00 may produce the following
  21820.  fatal error under DOS or a protection violation under OS/2 if an
  21821.  executable statement contains a variable that is later used as a
  21822.  formal parameter in an ENTRY statement:
  21823.  
  21824.     F1001 : Internal Compiler Error
  21825.     (compiler file '@(#)omf_ms.c:1.118',line 1093)
  21826.  
  21827.  This programming practice is not allowed in FORTRAN. The
  21828.  fourth paragraph on Page 163 of the "Microsoft FORTRAN Reference"
  21829.  manual for Version 5.00 states the following:
  21830.  
  21831.     A formal argument cannot appear in an executable statement that
  21832.     occurs before the ENTRY statement containing the formal argument
  21833.     unless the formal argument also appears in a FUNCTION, SUBROUTINE,
  21834.     or ENTRY statement that precedes the executable statement.
  21835.  
  21836.  The next to last paragraph on Page 208 of the "Microsoft FORTRAN 4.1
  21837.  Optimizing Compiler: Language Reference" manual contains similar
  21838.  information.
  21839.  
  21840.  The following code produces the above mentioned error:
  21841.  
  21842.        a = 100.0
  21843.        call setpt (a)
  21844.        call frstc
  21845.        stop
  21846.        end
  21847.  
  21848.        subroutine frstc
  21849.        write(*,*) b     !b in an executable statement
  21850.        return
  21851.        entry setpt (b)  !b as formal parameter (for first time)
  21852.        return
  21853.        end
  21854.  
  21855.  If "b" is declared as a formal parameter for subroutine frstc, the
  21856.  program compiles with no errors.
  21857.  
  21858.  
  21859.  568. Mixed-Language Example: Accessing FORTRAN Common from C
  21860.  
  21861.  Product Version(s): 5.00    | 5.00
  21862.  Operating System:   MS-DOS  | OS/2
  21863.  Flags: ENDUSER | S_C S_QUICKC
  21864.  Last Modified:  2-MAR-1990    ArticleIdent: Q51614
  21865.  
  21866.  The following example demonstrates how to access a FORTRAN common
  21867.  block from a C function. The common block is declared in FORTRAN as a
  21868.  common block and in C as an external structure with a FORTRAN
  21869.  attribute. The common block can be referenced from both languages with
  21870.  these embedded language constructs. This program must be compiled for
  21871.  medium or large model. For more information on common blocks, see Page
  21872.  110 in the "Microsoft FORTRAN Advanced Topics" manual for FORTRAN
  21873.  5.00, or Page 132 in the mixed-language programming guide that is
  21874.  included with C 5.10, Pascal 4.00, and MASM 5.10.
  21875.  
  21876.  ------------------------COMMON.FOR-----------------------------
  21877.  C FORTRAN calling C, program used to show how to utilize common
  21878.  C blocks in a mixed-language application. This is the FORTRAN
  21879.  C main module that will declare the common block and call the C
  21880.  C procedure to modify the contents. After, it will display the
  21881.  C new common block values.
  21882.  C
  21883.  C The following shared common block is called "cblock".
  21884.  
  21885.        integer*4 I
  21886.        real R
  21887.        character*1 Ch
  21888.        common/cblock/ I,R,Ch
  21889.  C
  21890.  C The following FORTRAN code will display the contents of "cblock"
  21891.  C before and after the call to the C function.
  21892.  C
  21893.        I=10
  21894.        R=2.0
  21895.        Ch='d'
  21896.        Write(*,10) I,R,Ch
  21897.        call cproc
  21898.        Write(*,10) I,R,Ch
  21899.   10   format(1x,I3,1x,F7.2,1x,A)
  21900.        end
  21901.  ------------------------CBLOCK.C-------------------------------
  21902.  /*
  21903.    The C code declares a structure to look like a FORTRAN common
  21904.    block. This structure is declared extern with the FORTRAN
  21905.    attribute. Any common block can be declared the same way. The
  21906.    C function "cproc" simply assigns values to the elements in the
  21907.    common block (C structure).
  21908.   */
  21909.  
  21910.  struct mystruct { long i;
  21911.                    float f;
  21912.                    char c; };
  21913.  
  21914.  extern struct mystruct  cblock;
  21915.  
  21916.  void fortran cproc(void)
  21917.  {
  21918.    cblock.i = 100;
  21919.    cblock.f = 100.00;
  21920.    cblock.c = 'A';
  21921.  }
  21922.  ------------------------COMMON.MAK----------------------------
  21923.  # This make file will build the executable program COMMON.EXE.
  21924.  # The program is compiled for large or medium memory model and it
  21925.  # will include CodeView information. It is linked with no default
  21926.  # libraries and no extended dictionary search. This MAKE file can
  21927.  # be executed by typing:
  21928.  #
  21929.  #        MAKE common.mak
  21930.  # or
  21931.  #        NMAKE -f common.mak
  21932.  
  21933.  MODEL=L
  21934.  
  21935.  # The following line can be deleted if using MAKE.
  21936.  ALL : common.exe
  21937.  
  21938.  common.obj : common.for
  21939.    fl /Zi /A$(MODEL) /c $**
  21940.  
  21941.  cblock.obj : cblock.c
  21942.    cl /Zi /A$(MODEL) /c $**
  21943.  
  21944.  common.exe : common.obj cblock.obj
  21945.    link $** /nod /noe,,,$(MODEL)libfer.lib $(MODEL)libcer.lib;
  21946.  
  21947.  
  21948.  569. MODE='WRITE' Does Not Work with ACCESS='APPEND'
  21949.  
  21950.  Product Version(s): 5.00   | 5.00
  21951.  Operating System:   MS-DOS | OS/2
  21952.  Flags: ENDUSER | buglist5.00
  21953.  Last Modified:  2-MAR-1990    ArticleIdent: Q51749
  21954.  
  21955.  ACCESS='APPEND' does not work correctly if MODE='WRITE' is also
  21956.  included as one of the options in an OPEN statement. Under MS-DOS,
  21957.  instead of appending to a file, the file to be appended to is either
  21958.  partly or completely overwritten. Under OS/2, the following run-time
  21959.  error may be incorrectly generated:
  21960.  
  21961.     F6421:WRITE(test.dat) - file read-only or locked against writing
  21962.  
  21963.  Code Sample #1 -- Create TEST.DAT File
  21964.  --------------------------------------
  21965.  
  21966.  The following code creates a file TEST.DAT:
  21967.  
  21968.             integer a,b,c
  21969.             open (12,file='test.dat',status='new',mode='write')
  21970.             a = 10
  21971.             b = 20
  21972.             c = 30
  21973.             write (12,*) a,b,c
  21974.             end
  21975.  
  21976.  Code Sample #2 -- Append to TEST.DAT Fails
  21977.  ------------------------------------------
  21978.  
  21979.  The following code is supposed to append to TEST.DAT. However, the
  21980.  file is overwritten under MS-DOS, and the following run-time error is
  21981.  generated under OS/2:
  21982.  
  21983.     F6421:WRITE(test.dat) - file read-only or locked against writing
  21984.  
  21985.          integer a,b,c
  21986.          open (11,file= 'test.dat',access='append',
  21987.       +       mode='write')
  21988.          a = 1
  21989.          b = 2
  21990.          c = 3
  21991.          write (11,*) a,b,c
  21992.          end
  21993.  
  21994.  Code Sample #3 -- Append Works If MODE='WRITE' Is Removed
  21995.  ---------------------------------------------------------
  21996.  
  21997.  When MODE='WRITE' is removed, TEST.DAT is appended to properly, i.e.,
  21998.  the following code runs correctly:
  21999.  
  22000.          integer a,b,c
  22001.          open (11,file = 'test.dat',access='append')
  22002.          a = 1
  22003.          b = 2
  22004.          c = 3
  22005.          write (11,*) a,b,c
  22006.          end
  22007.  
  22008.  
  22009.  570. Dollar Sign in FORMAT Statement Equivalent to Backslash
  22010.  
  22011.  Product Version(s): 5.00   | 5.00
  22012.  Operating System:   MS-DOS | OS/2
  22013.  Flags: ENDUSER | docerr undocumented VAX extension
  22014.  Last Modified:  2-MAR-1990    ArticleIdent: Q51750
  22015.  
  22016.  A dollar sign ($) can be used in a FORMAT statement to suppress the
  22017.  carriage-control character. It functions the same as the backslash
  22018.  edit descriptor (\). It is used for formatted I/O to terminal devices,
  22019.  such as the screen or a printer. It is ignored in all other
  22020.  situations.
  22021.  
  22022.  Backslash editing is described on Page 84 of the "Microsoft FORTRAN
  22023.  Reference" manual for Version 5.00.
  22024.  
  22025.  
  22026.  571. PC Kwik RAM Disk May Cause Internal Compiler Errors
  22027.  
  22028.  Product Version(s): 5.00
  22029.  Operating System:   MS-DOS
  22030.  Flags: ENDUSER | F1001
  22031.  Last Modified:  2-MAR-1990    ArticleIdent: Q57303
  22032.  
  22033.  The PC Kwik RAM disk software shipped with the Dell System Enhancement
  22034.  package for DOS Version 4.00 may cause spurious internal compiler
  22035.  errors when compiling with the Microsoft FORTRAN Compiler Version
  22036.  5.00.
  22037.  
  22038.  This problem was reported by a customer whose TMP environment variable
  22039.  pointed to the RAM disk.  Pointing the TMP variable to the hard disk
  22040.  corrected the problem.
  22041.  
  22042.  
  22043.  572. Statement Function Changes from FORTRAN 3.x to 4.x and 5.00
  22044.  
  22045.  Product Version(s): 3.x 4.00 4.01 5.00 | 4.10 5.00
  22046.  Operating System:   MS-DOS             | OS/2
  22047.  Flags: ENDUSER | softlib STATFUNC.ARC
  22048.  Last Modified:  2-MAR-1990    ArticleIdent: Q57551
  22049.  
  22050.  The statement function defines a function in a single statement.
  22051.  
  22052.  There was a change in the internal operation of the statement function
  22053.  between Versions 3.x of FORTRAN and Versions 4.x and 5.00.
  22054.  
  22055.  In Versions 3.x, the code for the function generated by the statement
  22056.  function is generated once, and each use of the function generates a
  22057.  call to that code.
  22058.  
  22059.  In Versions 4.x and later, the code is inserted each time the function
  22060.  is called. This will increase code size, but cause faster operation.
  22061.  
  22062.  There is a file in the Software Library named STATFUNC that shows
  22063.  examples of the statement function in FORTRAN for Versions 3.31 and
  22064.  5.00. STATFUNC can be found in the Software/Data Library by searching
  22065.  on the keyword STATFUNC, the Q number of this article, or S21507.
  22066.  STATFUNC was archived using the PKware file-compression utility.
  22067.  
  22068.  
  22069.  573. MOVETO_W INTERFACE Statement Documentation Error
  22070.  
  22071.  Product Version(s): 5.00   | 5.00
  22072.  Operating System:   MS-DOS | OS/2
  22073.  Flags: ENDUSER | docerr moveto graphics
  22074.  Last Modified:  2-MAR-1990    ArticleIdent: Q57570
  22075.  
  22076.  There is a documentation error on Page 230 of the "Microsoft FORTRAN
  22077.  Advanced Topics" manual for Version 5.00.
  22078.  
  22079.  The INTERFACE statement to subroutine MOVETO_W specifies that the
  22080.  first two parameters passed to subroutine MOVETO_W should be of type
  22081.  INTEGER*2. This is incorrect, they should be of type DOUBLE PRECISION.
  22082.  
  22083.  The INTERFACE statement in the include file FGRAPH.FI is correct.
  22084.  
  22085.  The correct INTERFACE statement reads as follows:
  22086.  
  22087.         INTERFACE TO SUBROUTINE
  22088.        +moveto_w[FAR,C,ALIAS:"__f_moveto_w"](wx,wy,s)
  22089.         DOUBLE PRECISION wx,wy     !manual incorrect here
  22090.         STRUCTURE/wxycoord/
  22091.          DOUBLE PRECISION wx
  22092.          DOUBLE PRECISION wy
  22093.         END STRUCTURE
  22094.         RECORD/wxycoord/s[FAR,REFERENCE]
  22095.         END
  22096.  
  22097.  
  22098.  574. Passing Variables with the SYSTEM Call
  22099.  
  22100.  Product Version(s): 4.10 5.00 | 4.10 5.00
  22101.  Operating System:   MS-DOS    | OS/2
  22102.  Flags: ENDUSER |
  22103.  Last Modified:  2-MAR-1990    ArticleIdent: Q57571
  22104.  
  22105.  The C function, SYSTEM, is available within the FORTRAN Run Time
  22106.  Library. It is possible to pass a variable argument within that
  22107.  function call. The variable can also be a concatenated variable. Below
  22108.  is an example demonstrating this feature.
  22109.  
  22110.  Note: SYSTEM is a C function within the FORTRAN Library. Any
  22111.  limitation or characteristics that are encountered are those of the C
  22112.  convention and not of FORTRAN (for example, null terminated strings).
  22113.  
  22114.  c...This program will demonstrate the use of a concatenated
  22115.  c...variable argument for the SYSTEM function call. It has
  22116.  c...the same effect as typing DIR *.FOR at the DOS prompt.
  22117.  
  22118.  c..Interface statement
  22119.  
  22120.        interface to integer*2 function system[c]
  22121.       +(string[reference])
  22122.        character*1 string
  22123.        end
  22124.  
  22125.  c..Variable set up and function call
  22126.  
  22127.        integer*2 system
  22128.        character*4 foo
  22129.        character*5 bar
  22130.        character*9 all
  22131.        foo='dir'
  22132.        bar='*.for'c   ! c treats this as a null terminated C string
  22133.        all=foo//bar   ! Concatenate the string as 'dir *.for'
  22134.        i=system(all)  ! Pass a variable to SYSTEM
  22135.        end
  22136.  
  22137.  
  22138.  575. Formatted I/O, Carriage Control Characters, and LPT2
  22139.  
  22140.  Product Version(s): 5.00   | 5.00
  22141.  Operating System:   MS-DOS | OS/2
  22142.  Flags: ENDUSER | buglist5.00
  22143.  Last Modified:  2-MAR-1990    ArticleIdent: Q57572
  22144.  
  22145.  The section on "Carriage Control" on Page 78 of the "Microsoft FORTRAN
  22146.  Reference" manual for Version 5.00 states the following:
  22147.  
  22148.     When formatted I/O is used to transfer a record to a terminal
  22149.     device, such as screen or printer, the first character of that
  22150.     record is interpreted as a carriage control character, and is not
  22151.     printed.
  22152.  
  22153.  This is not true for printers connected to LPT2. Thus, the carriage
  22154.  control characters listed on Page 79 of the FORTRAN 5.00 reference
  22155.  manual will not be interpreted properly for the printers connected to
  22156.  LPT2.
  22157.  
  22158.  Microsoft has confirmed this to be a problem in Version 5.00. We are
  22159.  researching this problem and will post new information as it becomes
  22160.  available.
  22161.  
  22162.  The following program is supposed to form feed and then print "5
  22163.  years". However, it does not form feed and it prints "15 years":
  22164.  
  22165.        open (10, file='LPT2', status='OLD')
  22166.        write(10,200)
  22167.  200   format ('15 years')
  22168.        end
  22169.  
  22170.  To work around this problem, either change 'LPT2' to 'LPT1' in the
  22171.  OPEN statement and connect the printer to LPT1, or use the CHAR
  22172.  function to send the carriage control characters to the printer on
  22173.  LPT2. The following code sample demonstrates the second workaround:
  22174.  
  22175.        open (10, file='LPT2', status='OLD')
  22176.        write(10,200) char(12)   ! Form Feed - ASCII 12
  22177.  200   format (a1,'5 years')
  22178.        end
  22179.  
  22180.  
  22181.  576. VAX/VMS FORTRAN Language Features NOT Supported in 4.10/5.00
  22182.  
  22183.  Product Version(s): 4.10 5.00      | 4.10 5.00
  22184.  Operating System:   MS-DOS         | OS/2
  22185.  Flags: ENDUSER | extension
  22186.  Last Modified:  2-MAR-1990    ArticleIdent: Q57592
  22187.  
  22188.  Below is a list of VAX/VMS FORTRAN 77 language features that Microsoft
  22189.  FORTRAN Version 4.10 does not support. Some features that require
  22190.  VAX-specific architecture support (such as keyed access files) are not
  22191.  listed.
  22192.  
  22193.  Those features implemented in Microsoft FORTRAN Version 5.00 are
  22194.  preceded by an asterisk (*).
  22195.  
  22196.     *  IMPLICIT NONE
  22197.        Many intrinsic function names (but no new functionality)
  22198.     *  NAMELIST
  22199.     *  INCLUDE STATEMENT
  22200.     *  End-of-line comments (!)
  22201.        Tabs that are treated like tabs in the source
  22202.        Continuation lines can begin with a tab
  22203.     *  DOUBLE COMPLEX keyword (COMPLEX*16 is supported)
  22204.        BYTE data type
  22205.        REAL *16
  22206.        COMMON block vars can be initialized in DATA statements before
  22207.           COMMON statement
  22208.        Octal and hexadecimal constant notation ('017'O, 'FF'X)
  22209.     *  Records and structures
  22210.        LOGICAL and INTEGER variables are interchangable
  22211.           (the complication here is that .TRUE. is odd, .FALSE. is even
  22212.           on VAX)
  22213.     *  .AND., .OR., .XOR., etc. allow numeric arguments
  22214.        VOLATILE statement
  22215.        Some intrinsic functions are allowed in PARAMETER expressions
  22216.        DO  ...   END DO
  22217.     *  DO WHILE
  22218.        %LOC
  22219.        %REF, %VAL, %DESCR
  22220.        FUNCTION length specifications  (e.g. INTEGER FUNCTION FUN*2)
  22221.        ACCEPT and TYPE statements
  22222.        REWRITE statement
  22223.        Variable format descriptors
  22224.        O, $ edit descriptors
  22225.        OPEN statement keywords:
  22226.           ASSOCIATEVARIABLE
  22227.           DEFAULTFILE
  22228.           DISP[OSE]
  22229.           NAME
  22230.           MAXREC
  22231.           ORGANIZATION
  22232.           READONLY
  22233.           RECORDSIZE  (a synonym for RECL)
  22234.        CLOSE statement DISP[OSE] keyword
  22235.        READ(iunit'irec) syntax for direct access files
  22236.        INQUIRE statement keywords:
  22237.               DEFAULTFILE
  22238.               ORGANIZATION
  22239.     *  OPEN append
  22240.  
  22241.        FORTRAN 66 leftovers:
  22242.               ENCODE, DECODE statement
  22243.               DEFINE FILE
  22244.               FIND
  22245.               Old PARAMETER syntax and semantics
  22246.  
  22247.  
  22248.  577. MAXEXPONENT Function Documentation Error
  22249.  
  22250.  Product Version(s): 5.00   | 5.00
  22251.  Operating System:   MS-DOS | OS/2
  22252.  Flags: ENDUSER | docerr
  22253.  Last Modified:  2-MAR-1990    ArticleIdent: Q57608
  22254.  
  22255.  Page 242 of the "Microsoft FORTRAN Reference" manual for Version 5.00
  22256.  incorrectly states that the return value of the MAXEXPONENT function
  22257.  is 38.
  22258.  
  22259.  The MAXEXPONENT function actually returns 308.
  22260.  
  22261.  
  22262.  578. Conversion Functions from BCD (DECMATH.LIB) to IEEE Formats
  22263.  
  22264.  Product Version(s): 3.20 3.30 3.31 4.10 5.00 | 4.10 5.00
  22265.  Operating System:   MS-DOS                   | OS/2
  22266.  Flags: ENDUSER | softlib BCD2IEEE.ARC
  22267.  Last Modified:  2-MAR-1990    ArticleIdent: Q57871
  22268.  
  22269.  There is a file in the Software/Data Library named BCD2IEEE that
  22270.  includes Microsoft FORTRAN 5.0 source code for conversion between
  22271.  Binary Coded Decimal (BCD) floating-point format (used in FORTRAN Versions
  22272.  3.20, 3.30, and 3.31 DECMATH.LIB) and IEEE floating-point format (used in
  22273.  the Version 4.00, 4.01, 4.10, and 5.00 coprocessor and emulator libraries).
  22274.  
  22275.  BCD2IEEE can be found in the Software/Data Library by searching
  22276.  on the keyword BCD2IEEE, the Q number of this article, or S12521.
  22277.  BCD2IEEE was archived using the PKware file-compression utility.
  22278.  
  22279.  BCD2IEEE includes the following files:
  22280.  
  22281.     File           Description
  22282.     ----           -----------
  22283.  
  22284.     SDECCVT        A FORTRAN function that converts Binary Coded Decimal
  22285.                    floating-point format for single-precision real
  22286.                    numbers to IEEE floating-point format for
  22287.                    single-precision reals
  22288.  
  22289.     SDECTST.FOR    A FORTRAN program to demonstrate the use of SDECCVT
  22290.  
  22291.     DDECCVT        A FORTRAN function that converts Binary Coded Decimal
  22292.                    floating-point format for double-precision reals to
  22293.                    IEEE floating-point format for double-precision
  22294.                    reals
  22295.  
  22296.     DDECTST.FOR    A FORTRAN program to demonstrate the use of DDECCVT
  22297.  
  22298.  
  22299.  579. Handling Floating-Point Exceptions
  22300.  
  22301.  Product Version(s): 3.30 3.31 4.00 4.01 4.10 5.00 | 4.10 5.00
  22302.  Operating System:   MS-DOS                        | OS/2
  22303.  Flags: ENDUSER |
  22304.  Last Modified:  2-MAR-1990    ArticleIdent: Q57918
  22305.  
  22306.  Section 1.5 of the "Microsoft FORTRAN Advanced Topics" manual for the
  22307.  Microsoft FORTRAN Optimizing Compiler Version 5.00 describes how the
  22308.  five exceptions of floating-point arithmetic required by the IEEE
  22309.  standard can be controlled. Similar information is contained in
  22310.  Appendix D of the "Microsoft FORTRAN 4.1 Optimizing Compiler: User's
  22311.  Guide" for Versions 4.x and Appendix F of the "Microsoft FORTRAN
  22312.  User's Guide" for Versions 3.3x.
  22313.  
  22314.  These exceptions are invalid operation, divide by zero, overflow,
  22315.  underflow, and precision. The following three routines, provided in
  22316.  the FORTRAN run-time library, allow you to obtain and set the value of
  22317.  the status and control words:
  22318.  
  22319.     The store-status-word (SSWRQQ) function returns the value of
  22320.     the status word.
  22321.  
  22322.     The store-control-word (SCWRQQ) function returns the value
  22323.     of the control word.
  22324.  
  22325.     The load-control-word (LCWRQQ) function set the control word
  22326.     to a certain value.
  22327.  
  22328.  The following program demonstrates usage of the LCWRQQ function to
  22329.  disable overflow and zero divide run-time errors:
  22330.  
  22331.       INTERFACE TO SUBROUTINE LCWRQQ(CW)
  22332.       INTEGER*2 CW
  22333.       END
  22334.  
  22335.       PROGRAM NOEXCEPTIONS
  22336.  
  22337.       INTEGER*2 CW
  22338.       PARAMETER(CW=16#133F)
  22339.       REAL*4 X,Y,Z
  22340.  
  22341.       X = 1.0
  22342.       Y = 0.0
  22343.  
  22344.       CALL LCWRQQ(CW)
  22345.  
  22346.       Z = X / Y
  22347.  
  22348.       END
  22349.  
  22350.  
  22351.  580. Internal Compiler Error: '@(#)omf.c:1.60', Line 185
  22352.  
  22353.  Product Version(s): 5.00
  22354.  Operating System:   MS-DOS
  22355.  Flags: ENDUSER | buglist5.00
  22356.  Last Modified:  2-MAR-1990    ArticleIdent: Q58322
  22357.  
  22358.  The program below causes the following internal compiler error:
  22359.  
  22360.     fatal error F1001: Internal Compiler Error
  22361.                    (compiler file '@(#)omf.c:1.60', line 185)
  22362.                    Contact Microsoft Technical Support
  22363.  
  22364.  The program defines a common block of arrays that spans three
  22365.  segments. The program then initializes the arrays of the common block
  22366.  to zero. The error is generated because the program is initializing
  22367.  the arrays in a different order than they are specified in the common
  22368.  block.
  22369.  
  22370.  The workaround is to initialize the arrays in the same order that they
  22371.  appear in the common block.
  22372.  
  22373.  Microsoft is currently researching the problem and will post new
  22374.  information as it becomes available.
  22375.  
  22376.  The following program demonstrates the internal compiler error:
  22377.  
  22378.  C ============ FORTRAN SOURCE CODE == Fragment #1 ===============
  22379.  
  22380.        real*8 test1[huge](225,100), test2(300), test3(300)
  22381.  
  22382.        common /test/ test1, test2, test3
  22383.  
  22384.        data test3 /300*0/
  22385.        data test1 /22500*0/
  22386.  
  22387.        end
  22388.  C ===============================================================
  22389.  
  22390.  The workaround is to initialize the arrays in the order they appear in
  22391.  the common block as seen below.
  22392.  
  22393.  C ============ FORTRAN SOURCE CODE == Fragment #2 ===============
  22394.  
  22395.        real*8 test1[huge](225,100), test2(300), test3(300)
  22396.  
  22397.        common /test/ test1, test2, test3
  22398.  
  22399.        data test1 /22500*0/
  22400.        data test3 /300*0/
  22401.  
  22402.        end
  22403.  C ===============================================================
  22404.  
  22405.  
  22406.  581. Strange Characters in MAP File on 27th Segment Name and Above
  22407.  
  22408.  Product Version(s): 5.00   | 5.00
  22409.  Operating System:   MS/DOS | OS/2
  22410.  Flags: ENDUSER | S_LINK buglist5.00
  22411.  Last Modified:  2-MAR-1990    ArticleIdent: Q58394
  22412.  
  22413.  When looking at a MAP file that was compiled with FORTRAN Version 5.00
  22414.  that has more than 26 segments, some strange characters start
  22415.  appearing on the 27th segment name. The characters could be smiley
  22416.  faces, diamonds, or hearts, in addition to the ASCII characters of
  22417.  132d and 128d.
  22418.  
  22419.  Microsoft has confirmed this to be a problem with FORTRAN 5.00 and
  22420.  linker Versions 5.03 and 5.01.20. This problem does not occur if the
  22421.  file was compiled under FORTRAN 4.10. We are researching this problem
  22422.  and will post new information as it becomes available.
  22423.  
  22424.  The following program demonstrates the problem:
  22425.  
  22426.  SOURCE CODE:
  22427.         PROGRAM strange
  22428.         COMMON /dummy/ x(500000) !makes over 26 segments
  22429.         STOP
  22430.         END
  22431.  
  22432.  The above program was compiled with the default options.
  22433.  
  22434.  The above code produces a MAP file upon link, as follows:
  22435.  
  22436.     Start     Length   Name             Code
  22437.     -----     ------   ----             ----
  22438.  
  22439.     0001:0000 00020H   STRANGE_TEXT     CODE
  22440.     0001:0020 02AB1H   _TEXT            CODE
  22441.     0001:2AD2 00000H   C_ETEXT          ENDCODE
  22442.     0002:0000 10000H   DUMMY$A          $DUMMY
  22443.      .    .     .        .                .
  22444.      .    .     .        .                .
  22445.     001B:0000 10000H   DUMMY$Z          $DUMMY
  22446.     001C:0000 10000H   DUMMY$AA###      $DUMMY
  22447.     001D:0000 10000H   DUMMY$AB###      $DUMMY
  22448.     OO1E:0000 10000H   DUMMY$AC###      $DUMMY
  22449.      .    .     .        .     ^^^        .
  22450.                                 |
  22451.     These are the strange-------|
  22452.     characters.
  22453.  
  22454.  The strange characters usually are the ASCII characters of smiley
  22455.  faces, hearts, diamonds, an "a" with two dots over it, and a "c" with
  22456.  a squiggly line under it. These characters represent the ASCII decimal
  22457.  values of 1-4, 128, and 132.
  22458.  
  22459.  
  22460.  582. Registerfonts Function Returns -4 When Out of Memory
  22461.  
  22462.  Product Version(s): 5.00
  22463.  Operating System:   MS-DOS
  22464.  Flags: ENDUSER | docerr S_C S_QuickC _registerfonts
  22465.  Last Modified:  2-MAR-1990    ArticleIdent: Q58430
  22466.  
  22467.  The registerfonts function in the GRAPHICS.LIB graphics library may
  22468.  return a value of -4. This error code will be returned if there is not
  22469.  enough free memory to allocate space for the font(s). This return code
  22470.  should be documented on Page 239 of the "Microsoft FORTRAN Advanced
  22471.  Topics" manual for Version 5.00.
  22472.  
  22473.  Using the /CP:1 switch at link time may free up enough memory to
  22474.  enable registering of the font. The /CP or /CPARMAXALLOC switch limits
  22475.  the number of paragraphs the DOS loader may allocate at run-time.
  22476.  
  22477.  
  22478.  583. L1103 and Initialization of Large Common Blocks
  22479.  
  22480.  Product Version(s): 5.00   | 5.00
  22481.  Operating System:   MS-DOS | OS/2
  22482.  Flags: ENDUSER | buglist5.00
  22483.  Last Modified:  2-MAR-1990    ArticleIdent: Q58431
  22484.  
  22485.  The program below causes the following linker error:
  22486.  
  22487.     fatal error L1103: attempt to access data outside segment bounds
  22488.  
  22489.  The program defines a common block of arrays that span multiple
  22490.  segments. The program then initializes the arrays in the common block.
  22491.  The error is generated because the program is initializing the arrays
  22492.  in a different order than they are specified in the common block.
  22493.  
  22494.  The workaround is to initialize the arrays in the same order that they
  22495.  appear in the common block.
  22496.  
  22497.  Note: It is also possible to generate an internal compiler error by
  22498.  making simple modifications to the source code mentioned above.
  22499.  However, the workaround, is the same: initialize arrays in the order
  22500.  they are defined in the common block. For an example, query on the
  22501.  following in this Knowledge Base:
  22502.  
  22503.     internal and compiler and error and F1001 and line and 185
  22504.  
  22505.  Microsoft is researching this problem and will post new information
  22506.  here as it becomes available.
  22507.  
  22508.  The following program demonstrates the linker error L1103:
  22509.  
  22510.  C ============ FORTRAN SOURCE CODE == Fragment #1 ===============
  22511.  
  22512.        real*8    test1, test2
  22513.  
  22514.        common /test/ test1(1000,10), test2(100)
  22515.  
  22516.        data test2 /100*0/
  22517.        data test1 /10000*0/
  22518.  
  22519.        end
  22520.  C ===============================================================
  22521.  
  22522.  The workaround is to initialize the arrays in the order they appear in
  22523.  the common block, as shown below.
  22524.  
  22525.  C ============ FORTRAN SOURCE CODE == Fragment #2 ===============
  22526.  
  22527.        real*8    test1, test2
  22528.  
  22529.        common /test/ test1(1000,10), test2(100)
  22530.  
  22531.        data test1 /10000*0/
  22532.        data test2 /100*0/
  22533.  
  22534.        end
  22535.  C ===============================================================
  22536.  
  22537.  
  22538.  584. Invalid Filename Causes "SHARE Not Installed" in FORTRAN 5.00
  22539.  
  22540.  Product Version(s): 5.00
  22541.  Operating System:   OS/2
  22542.  Flags: ENDUSER | buglist5.00
  22543.  Last Modified:  2-MAR-1990    ArticleIdent: Q59093
  22544.  
  22545.  Trying to open a file with an invalid file specification incorrectly
  22546.  produces the following error message in OS/2.
  22547.  
  22548.     run-time error F6412: OPEN(filename.ext.)
  22549.      - SHARE not installed
  22550.  
  22551.  In the following example, the trailing period should be removed from
  22552.  the filename specification.
  22553.  
  22554.       OPEN(UNIT=7,FILE='filename.ext.')
  22555.       END
  22556.  
  22557.  Microsoft is researching the problem and will post new information
  22558.  here as it becomes available.
  22559.  
  22560.  
  22561.  585. Character String and PARAMETER Statement
  22562.  
  22563.  Product Version(s): 4.01 4.10 5.00 | 4.10 5.00
  22564.  Operating System:   MS-DOS         | OS/2
  22565.  Flags: ENDUSER |
  22566.  Last Modified:  2-MAR-1990    ArticleIdent: Q59094
  22567.  
  22568.  When using the PARAMETER statement to define a symbolic constant, you
  22569.  can use the symbolic constant to define the length of a CHARACTER
  22570.  string. The following program demonstrates this:
  22571.  
  22572.      PROGRAM FOO
  22573.      parameter (length=80)
  22574.      character string_NAME*(length)
  22575.      end
  22576.  
  22577.  You must put the symbolic constant (LENGTH) in parentheses, or a
  22578.  syntax error will occur.
  22579.  
  22580.  
  22581.  586. PRECISION Intrinsic Function Yields Incorrect Results
  22582.  
  22583.  Product Version(s): 5.00   | 5.00
  22584.  Operating System:   MS-DOS | OS/2
  22585.  Flags: ENDUSER | buglist5.00
  22586.  Last Modified:  2-MAR-1990    ArticleIdent: Q59227
  22587.  
  22588.  The FORTRAN intrinsic function PRECISION, which is documented on Page
  22589.  242 of the "Microsoft FORTRAN Reference" manual for Version 5.00,
  22590.  produces incorrect results when used to find the precision of a REAL
  22591.  number.
  22592.  
  22593.  Microsoft has confirmed this to be a problem with Microsoft FORTRAN
  22594.  Version 5.00. We are researching this problem and will post new
  22595.  information here as it becomes available.
  22596.  
  22597.  The PRECISION function was introduced with FORTRAN 5.00.
  22598.  
  22599.  The following example demonstrates this problem:
  22600.  
  22601.  C ===== FORTRAN source code ================================
  22602.  
  22603.        real*4 var1
  22604.        double precision var2
  22605.  
  22606.        data var1, var2 /0,0/
  22607.  
  22608.        write (*,*) PRECISION (var1)
  22609.        write (*,*) PRECISION (var2)
  22610.  
  22611.        end
  22612.  
  22613.  C ==========================================================
  22614.  
  22615.  The program output is as follows:
  22616.  
  22617.     15
  22618.     15
  22619.  
  22620.  The expected output should be as follows
  22621.  
  22622.      6
  22623.     15
  22624.  
  22625.  (that is, 6 for the real*4 and 15 for the double precision).
  22626.  
  22627.  
  22628.  587. F1912 "Cannot Open File" Caused by Nonexistent File
  22629.  
  22630.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  22631.  Operating System:   MS-DOS              | OS/2
  22632.  Flags: ENDUSER |
  22633.  Last Modified:  2-MAR-1990    ArticleIdent: Q59228
  22634.  
  22635.  The following error usually occurs because the file you are trying to
  22636.  compile does not exist (for example, you typed FL TXXT.FOR instead of
  22637.  FL TEST.FOR) or you are not compiling from the directory in which the
  22638.  file exists:
  22639.  
  22640.     fatal error F1912: (file name) : cannot open file
  22641.  
  22642.  To prevent this error, specify the correct filename or change to the
  22643.  directory in which the file resides, then proceed with compiling.
  22644.  
  22645.  
  22646.  588. "P" Edit Descriptor and Zero Output
  22647.  
  22648.  Product Version(s): 5.00   | 5.00
  22649.  Operating System:   MS-DOS | OS/2
  22650.  Flags: ENDUSER | buglist5.00
  22651.  Last Modified:  2-MAR-1990    ArticleIdent: Q59229
  22652.  
  22653.  The "P" edit descriptor is described on Page 84 of the "Microsoft
  22654.  FORTRAN Reference" manual for Version 5.00.
  22655.  
  22656.  The "P" edit descriptor is a "scale factor" for output. It is useful
  22657.  when printing out percentages.
  22658.  
  22659.  When a ZERO value is printed out, it is inconsistent with the other
  22660.  values, printing an extra zero. There does not seem to be any way
  22661.  around this.
  22662.  
  22663.  Microsoft has confirmed this to be a problem in Version 5.00. We are
  22664.  researching this problem and will post new information here as it
  22665.  becomes available.
  22666.  
  22667.  The following example demonstrates the problem:
  22668.  
  22669.  CC When a zero value printed out, an extra zero is printed.
  22670.        var1 = 0.0000
  22671.        var2 = 0.0123
  22672.        write (*,'(2P,1x,2F10.5)') var1, var2
  22673.        end
  22674.  
  22675.  The following line is the incorrect output from this program:
  22676.  
  22677.     00.00000   1.23000
  22678.  
  22679.  The output of the program should be as follows:
  22680.  
  22681.      0.00000   1.23000
  22682.  
  22683.  
  22684.  589. "Out of Environment" Error After Language Installation
  22685.  
  22686.  Product Version(s): 4.00 4.01 4.10 5.00
  22687.  Operating System:   MS-DOS
  22688.  Flags: ENDUSER | Supercharging MS-DOS O_MSDOS S_C H_MASM S_PASCAL install set
  22689.  Last Modified:  2-MAR-1990    ArticleIdent: Q59230
  22690.  
  22691.  The MS-DOS "out of environment space" error can be caused by an
  22692.  environment that contains the following:
  22693.  
  22694.  1. Many directories in the command path or DOS APPEND command
  22695.  2. Many SET statements
  22696.  3. A large system prompt definition
  22697.  4. Anything else that will fill up the environment
  22698.  
  22699.  For example, this error can occur if several Microsoft languages have
  22700.  been set up on a system and their associated environment variables
  22701.  have been placed in the AUTOEXEC.BAT file.
  22702.  
  22703.  A SHELL statement can be placed in the CONFIG.SYS file to increase the
  22704.  size of the environment and eliminate the error.
  22705.  
  22706.  In MS-DOS Versions 3.20 and later, a typical shell statement is as
  22707.  follows:
  22708.  
  22709.     SHELL=C:\COMMAND.COM /p /e:512
  22710.  
  22711.  The default is 160 bytes. This example sets the environment to 512
  22712.  bytes. The size can be as large as 32768 bytes, but this is not
  22713.  recommended because it wastes memory if the space is not really
  22714.  needed.
  22715.  
  22716.  In MS-DOS Versions 3.00 and 3.10, a typical shell statement is as
  22717.  follows:
  22718.  
  22719.     SHELL=C:\COMMAND.COM /p /e:32
  22720.  
  22721.  The default size is 10 (160 bytes). Size is expressed in multiples of
  22722.  16 bytes. The above example sets the environment to 512 bytes
  22723.  (16 * 32). The size can't be greater than 64 (1024 bytes).
  22724.  
  22725.  
  22726.  590. F6099: INTEGER Overflow Error with Char Function
  22727.  
  22728.  Product Version(s): 5.00   | 5.00
  22729.  Operating System:   MS-DOS | OS/2
  22730.  Flags: ENDUSER | buglist5.00
  22731.  Last Modified:  2-MAR-1990    ArticleIdent: Q59231
  22732.  
  22733.  The "F6099 run-time error - INTEGER overflow" may not be generated
  22734.  correctly when the /4Yb switch is used at compile time on code that
  22735.  contains a write statement and the char intrinsic function, in that
  22736.  order.
  22737.  
  22738.  Microsoft has confirmed this to be a problem in Version 5.00. We are
  22739.  researching this problem and will post new information here as it
  22740.  becomes available.
  22741.  
  22742.  The code below produces the F6099 run-time error when compiled with
  22743.  the /4Yb switch (extended error handling).
  22744.  
  22745.        character*1 jcha
  22746.        ic = 134
  22747.        write (*,*) ic
  22748.        jcha = char(ic - 68)
  22749.        end
  22750.  
  22751.  It gives the same error both in DOS and OS/2. The code compiles and
  22752.  runs without errors on previous versions of Microsoft FORTRAN.
  22753.  
  22754.  If the write statement is commented out, or if 76 is substituted for
  22755.  the expression "ic - 68", no error is produced.
  22756.  
  22757.  If the integer variable, ic, is initialized to a value of 127 or less,
  22758.  the error does not occur. Also, if the character variable, jcha, is
  22759.  typed as character*2 or greater, the error does not occur. Finally,
  22760.  the numeral 68 in the char function can be replaced with any integer
  22761.  greater than 0 and it will still generate the F6099 error at run time.
  22762.  
  22763.  
  22764.  591. Manually Patching the FORTRAN 5.00 8087 Control Word
  22765.  
  22766.  Product Version(s): 5.00
  22767.  Operating System:   MS-DOS
  22768.  Flags: ENDUSER | buglist5.00
  22769.  Last Modified: 27-MAR-1990    ArticleIdent: Q59379
  22770.  
  22771.  Using the Microsoft FORTRAN 5.00 coprocessor or math emulation library
  22772.  on an Intel 8087 math coprocessor (not an 80287 or 80387 coprocessor)
  22773.  may give incorrect results for math operations. The symptoms of this
  22774.  problem are incorrect results, loss of decimal place precision, or
  22775.  unexpected zero results. In some cases the machine may lock or hang at
  22776.  run time. The problem is caused by incorrect initialization of the
  22777.  8087 control word.
  22778.  
  22779.  To properly diagnose the problem, link the program with the emulator
  22780.  library, and set the NO87 environment variable (described on Page 17
  22781.  of the "Microsoft FORTRAN Advanced Topics" Version 5.0 manual). The
  22782.  patch listed below is necessary if the program runs correctly without
  22783.  the coprocessor (using NO87), but does not execute properly when the
  22784.  8087 coprocessor is used. Note: It is also possible, in this case,
  22785.  that the coprocessor is bad or there is another conflict on the
  22786.  machine.
  22787.  
  22788.  The FORTRAN 5.00 8087 Control Word patch is available from Microsoft
  22789.  Product Support Services by calling (206) 454-2030. This patch is for
  22790.  the FORTRAN coprocessor and math emulation libraries and is for use
  22791.  with the 8087 coprocessor, not the 80287 or the 80387.
  22792.  
  22793.  It is also possible to patch the library manually using LIB.EXE
  22794.  and DEBUG.COM. This process is outlined below.
  22795.  
  22796.  The procedure to patch the library first uses the library manager
  22797.  LIB.EXE to extract the module 87EXIST.OBJ. The module is then loaded
  22798.  into DEBUG, which is used to patch 7 bytes in the module. Finally,
  22799.  LIB.EXE is used to put the module back into the FORTRAN library.
  22800.  Familiarity with DEBUG is highly recommended for carrying out this
  22801.  procedure.
  22802.  
  22803.  To patch the FORTRAN 5.00 coprocessor library for use with the 8087,
  22804.  follow these steps:
  22805.  
  22806.  1. Make sure that the DOS directory and FORTRAN BIN directory are
  22807.     listed in the PATH.
  22808.  
  22809.  2. Change to the FORTRAN LIB directory.
  22810.  
  22811.  3. Type the following keystrokes verbatim (substituting the name of
  22812.     the FORTRAN coprocessor or emulator library you are using for
  22813.     LLIBFOR7.LIB below):
  22814.  
  22815.        LIB LLIBFOR7.LIB-*87EXIST; <ENTER>
  22816.  
  22817.        DEBUG 87EXIST.OBJ <ENTER>
  22818.  
  22819.        E 12DD:01E9 B9 1E 00 E2 FE DB E3 <ENTER>
  22820.  
  22821.        W <ENTER>
  22822.  
  22823.        Q <ENTER>
  22824.  
  22825.        LIB LLIBFOR7.LIB+87EXIST; <ENTER>
  22826.  
  22827.  The library is now patched and can be used normally.
  22828.  
  22829.  Notes
  22830.  -----
  22831.  
  22832.  1. If patching the math emulation library, use the library name
  22833.     LLIBFORE.LIB instead of LLIBFOR7.LIB.
  22834.  
  22835.  2. If, during any operation, something goes wrong and control is not
  22836.     returned to the DOS or DEBUG prompt, start over from the beginning.
  22837.     LIB.EXE will make a backup copy of the library when invoked, naming
  22838.     it with the .BAK extension. Simply rename the library to the .LIB
  22839.     extension and start over.
  22840.  
  22841.  3. OS/2 USERS: To be able to invoke DEBUG, you will have to boot to a
  22842.     version of DOS.
  22843.  
  22844.  
  22845.  592. L2029: Unresolved External ___aDBswpchk with GRAPHICS.LIB
  22846.  
  22847.  Product Version(s): 5.00
  22848.  Operating System:   OS/2
  22849.  Flags: ENDUSER | S_LINK
  22850.  Last Modified: 27-MAR-1990    ArticleIdent: Q59421
  22851.  
  22852.  Linking with GRAPHICS.LIB in OS/2 may give the following error
  22853.  message:
  22854.  
  22855.     d:\lib\GRAPHICS.LIB(..\gr\qeswap.asm) : error L2029 :
  22856.       '___aDBswpchk' : unresolved external
  22857.  
  22858.  This is because GRAPHICS.LIB is designed for DOS and is being linked
  22859.  with a protected-mode FORTRAN library, which does not include the
  22860.  external references required by GRAPHICS.LIB.
  22861.  
  22862.  Link with the real-mode library to correct the problem.
  22863.  
  22864.  For example, the following sample programs included with FORTRAN
  22865.  Version 5.00 produce this error if linked under OS/2:
  22866.  
  22867.     MAGNIFY.FOR
  22868.     COLOR.FOR
  22869.     TEXT.FOR
  22870.     ANIMATE.FOR
  22871.     EGA.FOR
  22872.  
  22873.  
  22874.  593. FORTRAN 5.00 Loop Optimization, Subroutine, and Array Problem
  22875.  
  22876.  Product Version(s): 5.00   | 5.00
  22877.  Operating System:   MS-DOS | OS/2
  22878.  Flags: ENDUSER | buglist5.00 bad bogus wrong invalid
  22879.  Last Modified: 27-MAR-1990    ArticleIdent: Q59422
  22880.  
  22881.  In FORTRAN Version 5.00, the loop optimizer does not correctly
  22882.  optimize the subroutine MOVE in the code below, producing incorrect
  22883.  output.
  22884.  
  22885.  /Od or /Odt takes care of the problem.
  22886.  
  22887.  Microsoft has confirmed this to be a problem in Version 5.00. We are
  22888.  researching this problem and will post new information here as it
  22889.  becomes available.
  22890.  
  22891.        integer*2 buf(20)
  22892.        do 10 i=1,10
  22893.  10    buf(i) = 9
  22894.  
  22895.        call move(10,buf(11),buf)
  22896.  
  22897.        write(*,'(10(i8))') (buf(i),i=1,20)
  22898.        end
  22899.  
  22900.        Subroutine move(npts, y1, y2)
  22901.        integer*2 y1(*), y2(*)
  22902.        do 10 i=1,npts
  22903.          y2(i) = y1(i)
  22904.  10    continue
  22905.        return
  22906.        end
  22907.  
  22908.  The following is the correct output:
  22909.  
  22910.      0     0     0     0     0     0     0     0     0     0
  22911.      0     0     0     0     0     0     0     0     0     0
  22912.  
  22913.  The following is the incorrect output:
  22914.  
  22915.      0     0     0     0 21325 21024 28277 21549 28009  8293
  22916.      0     0     0     0     0     0     0     0     0     0
  22917.  
  22918.  
  22919.  594. Using the SYSTEM and SPAWN Functions with FORTRAN
  22920.  
  22921.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  22922.  Operating System:   MS-DOS              | OS/2
  22923.  Flags: ENDUSER | 4.xx
  22924.  Last Modified: 27-MAR-1990    ArticleIdent: Q59602
  22925.  
  22926.  The DEMOEXEC.FOR sample program that is included with the Microsoft
  22927.  FORTRAN Optimizing Compiler demonstrates how to use DOS commands and
  22928.  execute programs from within a FORTRAN program.
  22929.  
  22930.  The SYSTEM command allows a FORTRAN program to execute DOS commands.
  22931.  For instance, a program may clear the screen by using the DOS CLS
  22932.  command.
  22933.  
  22934.  The SPAWN command allows a FORTRAN program to spawn -- or chain -- a
  22935.  program from itself. The FORTRAN program remains in memory while the
  22936.  spawned program is executed. Control is returned to the spawning
  22937.  FORTRAN program when the spawned program completes.
  22938.  
  22939.  For more information on the SYSTEM and SPAWN functions, please refer
  22940.  to the DEMOEXEC.FOR program included with your Microsoft FORTRAN
  22941.  Optimizing Compiler, or to Pages 87-88 in the "Microsoft FORTRAN
  22942.  Advanced Topics" manual for Version 5.00.
  22943.  
  22944.  
  22945.  595. Using Backslashes with the FORTRAN SYSTEM and SPAWN Functions
  22946.  
  22947.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  22948.  Operating System:   MS-DOS              | OS/2
  22949.  Flags: ENDUSER | 4.xx
  22950.  Last Modified: 27-MAR-1990    ArticleIdent: Q59603
  22951.  
  22952.  Care should be taken when using backslash (\) characters in strings
  22953.  passed to the SYSTEM and SPAWN functions. The SYSTEM and SPAWN
  22954.  functions are actually C routines. In C, the backslash character is
  22955.  used to denote an editing descriptor, somewhat similar to the way the
  22956.  I, F, X, etc., editing descriptors are used in the FORTRAN FORMAT
  22957.  statement. The following sample SYSTEM call incorrectly uses the
  22958.  backslash character:
  22959.  
  22960.     I = SYSTEM('dir c:\fortran\src\*.for'C)
  22961.  
  22962.  The C function associated with the FORTRAN SYSTEM function will
  22963.  interpret the backslashes as editing descriptors. In C, if you want to
  22964.  print out a backslash you must follow the first backslash with
  22965.  another; this tells C to temporarily ignore the backslash as an
  22966.  editing descriptor. The following line demonstrates how to properly
  22967.  use the backslash character in the SYSTEM and SPAWN functions:
  22968.  
  22969.     I = SYSTEM('dir c:\\fortran\\src\\*.for'C)
  22970.  
  22971.  For more information on the SYSTEM and SPAWN functions, please refer
  22972.  to the DEMOEXEC.FOR program included with the Microsoft FORTRAN
  22973.  Optimizing Compiler, or Pages 87-88 of the "Microsoft FORTRAN Advanced
  22974.  Topics" manual for Version 5.00.
  22975.  
  22976.  
  22977.  596. Speeding Up the Coprocessor Library with FORTRAN 5.00
  22978.  
  22979.  Product Version(s): 5.00   | 5.00
  22980.  Operating System:   MS-DOS | OS/2
  22981.  Flags: ENDUSER | /FPi87 docerr
  22982.  Last Modified: 18-JUL-1990    ArticleIdent: Q59604
  22983.  
  22984.  Pages 9-10 of the "Microsoft FORTRAN Advanced Topics" version 5.0
  22985.  manual and Page 323 of the "Microsoft FORTRAN Reference" version 5.0
  22986.  manual include Assembly source code that, when assembled and linked
  22987.  with a FORTRAN program and the coprocessor library, is supposed to
  22988.  increase the speed with which coprocessor functions are executed. The
  22989.  code is designed to create true inline coprocessor instructions.
  22990.  
  22991.  However, the code, as it appears on the above pages, contains several
  22992.  errors and will not assemble correctly. Minor changes can be made so
  22993.  that no Assembly or link errors occur, but the code will still not
  22994.  speed up calls to the coprocessor. The following code is a corrected
  22995.  version of the code in the advanced topics and reference manuals.
  22996.  Through informal testing, this corrected code has been found to speed
  22997.  up inline coprocessor code by as much as 2 to 3 percent.
  22998.  
  22999.  Please note that different switches must be used with the following
  23000.  code, depending on whether or not the coprocessor is an 8087.
  23001.  
  23002.       page ,132
  23003.       title     rmfixups
  23004.  ;
  23005.  ;rmfixups.asm -
  23006.  ;
  23007.  ;   Copyright (c) 1988-1990, Microsoft Corporation.
  23008.  ;         All Rights Reserved.
  23009.  ;
  23010.  ;Purpose:
  23011.  ;
  23012.  ;   To remove floating point fixups, create rmfixups.obj with:
  23013.  ;
  23014.  ;      masm -Mx rmfixups.asm,rmfixups.obj;
  23015.  ;
  23016.  ;   Then, link your .OBJs with rmfixups.obj and use the /noe link
  23017.  ;   switch. This .EXE will only run correctly on a machine with an
  23018.  ;   80x87 (or 80486).
  23019.  ;
  23020.  ;
  23021.  ;   To remove floating point fixups and fwait instructions that are
  23022.  ;   only needed with an 8087, create rmfwaits.obj with:
  23023.  ;
  23024.  ;      masm -Mx -DRM_FWAITS rmfixups.asm,rmfwaits.obj;
  23025.  ;
  23026.  ;   Then, link your .OBJs with rmfwaits.obj and use the /noe link
  23027.  ;   switch. This .EXE will only run correctly on a machine with an
  23028.  ;   80287, 80387, or 80486.
  23029.  ;
  23030.  ;*********************************************************************
  23031.  
  23032.  public FIWRQQ,FIERQQ,FIDRQQ,FISRQQ,FJSRQQ,FIARQQ,FJARQQ,FICRQQ,FJCRQQ
  23033.  
  23034.  ifdef  RM_FWAITS
  23035.  
  23036.      bFWAIT  equ     09bh
  23037.      bNOP    equ     090h
  23038.  
  23039.      FIDRQQ  equ     (bNOP - bFWAIT)
  23040.      FIERQQ  equ     (bNOP - bFWAIT)
  23041.      FIWRQQ  equ     0
  23042.  
  23043.      FIARQQ  equ     (bNOP - bFWAIT)
  23044.      FJARQQ  equ     0
  23045.      FISRQQ  equ     (bNOP - bFWAIT)
  23046.      FJSRQQ  equ     0
  23047.      FICRQQ  equ     (bNOP - bFWAIT)
  23048.      FJCRQQ  equ     0
  23049.  
  23050.  else ;not RM_FWAITS
  23051.  
  23052.      FIDRQQ  EQU     0
  23053.      FIERQQ  EQU     0
  23054.      FIWRQQ  EQU     0
  23055.  
  23056.      FIARQQ  EQU     0
  23057.      FJARQQ  EQU     0
  23058.      FISRQQ  EQU     0
  23059.      FJSRQQ  EQU     0
  23060.      FICRQQ  EQU     0
  23061.      FJCRQQ  EQU     0
  23062.  
  23063.  endif     ;not RM_FWAITS
  23064.  
  23065.  extrn     __fpmath:far
  23066.  extrn     __fptaskdata:far
  23067.  extrn     __fpsignal:far
  23068.  
  23069.  CDATA     segment word common 'DATA'
  23070.       dw   0
  23071.       dd   __fpmath
  23072.       dd   __fptaskdata
  23073.       dd   __fpsignal
  23074.  CDATA     ends
  23075.  
  23076.  end
  23077.  
  23078.  
  23079.  597. Multidimensional Array in Common Block Addressing Problem
  23080.  
  23081.  Product Version(s): 5.00   | 5.00
  23082.  Operating System:   MS-DOS | OS/2
  23083.  Flags: ENDUSER | buglist5.00
  23084.  Last Modified: 27-MAR-1990    ArticleIdent: Q59605
  23085.  
  23086.  When accessing multidimensional arrays that are located within a
  23087.  common block, a protection violation may result at run time under
  23088.  OS/2, or incorrect results under MS-DOS.
  23089.  
  23090.  The following code illustrates the problem. At run time, this code
  23091.  generates a protection violation under OS/2:
  23092.  
  23093.        common /cbname/array1(5,5)
  23094.  
  23095.        integer*4 array1,array2(5,5)
  23096.  
  23097.        do 10 j = 1,5
  23098.        array1(i,j)=array1(i,j)+array2(i,j)
  23099.  10    CONTINUE
  23100.        end
  23101.  
  23102.  The above code results in various positions in the array being
  23103.  skipped when run under DOS.
  23104.  
  23105.  Microsoft is researching this problem and will post new information
  23106.  here as it becomes available.
  23107.  
  23108.  
  23109.  598. BLOCK DATA Routine, and FORTRAN and Library Files
  23110.  
  23111.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  23112.  Operating System:   MS-DOS              | OS/2
  23113.  Flags: ENDUSER | S_LINK
  23114.  Last Modified: 27-MAR-1990    ArticleIdent: Q59606
  23115.  
  23116.  BLOCK DATA may not initialize data in common blocks when the block
  23117.  data routine is placed in a library.
  23118.  
  23119.  This is because of the operation of the linker program. The linker
  23120.  program only moves modules from library files into the executable if
  23121.  they are required to resolve external references.
  23122.  
  23123.  If the BLOCK DATA routine is the only thing in a particular module
  23124.  within a library, it will never be called into the executable.
  23125.  
  23126.  A BLOCK DATA routine generates a common block with initialized data.
  23127.  Because a common block is declared in each location it is used, it is
  23128.  not treated as an unresolved external when the linker is linking with
  23129.  other object modules.
  23130.  
  23131.  To make this work properly, make sure that the module the BLOCK DATA
  23132.  routine is located in is loaded by the linker to resolve some other
  23133.  external reference. This can be done by having a piece of executable
  23134.  code in the same module and making sure that it is needed in any
  23135.  program that wants to use the initialized block data.
  23136.  
  23137.  File in Library
  23138.  ---------------
  23139.  
  23140.  C ******** BLOCK DATA statement at beginning of file ***
  23141.  
  23142.        BLOCK DATA foo
  23143.          integer*2   int1
  23144.          real*4      real1
  23145.          character*2 char1
  23146.          logical     log1
  23147.          common /test/ int1, real1, char1, log1
  23148.          data int1, real1, char1, log1 /1,4.0,'ZZ',.true./
  23149.        END
  23150.  
  23151.        subroutine foo2 ! this is here to fulfill unresolved external.
  23152.        end
  23153.  
  23154.  File in Object File
  23155.  -------------------
  23156.  
  23157.  C ******** Beginning of main program *******************
  23158.  
  23159.        PROGRAM block
  23160.  
  23161.        integer*2   int1
  23162.        real*4      real1
  23163.        character*2 char1
  23164.        logical     log1
  23165.  
  23166.        common /test/ int1, real1, char1, log1
  23167.  
  23168.        write (*,100) int1, real1, char1, log1
  23169.  100   format (1X, I1, 3X, F3.1, 3X, A2, 3X, L1)
  23170.        call foo2 ! this causes Unresolved external, requiring load from
  23171.                  ! the Library file.
  23172.  
  23173.        end
  23174.  
  23175.  
  23176.  599. FORTRAN Setup Causes SYS2090 Error
  23177.  
  23178.  Product Version(s): 4.00 4.01 4.10 5.00
  23179.  Operating System:   MS-DOS
  23180.  Flags: ENDUSER |
  23181.  Last Modified: 27-MAR-1990    ArticleIdent: Q59735
  23182.  
  23183.  The system error SYS2090 during FORTRAN setup may be caused by:
  23184.  
  23185.  1. Either of the following:
  23186.  
  23187.     a. Using DOS Version 2.x or a Version 2.x COMMAND.COM with a
  23188.        different version of DOS
  23189.  
  23190.     b. Running bound programs under DOS 2.x (query on "SYS2090" for
  23191.        more information on this situation)
  23192.  
  23193.     Note: DOS 3.00 or later is required for FORTRAN 5.00.
  23194.  
  23195.  2. Interference from TSRs or network software
  23196.  
  23197.  3. A corrupt FORTRAN file
  23198.  
  23199.  
  23200.  600. Opening More Than 20 Files Under OS/2 with FORTRAN 5.00
  23201.  
  23202.  Product Version(s): 5.00
  23203.  Operating System:   OS/2
  23204.  Flags: ENDUSER | limit F6417 too many open files
  23205.  Last Modified: 24-JUL-1990    ArticleIdent: Q60046
  23206.  
  23207.  To increase the maximum number of open files with Microsoft FORTRAN
  23208.  5.00 under OS/2, follow the steps below. This procedure requires the
  23209.  use of Microsoft Macro Assembler Version 5.10 or later.
  23210.  
  23211.  The following information is also found on Pages 405-407 in the
  23212.  "Microsoft FORTRAN Reference" Version 5.0 manual.
  23213.  
  23214.  Note: The file CRT0DAT.ASM must be assembled using the /Dmem_l switch.
  23215.  This is not stated in the manual.
  23216.  
  23217.  1. Edit the file CRT0DAT.ASM found on the Source Code disk in the
  23218.     \STARTUP\OS2 directory.
  23219.  
  23220.     Change the following line
  23221.  
  23222.        _NFILE_=20
  23223.  
  23224.     to the following:
  23225.  
  23226.        _NFILE_=xx (replace xx with the number of files)
  23227.  
  23228.     Delete the comment mark (;) from the following line in CRT0DAT.ASM:
  23229.  
  23230.        ;  extrn DOSSETMAXFH:far
  23231.  
  23232.     You also should delete the comment marks (;) from the following
  23233.     lines in CRT0DAT.ASM:
  23234.  
  23235.        ;  mov ax,_NFILE_
  23236.        ;  push ax
  23237.        ;  call DOSSETMAXFH
  23238.  
  23239.     After you delete the comment marks, the lines should read as
  23240.     follows:
  23241.  
  23242.        mov ax,_NFILE_
  23243.        push ax
  23244.        call DOSSETMAXFH
  23245.  
  23246.  2. Edit the UNIT.ASM file on the Source Code disk in the \STARTUP
  23247.     directory. Change the following line
  23248.  
  23249.        _NFILE_   equ 20
  23250.  
  23251.     to the following:
  23252.  
  23253.        _NFILE_equ xx  (same as in the CRT0DAT.ASM file)
  23254.  
  23255.  3. Assemble (using Microsoft Macro Assembler Version 5.10) the
  23256.     UNIT.ASM and CRT0DAT.ASM files with the following lines [note that
  23257.     in mem_l, the last character is the lowercase letter "l", not the
  23258.     number 1 (one)]:
  23259.  
  23260.        MASM /Dmem_l CRT0DAT.ASM
  23261.  
  23262.        MASM UNIT.ASM
  23263.  
  23264.  4. Link the .OBJ files with the FORTRAN .OBJ file as in the following
  23265.     statement (where FOO.OBJ is your FORTRAN object code):
  23266.  
  23267.        LINK /NOE FOO.OBJ + UNIT.OBJ + CRT0DAT.OBJ;
  23268.  
  23269.  
  23270.  601. Accessing Mixed-Language, External Variables in FORTRAN
  23271.  
  23272.  Product Version(s): 4.10 5.00 | 4.10 5.00
  23273.  Operating System:   MS-DOS    | OS/2
  23274.  Flags: ENDUSER | S_C
  23275.  Last Modified: 30-MAR-1990    ArticleIdent: Q60076
  23276.  
  23277.  The following is a sample C and FORTRAN mixed-language program
  23278.  demonstrating how to access external variables from within Microsoft
  23279.  FORTRAN.
  23280.  
  23281.  FORTRAN Code
  23282.  ------------
  23283.  
  23284.        SUBROUTINE ASSIGN
  23285.        INTEGER*2 X [EXTERN, ALIAS:'_extrn']
  23286.  
  23287.        X = 2
  23288.        END
  23289.  
  23290.  C Code
  23291.  ------
  23292.  
  23293.  #include <stdio.h>
  23294.  
  23295.  extern void fortran assign(void);
  23296.  int extrn;
  23297.  
  23298.  main()
  23299.  {
  23300.      extrn = 5;
  23301.      printf("Before call to FORTRAN:  %d\n",extrn);
  23302.      assign();
  23303.      printf(" After call to FORTRAN:  %d\n",extrn);
  23304.  }
  23305.  
  23306.  To use global variables exported from another language in FORTRAN, the
  23307.  EXTERN attribute must be used. EXTERN tells the FORTRAN compiler that
  23308.  the variable is not local to the FORTRAN subroutine or function.
  23309.  Variables declared EXTERN will instead be resolved by the linker. You
  23310.  can use the ALIAS attribute to assign a different name to the imported
  23311.  variable; in this example, it is required because the underscore
  23312.  prepended by the C compiler is invalid in the FORTRAN naming
  23313.  convention.
  23314.  
  23315.  No modifications should be necessary for the exporting module to allow
  23316.  FORTRAN to import the global variable(s).
  23317.  
  23318.  
  23319.  602. $DEBUG and /4Yb May Increase Executable File Size
  23320.  
  23321.  Product Version(s): 5.00   | 5.00
  23322.  Operating System:   MS-DOS | OS/2
  23323.  Flags: ENDUSER | large big
  23324.  Last Modified: 30-MAR-1990    ArticleIdent: Q60077
  23325.  
  23326.  If an executable file size, or the load size of the executable, seems
  23327.  to be larger with Microsoft FORTRAN Version 5.0 than it was when
  23328.  compiling under a previous version of FORTRAN, it could be due to the
  23329.  use of the $DEBUG metacommand or /4Yb switch.
  23330.  
  23331.  Both /4Yb and $DEBUG include extended error handling information in
  23332.  the .EXE file. Reports from customers and some informal testing show
  23333.  that with FORTRAN 5.00, there may be an executable file size increase
  23334.  of anywhere from 5 to 28 percent when either /4Yb or $DEBUG are used.
  23335.  The load size of the executable also increases at about the same
  23336.  percentage. Also, it seems the larger and more complicated the code,
  23337.  the percentage that the .EXE file increases is higher. Previous
  23338.  versions of FORTRAN (Version 4.00, 4.10, etc.) do not show as large an
  23339.  increase, although the increase may be anywhere from 3 to 19 percent.
  23340.  
  23341.  
  23342.  603. Using the NEAR Attribute with Common Blocks in FORTRAN
  23343.  
  23344.  Product Version(s): 5.00   | 5.00
  23345.  Operating System:   MS-DOS | OS/2
  23346.  Flags: ENDUSER |
  23347.  Last Modified: 30-MAR-1990    ArticleIdent: Q60079
  23348.  
  23349.  On Page 34 of the "Microsoft FORTRAN Advanced Topics" guide is a
  23350.  description of using the NEAR attribute in conjunction with common
  23351.  blocks. In Microsoft FORTRAN, common blocks are by default put in
  23352.  their own segment. This saves space in the default data segment
  23353.  (DGROUP). The drawback to this method is that data in common blocks
  23354.  must be accessed through far pointers; code is therefore larger and
  23355.  slower. Use of the NEAR attribute with small, frequently used common
  23356.  blocks will speed up execution of the program and reduce code size.
  23357.  The only requirement is that there must be space in the default data
  23358.  segment.
  23359.  
  23360.  When using the NEAR attribute with common blocks, the data in each
  23361.  common block may appear to remain in its own segment rather than in
  23362.  DGROUP if a source listing (/Fs) is used. This may be confusing when
  23363.  there is obviously enough space in the default data segment. After
  23364.  examining an object listing (/Fl) or a map listing (/Fm), it becomes
  23365.  clear that the segments containing the NEAR common blocks are
  23366.  concatenated into the default data segment.
  23367.  
  23368.  The following code is a sample program using the NEAR attribute to put
  23369.  common blocks in the default data segment:
  23370.  
  23371.        integer*4 a,b,c
  23372.        common    /c1 [near]/ a,c
  23373.        common    /c2 [near]/ b
  23374.        end
  23375.  
  23376.  The source listing describes each common block:
  23377.  
  23378.     Global Symbols
  23379.     Name                      Class   Type              Size   Offset
  23380.     C1. . . . . . . . . . . . common  ***                  8    0000
  23381.     C2. . . . . . . . . . . . common  ***                  4    0000
  23382.     main. . . . . . . . . . . FSUBRT  ***                ***    0000
  23383.  
  23384.  The map file demonstrates that each common block is included in
  23385.  DGROUP. Note that the segment address of each common block is 005Dh,
  23386.  which is the same as DGROUP. The map file contains the following:
  23387.  
  23388.   Start  Stop   Length Name                   Class
  23389.   00710H 00713H 00004H C2$A                   $C2
  23390.   00720H 00727H 00008H C1$A                   $C1
  23391.  
  23392.   Origin   Group
  23393.   005D:0   DGROUP
  23394.  
  23395.    Address         Publics by Name
  23396.   005D:0130       C1
  23397.   005D:0120       C2
  23398.  
  23399.    Address         Publics by Value
  23400.   005D:0120       C2
  23401.   005D:0130       C1
  23402.  
  23403.  The object listing includes a description of the grouping of all the
  23404.  segments, including the common blocks, into DGROUP:
  23405.  
  23406.       NAME    common
  23407.  
  23408.  C2$A SEGMENT  PARA COMMON '$C2'
  23409.  C2$A ENDS
  23410.  C1$A SEGMENT  PARA COMMON '$C1'
  23411.  C1$A ENDS
  23412.  DGROUP    GROUP     CONST, _BSS, _DATA, C2$A, C1$A
  23413.       ASSUME  CS: COMMON_TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP
  23414.  
  23415.  
  23416.  604. FORTRAN 5.00 .FON Files Identical to Windows .FON Files
  23417.  
  23418.  Product Version(s): 5.00
  23419.  Operating System:   MS-DOS
  23420.  Flags: ENDUSER | docerr
  23421.  Last Modified: 30-MAR-1990    ArticleIdent: Q60097
  23422.  
  23423.  On Page 187 in the "Microsoft FORTRAN Advanced Topics" Version 5.0
  23424.  manual, it states that FORTRAN's .FON font files are identical to the
  23425.  .FNT font files used in Microsoft Windows. This is incorrect.
  23426.  
  23427.  Instead, the manual should read as follows:
  23428.  
  23429.     FORTRAN's .FON files are identical to the .FON files used in the
  23430.     Microsoft Windows operating environment.
  23431.  
  23432.  All four occurrences of ".FNT" on that page should be changed to
  23433.  ".FON."
  23434.  
  23435.  Brief testing shows that the Windows .FON files will work with
  23436.  Microsoft FORTRAN Version 5.00. (Note: Windows Version 2.11 .FON files
  23437.  were used for this test.)
  23438.  
  23439.  
  23440.  605. FORTRAN 5.00 Differences from Previous Versions
  23441.  
  23442.  Product Version(s): 3.20 3.30 3.31 4.00 4.01 4.10 5.00 | 4.10 5.00
  23443.  Operating System:   MS-DOS                             | OS/2
  23444.  Flags: ENDUSER | 3.xx 4.xx 5.xx
  23445.  Last Modified:  2-APR-1990    ArticleIdent: Q60151
  23446.  
  23447.  For information on what has changed in Microsoft FORTRAN as the
  23448.  language has evolved from Version 3.20 to 5.00, see Appendix B (Pages
  23449.  373-400) of the "Microsoft FORTRAN Reference" Version 5.0 manual.
  23450.  
  23451.  Information on changes is ordered as follows:
  23452.  
  23453.  1. Changes from Version 4.10 to 5.00 (Pages 373-377)
  23454.  
  23455.  2. Changes from Version 4.00 to 4.10 (Pages 377-379)
  23456.  
  23457.  3. Changes from Versions 3.20 and 3.30 to 4.00 (Pages 379-388)
  23458.  
  23459.  
  23460.  606. Improper Array Declaration May Cause Computer to Hang
  23461.  
  23462.  Product Version(s): 5.00   | 5.00
  23463.  Operating System:   MS-DOS | OS/2
  23464.  Flags: ENDUSER | buglist5.00
  23465.  Last Modified: 23-MAY-1990    ArticleIdent: Q61530
  23466.  
  23467.  Microsoft FORTRAN permits operations on full arrays that would
  23468.  normally only work with single arguments (scalars); these operations
  23469.  are called array expressions. In cases where an array is declared
  23470.  improperly, an array expression involving that array may cause the
  23471.  computer to hang at run time.
  23472.  
  23473.  The following is a simple program that demonstrates this problem:
  23474.  
  23475.        integer*4 array(4:1)    ! Improper array declaration
  23476.        array = 0               ! Array expression
  23477.        end
  23478.  
  23479.  The problem with this program is that the array indexes are declared
  23480.  in reverse order. The FORTRAN compiler does not generate any error
  23481.  messages, but when run under DOS the program will cause the computer
  23482.  to hang; under OS/2 CTRL+C will terminate the program.
  23483.  
  23484.  Microsoft is currently researching this problem and will post new
  23485.  information here as it becomes available.
  23486.  
  23487.  
  23488.  607. Repeated Edit Descriptors Do Not Work with Implied-DO Loop
  23489.  
  23490.  Product Version(s): 5.00   | 5.00
  23491.  Operating System:   MS-DOS | OS/2
  23492.  Flags: ENDUSER | buglist5.00
  23493.  Last Modified:  8-JUN-1990    ArticleIdent: Q61533
  23494.  
  23495.  Repeated edit descriptors in FORMAT statements used with implied-DO
  23496.  loops do not work properly. In this case, Microsoft FORTRAN version
  23497.  5.00 does not reset the FORMAT statement properly. On the second cycle
  23498.  through the FORMAT statement, the variables to be output have no edit
  23499.  descriptors associated with them; thus, a run-time error F6207 will
  23500.  result.
  23501.  
  23502.  The following program demonstrates the problem:
  23503.  
  23504.        integer*2 j
  23505.        real*4   x(4),y(4)
  23506.  
  23507.        write (*,10) (j,x(j),y(j),j=1,4)
  23508.   10   format (2x,i2,2(2x,f6.1))
  23509.  
  23510.  C  No errors are generated if the following line is used in place of
  23511.  C  the above FORMAT statement
  23512.  C 10  format (2x,i2,2x,f6.1,2x,f6.1)
  23513.        end
  23514.  
  23515.  The output is as follows:
  23516.  
  23517.    1      .0      .0
  23518.  run-time error F6207: WRITE(CON)
  23519.  - I edit descriptor expected for INTEGER
  23520.  
  23521.  The output should be the following:
  23522.  
  23523.    1      .0      .0
  23524.    2      .0      .0
  23525.    3      .0      .0
  23526.    4      .0      .0
  23527.  
  23528.  Microsoft is currently researching this problem and will post new
  23529.  information here as it becomes available.
  23530.  
  23531.  
  23532.  608. L2029 and L2025 with Pascal 4.00 and FORTRAN 4.10 or 5.00
  23533.  
  23534.  Product Version(s): 4.10 5.00 | 4.10 5.00
  23535.  Operating System:   MS-DOS    | OS/2
  23536.  Flags: ENDUSER | buglist4.10 buglist5.00 S_PASCAL S_LINK
  23537.  Last Modified: 23-MAY-1990    ArticleIdent: Q61536
  23538.  
  23539.  When using real numbers and mathematical calculations between
  23540.  Microsoft Pascal version 4.00 and Microsoft FORTRAN version 4.10 or
  23541.  5.00, the following error messages may be generated, depending on the
  23542.  order of the libraries at link time:
  23543.  
  23544.     error L2029: Unresolved externals
  23545.  
  23546.     error L2025: symbol defined more than once
  23547.  
  23548.  The code should link without errors if the FORTRAN library is placed
  23549.  first on the link line.
  23550.  
  23551.  With FORTRAN 4.00 or 4.01, the code functions correctly.
  23552.  
  23553.  Microsoft is currently researching this problem and will post new
  23554.  information here as it becomes available.
  23555.  
  23556.  The following code generates the linker error messages listed below:
  23557.  
  23558.  PMIX.PAS
  23559.  --------
  23560.  
  23561.  program pmix(input,output);
  23562.  
  23563.  procedure fort(vars xold, xdata: real); extern;
  23564.  
  23565.  var xdata, xold: real;
  23566.  begin
  23567.    xold:=1.0;
  23568.    fort(xold, xdata);
  23569.    writeln('xdata = ',xdata);
  23570.  end.
  23571.  
  23572.  FMIX.FOR
  23573.  --------
  23574.  
  23575.        subroutine fort(xold,xdata)
  23576.        real xold, xdata
  23577.        integer*4 idec
  23578.        idec=3
  23579.        xdata=xold/10.**idec
  23580.        return
  23581.        end
  23582.  
  23583.  With the FORTRAN library first:
  23584.  
  23585.     link pmix fmix /nod /noe,,,llibfer libpaser;
  23586.  
  23587.     LINK : error L2029: Unresolved externals:
  23588.  
  23589.     __positive in file(s):
  23590.      LLIBFER.LIB(\mrt\c\fltused.ASM)
  23591.     __cftoe in file(s):
  23592.      LLIBFER.LIB(\mrt\c\fltused.ASM)
  23593.     __cftof in file(s):
  23594.      LLIBFER.LIB(\mrt\c\fltused.ASM)
  23595.     __cftog in file(s):
  23596.      LLIBFER.LIB(\mrt\c\fltused.ASM)
  23597.     __cropzeros in file(s):
  23598.      LLIBFER.LIB(\mrt\c\fltused.ASM)
  23599.     __cfltcvt in file(s):
  23600.      LLIBFER.LIB(\mrt\c\fltused.ASM)
  23601.     __forcdecpt in file(s):
  23602.      LLIBFER.LIB(\mrt\c\fltused.ASM)
  23603.     __fassign in file(s):
  23604.      LLIBFER.LIB(\mrt\c\fltused.ASM)
  23605.  
  23606.     There were 8 errors detected
  23607.  
  23608.  With the Pascal library first:
  23609.  
  23610.     link pmix fmix /nod /noe,,,libpaser llibfer;
  23611.  
  23612.     LLIBFER.LIB(dos\crt0.asm) : error L2025: __aexit_rtn :
  23613.     symbol defined more than once
  23614.      pos: 2B6F5 Record type: 7F04
  23615.     LLIBFER.LIB(dos\crt0.asm) : error L2025: __abrkp : symbol
  23616.     defined more than once
  23617.      pos: 2B72C Record type: 7F04
  23618.     LLIBFER.LIB(dos\crt0.asm) : error L2025: __abrktb : symbol
  23619.     defined more than once
  23620.      pos: 2B738 Record type: 7F04
  23621.     LLIBFER.LIB(dos\crt0.asm) : error L2025: __asizds : symbol
  23622.     defined more than once
  23623.      pos: 2B744 Record type: 7F04
  23624.     LLIBFER.LIB(dos\crt0.asm) : error L2025: __astart : symbol
  23625.     defined more than once
  23626.      pos: 2B756 Record type: 7F04
  23627.     LLIBFER.LIB(dos\crt0.asm) : error L2025: __atopsp : symbol
  23628.     defined more than once
  23629.      pos: 2B768 Record type: 7F04
  23630.     LLIBFER.LIB(dos\crt0.asm) : error L2025: __abrktbe : symbol
  23631.     defined more than once
  23632.      pos: 2B775 Record type: 7F04
  23633.     LLIBFER.LIB(dos\crt0.asm) : error L2025: __cintDIV : symbol
  23634.     defined more than once
  23635.      pos: 2B788 Record type: 7F04
  23636.     LLIBFER.LIB(dos\crt0.asm) : error L2025: __amsg_exit :
  23637.     symbol defined more than once
  23638.      pos: 2B7E4 Record type: 7F04
  23639.  
  23640.     There were 9 errors detected
  23641.  
  23642.  With FORTRAN 4.00 or 4.01, the above code generates the following
  23643.  error message at link time, but it creates an executable and seems to
  23644.  function correctly if the Pascal library is placed first at link time:
  23645.  
  23646.  LLIBFORE(dbgmsg) : error L2025 : __FF_MSGBANNER : symbol defined more
  23647.  than once
  23648.  
  23649.  The above symbol can be removed from the FORTRAN library to eliminate
  23650.  the error message.
  23651.  
  23652.  
  23653.  609. Error in Example on Page 39 of 5.0 Reference Guide
  23654.  
  23655.  Product Version(s): 5.00   | 5.00
  23656.  Operating System:   MS-DOS | OS/2
  23657.  Flags: ENDUSER | docerr
  23658.  Last Modified: 23-MAY-1990    ArticleIdent: Q61778
  23659.  
  23660.  The example code on Page 39 of the "Microsoft FORTRAN Quick Reference
  23661.  Guide" for Microsoft FORTRAN version 5.0 is incorrect. The second
  23662.  example of logical expressions is not equivalent as the manual states.
  23663.  
  23664.  The text in the manual reads as follows:
  23665.  
  23666.     C  The following two statements are equivalent:
  23667.  
  23668.        go =  .NOT. a  .OR. b  .AND. c
  23669.        go =  ((.NOT. a) .OR. b) .AND. c
  23670.  
  23671.  These statements are not equivalent. One possible equivalent
  23672.  combination would be as follows:
  23673.  
  23674.     go = .NOT. a  .OR. b  .AND. c
  23675.     go = (.NOT. a) .OR. (b .AND. c)
  23676.  
  23677.  
  23678.  610. Line-Continuation Error in the $FREEFORM Sample Program
  23679.  
  23680.  Product Version(s): 5.00   | 5.00
  23681.  Operating System:   MS-DOS | OS/2
  23682.  Flags: ENDUSER | docerr
  23683.  Last Modified: 23-MAY-1990    ArticleIdent: Q61789
  23684.  
  23685.  There is a documentation error on Page 296 of the "Microsoft FORTRAN
  23686.  Reference" for version 5.0 in the sample program under the $FREEFORM
  23687.  metacommand. The error is on the 300 FORMAT... line, which is the
  23688.  second to the last line in the sample program.
  23689.  
  23690.  The $FREEFORM metacommand states that if the last nonblank or
  23691.  noncomment character of a line is a minus (-) sign, it is interpreted
  23692.  as a line continuation and discarded. However, the sample program uses
  23693.  the conventional character in column 6 for the line continuation and
  23694.  does not have the minus (-) sign to indicate a line continuation.
  23695.  
  23696.  When using the $FREEFORM metacommand, you must use the minus (-) sign
  23697.  to indicate a line continuation.
  23698.  
  23699.  If you compile the sample program, it causes the following errors:
  23700.  
  23701.     freeform.for(32) : warning F4988: unexpected end of format
  23702.     freeform.for(33) : error F2115: syntax error
  23703.  
  23704.  The following is the corrected example:
  23705.  
  23706.  $FREEFORM
  23707.  
  23708.  "The sine of the number x is calculated using a power
  23709.  series.
  23710.  "Successive terms are calculated until one is less than epsi.
  23711.  
  23712.      REAL x, epsi, z, sine, next
  23713.      INTEGER i
  23714.      epsi = 0.0001
  23715.  
  23716.      WRITE (*,100)
  23717.  
  23718.  100 FORMAT ( 1X, 'ENTER x: ' \ )
  23719.  
  23720.      READ (*,'(F10.5)') x
  23721.  
  23722.      z = AMOD( x, 6.2831853 )
  23723.      sine = z
  23724.      i = 4
  23725.      next = -z * z * z / 6.0
  23726.  
  23727.  200 IF ( ABS( next ) .GE. epsi ) THEN
  23728.  
  23729.       sine = sine + next
  23730.       next = -next * z * z / (i * (i + 1))
  23731.       i = i + 2
  23732.       GOTO 200
  23733.  
  23734.      END IF
  23735.  
  23736.      WRITE (*,300) x, sine
  23737.  
  23738.  300 FORMAT ( 1X, 'THE SINE OF ',F10.5, - ! This is the correct
  23739.            ' = ',F12.10 )                 ! line continuation
  23740.                                           ! for $FREEFORM
  23741.  
  23742.  END
  23743.  
  23744.  
  23745.  611. SETFILLMASK Graphics Routine and Integer Range Error F2367
  23746.  
  23747.  Product Version(s): 5.00
  23748.  Operating System:   MS-DOS
  23749.  Flags: ENDUSER | sine fill
  23750.  Last Modified:  9-JUL-1990    ArticleIdent: Q62476
  23751.  
  23752.  If you use the SETFILLMASK graphics routine in Microsoft FORTRAN, you
  23753.  shouldn't use the $DEBUG metacommand in the source code or compile
  23754.  using the /4Yb compiler switch. The array used by the routine is
  23755.  declared as INTEGER*1 and if you have any values greater than 127 in
  23756.  the array, it produces an "F2367 Integer range error" at compile time.
  23757.  
  23758.  The SINE.FOR and FILL.FOR sample programs which are included on the
  23759.  Source Code Disk in the Samples subdirectory will produce the above
  23760.  error when either /4Yb or $DEBUG are used.
  23761.  
  23762.  SETFILLMASK uses an 8 x 8 bit array for the fill-mask design. The
  23763.  array must be initialized as INTEGER*1, which has a range of -128 to
  23764.  127. The values of the bit array must be able to range from 0 to 255
  23765.  in decimal and 00000000 to 11111111 in binary to get every combination
  23766.  of fill patterns. This, however, can exceed the range of the INTEGER*1
  23767.  array.
  23768.  
  23769.  Without using the debug options, the program compiles and works
  23770.  correctly, but if you add one of the above debug options and have a
  23771.  value in the mask array that is larger that 127, you receive the
  23772.  following compiler error:
  23773.  
  23774.     name.for(23) : error F2367: value 129 : INTEGER : range error
  23775.  
  23776.  The debug option performs range checking of variables. For example, if
  23777.  an INTEGER*1 variable exceeds 127 the compiler produces an error.
  23778.  
  23779.  If you compile the following example with the /4Yb compiler switch, the
  23780.  following errors are produced:
  23781.  
  23782.     fill.for
  23783.     fill.for(23) : error F2367: value 129 : INTEGER : range error
  23784.     fill.for(23) : error F2367: value 145 : INTEGER : range error
  23785.  
  23786.  The following is an example using the SETFILLMASK graphics routine:
  23787.  
  23788.  C Won't compile with $DEBUG metacommand or with the /4Yb
  23789.  C compiler switch because of the two elements in the array
  23790.  C mask that are larger than 127.
  23791.  
  23792.        INCLUDE 'FGRAPH.FI'
  23793.        INCLUDE 'FGRAPH.FD'
  23794.  
  23795.        INTEGER*2 dummy_2    ! Variables for Function Return
  23796.        INTEGER*4 dummy_4    !    Values
  23797.  
  23798.        INTEGER*1 mask(8)    ! Integer*1 has range of -128 to 127
  23799.                             !    Largest mask value can be
  23800.                             !    11111111b or 255d
  23801.  
  23802.  C               Binary      Decimal
  23803.  C              --------     -------
  23804.        DATA mask / 2# 00000000 ,   !  0d
  23805.       +            2# 00111100 ,   !  60d
  23806.       +            2# 01000010 ,   !  66d
  23807.       +            2# 10000001 ,   !  129d ! Error with /4Yb
  23808.       +            2# 10010001 ,   !  145d ! Error with /$Yb
  23809.       +            2# 01001010 ,   !  74d
  23810.       +            2# 00111100 ,   !  60d
  23811.       +            2# 00000011  /  !  3d
  23812.  
  23813.        dummy_2 = setvideomode( $VRES16COLOR )  ! Set 16 Color VGA Mode
  23814.        dummy_4 = setbkcolor( $BLUE )     !BLUE ! Set Background Color
  23815.  
  23816.        CALL clearscreen( $GCLEARSCREEN )
  23817.  
  23818.        dummy_2 = setcolor( 15 )          !WHITE
  23819.  
  23820.        CALL setfillmask(mask)
  23821.  
  23822.        dummy_s = rectangle( $GBORDER, 100,100,500,300 ) ! Border
  23823.  
  23824.        dummy_2 = rectangle( $GFILLINTERIOR, 100,100,500,300 ) ! Fill
  23825.                                                               ! with
  23826.        PAUSE                                                  ! Mask
  23827.  
  23828.        dummy_2 = setvideomode( $DEFAULTMODE )  ! Reset Video Mode
  23829.  
  23830.        END
  23831.  
  23832.  
  23833.  612. GetTextWindow Not Listed in Include Files and Does Not Work
  23834.  
  23835.  Product Version(s): 5.00   | 5.00
  23836.  Operating System:   MS-DOS | OS/2
  23837.  Flags: ENDUSER | buglist5.00
  23838.  Last Modified:  6-JUN-1990    ArticleIdent: Q62484
  23839.  
  23840.  The GetTextWindow subroutine listed in the "Additional Graphics
  23841.  Routines" section of the README.DOC file on the Setup Disk does not
  23842.  work correctly. First, the corresponding routine in the GRAPHICS.LIB
  23843.  library does not work correctly. In addition, the include files that
  23844.  are needed with the graphics routines, FGRAPH.FI and FGRAPH.FD, have
  23845.  no entry for this subroutine.
  23846.  
  23847.  The first problem has no solution. The second problem can be corrected
  23848.  by adding the following information to the corresponding include files
  23849.  as shown below.
  23850.  
  23851.  Add the following to the FGRAPH.FI include file:
  23852.  
  23853.      INTERFACE TO SUBROUTINE
  23854.     1 gettextwindow[FAR,C,ALIAS:"__gettextwindow"]
  23855.     1 (r1,c1,r2,c2)
  23856.      INTEGER*2 r1
  23857.      INTEGER*2 c1
  23858.      INTEGER*2 r2
  23859.      INTEGER*2 c2
  23860.      END
  23861.  
  23862.  Add the following to the FGRAPH.FD include file:
  23863.  
  23864.     EXTERNAL gettextwindow
  23865.  
  23866.  Note: The GetTextWindow subroutine is not listed in the "Graphics
  23867.  Library Routines" chapter of the "Microsoft FORTRAN Advanced Topics"
  23868.  manual.
  23869.  
  23870.  The GetTextWindow subroutine gets the boundaries of the current text
  23871.  window and is included in the GRAPHICS.LIB library. However, after
  23872.  adding the information above to the include files, the GetTextWindow
  23873.  subroutine does not work correctly. The subroutine returns zeros for the
  23874.  coordinates of the window regardless of the coordinates the window
  23875.  actually has.
  23876.  
  23877.  Also, depending on the hardware/software configuration, the machine
  23878.  may hang or a "run-time error R6003: integer divide by 0" may occur
  23879.  when executing the program. An example of using the subroutine is as
  23880.  follows:
  23881.  
  23882.  c
  23883.  c Compile command line: fl /FPi test.for graphics.lib /link /NOI
  23884.  c
  23885.        INCLUDE 'FGRAPH.FI'
  23886.        INCLUDE 'FGRAPH.FD'
  23887.  
  23888.        INTEGER x1,y1,x2,y2
  23889.  
  23890.        call settextwindow(10,10,30,20)
  23891.        call gettextwindow(x1,y1,x2,y2)
  23892.  c
  23893.  c Returns zeros for all four values
  23894.  c
  23895.        write (*,*) x1,y1
  23896.        write (*,*) x2,y2
  23897.  
  23898.        END
  23899.  
  23900.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  23901.  We are researching this problem and will post new information here as
  23902.  it becomes available.
  23903.  
  23904.  
  23905.  613. PIE Declaration in Manual Is Incorrect
  23906.  
  23907.  Product Version(s): 5.00
  23908.  Operating System:   MS-DOS
  23909.  Flags: ENDUSER | docerr
  23910.  Last Modified:  6-JUN-1990    ArticleIdent: Q62533
  23911.  
  23912.  There is a documentation error in the declaration of the PIE function
  23913.  on Page 233 of the "Microsoft FORTRAN Advanced Topics" manual for
  23914.  version 5.00.
  23915.  
  23916.  If the INTERFACE statement in the manual is used, an error "L2029 :
  23917.  '__f_pie' : unresolved external" occurs. The INTERFACE statement in
  23918.  the FGRAPH.FI include file contains the correct information.
  23919.  
  23920.  The incorrect line appears as follows:
  23921.  
  23922.        INTEGER*2 pie[FAR,C,ALIAS:"__f_pie"]
  23923.  
  23924.     "__f_pie" should be changed to "__pie" as follows:
  23925.  
  23926.        INTEGER*2 pie_w[FAR,C,ALIAS:"__pie"]
  23927.  
  23928.  The FIGURE.FOR sample program that is included with FORTRAN version
  23929.  5.00 illustrates the use of the PIE function.
  23930.  
  23931.  
  23932.  614. PIE_W Declaration in Manual Is Incorrect
  23933.  
  23934.  Product Version(s): 5.00
  23935.  Operating System:   MS-DOS
  23936.  Flags: ENDUSER | docerr
  23937.  Last Modified:  6-JUN-1990    ArticleIdent: Q62534
  23938.  
  23939.  There is a documentation error in the declaration of the PIE_W
  23940.  function on Page 233 of the "Microsoft FORTRAN Advanced Topics" manual
  23941.  for version 5.00.
  23942.  
  23943.  The incorrect line appears as follows:
  23944.  
  23945.     INTEGER*2 pie[FAR,C,ALIAS:"__f_pie_w"]
  23946.  
  23947.     "pie" should be changed to "pie_w" as follows:
  23948.  
  23949.     INTEGER*2 pie_w[FAR,C,ALIAS:"__f_pie_w"]
  23950.  
  23951.  
  23952.  615. Incorrect RGB Line in Manual; "9" Should Be "g"
  23953.  
  23954.  Product Version(s): 5.00   | 5.00
  23955.  Operating System:   MS-DOS | OS/2
  23956.  Flags: ENDUSER | docerr
  23957.  Last Modified:  6-JUN-1990    ArticleIdent: Q62535
  23958.  
  23959.  There is a documentation error on Page 163 of the "Microsoft FORTRAN
  23960.  Advanced Topics" manual for version 5.00.
  23961.  
  23962.  The incorrect line appears as follows:
  23963.  
  23964.     RGB (r,g,b) = (#3f3f3f.AND.(ISHFT(b,16).OR.ISHFT(9,8).OR.r))
  23965.  
  23966.  The "9" should be changed to a "g" as follows:
  23967.  
  23968.     RGB (r,g,b) = (#3f3f3f.AND.(ISHFT(b,16).OR.ISHFT(g,8).OR.r))
  23969.                                                      |
  23970.                                         correction --|
  23971.  
  23972.  
  23973.  616. Example Using C or Assembly to Scroll Text for FORTRAN
  23974.  
  23975.  Product Version(s): 5.00
  23976.  Operating System:   MS-DOS
  23977.  Flags: ENDUSER | mixed language S_C H_MASM
  23978.  Last Modified: 19-JUN-1990    ArticleIdent: Q62885
  23979.  
  23980.  With an OUTTEXT call, it is not possible to embed CR/LF characters to
  23981.  enforce scrolling of text on the screen. To scroll the text, an
  23982.  assembler or C routine may be used as follows:
  23983.  
  23984.  1. Use SETTEXTPOSITION to position the cursor on the screen.
  23985.  
  23986.  2. Use OUTTEXT to display the output at that position.
  23987.  
  23988.  3. Call an Assembly or C routine to scroll the screen by one line.
  23989.  
  23990.  4. Return to step 1 above, positioning the cursor at the same location
  23991.     on the screen.
  23992.  
  23993.  The following code sample illustrates the use of the assembly routine:
  23994.  
  23995.         interface to subroutine scroll_line()
  23996.         end
  23997.         include 'fgraph.fi'
  23998.         include 'fgraph.fd'
  23999.         record/rccoord/curpos
  24000.  c
  24001.         call settextposition (10,20,curpos)
  24002.         call outtext('Hello1')
  24003.  c
  24004.         call scroll_line()
  24005.  c
  24006.         call settextposition (10,20,curpos)
  24007.         call outtext ('Hello2')
  24008.         end
  24009.  
  24010.  The following is the code segment of the assembly module:
  24011.  
  24012.  .model large,fortran
  24013.  
  24014.  .code
  24015.  
  24016.  scroll_line proc far
  24017.       push bp
  24018.       mov bp, sp
  24019.       mov ah,6          ;function 6H
  24020.       mov al,1          ;number of lines to scroll
  24021.       mov ch,0          ;row of top left corner
  24022.       mov cl,0          ;col of top left corner
  24023.       mov dh,24         ;row of bottom right corner
  24024.       mov dl,79         ;col of bottom right corner
  24025.       mov bh,7          ;attribute of line
  24026.       int 10h           ;interrupt 10h
  24027.       pop bp
  24028.       ret
  24029.  scroll_line endp
  24030.       end
  24031.  
  24032.  To use the C subroutine, only the interface statement of the FORTRAN
  24033.  module should be modified to read as follows:
  24034.  
  24035.         interface to subroutine scroll_line [FAR,C] ()
  24036.         end
  24037.  
  24038.  The following is the code segment of the C module:
  24039.  
  24040.  #include <stdio.h>
  24041.  #include <dos.h>
  24042.  
  24043.  union REGS reg;
  24044.  
  24045.  void scroll_line()
  24046.  {
  24047.  
  24048.  /*
  24049.   *  The registers have the same significance as those in
  24050.   *  the assembly-language routine above.
  24051.   */
  24052.  
  24053.    reg.h.ah = 6;     // function 6H
  24054.    reg.h.al = 1;     // number of lines to scroll
  24055.    reg.h.bh = 0x7;   // attribute of line
  24056.    reg.h.ch = 0;     // row of top left corner
  24057.    reg.h.cl = 0;     // column of top left corner
  24058.    reg.h.dh = 24;    // row of bottom right corner
  24059.    reg.h.dl = 79;    // row of top right corner
  24060.  
  24061.    int86(0x10, ®, ®);
  24062.    return;
  24063.  }
  24064.  
  24065.  The following is the MAKE file when the assembly module subroutine is
  24066.  used:
  24067.  
  24068.  all=1.obj 2.obj
  24069.  
  24070.  update: 1.for
  24071.      fl /Zi /c 1.for
  24072.  
  24073.  update: 2.asm
  24074.      masm /Zi 2.asm;
  24075.  
  24076.  update: $(all)
  24077.  link /co $(all),,,/nod graphics llibfer;
  24078.  
  24079.  The following is the MAKE file when the C module subroutine is used:
  24080.  
  24081.  all=1.obj 2.obj
  24082.  
  24083.  update: 1.for
  24084.      fl /Zi /c 1.for
  24085.  
  24086.  update: 2.c
  24087.      cl /AL /Zi /c 2.c
  24088.  
  24089.  update: $(all)
  24090.      link $(all)/co,,,/nod /noe graphics llibfer llibcer;
  24091.  
  24092.  
  24093.  617. FORTRAN 5.00 and C 6.00 Character String and Integer Array
  24094.  
  24095.  Product Version(s): 5.00   | 5.00
  24096.  Operating System:   MS-DOS | OS/2
  24097.  Flags: enduser |
  24098.  Last Modified:  6-JUL-1990    ArticleIdent: Q63308
  24099.  
  24100.  The following code is designed to show passing arrays and character
  24101.  strings from FORTRAN to C and from C to FORTRAN.
  24102.  
  24103.  There are two programs here. The first has a FORTRAN main and C
  24104.  subroutine; the second a C main and FORTRAN subroutine. Each program
  24105.  does essentially the same thing -- passes an array of 5 INTEGER*4 and a
  24106.  character string to the subroutine, which then prints the values.
  24107.  
  24108.  C version 6.00 and FORTRAN version 5.00 were used in this example.
  24109.  FORTRAN needs to be built with C compatible libraries, and the modules
  24110.  need to be linked with the /NOE switch. Each module needs to be
  24111.  compiled with the same floating-point and memory-module options (for
  24112.  example, /AL /FPi).
  24113.  
  24114.  The following is the FORTRAN main:
  24115.  
  24116.  C Note that the passed string has a zero length C style string
  24117.  C appended so that it appends a NULL terminating character.
  24118.  
  24119.        INTERFACE TO SUBROUTINE CPRINT [C] (I,STRING)
  24120.        INTEGER*4 I [REFERENCE]
  24121.        CHARACTER*(*) STRING [REFERENCE]
  24122.        END
  24123.  
  24124.        PROGRAM FMAIN
  24125.  
  24126.        INTEGER*4 I(5)
  24127.        CHARACTER*255 PRINTSTRING /'This example shows passing an array an
  24128.       +d a string.'/
  24129.  
  24130.        I(1) = 5
  24131.        I(2) = 4
  24132.        I(3) = 3
  24133.        I(4) = 2
  24134.        I(5) = 1
  24135.  
  24136.        CALL CPRINT(I,PRINTSTRING//''C)
  24137.  
  24138.        END
  24139.  
  24140.  The following is the start of the C subroutine:
  24141.  
  24142.  #include <stdio.h>
  24143.  
  24144.  void cprint(long int i[], char * printstring)
  24145.  {
  24146.    int count;
  24147.  
  24148.    printf("\n");
  24149.    for (count = 0; count < 5;count++)
  24150.      printf("\t%li",i[count]);
  24151.    printf("\n");
  24152.  
  24153.    printf("%s",printstring);
  24154.  }
  24155.  
  24156.  The following is the start of the C main program:
  24157.  
  24158.  extern void fortran fprint (long int *, char *);
  24159.  
  24160.  main ()
  24161.  {
  24162.      long int i[5];
  24163.      char printstring[255] = "This example shows passing an array and"
  24164.                              " a string.";
  24165.  
  24166.      i[0] = 5;
  24167.      i[1] = 4;
  24168.      i[2] = 3;
  24169.      i[3] = 2;
  24170.      i[4] = 1;
  24171.  
  24172.      fprint(i,printstring);
  24173.  }
  24174.  
  24175.  The following is the start of the FORTRAN subroutine:
  24176.  
  24177.  C The declaration of PRINTSTRING has to be equal to or less than the
  24178.  C size of the string passed from C. If it is not, other data will get
  24179.  C accessed, possibly causing a protection violation under OS/2.
  24180.  
  24181.        SUBROUTINE FPRINT (I,PRINTSTRING)
  24182.        INTEGER*4 I(*)
  24183.        CHARACTER*255 PRINTSTRING
  24184.  
  24185.        INTEGER  J
  24186.  
  24187.  C The following line truncates the string at the end of the C string.
  24188.  C (The C string end-of-string character is CHAR(0).)
  24189.        PRINTSTRING = PRINTSTRING(1:INDEX(PRINTSTRING,CHAR(0)))
  24190.  
  24191.        WRITE (*,*) (I(J),J=1,5)
  24192.        WRITE (*,*)
  24193.  C The substring (1:lentrim()) is printed instead of just the
  24194.  C variable because this way only the characters stored in the
  24195.  C variable are printed, and not the entire length of the variable
  24196.  C padded with spaces (255 spaces).
  24197.        WRITE (*,*) PRINTSTRING(1:LEN_TRIM(PRINTSTRING))
  24198.        END
  24199.  
  24200.  
  24201.  618. Multiplying by a Power of 2 Produces Wrong Results
  24202.  
  24203.  Product Version(s): 5.00   | 5.00
  24204.  Operating System:   MS-DOS | OS/2
  24205.  Flags: ENDUSER | buglist5.00
  24206.  Last Modified:  2-JUL-1990    ArticleIdent: Q63360
  24207.  
  24208.  Incorrect results are produced in FORTRAN version 5.00 when
  24209.  multiplying an integer variable by a constant that is a power of 2
  24210.  if the result of the multiplication is larger than the range of the
  24211.  integer variable.
  24212.  
  24213.  This problem is a result of an overflow generated by the
  24214.  assembly-language code produced by the FORTRAN compiler. This problem
  24215.  does not occur if the result of the multiplication falls within the
  24216.  range of the integer variable. To work around this problem, use a
  24217.  variable instead of a constant to represent the multiplier.
  24218.  
  24219.  Microsoft is currently researching this problem and will post new
  24220.  information here as it becomes available.
  24221.  
  24222.  The following code example demonstrates the problem and the
  24223.  workaround:
  24224.  
  24225.    INTEGER*2 K/1234/
  24226.    INTEGER*2 L/31/, M/32/ ,N/33/
  24227.    WRITE(*,*) K*31, K*32, K*33 !Displays incorrect results for K*32
  24228.    WRITE(*,*) K*L, K*M, K*N    !Displays correct results for K*M
  24229.    END
  24230.  
  24231.  The following is the output from the program above:
  24232.  
  24233.     38254      -26048       40722
  24234.     38254       39488       40722
  24235.  
  24236.  The following is a fragment of the assembly listing, which shows the
  24237.  compiler does not detect overflow (use the /Fc compilation option to
  24238.  produce a combined source-assembly listing):
  24239.  
  24240.  ;|*** WRITE(*,*) K*31, K*32, K*33 !Displays incorrect results for K*32
  24241.          *** 00000f      a1 00 00                mov     ax,$S14_K
  24242.          *** 000012      b1 05                   mov     cl,5
  24243.          *** 000014      d3 e0                   shl     ax,cl
  24244.          *** 000016      99                      cwd
  24245.          *** 000017      52                      push    dx
  24246.          *** 000018      50                      push    ax
  24247.  ;|*** WRITE(*,*) K*L, K*M, K*N    !Displays correct results for K*M
  24248.          *** 000037      a1 00 00                mov     ax,$S14_K
  24249.          *** 00003a      f7 2e 04 00             imul    WORD PTR $S16_M
  24250.          *** 00003e      52                      push    dx
  24251.          *** 00003f      50                      push    ax
  24252.  
  24253.  In line 3a of the assembly-language listing, the integer variable K is
  24254.  correctly multiplied by the variable M (which is equal to 32), by
  24255.  using the IMUL instruction. The IMUL instruction is a signed multiply
  24256.  instruction that multiplies an implied destination operand by a
  24257.  specified source operand.
  24258.  
  24259.  In line 14, K is multiplied by 32 by shifting it left the number of
  24260.  positions specified by the corresponding power of 2. In this case, K
  24261.  is shifted five places to the left because 5 is the corresponding
  24262.  power of 2 for 32 (that is, 2^5 = 32). An overflow occurs because K is
  24263.  shifted left too many positions, which is what happens when the result
  24264.  of an integer is out of range.
  24265.  
  24266.  Overflow is not checked for, and thus, incorrect results are displayed
  24267.  as above. Also, if the number was converted to a double prior to the
  24268.  shift in the assembly-language code, the overflow would not have
  24269.  occurred (see lines 16 and 14 above).
  24270.  
  24271.  Disabling optimization has no effect.
  24272.  
  24273.  
  24274.  619. "R6001: Null Pointer Assignment" Caused by Loop Optimization
  24275.  
  24276.  Product Version(s): 5.00   | 5.00
  24277.  Operating System:   MS-DOS | OS/2
  24278.  Flags: ENDUSER | buglist5.00
  24279.  Last Modified:  2-JUL-1990    ArticleIdent: Q63381
  24280.  
  24281.  Under some circumstances, programs compiled by the Microsoft FORTRAN
  24282.  compiler with loop optimization enabled cause the error "R6001: null
  24283.  pointer assignment" at run-time.
  24284.  
  24285.  The workaround for this problem is to disable loop optimization by
  24286.  compiling with either the /Od or /Odct switch. Using CHARACTER*10
  24287.  character strings also eliminates the problem in the example below.
  24288.  
  24289.  The following program demonstrates the problem:
  24290.  
  24291.        CHARACTER*1 STR1(10), STR2(10)
  24292.        DATA STR1 / 'T','.','B','.','C','.',4*' ' /
  24293.        CALL COPYSTR(STR1,1,10,STR2,1)
  24294.        END
  24295.  
  24296.        SUBROUTINE COPYSTR(IARRAY,IBEG,IEND,JARRAY,JBEG)
  24297.        CHARACTER*1 IARRAY(10),JARRAY(10)
  24298.  
  24299.        JPT = JBEG
  24300.        DO 100 IGET=IBEG,IEND
  24301.          JARRAY(JPT) = IARRAY(IGET)
  24302.          JPT = JPT+1
  24303.   100  CONTINUE
  24304.        RETURN
  24305.        END
  24306.  
  24307.  Microsoft is currently researching this problem and will post new
  24308.  information here as it becomes available.
  24309.  
  24310.  
  24311.  620. FORTRAN Err Msg: R6009: Not Enough Space for Environment
  24312.  
  24313.  Product Version(s): 5.00   | 5.00
  24314.  Operating System:   MS-DOS | OS/2
  24315.  Flags: ENDUSER |
  24316.  Last Modified:  2-JUL-1990    ArticleIdent: Q63382
  24317.  
  24318.  The run-time error "R6009: not enough space for environment"
  24319.  sometimes occurs when the default data segment, or DGROUP, is nearing
  24320.  the 64K segment limit. The solution is to use the /Gt switch when
  24321.  compiling all modules of the program.
  24322.  
  24323.  The /Gt switch frees space in the default data segment by moving data
  24324.  items greater than a specified size into far data segments. /Gt4
  24325.  should be used for optimal results.
  24326.  
  24327.  Please refer to Section 7.6, Page 326, of the "Microsoft FORTRAN
  24328.  Reference" manual for more information about the /Gt switch.
  24329.  
  24330.  
  24331.  621. L2025 Errors in CHKSTK.ASM with FORTRAN 5.00 and C 6.00
  24332.  
  24333.  Product Version(s): 5.00   | 5.00
  24334.  Operating System:   MS-DOS | OS/2
  24335.  Flags: ENDUSER | S_C mixed language
  24336.  Last Modified:  9-JUL-1990    ArticleIdent: Q63440
  24337.  
  24338.  When linking Microsoft FORTRAN version 5.00 and C version 6.00 object
  24339.  modules, the following three errors may occur:
  24340.  
  24341.     error L2025: STKHQQ : symbol defined more than once
  24342.     error L2025: __aaltstkovr : symbol defined more than once
  24343.     error L2025: __chkstk : symbol defined more than once
  24344.  
  24345.  These three symbols reside in the CHKSTK.ASM module within the FORTRAN
  24346.  and C libraries. To eliminate these error messages, use the Library
  24347.  Manager (LIB.EXE) to remove the CHKSTK module from the FORTRAN library
  24348.  as follows:
  24349.  
  24350.     LIB LLIBFORE-CHKSTK;
  24351.  
  24352.  Substitute the name of the appropriate FORTRAN library for LLIBFORE
  24353.  above.
  24354.  
  24355.  The following code demonstrates the problem when compiled
  24356.  and linked as indicated below:
  24357.  
  24358.        read(*,*) i
  24359.        write(*,*) i
  24360.        end
  24361.  
  24362.  fl /FPi /c test.for
  24363.  link test,,,/noe /nod llibce.lib llibfore.lib;
  24364.  
  24365.  The FORTRAN library was built with C compatibility.
  24366.  
  24367.  Microsoft is researching this problem and will post new information
  24368.  here as it becomes available.
  24369.  
  24370.  
  24371.  622. Calling MS-DOS Interrupt 21 Hex from FORTRAN Version 5.00
  24372.  
  24373.  Product Version(s): 5.00
  24374.  Operating System:   MS-DOS
  24375.  Flags: ENDUSER |
  24376.  Last Modified: 24-JUL-1990    ArticleIdent: Q63464
  24377.  
  24378.  The C INTDOS and INTDOSX routines in Microsoft FORTRAN version 5.00
  24379.  are built into the FORTRAN run-time libraries. These two routines can
  24380.  be used to call the MS-DOS interrupt 21 hex.
  24381.  
  24382.  INTDOS invokes the MS-DOS system call specified by registers passed to
  24383.  it and returns the result of the system call in another set of
  24384.  registers. INTDOSX invokes the MS-DOS system call in the same manner
  24385.  as INTDOS, but also accepts segment register values.
  24386.  
  24387.  Listed below are two FORTRAN sample programs and an include file that
  24388.  demonstrates how to use INTDOS and INTDOSX.
  24389.  
  24390.  Note: INTDOS and INTDOSX are not available with FORTRAN run-time
  24391.  libraries built for C compatibility. Using these routines with the C
  24392.  run-time libraries may cause unexpected results.
  24393.  
  24394.  Microsoft cannot guarantee that the information stated here regarding
  24395.  how to use INTDOS and INTDOSX will perform all MS-DOS system calls
  24396.  correctly because this information has not been tested rigorously and
  24397.  is not considered a feature of the product. Also, Microsoft cannot
  24398.  guarantee that this information will remain unchanged or work
  24399.  correctly in future releases of the Microsoft FORTRAN Compiler.
  24400.  
  24401.  This information applies to the Microsoft FORTRAN Compiler version
  24402.  5.00 for MS-DOS.
  24403.  The INTDOS and INTDOSX routines are not documented in either the
  24404.  "Microsoft FORTRAN Reference" manual or the "Microsoft FORTRAN
  24405.  Advanced Topics" manual. However, these routines are documented on
  24406.  Pages 247-248 in the Microsoft C Compiler version 6.00 "Microsoft C
  24407.  Reference" manual and Page 365 in the Microsoft C Compiler version
  24408.  5.10 "Microsoft C Run-Time Library Reference" manual.
  24409.  
  24410.  The file below, INTDOS.INC, is the FORTRAN include file for the INTDOS
  24411.  and INTDOSX routines. This file includes the INTERFACE to the C
  24412.  routines and the register structures needed for these routines.
  24413.  
  24414.  c INTDOS.INC : include file for INTDOS and INTDOSX.
  24415.  
  24416.        INTERFACE TO SUBROUTINE INTDOS [C] (inregs,outregs)
  24417.        structure /regs/
  24418.            integer*2 ax,bx,cx,dx,si,di,flags
  24419.        end structure
  24420.        record /regs/ inregs  [REFERENCE]   ! Regs into INTDOS
  24421.        record /regs/ outregs [REFERENCE]   ! Regs returned
  24422.        end
  24423.  
  24424.        INTERFACE TO SUBROUTINE INTDOSX [C] (inregs,outregs,segregs)
  24425.        structure /regs/
  24426.            integer*2 ax,bx,cx,dx,si,di,flags
  24427.        end structure
  24428.        structure /sregs/
  24429.            integer*2 es,cs,ss,ds
  24430.        end structure
  24431.        record /regs/ inregs   [REFERENCE] ! Regs into INTDOS
  24432.        record /regs/ outregs  [REFERENCE] ! Regs returned
  24433.        record /sregs/ segregs [REFERENCE] ! Segment registers
  24434.        end
  24435.  
  24436.        implicit a-g
  24437.  
  24438.        structure /wordregs/                  ! Full word registers
  24439.            integer*2 ax,bx,cx,dx,si,di,flags
  24440.        end structure
  24441.  
  24442.        structure /sregs/                     ! Segment registers
  24443.            integer*2 es,cs,ss,ds
  24444.        end structure
  24445.  
  24446.        record /wordregs/ inregs,outregs
  24447.        record /sregs/ segregs
  24448.  
  24449.  The following program is an example of calling the INTDOS routine:
  24450.  
  24451.  c Call the MS-DOS interrupt 21 hex, with function 2A hex to get the
  24452.  c system date.
  24453.  
  24454.        include 'intdos.inc'
  24455.  
  24456.        gethibyte (dataword) = dataword / 256
  24457.        getlobyte (dataword) = iand(dataword,255)
  24458.  
  24459.        inregs.ax=#2a00                    ! Function number
  24460.        call intdos(inregs,outregs)        ! Call DOS interrupt
  24461.        write(*,*) ' Month= ',gethibyte(outregs.dx) ! High byte is month
  24462.        write(*,*) ' Day  = ',getlobyte(outregs.dx) ! Low byte is day
  24463.        write(*,*) ' Year = ',outregs.cx            ! Year
  24464.        end
  24465.  
  24466.  The following program is an example of calling the INTDOSX routine:
  24467.  
  24468.  c Call the MS-DOS interrupt 21 hex, with function 41 hex to delete a
  24469.  c file. This example uses the segment registers.
  24470.  
  24471.        include 'intdos.inc'
  24472.        character filename*12              ! File to delete
  24473.        integer*2 flen                     ! Length of filename
  24474.        integer*4 addr                     ! Location of filename
  24475.        print 10
  24476.     10 format (' Enter name of file to delete -> ',$)
  24477.        read (*,'(a)') filename            ! Get the file to delete
  24478.        flen=len_trim(filename)            ! Remove extra spaces
  24479.        filename=filename(:flen)//char(0)  ! Must be an ASCIIZ filename
  24480.        addr=locfar(filename)              ! Get the segment and offset
  24481.                                           ! of the file
  24482.        inregs.dx=iand(addr,#FFFF)
  24483.        segregs.ds=ishft(addr,-16)
  24484.        inregs.ax=#4100                         ! Function number
  24485.        call intdosx(inregs,outregs,segregs)    ! Call DOS interruptx
  24486.        if (iand(outregs.flags,1).eq.0) then    ! No error on delete
  24487.          write (*,*) 'File deleted successfully!'
  24488.        else                                    ! Error if carry is set
  24489.          write (*,*) ' File not deleted!  Status= ', outregs.ax
  24490.        endif
  24491.        end
  24492.  
  24493.  Note: Using a similar method to call the INTDOS routine causes a
  24494.  "Protection Violation" under OS/2 and hanging under DOS. This occurs
  24495.  when compiling a program that uses the EQUIVALENCE statement to cause
  24496.  two variables defined as STRUCTUREs to occupy the same memory location
  24497.  and compiling with the /Zi option.  For additional information
  24498.  concerning this problem, query on the following words:
  24499.  
  24500.       INTDOS and PROTECTION VIOLATION and /Zi
  24501.  
  24502.  
  24503.  623. Compiling FORTRAN Programs in the M Editor
  24504.  
  24505.  Product Version(s): 5.00   | 5.00
  24506.  Operating System:   MS-DOS | OS/2
  24507.  Flags: ENDUSER | S_editor
  24508.  Last Modified: 11-JUL-1990    ArticleIdent: Q63536
  24509.  
  24510.  To compile Microsoft FORTRAN version 5.00 programs and view error
  24511.  messages within the M Editor, add the following lines to the TOOLS.INI
  24512.  file:
  24513.  
  24514.     extmake:.for.obj fl /c /nologo %|F
  24515.     Nextmsg:Shift+F3
  24516.  
  24517.  This information applies to the Microsoft FORTRAN Compiler version
  24518.  5.00 for MS-DOS and OS/2 and the Microsoft Editor version 1.02 for
  24519.  MS-DOS and OS/2.
  24520.  
  24521.  To compile a FORTRAN program that is loaded in the M Editor, type
  24522.  ALT+A, CTRL+F3. This will run a compilation according to the extmake
  24523.  switch above. In the extmake switch above, %|F tells the M Editor to
  24524.  compile the program that has been loaded. Other compile options can
  24525.  also be added to the extmake switch. If error messages are generated,
  24526.  they will appear at the bottom of the screen and the cursor will be
  24527.  placed at the corresponding error in the program. To move the cursor
  24528.  location to the next error message, press SHIFT+F3.
  24529.  
  24530.  At least 480K must be free before executing the M Editor when
  24531.  compiling FORTRAN programs that are loaded in the M Editor. A "D2027 :
  24532.  could not execute `C:\f1.exe'" error may occur if not enough memory is
  24533.  available. For more information on this topic, query on the following
  24534.  words:
  24535.  
  24536.       D2027 and M EDITOR
  24537.  
  24538.  Note: The /nologo compilation option is an undocumented option that
  24539.  stops the Microsoft copyright logo from appearing when compiling.
  24540.  Compiling programs in the M Editor under MS-DOS require use of the
  24541.  /nologo option; otherwise, the first error message will not be
  24542.  displayed. For more information on this problem, query on the word
  24543.  "NOLOGO".
  24544.  
  24545.  Additional information regarding compiling, invoking compilers and
  24546.  other utilities, and viewing error output can be found on Pages 44-47
  24547.  in the "Microsoft Editor User's Guide," which is included with FORTRAN
  24548.  version 5.00.
  24549.  
  24550.  
  24551.  624. Expression Too Complex on a CALL Statement in FORTRAN 5.00
  24552.  
  24553.  Product Version(s): 5.00   | 5.00
  24554.  Operating System:   MS-DOS | OS/2
  24555.  Flags: ENDUSER | buglist5.00
  24556.  Last Modified:  9-JUL-1990    ArticleIdent: Q63645
  24557.  
  24558.  In Microsoft FORTRAN version 5.00, "fatal error F1035: expression too
  24559.  complex, please simplify" is generated on the CALL statement when
  24560.  compiling the following FORTRAN program:
  24561.  
  24562.        CHARACTER*1 FILE8, FILE9, FILEA, FILEB
  24563.        CHARACTER*1 OUT1, OUT2, OUT3, OUT4, OUT5
  24564.        CHARACTER*1 TITLEE, TITLET
  24565.  C
  24566.        CALL IPEXP
  24567.       &  (DSFILE, DSOIL, EFFIRR, EXPTNO, FILE1, FILE2, FILE4, FILE5,
  24568.       &  FILE6, FILE7, FILE8, FILE9, FILEA, FILEB, IIRR, INSTE, ISIM,
  24569.       &  ISOILT, ISOW, ISWNIT, MTRT, NFEXP, NREP, NSFILE, NTRT,
  24570.       &  NWFILE, OUT1, OUT2, OUT3, OUT4, OUT5, PHINT, PLANTS, ROWSPC,
  24571.       &  RUNALL, RUNEND, SDEPTH, SITEE, THETAC, TITLEE, TITLET)
  24572.        END
  24573.  
  24574.  The following is the FL command line used to compile the FORTRAN
  24575.  program above and generate the "expression too complex" error:
  24576.  
  24577.     FL /c /Fs test.for
  24578.  
  24579.  The exact combination of variable declarations and CALL statement will
  24580.  generate the "expression too complex error." Rearranging the order of
  24581.  the variables in the CALL statement or in the declarations or changing
  24582.  the variable names will prevent this error from occurring.
  24583.  
  24584.  Microsoft is researching this problem and will post new information
  24585.  here as it becomes available.
  24586.  
  24587.  This information applies to the Microsoft FORTRAN Compiler version
  24588.  5.00 for MS-DOS and OS/2.
  24589.  
  24590.  Disabling optimization does not inhibit generation of the error "fatal
  24591.  error F1035: expression too complex, please simplify."
  24592.  
  24593.  For more information on the F1035 error, see Page 415 in the
  24594.  "Microsoft FORTRAN Reference" manual.
  24595.  
  24596.  
  24597.  625. Size Comparison Charts for FORTRAN 4.x and 5.00 Libraries
  24598.  
  24599.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  24600.  Operating System:   MS-DOS              | OS/2
  24601.  Flags: ENDUSER |
  24602.  Last Modified:  9-JUL-1990    ArticleIdent: Q63658
  24603.  
  24604.  The following tables include the sizes, in bytes, of the coprocessor,
  24605.  emulator, and alternate math libraries for Microsoft FORTRAN versions
  24606.  4.00, 4.01, 4.10, and 5.00. The libraries were built with and without
  24607.  C compatibility for the medium and large memory models, and for DOS
  24608.  and OS/2 as applicable.
  24609.  
  24610.  Note the following:
  24611.  
  24612.  1. All libraries listed below were built to include error message
  24613.     text. Subtract approximately 2.5K from the size of the library
  24614.     if error message text was not included.
  24615.  
  24616.  2. The libraries listed do not include compatibility with FORTRAN
  24617.     versions 3.20 and 3.30 (this option is available with FORTRAN
  24618.     versions 4.00, 4.01, and 4.10, but not version 5.00). Including
  24619.     3.20/3.30 compatibility increases the library size by approximately
  24620.     4K for the coprocessor and emulator libraries, and 6K for the
  24621.     alternate library.
  24622.  
  24623.  The following abbreviations are used in the tables below:
  24624.  
  24625.  L - Large memory model          7 - Coprocessor library
  24626.  M - Medium memory model         E - Emulator library
  24627.  R - Real mode (DOS)             A - Alternate library
  24628.  P - Protected mode (OS/2)
  24629.  
  24630.  --------------------------------------------------------------------
  24631.  |      |   Without C Compatibility   |     With C Compatibility    |
  24632.  | 5.00 |-----------------------------|-----------------------------|
  24633.  |      |     7         E         A   |     7         E         A   |
  24634.  |------|-----------------------------|-----------------------------|
  24635.  | L  R | 205,741   218,541   218,287 | 186,173   198,973   199,745 |
  24636.  | L  P | 201,637   213,927   213,663 | 185,659   197,947   199,231 |
  24637.  |------|-----------------------------|-----------------------------|
  24638.  | M  R | 202,105   214,905   215,197 | 183,067   195,355   196,673 |
  24639.  | M  P | 198,003   210,293   210,575 | 182,553   194,841   196,159 |
  24640.  --------------------------------------------------------------------
  24641.  
  24642.  --------------------------------------------------------------------
  24643.  |      |   Without C Compatibility   |     With C Compatibility    |
  24644.  | 4.10 |-----------------------------|-----------------------------|
  24645.  |      |     7         E         A   |     7         E         A   |
  24646.  |------------------------------------------------------------------|
  24647.  | L  R | 188,437   200,725   202,023 | 171,475   183,763   183,527 |
  24648.  | L  P | 185,389   197,679   198,967 | 171,995   184,283   183,535 |
  24649.  |------|-----------------------------|-----------------------------|
  24650.  | M  R | 184,807   197,095   198,937 | 168,371   180,659   180,455 |
  24651.  | M  P | 181,761   194,051   195,883 | 168,379   181,179   180,463 |
  24652.  --------------------------------------------------------------------
  24653.  
  24654.  --------------------------------------------------------------------
  24655.  |      |   Without C Compatibility   |     With C Compatibility    |
  24656.  | 4.01 |-----------------------------|-----------------------------|
  24657.  |      |     7         E         A   |     7         E         A   |
  24658.  |------------------------------------------------------------------|
  24659.  | L  R | 185,955   197,731   197,821 | 167,933   179,709   177,749 |
  24660.  |------|-----------------------------|-----------------------------|
  24661.  | M  R | 181,813   193,589   194,223 | 164,317   176,605   174,677 |
  24662.  --------------------------------------------------------------------
  24663.  
  24664.  --------------------------------------------------------------------
  24665.  |      |   Without C Compatibility   |     With C Compatibility    |
  24666.  | 4.00 |-----------------------------|-----------------------------|
  24667.  |      |     7         E         A   |     7         E         A   |
  24668.  |------------------------------------------------------------------|
  24669.  | L  R | 182,272   194,048   194,048 | 168,473   180,249   178,289 |
  24670.  |------|-----------------------------|-----------------------------|
  24671.  | M  R | 178,176   189,952   190,464 | 165,369   177,145   175,217 |
  24672.  --------------------------------------------------------------------
  24673.  
  24674.  
  24675.  626. Recursion Not Supported by FORTRAN
  24676.  
  24677.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  24678.  Operating System:   MS-DOS              | OS/2
  24679.  Flags: ENDUSER |
  24680.  Last Modified: 16-JUL-1990    ArticleIdent: Q63819
  24681.  
  24682.  Recursion is not supported by the Microsoft FORTRAN Optimizing
  24683.  Compiler. This information is stated in the following manuals:
  24684.  
  24685.  1. The "Microsoft FORTRAN Reference" manual for FORTRAN version 5.00
  24686.     on Pages 127, 172, 225, and 231
  24687.  
  24688.  2. The "Microsoft FORTRAN Optimizing Compiler Language Reference"
  24689.     manual for FORTRAN versions 4.00, 4.10, and 4.01 on Pages 174, 218,
  24690.     and 273
  24691.  
  24692.  3. The "ANSI X3.9-1978 FORTRAN 77" standard in Section 15.2 on
  24693.     Page 15-1
  24694.  
  24695.  This information applies to the Microsoft FORTRAN Optimizing Compiler
  24696.  versions 4.00, 4.01, 4.10, and 5.00 for MS-DOS and OS/2.
  24697.  
  24698.  The following is the information about support for recursion from
  24699.  Section 15.2 of the "ANSI X3.9-1978 FORTRAN 77" standard:
  24700.  
  24701.       A subprogram must not reference itself, either directly or
  24702.       indirectly.
  24703.  
  24704.  Direct recursion is when a subroutine calls itself. Page 231 of the
  24705.  "Microsoft FORTRAN Reference" manual for FORTRAN version 5.00 states
  24706.  that "any attempt at direct recursion results in a compile-time error
  24707.  [F2600: name : directly recursive]."
  24708.  
  24709.  Indirect recursion is when a subroutine calls another subprogram,
  24710.  which in turn calls the first subroutine before the first subroutine
  24711.  has completed execution. Page 231 of the "Microsoft FORTRAN Reference"
  24712.  manual for FORTRAN version 5.00 states that indirect recursion is not
  24713.  detected.
  24714.  
  24715.  
  24716.  627. /Zi and EQUIVALENCEing RECORD Variables Hangs Machine
  24717.  
  24718.  Product Version(s): 5.00   | 5.00
  24719.  Operating System:   MS-DOS | OS/2
  24720.  Flags: ENDUSER |
  24721.  Last Modified: 24-JUL-1990    ArticleIdent: Q63839
  24722.  
  24723.  In Microsoft FORTRAN version 5.00, you will receive a protection
  24724.  violation in OS/2 and will hang in DOS when you compile a program that
  24725.  uses the EQUIVALENCE statement to cause two variables specified as
  24726.  user-defined STRUCTUREs to occupy the same memory location and then
  24727.  compile with the /Zi option. The FORTRAN program listed below
  24728.  demonstrates this problem.
  24729.  
  24730.  Microsoft is currently researching this problem and will post new
  24731.  information here as it becomes available.
  24732.  
  24733.  The following is the Microsoft FORTRAN program that generates a
  24734.  protection violation in OS/2 and hangs in DOS when you compile with
  24735.  the /Zi option:
  24736.  
  24737.        structure /wordregs/          ! Full word registers
  24738.            integer*2 ax
  24739.        end structure
  24740.  
  24741.        structure /byteregs/          ! High and low registers
  24742.            integer*1 ah,al
  24743.        end structure
  24744.  
  24745.        record /wordregs/ inregs1
  24746.        record /byteregs/ inregs2
  24747.  
  24748.        equivalence (inregs1,inregs2) ! This statement causes the
  24749.                                      ! problem.
  24750.        end
  24751.  
  24752.  The sample program above is a fragment of a complete FORTRAN program
  24753.  that demonstrates how to use the C routines, INTDOS and INTDOSX to
  24754.  call MS-DOS interrupt 21 hex. Equivalencing the variables inregs1 and
  24755.  inregs2 allows accessing both the word and high-and-low bytes of the
  24756.  8086 general registers. For more information on how to use the INTDOS
  24757.  and INTDOSX routines, query on the following words:
  24758.  
  24759.     INTDOS and INTERFACE
  24760.  
  24761.  More information concerning the EQUIVALENCE and STRUCTURE statements
  24762.  can be found on Pages 164-166 and 228-229, respectively, in the
  24763.  "Microsoft FORTRAN Reference" manual.
  24764.  
  24765.  The /Zi option prepares for debugging with Microsoft CodeView
  24766.  debugger. More information concerning the /Zi option can be found on
  24767.  Pages 357-358 in the "Microsoft FORTRAN Reference" manual.
  24768.  
  24769.  
  24770.  628. Environment Variables in STARTUP.CMD in FORTRAN
  24771.  
  24772.  Product Version(s): 5.00
  24773.  Operating System:   OS/2
  24774.  Flags: ENDUSER | docerr
  24775.  Last Modified: 23-JUL-1990    ArticleIdent: Q64018
  24776.  
  24777.  Contrary to what is stated in the "Microsoft FORTRAN Getting Started"
  24778.  booklet included with Microsoft FORTRAN version 5.00, SET statements
  24779.  for environment variables should not be included in the STARTUP.CMD
  24780.  file. These statements should be included in the CONFIG.SYS file, an
  24781.  OS2INIT.CMD file, or in another .CMD file that is executed before
  24782.  FORTRAN is used.
  24783.  
  24784.  The FORTRAN version 4.10 manuals do not contain this documentation
  24785.  error, but the information included below about setting up the
  24786.  environment also applies to version 4.10.
  24787.  
  24788.  Page 20 of the "Microsoft FORTRAN Getting Started" booklet included
  24789.  with FORTRAN 5.00 states the following:
  24790.  
  24791.     The environment-setting commands can be included in your
  24792.     AUTOEXEC.BAT or STARTUP.CMD file to ensure that the compiler
  24793.     environment is properly set up each time you reboot.
  24794.  
  24795.  This is correct for the DOS AUTOEXEC.BAT file but not for the OS/2
  24796.  STARTUP.CMD file. Both files are executed when a machine running their
  24797.  respective systems is booted, but the environment variables set in
  24798.  STARTUP.CMD are only recognized by the OS/2 screen group that executes
  24799.  the .CMD file. If another OS/2 screen group is started, STARTUP.CMD is
  24800.  not automatically executed and the environment set by it in the
  24801.  original screen group does not affect the new screen group.
  24802.  
  24803.  To ensure that the environment settings required by FORTRAN are set
  24804.  under OS/2, the PATH, SET LIB, SET TMP, SET INIT, and SET INCLUDE
  24805.  statements should be included in the CONFIG.SYS file, in an
  24806.  OS2INIT.CMD file, or in a .CMD file that is executed before working
  24807.  with FORTRAN.
  24808.  
  24809.  Environment variables can be set in the CONFIG.SYS file for OS/2
  24810.  versions 1.10 and later. The variables set there are recognized by
  24811.  each OS/2 screen group. This feature is not available in version 1.00
  24812.  of OS/2. In this case, an OS2INIT.CMD file can be used to set the
  24813.  environment.
  24814.  
  24815.  The OS2INIT.CMD file is the OS/2 equivalent to the DOS AUTOEXEC.BAT in
  24816.  terms of setting the environment for an OS/2 screen group. To use
  24817.  OS2INIT.CMD, the /K option for CMD.EXE must be included in the
  24818.  PROTSHELL statement of CONFIG.SYS.
  24819.  
  24820.  For example:
  24821.  
  24822.     PROTSHELL=... ... C:\0S2\CMD.EXE /K OS2INIT.CMD
  24823.  
  24824.  The file specified after the /K option is executed every time a new
  24825.  screen group is started. Any name can be used for the .CMD file.
  24826.  
  24827.  
  24828.  629. Multithreaded Programming Between FORTRAN 5.00 and C 5.10
  24829.  
  24830.  Product Version(s): 5.00
  24831.  Operating System:   OS/2
  24832.  Flags: ENDUSER | S_C multiple threads
  24833.  Last Modified: 27-JUL-1990    ArticleIdent: Q64192
  24834.  
  24835.  Multithreaded programming between languages is not recommended, as
  24836.  stated on Page 51 of the "Microsoft FORTRAN Advanced Topics" manual
  24837.  for version 5.0. However, when certain guidelines are followed as
  24838.  outlined below, multithreaded programming between Microsoft FORTRAN
  24839.  version 5.00 and Microsoft C version 5.10 will work correctly.
  24840.  
  24841.  Use the following guidelines:
  24842.  
  24843.  1. I/O within a thread should be done only in the language that
  24844.     created the thread.
  24845.  
  24846.  2. The FORTRAN BEGINTHREAD, ENDTHREAD, and THREADID routines must
  24847.     be used for thread control in FORTRAN rather than the C
  24848.     _beginthread, _endthread, or _threadid routines.
  24849.  
  24850.  3. The OS/2 API calls DosCreateThread and DosExit should not be
  24851.     used with FORTRAN.
  24852.  
  24853.  The results are unpredictable if the above guidelines are not
  24854.  followed.
  24855.  
  24856.  The example below demonstrates multithread programming between FORTRAN
  24857.  5.00 and C 5.10. It will not function correctly with C 6.00 because of
  24858.  changes between C 5.10 and C 6.00.
  24859.  
  24860.  Pages 49-60 of the "Microsoft FORTRAN Advanced Topics" manual for
  24861.  version 5.0 contain additional information about OS/2 programming and
  24862.  threads with FORTRAN. The MTDYNA.DOC file that is included on the C
  24863.  5.10 Compiler 2 Disk contains similar information for C.
  24864.  
  24865.  The following code demonstrates how to include FORTRAN as a secondary
  24866.  thread. The FORTRAN subroutine fsub will perform input/output
  24867.  operations, so the thread containing fsub must be started from
  24868.  FORTRAN. The fthread subroutine begins the new thread. Notice that
  24869.  the FORTRAN subroutine can call C routines to access global variables
  24870.  or perform routine processing better handled by C.
  24871.  
  24872.  The output of the program below is as follows:
  24873.  
  24874.     Data received OK
  24875.  
  24876.  In this example the os2.lib and os2.h files were taken from the
  24877.  "Microsoft OS/2 Presentation Manager Toolkit."
  24878.  
  24879.  # ------------------ File test (MAKE file) ------------------
  24880.  
  24881.  test.obj: test.c
  24882.     cl -Zi -c -G2sw -FPi -Alfw test.c
  24883.  
  24884.  fsub.obj: fsub.for
  24885.     fl -Zi -c -G2sw -FPi -MT fsub.for
  24886.  
  24887.  test.exe: test.obj fsub.obj
  24888.     link /NOE /NOD /CO test+fsub, /align:16,,  \
  24889.     llibfmt+llibcmt+os2,test.def
  24890.  
  24891.  // ----------------- File test.c (Main Program) --------------------
  24892.  
  24893.  #define INCL_DOSPROCESS
  24894.  #include <os2.h>
  24895.  #include <mt\process.h>
  24896.  #include <mt\stdio.h>
  24897.  #include <mt\stdlib.h>
  24898.  
  24899.  short    n1=12, n2=6, n3=16, n4=8;
  24900.  ULONG    MySemaphore;
  24901.  
  24902.  void main(void);
  24903.  void far pascal fthread(void far *);
  24904.  void fdone(void);
  24905.  void getdat(short *,short *,short *,short *);
  24906.  
  24907.  void main()
  24908.  {
  24909.     BYTE     *abStack;
  24910.  
  24911.     DosSemSet(&MySemaphore);
  24912.     abStack = (BYTE *) malloc(8192);
  24913.     fthread(abStack);
  24914.     /*             ...
  24915.           Go about other business here
  24916.                    ...                     */
  24917.     DosSemWait(&MySemaphore,SEM_INDEFINITE_WAIT);
  24918.     if (abStack != NULL) free(abStack);
  24919.  }
  24920.  
  24921.  void fdone()
  24922.  {
  24923.     DosSemClear(&MySemaphore);
  24924.  }
  24925.  
  24926.  void getdat(i1, i2, i3, i4)
  24927.  short *i1, *i2, *i3, *i4;
  24928.  {
  24929.     *i1 = n1;
  24930.     *i2 = n2;
  24931.     *i3 = n3;
  24932.     *i4 = n4;
  24933.  }
  24934.  
  24935.  C --------------- File fsub.for (FORTRAN subroutines) --------------
  24936.  
  24937.        INTERFACE TO INTEGER*2 FUNCTION BEGINTHREAD(RTN,STK,SIZE,ARG)
  24938.        INTEGER*4      RTN [VALUE]
  24939.        INTEGER*1      STK(*)
  24940.        INTEGER*4      SIZE
  24941.        INTEGER*4      ARG
  24942.        END
  24943.  
  24944.        INTERFACE TO SUBROUTINE ENDTHREAD()
  24945.        END
  24946.  
  24947.        INTERFACE TO SUBROUTINE FDONE [C] ()
  24948.        END
  24949.  
  24950.        INTERFACE TO SUBROUTINE GETDAT [C] (N1,N2,N3,N4)
  24951.        INTEGER*2         N1 [REFERENCE]
  24952.        INTEGER*2         N2 [REFERENCE]
  24953.        INTEGER*2         N3 [REFERENCE]
  24954.        INTEGER*2         N4 [REFERENCE]
  24955.        END
  24956.  
  24957.        subroutine fthread(stack)
  24958.        integer*1   stack(*)
  24959.        integer*2   tid, beginthread
  24960.        external    fsub
  24961.        tid = beginthread(LOCFAR(fsub),stack,8192,0)
  24962.        return
  24963.        end
  24964.  
  24965.        subroutine fsub()
  24966.        logical     dataok
  24967.        integer*2   n1, n2, n3, n4
  24968.        call getdat(n1, n2, n3, n4)
  24969.        dataok = (n1 .eq. 12 .and. n2 .eq. 6 .and. n3 .eq. 16 .and.
  24970.       1          n4 .eq. 8)
  24971.        if (dataok) then
  24972.           write(*,*) 'Data received OK'
  24973.        else
  24974.           write(*,*) 'Data NOT received OK'
  24975.        endif
  24976.        call fdone
  24977.        call endthread()
  24978.        end
  24979.  
  24980.  ; ---------------- File test.def (DEFINITIONS file) -----------------
  24981.  
  24982.  NAME TEST WINDOWCOMPAT
  24983.  PROTMODE
  24984.  CODE LOADONCALL
  24985.  DATA LOADONCALL NONSHARED
  24986.  
  24987.  
  24988.  630. BASIC Code in FORTRAN 5.00 Advanced Topics Manual Is Incorrect
  24989.  
  24990.  Product Version(s): 5.00   | 5.00
  24991.  Operating System:   MS-DOS | OS/2
  24992.  Flags: ENDUSER | docerr B_QuickBas B_BasicCom
  24993.  Last Modified:  1-AUG-1990    ArticleIdent: Q64318
  24994.  
  24995.  The example on Page 90 of the "Microsoft FORTRAN Advanced Topics"
  24996.  manual for version 5.0 has omitted some required BASIC source code.
  24997.  
  24998.  If the BASIC code is compiled as suggested, and then linked to the
  24999.  FORTRAN subroutine, running the program produces the following error:
  25000.  
  25001.     run-time error F6700
  25002.     - heap space limit exceeded
  25003.  
  25004.  This error occurs because the FORTRAN subroutine does not have any
  25005.  heap space set up for it to use. This must be done in the BASIC code
  25006.  by adding the following lines:
  25007.  
  25008.     DIM HEAP%(2048)
  25009.     COMMON SHARED /nmalloc/ HEAP%()
  25010.  
  25011.  This will declare a heap size of 2K for FORTRAN to use.
  25012.  
  25013.  The following is the corrected code for the BASIC main:
  25014.  
  25015.  ' BASIC source
  25016.  '
  25017.  DIM HEAP%(2048)
  25018.  COMMON SHARED /nmalloc/ HEAP%()
  25019.  '
  25020.  DEFINT A-Z
  25021.  DECLARE SUB Fprog ()
  25022.  CALL Fprog
  25023.  END
  25024.  '
  25025.  FUNCTION Dbl (N) STATIC
  25026.       Dbl = N*2
  25027.  END FUNCTION
  25028.  '
  25029.  SUB Printnum (A,B) STATIC
  25030.       PRINT "The first number is ";A
  25031.       PRINT "The second number is ";B
  25032.  END SUB
  25033.  
  25034.  
  25035.  631. SYS2070 Error with FORTRAN Dynamic-Link Libraries
  25036.  
  25037.  Product Version(s): 5.00
  25038.  Operating System:   OS/2
  25039.  Flags: ENDUSER | sys 2070 DLL
  25040.  Last Modified:  3-AUG-1990    ArticleIdent: Q64447
  25041.  
  25042.  The error below occurs when running a Microsoft FORTRAN program that
  25043.  uses dynamic-link libraries and has been linked using the /NOI switch.
  25044.  The error may also occur if there are bad sectors on the hard disk or
  25045.  if a library is corrupt.
  25046.  
  25047.     SYS2070: The system could not demand load the
  25048.     application's segment.
  25049.  
  25050.  To alleviate this error, do not link with the /NOI switch or rebuild
  25051.  the library.
  25052.  
  25053.  The program below demonstrates the error when compiled and
  25054.  linked as follows:
  25055.  
  25056.  FL /MD /c sample.for
  25057.  LINK sample frtexe.obj,,,frtlib doscalls /NOI;
  25058.  
  25059.        PROGRAM SAMPLE
  25060.        WRITE(*,*) 'HELLO WORLD'
  25061.        END
  25062.  
  25063.  The above program generates the following error when run:
  25064.  
  25065.     SYS2070: The system could not demand load the
  25066.     application's segment.  FRTLIB __FFwr is in error.
  25067.  
  25068.  FRTLIB.LIB and FRTLIB.DLL were created by running the FDLLOBJS.CMD
  25069.  file that is included on the OS/2 Support 1 Distribution Disk for
  25070.  FORTRAN. FRTEXE.OBJ and DOSCALLS.LIB are also included with FORTRAN.
  25071.  
  25072.  To run the program, FRTLIB.DLL must reside in a directory that is
  25073.  pointed to by the LIBPATH variable in the CONFIG.SYS file.
  25074.  
  25075.  For more information about dynamic-link libraries and FORTRAN, see
  25076.  Pages 61-70 of the "Microsoft FORTRAN Advanced Topics" manual for
  25077.  version 5.0.
  25078.  
  25079.  
  25080.  632. Internal Compiler Error: getattrib.c:1.4, Line 174 in FORTRAN
  25081.  
  25082.  Product Version(s): 5.00    | 5.00
  25083.  Operating System:   MS-DOS  | OS/2
  25084.  Flags: ENDUSER | buglist5.00 SR# S900727-117
  25085.  Last Modified: 14-AUG-1990    ArticleIdent: Q64596
  25086.  
  25087.  The code below generates the following error:
  25088.  
  25089.     fatal error F1001: Internal Compiler Error
  25090.     (compiler file '@(#)getattrib.c:1.4', line 174).
  25091.  
  25092.  The error is produced when a program contains the following:
  25093.  
  25094.  1. The AUTOMATIC statement
  25095.  
  25096.  2. A structure variable that has an array as an element
  25097.  
  25098.  3. An implicit READ or WRITE of the array structure element
  25099.  
  25100.  The following code produces the error:
  25101.  
  25102.           AUTOMATIC
  25103.  
  25104.           STRUCTURE /struc/
  25105.             INTEGER var(2)
  25106.           END STRUCTURE
  25107.  
  25108.           RECORD /struc/ test
  25109.  
  25110.           READ(*,*) test.var
  25111.  
  25112.           END
  25113.  
  25114.  To work around this problem, either remove the AUTOMATIC statement or
  25115.  do not read or write the array implicitly.
  25116.  
  25117.  Microsoft has confirmed this to be a problem in the FORTRAN compiler
  25118.  version 5.00. We are researching this problem and will post new
  25119.  information here as it becomes available.
  25120.  
  25121.  
  25122.  633. $FREEFORM Allows Lines to Be 80 Characters Long in FORTRAN
  25123.  
  25124.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  25125.  Operating System:   MS-DOS              | OS/2
  25126.  Flags: ENDUSER | docerr buglist5.00
  25127.  Last Modified:  9-JAN-1991    ArticleIdent: Q64611
  25128.  
  25129.  The standard format for lines in Microsoft FORTRAN allows for
  25130.  characters in columns 1 through 72. By using the $FREEFORM metacommand
  25131.  with FORTRAN versions 4.00, 4.01, 4.10, and 5.00, lines may have
  25132.  characters in columns 1 through 80. The limit is column 79 if the last
  25133.  character in the line is an apostrophe or single quotation mark (').
  25134.  
  25135.  The allowed line length in source code with the $FREEFORM metacommand
  25136.  is not explicitly stated in the FORTRAN manuals. Section 2.3,
  25137.  "Free-Form Source Code," on Page 46 in the "Microsoft FORTRAN
  25138.  Reference" manual for version 5.0 states that most of the rules
  25139.  applying to line formatting in Section 2.1 do not apply to free-form
  25140.  code. The rules state that any characters in column 73 and above are
  25141.  ignored. With the $FREEFORM metacommand characters in column 81 and
  25142.  above are ignored.
  25143.  
  25144.  The following code will demonstrate the limit:
  25145.  
  25146.  $FREEFORM
  25147.  
  25148.  aa  = 1
  25149.  aaa = 2
  25150.  
  25151.  WRITE (*,*)                     aaa !aaa starts in column 79
  25152.  END
  25153.  
  25154.  This program prints a "1" because the third "a" in the variable name
  25155.  is ignored.
  25156.  
  25157.  An exception to the 80-character length limit occurs when the last
  25158.  character in the line is an apostrophe or single quotation mark (').
  25159.  When this is the case, the compiler only accepts 79 characters on a
  25160.  line.
  25161.  
  25162.  Consider the following code:
  25163.  
  25164.  $FREEFORM
  25165.  
  25166.  WRITE (*,*)             'The closing quotation mark is in column 80'
  25167.  END
  25168.  
  25169.  When this code is compiled the following error is generated:
  25170.  
  25171.     ...error F2031 : closing quote missing
  25172.  
  25173.  
  25174.  634. $STORAGE:2 Causes Incorrect RETURN from a SUBROUTINE
  25175.  
  25176.  Product Version(s): 5.00   | 5.00
  25177.  Operating System:   MS-DOS | OS/2
  25178.  Flags: ENDUSER | STORAGE return
  25179.  Last Modified: 16-AUG-1990    ArticleIdent: Q64847
  25180.  
  25181.  When a subroutine contains the $STORAGE:2 metacommand, a RETURN to an
  25182.  alternate return label will fail if the subroutine is in a separate
  25183.  file from the calling routine and the calling routine does not contain
  25184.  $STORAGE:2. This is caused by the inconsistent use of the $STORAGE:2
  25185.  metacommand. This error occurs under both DOS and OS/2, and only
  25186.  occurs in version 5.00 of Microsoft FORTRAN.
  25187.  
  25188.  Removing the $STORAGE:2 metacommand from the subroutine file, placing
  25189.  the subroutine in the same file as the calling routine, or placing the
  25190.  $STORAGE:2 metacommand in the calling-routine file corrects the
  25191.  problem. Optimization has no affect on this error.
  25192.  
  25193.  This problem occurs because the alternate return labels are considered
  25194.  to be integer arguments of a subroutine call, and thus fall under the
  25195.  control of the $STORAGE metacommand.
  25196.  
  25197.  Page 126 of the "Microsoft FORTRAN Reference" manual for version 5.0
  25198.  states in the "NOTE" section that there must be type agreement between
  25199.  the integer arguments of a subroutine and a calling program. To
  25200.  guarantee that the alternate return label types agree, the $STORAGE
  25201.  metacommand must be the same in both the calling routine and the
  25202.  subroutine files. A warning about the usage of $STORAGE with source
  25203.  code in multiple files is also found on Page 308 of the "Microsoft
  25204.  FORTRAN Reference" manual.
  25205.  
  25206.  The code listed below illustrates the problem:
  25207.  
  25208.  FILE 1:
  25209.  ------
  25210.  
  25211.        CALL SUB1 (*10)
  25212.        STOP '*10 DID NOT WORK'
  25213.  10    STOP '*10 DID WORK'
  25214.        END
  25215.  
  25216.  FILE 2:
  25217.  ------
  25218.  
  25219.  $STORAGE:2
  25220.        SUBROUTINE SUB1 (*)
  25221.        RETURN 1
  25222.        END
  25223.  
  25224.  The above program will print to the screen as follows:
  25225.  
  25226.  *10 DID NOT WORK
  25227.  
  25228.  If $STORAGE:2 is removed from FILE 2 or added to FILE 1, the program
  25229.  will print as follows:
  25230.  
  25231.  *10 DID WORK
  25232.  
  25233.  The program will also work correctly if the subroutine is placed in
  25234.  the same file.
  25235.  
  25236.  
  25237.  635. Undocumented FORTRAN Error "F2347: Missing Type"
  25238.  
  25239.  Product Version(s): 5.00   | 5.00
  25240.  Operating System:   MS-DOS | OS/2
  25241.  Flags: ENDUSER | SR# G900201-54
  25242.  Last Modified: 16-AUG-1990    ArticleIdent: Q64848
  25243.  
  25244.  If IMPLICIT NONE is specified in a program, then all user-defined
  25245.  names must be explicitly typed.
  25246.  
  25247.  An untyped name causes the following undocumented compile-time error:
  25248.  
  25249.     F2347: missing type
  25250.  
  25251.  The program below demonstrates this error:
  25252.  
  25253.        implicit none
  25254.        x = 3
  25255.        end
  25256.  
  25257.  f2347.for(2) : error F2347: X : missing type
  25258.  
  25259.  To alleviate the error, declare the variable as in the following
  25260.  program:
  25261.  
  25262.        implicit none
  25263.        integer*4 x
  25264.        x = 3
  25265.        end
  25266.  
  25267.  
  25268.  636. Accessing Command-Line Arguments with FORTRAN
  25269.  
  25270.  Product Version(s): 4.00 4.01 4.10
  25271.  Operating System:   MS-DOS
  25272.  Flags: ENDUSER | appnote HF0220
  25273.  Last Modified: 28-AUG-1990    ArticleIdent: Q65236
  25274.  
  25275.  An application note called "Accessing Command-Line Arguments with
  25276.  FORTRAN," which explains how to access the command-line arguments
  25277.  under Microsoft FORTRAN versions 4.00, 4.01, and 4.10, is available
  25278.  from Microsoft Product Support Services by calling (206) 637-7096.
  25279.  
  25280.  This article contains the same information as the application note.
  25281.  Below is the code for the following FORTRAN files.
  25282.  
  25283.  Filename      Description
  25284.  --------      ------------
  25285.  
  25286.  PSPTST.FOR    Main program that contains the INTERFACE to DMPCMD and
  25287.                calls DMPCMD
  25288.  
  25289.  DMPCMD.FOR    Subroutine that prints the contents of the command line
  25290.  
  25291.  Note: DMPCMD must be compiled in a separate source file.
  25292.  
  25293.  How to Use PSPTST
  25294.  -----------------
  25295.  
  25296.  Use the following command to compile the two programs:
  25297.  
  25298.     FL PSPTST.FOR DMPCMD.FOR
  25299.  
  25300.  If PSPTST is invoked with a command line such as
  25301.  
  25302.     PSPTST hello
  25303.  
  25304.  the output will be as follows:
  25305.  
  25306.     < hello>
  25307.  
  25308.  In FORTRAN version 5.00, command-line arguments can be accessed using
  25309.  the NARGS function and the GETARG procedure described on Page 271 of
  25310.  the "Microsoft FORTRAN Reference" manual for version 5.00.
  25311.  
  25312.  The PSPTST Program
  25313.  ------------------
  25314.  
  25315.  c The INTERFACE statement is used to pass the addresses of the start
  25316.  c of the command line and the number of characters in the command line
  25317.  c to the separately compiled subroutine, DMPCMD, by value, instead of
  25318.  c by reference. The variables are passed by value because they are
  25319.  c themselves addresses. The DMPCMD subroutine is compiled separately
  25320.  c so that it will accept its arguments by reference. This results in
  25321.  c the two passed addresses being properly "dereferenced."
  25322.  c
  25323.        INTERFACE TO SUBROUTINE DMPCMD( II,JJ )
  25324.        INTEGER*4 II [VALUE], JJ [VALUE]
  25325.        END
  25326.  c
  25327.  c --------------------------------------------------------------------
  25328.        PROGRAM PSPTST
  25329.        INTEGER*4 PSP, PSPNCH, OFFSET
  25330.  c --------------------------------------------------------------------
  25331.  c The method used in this program will work only if the Program
  25332.  c Segment Prefix precedes the main program, which it will by
  25333.  c default. Since the PSP starts 16 paragraphs (256 bytes) before
  25334.  c the main program, the first step is to load the variable OFFSET
  25335.  c with the hex value 0010:0000, as follows:
  25336.  c
  25337.        OFFSET = #00100000
  25338.  c --------------------------------------------------------------------
  25339.  c Use LOCFAR to find the segment:offset of the main program:
  25340.  c
  25341.        PSP = LOCFAR(PSPTST)
  25342.  c --------------------------------------------------------------------
  25343.  c To set PSP so that it points to the start of the text of the
  25344.  c command line, do the following:
  25345.  c
  25346.  c 1. Zero out the offset portion of the address in variable PSP.
  25347.  c
  25348.  c 2. Subtract 16 paragraphs from the segment:offset.
  25349.  c
  25350.  c 3. Add hex 81 so that PSP now points to the start of the text of the
  25351.  c    command line:
  25352.  c
  25353.        PSP = (PSP-MOD(PSP,#10000))-OFFSET+#81
  25354.  c --------------------------------------------------------------------
  25355.  c PSPNCH points to the byte (80 hex) in the PSP that contains the
  25356.  c length of the command line:
  25357.  c
  25358.        PSPNCH = PSP-1
  25359.  c --------------------------------------------------------------------
  25360.  c Call DMPCMD to list out the command line:
  25361.  c
  25362.        CALL DMPCMD(PSP, PSPNCH)
  25363.        END
  25364.  
  25365.  The DMPCMD Subroutine
  25366.  ---------------------
  25367.  
  25368.  Note: Compile this routine in a file separate from PSPTST.
  25369.  
  25370.        SUBROUTINE DMPCMD(CMDLIN, N)
  25371.        CHARACTER*80 CMDLIN
  25372.        INTEGER*1 N
  25373.  c
  25374.  c Write out N characters from CMDLIN (N is PSP+80 hex; CMDLIN is
  25375.  c PSP+81 hex).
  25376.  c
  25377.        WRITE (*,*) '<',CMDLIN(:N),'>'
  25378.        RETURN
  25379.        END
  25380.  
  25381.  
  25382.  637. Compiler Errors F1002, F1901, R6000 Using Large Namelists
  25383.  
  25384.  Product Version(s): 5.00   | 5.00
  25385.  Operating System:   MS-DOS | OS/2
  25386.  Flags: ENDUSER | buglist5.00
  25387.  Last Modified:  3-OCT-1990    ArticleIdent: Q65047
  25388.  
  25389.  In the code sample below, errors are produced when a READ operation is
  25390.  performed on a namelist that contains more than 99 variables.
  25391.  
  25392.  If the namelist contains
  25393.  
  25394.     100 - 106 variables
  25395.  
  25396.  the following errors are produced:
  25397.  
  25398.     F1002: out of heap space
  25399.     R6000 - stack overflow
  25400.  
  25401.  If the namelist contains
  25402.  
  25403.     107 - 117 variables
  25404.  
  25405.  the machine hangs under DOS or produces a protection violation under
  25406.  OS/2. If the namelist contains
  25407.  
  25408.     118 + variables
  25409.  
  25410.  the error is as follows:
  25411.  
  25412.     F1901: program too large for memory
  25413.  
  25414.  If the READ in the code below is changed to a WRITE, the errors are
  25415.  the same, except when the namelist contains 104 - 106 variables under
  25416.  OS/2. In this case, the screen group running the compiler will hang.
  25417.  
  25418.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  25419.  We are researching this problem and will post new information here as
  25420.  it becomes available.
  25421.  
  25422.  The following code will produce the errors:
  25423.  
  25424.        NAMELIST /test/
  25425.       * a001,a002,a003,a004,a005,a006,a007,a008,a009,a010
  25426.       *,a011,a012,a013,a014,a015,a016,a017,a018,a019,a020
  25427.       *,a021,a022,a023,a024,a025,a026,a027,a028,a029,a030
  25428.       *,a031,a032,a033,a034,a035,a036,a037,a038,a039,a040
  25429.       *,a041,a042,a043,a044,a045,a046,a047,a048,a049,a050
  25430.       *,a051,a052,a053,a054,a055,a056,a057,a058,a059,a060
  25431.       *,a061,a062,a063,a064,a065,a066,a067,a068,a069,a070
  25432.       *,a071,a072,a073,a074,a075,a076,a077,a078,a079,a080
  25433.       *,a081,a082,a083,a084,a085,a086,a087,a088,a089,a090
  25434.       *,a091,a092,a093,a094,a095,a096,a097,a098,a099,a100
  25435.       *,a101,a102,a103,a104,a105,a106,a107,a108,a109,a110
  25436.       *,a111,a112,a113,a114,a115,a116,a117,a118,a119,a120
  25437.  
  25438.        READ (*,test)
  25439.        END
  25440.  
  25441.  The workaround to this problem is to reduce the size of the namelist.
  25442.  This can be accomplished by either splitting the namelist into
  25443.  multiple smaller namelists or by grouping variables of similar type
  25444.  together using arrays.
  25445.  
  25446.  The following code uses an array instead of individual variables:
  25447.  
  25448.        real a(120)
  25449.        namelist/test/ a
  25450.  
  25451.        read (*,test)
  25452.        end
  25453.  
  25454.  
  25455.  638. IMAGESIZE_W Type Definition Is Incorrect in FGRAPH.FD
  25456.  
  25457.  Product Version(s): 5.00
  25458.  Operating System:   MS-DOS
  25459.  Flags: ENDUSER | buglist5.00
  25460.  Last Modified: 22-AUG-1990    ArticleIdent: Q65048
  25461.  
  25462.  The graphics function IMAGESIZE_W is incorrectly typed in the
  25463.  FGRAPH.FD include file for Microsoft FORTRAN version 5.00. The
  25464.  function is typed as INTEGER*2 instead of INTEGER*4. It is typed
  25465.  correctly in both the "Microsoft Advanced Topics" manual and the
  25466.  FGRAPH.FI include file.
  25467.  
  25468.  When compiling a program that references IMAGESIZE_W, the following
  25469.  error is generated:
  25470.  
  25471.     F2220: IMAGESIZE_W : length redefined
  25472.  
  25473.  This error can be corrected by changing the line in the FGRAPH.FD file
  25474.  that reads
  25475.  
  25476.     INTEGER*2 IMAGESIZE_W
  25477.  
  25478.  to the following:
  25479.  
  25480.     INTEGER*4 IMAGESIZE_W
  25481.  
  25482.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  25483.  We are researching this problem and will post new information here as
  25484.  it becomes available.
  25485.  
  25486.  
  25487.  639. F2124: CODE GENERATION ERROR with Adjustable Arrays and $LARGE
  25488.  
  25489.  Product Version(s): 5.00   | 5.00
  25490.  Operating System:   MS-DOS | OS/2
  25491.  Flags: ENDUSER | buglist5.00
  25492.  Last Modified: 22-AUG-1990    ArticleIdent: Q65049
  25493.  
  25494.  The error
  25495.  
  25496.     F2124: CODE GENERATION ERROR
  25497.  
  25498.  occurs when using adjustable-sized, three-dimensional arrays and the
  25499.  huge memory model with Microsoft FORTRAN version 5.00. Compiling with
  25500.  the /Od option will eliminate this error. Changing the order and size
  25501.  of the subscripts may also eliminate this error.
  25502.  
  25503.  The following sample code generates error F2124 when compiled with the
  25504.  /AH switch or $LARGE metacommand:
  25505.  
  25506.        SUBROUTINE X( a,b,i,j,m )
  25507.        DIMENSION a(m,2,2), b(2,m,2)
  25508.  
  25509.        a(i,2,1) = b(j,i,2)
  25510.  
  25511.        RETURN
  25512.        END
  25513.  
  25514.  Microsoft is researching this problem and will post new information
  25515.  here as it becomes available.
  25516.  
  25517.  
  25518.  640. Problems Indexing Arrays with INTEGER*1 Variables
  25519.  
  25520.  Product Version(s): 5.00   | 5.00
  25521.  Operating System:   MS-DOS | OS/2
  25522.  Flags: ENDUSER | buglist5.00
  25523.  Last Modified:  5-SEP-1990    ArticleIdent: Q65414
  25524.  
  25525.  Erroneous results can be generated when using an INTEGER*1 variable to
  25526.  index an array. Changing the index to an INTEGER*2 variable, or
  25527.  compiling with the /4Yb switch will correct the problem.
  25528.  
  25529.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  25530.  We are researching this problem and will post new information here as
  25531.  it becomes available.
  25532.  
  25533.  The sample code below generates improper values when compiled using
  25534.  FORTRAN version 5.00. The error occurs when the compiler calculates
  25535.  the offset of certain array elements. If the number of bytes per
  25536.  element is a power of two, the compiler uses a shift instruction to
  25537.  multiply the index, calculating the element's offset from the
  25538.  beginning of the array.  Depending on the number of shifts and the
  25539.  initial value of the index, bits may be lost and/or shifted into the
  25540.  sign bit, resulting in incorrect offset values.
  25541.  
  25542.  The following is a sample code:
  25543.  
  25544.           integer*1 k
  25545.           integer*2 iarray(100)
  25546.  
  25547.           iarray = 0
  25548.  
  25549.           do k=1,100
  25550.              write(*,*) iarray(k)
  25551.           enddo
  25552.           end
  25553.  
  25554.  The screen output appears as follows:
  25555.  
  25556.         0
  25557.         .
  25558.         .
  25559.         .
  25560.         0     ( 63 zeros )
  25561.     25972
  25562.     26998
  25563.      3376
  25564.     12336
  25565.     29807
  25566.      8296
  25567.         .
  25568.         .
  25569.         .
  25570.  
  25571.  This example runs correctly when compiled with the /4Yb option.
  25572.  
  25573.  
  25574.  641. FORTRAN Err Msg: R6001 Null Pointer Assignment Using Namelist
  25575.  
  25576.  Product Version(s): 5.00   | 5.00
  25577.  Operating System:   MS-DOS | OS/2
  25578.  Flags: ENDUSER | buglist5.00
  25579.  Last Modified: 24-SEP-1990    ArticleIdent: Q65607
  25580.  
  25581.  The compile time error
  25582.  
  25583.     run-time error R6001
  25584.     - null pointer assignment
  25585.  
  25586.  is generated when a NAMELIST group name is declared as a variable or
  25587.  is initialized as a variable before the NAMELIST is defined.
  25588.  
  25589.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  25590.  We are researching this problem and will post new information here as
  25591.  it becomes available.
  25592.  
  25593.  When the code below is compiled with Microsoft FORTRAN version 5.00, a
  25594.  null pointer assignment is generated:
  25595.  
  25596.        a=1
  25597.        NAMELIST /a/ b   ! 'a' is already a variable name
  25598.        END
  25599.  
  25600.  
  25601.  642. Incorrect Use of Structure Variable Hangs Compiler
  25602.  
  25603.  Product Version(s): 5.00   | 5.00
  25604.  Operating System:   MS-DOS | OS/2
  25605.  Flags: ENDUSER | buglist5.00
  25606.  Last Modified: 24-SEP-1990    ArticleIdent: Q65608
  25607.  
  25608.  Compiling code that attempts to access an undefined element of a
  25609.  STRUCTURE hangs your machine under DOS and causes a protection
  25610.  violation under OS/2. The compiler should display the following:
  25611.  
  25612.     error F2509:  (element): not an element of (name)
  25613.  
  25614.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  25615.  We are researching this problem and will post new information here as
  25616.  it becomes available.
  25617.  
  25618.  When you compile with Microsoft FORTRAN version 5.00, the following
  25619.  code hangs the machine under DOS and causes a protection violation
  25620.  under OS/2:
  25621.  
  25622.        STRUCTURE /a/
  25623.           INTEGER b
  25624.        END STRUCTURE
  25625.        RECORD /a/ c
  25626.  
  25627.        c.b = c.b.d    ! b.d is not an element of c
  25628.  
  25629.        END
  25630.  
  25631.  
  25632.  643. PAUSE Command with Input Redirection in FORTRAN
  25633.  
  25634.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  25635.  Operating System:   MS-DOS              | OS/2
  25636.  Flags: ENDUSER | buglist5.00
  25637.  Last Modified: 27-NOV-1990    ArticleIdent: Q67098
  25638.  
  25639.  Beginning with Microsoft FORTRAN version 4.00, the PAUSE command
  25640.  allows you to execute operating system commands while program
  25641.  execution is suspended. When program input is redirected from the
  25642.  keyboard to a file, the PAUSE statement does not work correctly if the
  25643.  program READs from the redirection file or if the program contains
  25644.  multiple PAUSE statements.
  25645.  
  25646.  Microsoft has confirmed this to be a problem in FORTRAN versions 4.x
  25647.  and 5.00. We are researching this problem and will post new
  25648.  information here as it becomes available.
  25649.  
  25650.  When input is redirected from a file and the only data read from the
  25651.  file is one DOS command for a PAUSE statement, the program works
  25652.  correctly. The following short program gives an example:
  25653.  
  25654.  Code, TEST.FOR:
  25655.  
  25656.        write(*,*) 'Before PAUSE'
  25657.        pause
  25658.        write (*,*) 'After PAUSE'
  25659.        end
  25660.  
  25661.  Data file, TEST.DAT:
  25662.  
  25663.     Ver
  25664.  
  25665.  Command line:
  25666.  
  25667.     C:\> TEST < TEST.DAT
  25668.  
  25669.  Output:
  25670.  
  25671.     Before PAUSE
  25672.     Pause - Please enter a blank line (to continue) or a
  25673.       DOS command.
  25674.  
  25675.     MS-DOS Version x.xx
  25676.  
  25677.     After PAUSE
  25678.  
  25679.  If another PAUSE statement is added to the program, only the command
  25680.  for the first PAUSE is executed. The program appears to read to the
  25681.  end of the redirection file when it encounters the first PAUSE. If a
  25682.  READ statement is added to the program after the PAUSE statement, as
  25683.  in the next example, the program again reads to the end of the file.
  25684.  In this case, ERROR 6501 is generated.
  25685.  
  25686.  Code:
  25687.  
  25688.        integer i
  25689.        write(*,*) 'Before PAUSE'
  25690.        pause
  25691.        write (*,*) 'After PAUSE'
  25692.        read(*,*) i
  25693.        write (*,*) i
  25694.        end
  25695.  
  25696.  Data:
  25697.  
  25698.     Ver
  25699.     1
  25700.  
  25701.  Output:
  25702.  
  25703.     Before PAUSE
  25704.     Pause - Please enter a blank line (to continue) or a
  25705.       DOS command.
  25706.  
  25707.     MS-DOS Version x.xx
  25708.  
  25709.     After PAUSE
  25710.     run-time error F6501: READ(CON)
  25711.     - end of file encountered
  25712.  
  25713.  When the READ statement is before the PAUSE statement, the DOS command
  25714.  is not executed:
  25715.  
  25716.  Code:
  25717.  
  25718.        integer i
  25719.        read(*,*) i
  25720.        write (*,*) i
  25721.        write(*,*) 'Before PAUSE'
  25722.        pause
  25723.        write (*,*) 'After PAUSE'
  25724.        end
  25725.  
  25726.  Data:
  25727.  
  25728.     1
  25729.     Ver
  25730.  
  25731.  Output:
  25732.  
  25733.               1
  25734.     Before PAUSE
  25735.     Pause - Please enter a blank line (to continue) or a
  25736.       DOS command.
  25737.  
  25738.     After PAUSE
  25739.  
  25740.  These problems are caused by the PAUSE command not reading data from
  25741.  the redirection file in the same way a READ statement would.
  25742.  
  25743.  Workarounds
  25744.  -----------
  25745.  
  25746.  Do not use redirection on a program with more than one PAUSE
  25747.  statement or a combination of PAUSE and READ statements.
  25748.  
  25749.  Use the OPEN command to open a file to be used for input
  25750.  for READ statements.
  25751.  
  25752.  Use calls to the C functions SYSTEM or SPAWNLP instead of PAUSE
  25753.  statements to execute DOS commands. For more information on these
  25754.  functions, see page 86 of the "FORTRAN Advanced Topics" manual for
  25755.  version 5.00 or the DEMOEXEC.FOR program included with versions 4.x
  25756.  and 5.00 of FORTRAN.
  25757.  
  25758.  This problem does not occur in earlier versions of FORTRAN because the
  25759.  functionality of the PAUSE statement is different. In earlier
  25760.  versions, you are not allowed to execute DOS commands after a PAUSE.
  25761.  
  25762.  
  25763.  644. Problems Initializing Structure Arrays in DATA Statements
  25764.  
  25765.  Product Version(s): 5.00   | 5.00
  25766.  Operating System:   MS-DOS | OS/2
  25767.  Flags: ENDUSER | buglist5.00
  25768.  Last Modified: 27-NOV-1990    ArticleIdent: Q67150
  25769.  
  25770.  Initializing indexed structures in DATA statements can produce the
  25771.  following compiler error in Microsoft FORTRAN when the DATA statement
  25772.  contains an implied DO-list and the structure contains an array as an
  25773.  element:
  25774.  
  25775.     F2414: DATA : not array-element name
  25776.  
  25777.  The following error occurs when the DATA statement contains an implied
  25778.  DO-list and the structure variable is an array:
  25779.  
  25780.     F2409: nonstatic address illegal in initialization
  25781.  
  25782.  The following errors occur when the array is specified without an
  25783.  index and the necessary amount of data to fill the array is then
  25784.  specified:
  25785.  
  25786.     F2537: VAR : array subscripts missing
  25787.     F4400 warning: DATA : more constants than names
  25788.  
  25789.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  25790.  We are researching this problem and will post new information here as
  25791.  it becomes available.
  25792.  
  25793.  The following code produces the compiler error
  25794.  
  25795.     F2414: DATA : not array-element name
  25796.  
  25797.  when a structure with an indexed element is initialized in a DATA
  25798.  statement with an implied DO-list. The commented DATA statement works
  25799.  correctly.
  25800.  
  25801.        INTEGER i
  25802.  
  25803.        STRUCTURE /struct/
  25804.           integer var(3)
  25805.        END STRUCTURE
  25806.  
  25807.        RECORD /struct/ test
  25808.  
  25809.        DATA (test.var(i), i=1,3) / 1, 2, 3 /
  25810.  
  25811.  C     DATA test.var(1), test.var(2), test.var(3) / 1, 2, 3 /
  25812.  
  25813.        write(*,*) test.var
  25814.  
  25815.        END
  25816.  
  25817.  The following code produces the compiler error
  25818.  
  25819.     F2409: TEST : nonstatic address illegal in initialization
  25820.  
  25821.  when an indexed structure is initialized in a DATA statement with an
  25822.  implied DO-loop. The commented DATA statement works correctly.
  25823.  
  25824.        INTEGER i
  25825.  
  25826.        STRUCTURE /struct/
  25827.           integer var
  25828.        END STRUCTURE
  25829.  
  25830.        RECORD /struct/ test(3)
  25831.  
  25832.        DATA (test(i).var, i=1,3) / 1, 2, 3 /
  25833.  
  25834.  C     DATA test(1).var, test(2).var, test(3).var / 1, 2, 3 /
  25835.  
  25836.        write(*,*) test.var
  25837.  
  25838.        END
  25839.  
  25840.  The following code produces the compiler error and warning
  25841.  
  25842.     F2537: VAR : array subscripts missing
  25843.     F4400 warning: DATA : more constants than names
  25844.  
  25845.  when no index is specified for a structure variable array or a
  25846.  structure element that is an array, and the necessary amount of data
  25847.  to fill the array is then specified. The commented DATA statement
  25848.  works correctly.
  25849.  
  25850.        INTEGER i, dummy_array(3)
  25851.  
  25852.        STRUCTURE /struct/
  25853.           integer var(3)
  25854.        END STRUCTURE
  25855.  
  25856.        RECORD /struct/ test
  25857.  
  25858.        DATA test.var / 1, 2, 3 /
  25859.  
  25860.  C     DATA dummy_array / 1, 2, 3 /
  25861.  
  25862.        write(*,*) test.var
  25863.  
  25864.        END
  25865.  
  25866.  Workarounds
  25867.  -----------
  25868.  
  25869.  Use a DO-loop and assignment statements.
  25870.  
  25871.  List each structure element in the DATA statement rather than using an
  25872.  implied DO-list.
  25873.  
  25874.  Use a DO-loop to READ in each element from a file. This last option
  25875.  does not work when the structure variable is an array. Reading a
  25876.  structure element in this case produces error F2725. For more
  25877.  information about this error, query on the following word:
  25878.  
  25879.     F2725
  25880.  
  25881.  Note: Using the patched version of F1.EXE and disabling optimization
  25882.  have no effect. For more information on the FORTRAN 5.00 patch, query
  25883.  on the following word:
  25884.  
  25885.     FORPATCH.ARC
  25886.  
  25887.  
  25888.  645. Compiler Errors in INCLUDE Files Not Flagged in Listing File
  25889.  
  25890.  Product Version(s): 5.00   | 5.00
  25891.  Operating System:   MS-DOS | OS/2
  25892.  Flags: ENDUSER | buglist5.00
  25893.  Last Modified: 27-NOV-1990    ArticleIdent: Q67167
  25894.  
  25895.  When a compiler error occurs in an INCLUDE file, the compiler error
  25896.  messages do not appear in the source listing file generated by the
  25897.  Microsoft FORTRAN version 5.00 compiler. However, the total number of
  25898.  detected errors tallied at the end of the listing file is correct.
  25899.  
  25900.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  25901.  We are researching this problem and will post new information here as
  25902.  it becomes available.
  25903.  
  25904.  When the FL command is issued with the /Fs option, a source listing
  25905.  file is created that should contain any compiler errors next to the
  25906.  line of source code that generated the error. The errors are also sent
  25907.  to the screen and subsequently to the M editor, if compilation is
  25908.  being done from within the editor. If a compiler error is generated on
  25909.  a source line in an INCLUDE file, the error is correctly flagged on
  25910.  output to the screen and consequently to the editor, but not correctly
  25911.  inserted into the source listing file.
  25912.  
  25913.  In the following code, the INCLUDE file has one error (which is not
  25914.  flagged in the listing file), and the program source file has one
  25915.  error to demonstrate how the listing file should flag errors.
  25916.  
  25917.  Source file (foo.for):
  25918.  
  25919.        program main
  25920.        include 'test'
  25921.        write(*,*) 'This is a test'
  25922.        writ(*,*) 'This is also a bad line'
  25923.        end
  25924.  
  25925.  Include file (test):
  25926.  
  25927.        writ(*,*) 'This is a bad line'
  25928.  
  25929.  List file:
  25930.  
  25931.  PAGE   1
  25932.  
  25933.  11-14-90
  25934.  
  25935.  03:09:12
  25936.  
  25937.   Line#  Source Line          Microsoft FORTRAN Optimizing Compiler
  25938.  Version 5.00
  25939.  
  25940.       1        program main
  25941.       2        include 'test'
  25942.        ***** Begin listing of: test
  25943.       1        writ(*,*) 'This is a bad line'
  25944.        ***** End listing of: test
  25945.       3        write(*,*) 'This is a test'
  25946.       4        writ(*,*) 'This is also a bad line'
  25947.  ***** foo.for(4) : error F2115: syntax error
  25948.       5        end
  25949.  
  25950.  2 errors detected
  25951.  
  25952.  
  25953.  646. F1001: Internal Compiler Error, ctypes.c: with ICHAR Function
  25954.  
  25955.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  25956.  Operating System:   MS-DOS              | OS/2
  25957.  Flags: ENDUSER | buglist5.00
  25958.  Last Modified: 28-NOV-1990    ArticleIdent: Q67168
  25959.  
  25960.  When a nonarray character string is incorrectly used as an
  25961.  array in the ICHAR function, the following error is generated:
  25962.  
  25963.     F1001: Internal Compiler Error
  25964.  
  25965.  The compiler file listed depends on the version of FORTRAN used. The
  25966.  following are the different compiler files and line numbers listed
  25967.  by the errors generated by the different versions of FORTRAN:
  25968.  
  25969.     (compiler file @(#)ctypes.c:1.11, line 448)
  25970.        with FORTRAN 5.00,
  25971.  
  25972.     (compiler file @(#)ctypes.c:1.89, line 428)
  25973.        with FORTRAN 4.10,
  25974.  
  25975.     (compiler file @(#)ctypes.c:1.88, line 428)
  25976.        with FORTRAN 4.01,
  25977.  
  25978.     (compiler file @(#)ctypes.c:1.80, line 426)
  25979.        with FORTRAN 4.00.
  25980.  
  25981.  The following error should be generated:
  25982.  
  25983.     F2512: argument list illegal.
  25984.  
  25985.  Microsoft has confirmed this to be a problem in FORTRAN version 5.10.
  25986.  We are researching this problem and will post new information here as
  25987.  it becomes available.
  25988.  
  25989.  The following sample code produces this error:
  25990.  
  25991.        CHARACTER*5 strg
  25992.  
  25993.        ival = ICHAR(strg(j))
  25994.  
  25995.        END
  25996.  
  25997.  Note that "strg" is a nonarray character string and the ICHAR function
  25998.  is attempting to reference "strg" as an array. This error could be
  25999.  caused by incorrectly trying to reference a single character of
  26000.  "strg." To reference a single character, the ICHAR statement would
  26001.  have the following form:
  26002.  
  26003.     ival = ICHAR(strg(j:j))
  26004.  
  26005.  Substring manipulation is discussed on pages 17 and 18 of the
  26006.  "Microsoft FORTRAN Reference" manual for version 5.00 in the Elements
  26007.  of FORTRAN chapter.
  26008.  
  26009.  Also, if the character string "strg" is changed to CHARACTER*4 or
  26010.  less, the program compiles without an error, even though it still
  26011.  should generate a F2512 error.
  26012.  
  26013.  
  26014.  647. How to Avoid the "Program Too Large for Memory" FORTRAN Error
  26015.  
  26016.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  26017.  Operating System:   MS-DOS              | OS/2
  26018.  Flags: ENDUSER |
  26019.  Last Modified: 27-NOV-1990    ArticleIdent: Q67194
  26020.  
  26021.  When you attempt to run a very large program in DOS, the error
  26022.  "Program Too Large For Memory" may occur. MS-DOS runs in real mode,
  26023.  which does not allow more than 640K of memory for applications. This
  26024.  article discusses possible methods to circumvent this limitation.
  26025.  These methods include using the OS/2 operating system instead of DOS,
  26026.  direct-access disk file(s) for data storage, ALLOCATABLE arrays, and
  26027.  overlays.
  26028.  
  26029.  Using Expanded and Extended Memory with Microsoft FORTRAN
  26030.  ---------------------------------------------------------
  26031.  
  26032.  Some DOS applications can use an expanded memory manager (EMM) driver
  26033.  program and expanded memory board(s) to access memory beyond the 1 MB
  26034.  limit of conventional memory. Microsoft FORTRAN, however, does not
  26035.  have the capability to use expanded memory. It can utilize extended
  26036.  memory (above 1 MB), but only when used with the OS/2 operating system
  26037.  and protected mode libraries. Extended memory is the term used to
  26038.  refer to the memory at physical addresses above 1 MB that can be
  26039.  accessed by an 80286 or 80386 CPU in protected mode.
  26040.  
  26041.  Using a Direct Access Disk File to Store Large Amounts of Data
  26042.  --------------------------------------------------------------
  26043.  
  26044.  A disk drive can be used to store large amounts of data in a direct-
  26045.  access disk file, thus freeing up the memory that would otherwise be
  26046.  used by the data. By using a direct-access file, records can be read
  26047.  from or written to in any order, simulating the use of an array. If
  26048.  expanded or extended memory is available, it can be used for a RAM
  26049.  drive. By using a RAM drive, I/O access to the data is much faster
  26050.  than when using a fixed disk drive.
  26051.  
  26052.  Using Allocatable Arrays in FORTRAN Version 5.00
  26053.  ------------------------------------------------
  26054.  
  26055.  An ALLOCATABLE array is an array that is dynamically sized at run time
  26056.  by using the ALLOCATE statement and the ALLOCATABLE attribute (see
  26057.  pages 21-25 of the "Microsoft FORTRAN Reference" manual). The ALLOCATE
  26058.  statement (see pages 113-114 of the "Microsoft FORTRAN Reference"
  26059.  manual) establishes the upper and lower bounds of each ARRAY dimension
  26060.  and reserves sufficient memory. The array can then be DEALLOCATED at
  26061.  run time by using the DEALLOCATE statement (see page 143 of the
  26062.  "Microsoft FORTRAN Reference" manual) to free memory for use by other
  26063.  arrays.
  26064.  
  26065.  For example:
  26066.  
  26067.    INTEGER data [ALLOCATABLE] (:,:)
  26068.    INTEGER error
  26069.    DATA i, j / 10,50 /
  26070.    ALLOCATE (data (i,j), STAT=error)
  26071.  
  26072.    DEALLOCATE (data, STAT=error)
  26073.  
  26074.  Using Overlays in FORTRAN Versions 4.00, 4.01, 4.10, and 5.00
  26075.  -------------------------------------------------------------
  26076.  
  26077.  Overlays (see pages 366-367 of the "Microsoft FORTRAN Reference"
  26078.  manual for versions 5.00 and pages 258-260 of the "Microsoft FORTRAN
  26079.  CodeView and Utilities User's Guide") allow several program modules to
  26080.  use the same memory area. When needed, a module or group of modules is
  26081.  loaded into memory from the disk. Module access time can be shortened
  26082.  if a RAM drive is used to store the executable. Modules that are to be
  26083.  overlaid are enclosed in parentheses. CODE (but NEVER DATA) is
  26084.  overlaid. Note: If the program consists of mostly DATA, then this
  26085.  procedure will be of little help.
  26086.  
  26087.  The following example is for versions 4.00, 4.01, 4.10, and 5.00:
  26088.  
  26089.     At LINK command line: LINK A (B C) (E F)
  26090.  
  26091.     Object modules B and C are swapped in and out of the same memory for
  26092.     Object modules E and F. Note: Object modules in parentheses are
  26093.     overlaid together so that they will be loaded into memory at the
  26094.     same time.
  26095.  
  26096.  The following example is for versions 4.10 and 5.00:
  26097.  
  26098.     At FL command line: FL MAIN.FOR (OVER1.FOR) (OVER2.FOR)
  26099.  
  26100.     FORTRAN code modules OVER1 and OVER2 are swapped in and out of the
  26101.     same memory location.
  26102.  
  26103.  
  26104.  648. Using ANSI Escape Sequences to Clear the Screen
  26105.  
  26106.  Product Version(s): 3.20 3.30 3.31 4.00 4.01 4.10 5.00 | 4.10 5.00
  26107.  Operating System:   MS-DOS                             | OS/2
  26108.  Flags: ENDUSER |
  26109.  Last Modified: 27-NOV-1990    ArticleIdent: Q67195
  26110.  
  26111.  An ANSI escape sequence can be used within a FORTRAN program to clear
  26112.  the screen. Programs can use a subset of the ANSI 3.64-1979 standard
  26113.  escape sequences to erase the display, set the display mode and
  26114.  attributes, and control the cursor in a hardware-independent manner.
  26115.  
  26116.  In real mode, the ANSI.SYS device driver is used to support ANSI
  26117.  escape sequences. It is installed in the CONFIG.SYS file with the
  26118.  following command:
  26119.  
  26120.     DEVICE=[drive:][path]ANSI.SYS
  26121.  
  26122.  In protected mode, support for ANSI escape sequences come from an OS/2
  26123.  AVIO ("advanced video input/output") function.
  26124.  
  26125.  An ANSI escape sequence is a sequence of ASCII characters, the first
  26126.  two of which must be the escape character (char(27)) and the
  26127.  left-bracket character ([). The characters following the escape and
  26128.  left-bracket characters vary with the type of control function being
  26129.  performed.
  26130.  
  26131.  An escape sequence cannot be entered directly at the system prompt
  26132.  because each ANSI escape sequence must begin with an escape character.
  26133.  If you press the ESC key, MS-DOS cancels the command line.
  26134.  
  26135.  The following program uses the ANSI escape sequence (ESC[2J) to clear
  26136.  the screen:
  26137.  
  26138.        character*1 clrstr(4)
  26139.        data clrstr /' ','[','2','J'/
  26140.        clrstr(1) = char(27)            ! Escape character (ASCII 27).
  26141.        write (*,'(1x,4a1\)') clrstr    ! You must use a 1x as the first
  26142.        end                             ! part of the format specifier
  26143.                                        ! to ensure output of escape
  26144.                                        ! character.
  26145.  
  26146.  The CHAR(int) intrinsic function is used to form either printing or
  26147.  nonprinting characters using the corresponding integer from the ASCII
  26148.  table.
  26149.  
  26150.  
  26151.  649. Problem with Character*(*) Length Specifier in FORTRAN
  26152.  
  26153.  Product Version(s): 4.00 5.00 | 5.00
  26154.  Operating System:   MS-DOS    | OS/2
  26155.  Flags: ENDUSER | buglist5.00
  26156.  Last Modified: 30-NOV-1990    ArticleIdent: Q67227
  26157.  
  26158.  In a Microsoft FORTRAN version 4.00 or 5.00 program, invalid output
  26159.  can be generated in a subroutine that accepts a character string with
  26160.  the CHARACTER*(*) length specifier. For the error to occur, the
  26161.  following conditions must also exist:
  26162.  
  26163.  1. There must be at least one initial CALL to a subroutine in which a
  26164.     character argument is passed.
  26165.  
  26166.  2. The CALL to the subroutine that produces invalid output must
  26167.     contain, as its first actual argument, a reference to a function.
  26168.     This function must accept a character argument. The length of the
  26169.     character argument it accepts must be different than the length of
  26170.     the character argument passed as the second actual argument in the
  26171.     faulty subroutine.
  26172.  
  26173.     Note: In this situation, the second formal argument to the
  26174.     subroutine, which is typed as CHARACTER*(*), assumes the length of
  26175.     the character string from the function reference, instead of the
  26176.     correct length.
  26177.  
  26178.  The following example produces the invalid output:
  26179.  
  26180.        integer*4 IFUN
  26181.        character*1 C1
  26182.        character*2 C2
  26183.         c2='xy'
  26184.         call sub1(c1)
  26185.         call sub2(IFUN(c1),c2)    ! line 7
  26186.        end
  26187.  C
  26188.        subroutine sub1(x)
  26189.         character *(*) x
  26190.        end
  26191.  C
  26192.        subroutine sub2(i,c)
  26193.         character *(*) c
  26194.         integer i
  26195.         print*,c             ! prints "x" instead of "xy"
  26196.         print*,len(c)        ! prints 1 instead of 2
  26197.        end
  26198.  C
  26199.        integer*4 function IFUN(c)
  26200.         character*(*) c
  26201.         IFUN=0
  26202.        end
  26203.  
  26204.  The actual length being returned for c2 is the length of c1.
  26205.  
  26206.  In Microsoft FORTRAN version 5.00, the compiler leaves out an assembly
  26207.  code line passing the length of the character string to the second
  26208.  subroutine. Versions 4.1 and 4.01 retain this assembly code and work
  26209.  correctly. Version 4.00 has many differences at the assembly level
  26210.  and nothing can be concluded.
  26211.  
  26212.  Note: The /Od switch does not affect this code.
  26213.  
  26214.  A possible solution would be to replace line 7 with one of
  26215.  the following:
  26216.  
  26217.  1. Switch the order of the following arguments:
  26218.  
  26219.        call sub2(c2,IFUN(c1))
  26220.  
  26221.  2. Use an intermediate variable, as follows:
  26222.  
  26223.        j=IFUN(c1)
  26224.        call sub2(j,c2)
  26225.  
  26226.  Microsoft has confirmed this to be a problem in FORTRAN
  26227.  versions 4.00 and 5.00. We are researching this problem and
  26228.  will post new information here as it becomes available.
  26229.  
  26230.  
  26231.  650. Extending a Common Block with an EQUIVALENCE Statement
  26232.  
  26233.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  26234.  Operating System:   MS-DOS              | OS/2
  26235.  Flags: ENDUSER |
  26236.  Last Modified: 30-NOV-1990    ArticleIdent: Q67229
  26237.  
  26238.  An EQUIVALENCE statement can be used to extend a common block size by
  26239.  EQUIVALENCing the last element of a common block with the first element
  26240.  of an array that is not in a common block. This is demonstrated
  26241.  in the code below.
  26242.  
  26243.  This article expands upon the information in the EQUIVALENCE statement
  26244.  section of the "Microsoft FORTRAN Reference" manual, which discusses
  26245.  extending common blocks found.
  26246.  
  26247.  The following code fragment shows a common block being extended from
  26248.  4 bytes to 800 bytes in length.
  26249.  
  26250.  C ***** FORTRAN program fragment *****
  26251.  
  26252.        REAL*4 VAR, A(200)
  26253.        COMMON /TEST/ VAR
  26254.        EQUIVALENCE (VAR, A(1))
  26255.  
  26256.  In this fragment, the common block TEST is initially 4 bytes in
  26257.  length. The equivalence statement specifies that VAR and A(1) will
  26258.  share the same location in memory. Because all of A's elements are
  26259.  contiguous in memory, the common block TEST is extended to be 200 x 4
  26260.  or 800 bytes in length. This is shown graphically below:
  26261.  
  26262.     |01|02|03|04|05|06|07|08|09|0A|0B|0C|0D|0E|0F|10|
  26263.     |------------------------------------------------
  26264.     |....VAR....|
  26265.     |------------------------------------------------
  26266.     |....A(1)...|....A(2)...|....A(3)...|....A(4)...|
  26267.     |------------------------------------------------
  26268.     |<-- Beginning address of common block TEST
  26269.  
  26270.  The guidelines listed below must be followed when using EQUIVALENCE to
  26271.  extend a common block's length:
  26272.  
  26273.  1. A common block may only be extended by adding elements to the end
  26274.     of the common block. An EQUIVALENCE operation cannot add elements
  26275.     that precede the common block as in the following example:
  26276.  
  26277.  C ***** FORTRAN program fragment *****
  26278.  
  26279.        REAL*4 VAR, A(200)
  26280.        COMMON /TEST/ VAR
  26281.        EQUIVALENCE (VAR, A(2))
  26282.  
  26283.     Here VAR and A(2) will share the same memory location. Because A(1)
  26284.     precedes A(2) in memory, it will also precede VAR, which is the
  26285.     beginning of the common block. This is called extending a common
  26286.     block forward and is shown graphically below:
  26287.  
  26288.        |??|??|??|??|01|02|03|04|05|06|07|08|09|0A|0B|0C|0D|0E|0F|10
  26289.        ------------|------------------------------------------------
  26290.        ............|....VAR....|
  26291.        ------------|------------------------------------------------
  26292.        |....A(1)...|....A(2)...|....A(3)...|....A(4)...|....A(5)...
  26293.        ------------|------------------------------------------------
  26294.        ............|<-- Beginning address of common block TEST
  26295.  
  26296.     The following error is generated when the code listed above is
  26297.     compiled:
  26298.  
  26299.        F2320: A : EQUIVALENCE : extends common block TEST forward
  26300.  
  26301.  2. The ANSI FORTRAN 77 Standard states that a NAMED common block must
  26302.     be of the same size in all program units of an executable program
  26303.     in which it appears. For this reason, when a NAMED common block is
  26304.     extended, every subsequent subprogram accessing the common block
  26305.     must declare it according to its new size. For example, in the
  26306.     code below, a NAMED common block is again declared with one REAL*4
  26307.     element and then EQUIVALENCEd with a 200 element REAL*4 array. In
  26308.     the subroutine, the common block is then declared with its new size
  26309.     of 200 elements:
  26310.  
  26311.  C ***** FORTRAN program fragment *****
  26312.  
  26313.        PROGRAM main
  26314.        REAL*4 VAR, A(200)
  26315.        COMMON /TEST/ VAR
  26316.        EQUIVALENCE (VAR, A(1))
  26317.        CALL sub()
  26318.        .
  26319.        .
  26320.        END
  26321.  
  26322.        SUBROUTINE sub ()
  26323.        REAL*4 B
  26324.        COMMON /TEST/ B(200)
  26325.        .
  26326.        .
  26327.        RETURN
  26328.        END
  26329.  
  26330.     However, FORTRAN 5.00 will allow a NAMED common block to have
  26331.     different sizes in subprogram units. In this situation, the compiler
  26332.     generates the following warning:
  26333.  
  26334.        F4329: TEST : COMMON : size changed
  26335.  
  26336.     If the /4Ys compile option or $STRICT metacommand is used with
  26337.     FORTRAN 5.00, or if the program is compiled with FORTRAN 4.x, the
  26338.     error
  26339.  
  26340.        F2323: TEST : COMMON : size changed
  26341.  
  26342.     is generated when a NAMED common block's size is changed in a
  26343.     subprogram.
  26344.  
  26345.  
  26346.  651. No Error on Out-of-Range Read of INTEGER*1 Variable
  26347.  
  26348.  Product Version(s): 4.00 4.01 4.10 5.00 | 4.10 5.00
  26349.  Operating System:   MS-DOS              | OS/2
  26350.  Flags: ENDUSER | buglist4.x buglist5.00
  26351.  Last Modified: 30-NOV-1990    ArticleIdent: Q67230
  26352.  
  26353.  With a program compiled under Microsoft FORTRAN, reading a value that
  26354.  is less than -128 or more than +127 into an INTEGER*1 variable can
  26355.  fail to produce the expected error.
  26356.  
  26357.  The compiler should generate the following error:
  26358.  
  26359.     run-time error F6100:  READ
  26360.     -INTEGER overflow on input
  26361.  
  26362.  The following code reproduces the problem:
  26363.  
  26364.        integer*1 i
  26365.  10    read (*,*) i
  26366.        write (*,*) i
  26367.        goto 10
  26368.        end
  26369.  
  26370.  Entering the following values produces the corresponding results:
  26371.  
  26372.      0-127     Returns proper value
  26373.  
  26374.      128-255   Causes a Run-Time Error (RTE) as expected
  26375.  
  26376.      256-383   Returns value minus 256 (should cause an RTE)
  26377.  
  26378.      384-511   Causes an RTE
  26379.  
  26380.  This cycle repeats every 128 values.
  26381.  
  26382.  It appears that the run-time error management routine is inspecting
  26383.  the first byte of the input value to see if it is within range, and
  26384.  ignoring the remaining bytes. The following is an example:
  26385.  
  26386.      127 =  01111111               Returns the value 127
  26387.  
  26388.      128 =  10000000               Returns Run-time error
  26389.  
  26390.      255 =  00000000 11111111      Returns Run-time error
  26391.  
  26392.      256 =  00000001 00000000      Returns the value 0
  26393.  
  26394.  Thus, if the first byte is out of range, the program will correctly
  26395.  generate the error. However, if the first byte is in range, the
  26396.  program ignores all other bytes, fails to produce the error, and
  26397.  returns the value of the first byte. The /4Yb and $DEBUG metacommand
  26398.  do not affect the results.
  26399.  
  26400.  Microsoft has confirmed this to be a problem in FORTRAN versions 4.xx
  26401.  and 5.00. We are researching this problem and will post new
  26402.  information here as it becomes available.
  26403.  
  26404.  
  26405.  652. F1001: XX-2, Line 539, Allocating 43 Arrays in One Statement
  26406.  
  26407.  Product Version(s): 5.00   | 5.00
  26408.  Operating System:   MS-DOS | OS/2
  26409.  Flags: ENDUSER | buglist5.00
  26410.  Last Modified: 30-NOV-1990    ArticleIdent: Q67231
  26411.  
  26412.  When you allocate 43 or more arrays with one ALLOCATE statement in
  26413.  Microsoft FORTRAN version 5.00, the following error is produced, where
  26414.  XX = ASCII characters 2 and 254:
  26415.  
  26416.     fatal error F1001:  Internal Compiler Error
  26417.     (compiler file "XX-2," line 539)
  26418.  
  26419.  Solution
  26420.  --------
  26421.  
  26422.  Breaking the ALLOCATE statement into two separate statements
  26423.  eliminates the error.
  26424.  
  26425.  The size of the arrays has no effect on the error. If only 42 arrays
  26426.  are defined and allocated, the error is not generated.
  26427.  
  26428.  The following code reproduces the internal compiler error:
  26429.  
  26430.        INTEGER
  26431.       + a1  [ALLOCATABLE] (:), a2  [ALLOCATABLE] (:),
  26432.       + a3  [ALLOCATABLE] (:), a4  [ALLOCATABLE] (:),
  26433.       + a5  [ALLOCATABLE] (:), a6  [ALLOCATABLE] (:),
  26434.       + a7  [ALLOCATABLE] (:), a8  [ALLOCATABLE] (:),
  26435.       + a9  [ALLOCATABLE] (:), a10 [ALLOCATABLE] (:),
  26436.       + a11 [ALLOCATABLE] (:), a12 [ALLOCATABLE] (:),
  26437.       + a13 [ALLOCATABLE] (:), a14 [ALLOCATABLE] (:),
  26438.       + a15 [ALLOCATABLE] (:), a16 [ALLOCATABLE] (:),
  26439.       + a17 [ALLOCATABLE] (:), a18 [ALLOCATABLE] (:),
  26440.       + a19 [ALLOCATABLE] (:), a20 [ALLOCATABLE] (:),
  26441.       + a21 [ALLOCATABLE] (:), a22 [ALLOCATABLE] (:),
  26442.       + a23 [ALLOCATABLE] (:), a24 [ALLOCATABLE] (:),
  26443.       + a25 [ALLOCATABLE] (:), a26 [ALLOCATABLE] (:),
  26444.       + a27 [ALLOCATABLE] (:), a28 [ALLOCATABLE] (:),
  26445.       + a29 [ALLOCATABLE] (:), a30 [ALLOCATABLE] (:),
  26446.       + a31 [ALLOCATABLE] (:), a32 [ALLOCATABLE] (:),
  26447.       + a33 [ALLOCATABLE] (:), a34 [ALLOCATABLE] (:),
  26448.       + a35 [ALLOCATABLE] (:), a36 [ALLOCATABLE] (:),
  26449.       + a37 [ALLOCATABLE] (:), a38 [ALLOCATABLE] (:),
  26450.       + a39 [ALLOCATABLE] (:), a40 [ALLOCATABLE] (:),
  26451.       + a41 [ALLOCATABLE] (:), a42 [ALLOCATABLE] (:),
  26452.       + a43 [ALLOCATABLE] (:)
  26453.  
  26454.        ALLOCATE (
  26455.       + a1  (1), a2  (1), a3  (1), a4  (1), a5  (1),
  26456.       + a6  (1), a7  (1), a8  (1), a9  (1), a10 (1),
  26457.       + a11 (1), a12 (1), a13 (1), a14 (1), a15 (1),
  26458.       + a16 (1), a17 (1), a18 (1), a19 (1), a20 (1),
  26459.       + a21 (1), a22 (1), a23 (1), a24 (1), a25 (1),
  26460.       + a26 (1), a27 (1), a28 (1), a29 (1), a30 (1),
  26461.       + a31 (1), a32 (1), a33 (1), a34 (1), a35 (1),
  26462.       + a36 (1), a37 (1), a38 (1), a39 (1), a40 (1),
  26463.       + a41 (1), a42 (1), a43 (1))
  26464.        END
  26465.  
  26466.  To avoid this error, limit each ALLOCATE statement to less than 43
  26467.  arrays.
  26468.  
  26469.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  26470.  We are researching this problem and will post new information here as
  26471.  it becomes available.
  26472.  
  26473.  
  26474.  653. EXIT Statement Not Flagged as Nonstandard Statement
  26475.  
  26476.  Product Version(s): 5.00   | 5.00
  26477.  Operating System:   MS-DOS | OS/2
  26478.  Flags: ENDUSER |
  26479.  Last Modified: 30-NOV-1990    ArticleIdent: Q67232
  26480.  
  26481.  The EXIT statement, implemented in Microsoft FORTRAN version 5.00, is
  26482.  documented as an extension to the ANSI FORTRAN 77 standard (it appears
  26483.  in blue type in the "Microsoft FORTRAN Reference" manual). In
  26484.  addition, the EXIT statement does not appear in the list of IBM SAA
  26485.  and VAX extensions on pages 330-332 of the "Microsoft FORTRAN
  26486.  Reference" manual. For these reasons, the EXIT statement should
  26487.  generate the following error
  26488.  
  26489.     F2732 EXIT:  nonstandard statement
  26490.  
  26491.  when a FORTRAN 5.00 program is compiled with the $STRICT metacommand,
  26492.  or the /4Ys, /4Yi, or /4Yv compile option. This error is not generated
  26493.  under any circumstances.
  26494.  
  26495.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  26496.  We are researching this problem and will post new information here as
  26497.  it becomes available.
  26498.  
  26499.  
  26500.  654. Opening More than 123 Files Causes Error F6415 or F6417
  26501.  
  26502.  Product Version(s): 5.00   | 5.00
  26503.  Operating System:   MS-DOS | OS/2
  26504.  Flags: ENDUSER | buglist5.00
  26505.  Last Modified:  4-DEC-1990    ArticleIdent: Q67318
  26506.  
  26507.  After you increase the limit for the maximum number of open files to
  26508.  any number above 128, as discussed on pages 405 and 406 of the
  26509.  "Microsoft FORTRAN Reference" manual, the run-time error
  26510.  
  26511.     F6415: OPEN(file name)
  26512.     - file already exists
  26513.  
  26514.  or the run-time error
  26515.  
  26516.       F6417: OPEN(file name)
  26517.       - too many open files
  26518.  
  26519.  will be produced. FORTRAN generates these errors when you attempt to
  26520.  open more than 123 files at one time. Because FORTRAN reserves five
  26521.  file handles for its own use, the error occurs when the 129th file
  26522.  handle is requested. However, page 405 of the "Microsoft FORTRAN
  26523.  Reference" manual states that the maximum limit of open files is 256.
  26524.  
  26525.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  26526.  We are researching this problem and will post new information here as
  26527.  it becomes available.
  26528.  
  26529.  If 123 files are already open and the 124th file does not exist, the
  26530.  following error will be generated:
  26531.  
  26532.     F6415: OPEN(file name)
  26533.     - file already exists
  26534.  
  26535.  If the 124th file to be opened exists, the following error will
  26536.  be generated:
  26537.  
  26538.     F6417: OPEN(file name)
  26539.     - too many open files
  26540.  
  26541.  On some systems, only 122 files can be opened; while on other systems
  26542.  if the 124th file does not exist, it is created before the error
  26543.  message is generated.
  26544.  
  26545.  
  26546.  655. F1001: omf_ms.c:1.118, line 2785; Common Block Too Large
  26547.  
  26548.  Product Version(s): 5.00   | 5.00
  26549.  Operating System:   MS-DOS | OS/2
  26550.  Flags: ENDUSER | buglist5.00
  26551.  Last Modified: 10-DEC-1990    ArticleIdent: Q67420
  26552.  
  26553.  When the data in a COMMON block exceeds 45,940,736 (44,864K) bytes,
  26554.  the Microsoft FORTRAN version 5.00 compiler generates the following
  26555.  error:
  26556.  
  26557.     fatal error F1001: Internal Compiler Error
  26558.     (compiler file '@(#)omf_ms.c:1.118', line 2785)
  26559.  
  26560.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  26561.  We are researching this problem and will post new information here as
  26562.  it becomes available.
  26563.  
  26564.  The following code generates this error:
  26565.  
  26566.         INTEGER*1 A(45940737)
  26567.         COMMON  A
  26568.         END
  26569.  
  26570.  Any combination of data that adds up to more then 44,864K bytes will
  26571.  generate this error. The COMMON block can be named or unnamed.
  26572.  
  26573.  The following is another code sample that generates this error:
  26574.  
  26575.         REAL*4 A(3388,3388)
  26576.         INTEGER*1 B(26561)
  26577.         COMMON /TEST/ A,B
  26578.         END
  26579.  
  26580.  FORTRAN versions 4.x do not produce this error; instead, versions 4.x
  26581.  under DOS cause the following error:
  26582.  
  26583.     fatal error F1039: unrecoverable heap overflow in Pass 3
  26584.  
  26585.  FORTRAN 4.10 under OS/2 produces no compiler errors with the above
  26586.  code.
  26587.  
  26588.  Although using a slightly smaller amount of data allows compilation,
  26589.  using this much data in a single module will violate other limitations
  26590.  of the FORTRAN compiler and linker. For example, decreasing the size
  26591.  of the INTEGER array in the above code sample allows compilation with
  26592.  FORTRAN 5.00, but generates the following linker error:
  26593.  
  26594.     fatal error L1047: too many group, segment, and class names in
  26595.     one module
  26596.  
  26597.  The only practical solution is to decrease the size of the arrays
  26598.  significantly. The largest quantity of data that does not violate
  26599.  the limits on the number of group, segment, and class names is
  26600.  15,990,784 bytes, or 244 segments of 64K bytes per segment.
  26601.  
  26602.  
  26603.  656. Adjustable-Size Arrays Can Hang Machine in FORTRAN 5.00
  26604.  
  26605.  Product Version(s): 5.00   | 5.00
  26606.  Operating System:   MS-DOS | OS/2
  26607.  Flags: ENDUSER | buglist5.00
  26608.  Last Modified: 15-FEB-1991    ArticleIdent: Q67515
  26609.  
  26610.  Using the Microsoft FORTRAN 5.00 compiler on a program that contains
  26611.  an adjustable size array without the array being a formal argument to
  26612.  a subroutine can cause the machine to hang during compilation under
  26613.  DOS.
  26614.  
  26615.  This code will cause the compiler to generate an internal compiler error
  26616.  when compiling under OS/2.
  26617.  
  26618.  The compiler should generate the following error messages.
  26619.  
  26620.  In a Subroutine
  26621.  ---------------
  26622.  
  26623.  F2841:  adjustable-size array: not reference argument
  26624.  
  26625.  In a Main Program
  26626.  -----------------
  26627.  
  26628.  F2339:  adjustable-size array not in subprogram
  26629.  
  26630.  To eliminate the problem, include the array as an argument to the
  26631.  subroutine or declare it as ALLOCATABLE and allocate it. Page 145 of
  26632.  the "Microsoft FORTRAN Reference" manual explains how adjustable-sized
  26633.  arrays must be formal arguments to the program unit in which they
  26634.  appear. Allocatable arrays, however, must not be formal arguments.
  26635.  They are discussed on pages 25 and 113 of the "Microsoft FORTRAN
  26636.  Reference" manual. Versions 4.x of the compiler correctly report the
  26637.  error.
  26638.  
  26639.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  26640.  We are researching this problem and will post new information here as
  26641.  it becomes available.
  26642.  
  26643.  The following code reproduces the problem in a subroutine:
  26644.  
  26645.         SUBROUTINE a (b,c)
  26646.         DIMENSION b(1,1),d(c,1,1)
  26647.         e=1
  26648.         d(e,e,e) = d(1,1,1)+b(1,1)*d(1,1,1)
  26649.         END
  26650.  
  26651.  The error is dependent on both of the assignment statements and the
  26652.  arithmetic in the second statement. For example, changing the
  26653.  left-hand side of the equation in the second assignment statement to
  26654.  "d(1,1,1)" instead of "d(e,e,e)" will generate the correct error.
  26655.  
  26656.  The following code reproduces the problem in a main program:
  26657.  
  26658.         DIMENSION b(1,1),d(c,1,1)
  26659.         e=1
  26660.         d(e,e,e) = d(1,1,1)+b(1,1)*d(1,1,1)
  26661.         END
  26662.  
  26663.  In the main program, the following error is generated before
  26664.  causing a Protection Violation or hanging the machine:
  26665.  
  26666.     F2339: Adjustable-size array not in subprogram
  26667.  
  26668.  If an adjustable-size array is desired in the main program, declare
  26669.  the array as ALLOCATABLE and then allocate it using variables to
  26670.  establish the dimensions.
  26671.  
  26672.  
  26673.  657. Structure Element in OPEN Causes Protection Violation
  26674.  
  26675.  Product Version(s): 5.00
  26676.  Operating System:   OS/2
  26677.  Flags: ENDUSER | buglist5.00
  26678.  Last Modified:  9-JAN-1991    ArticleIdent: Q67615
  26679.  
  26680.  Using an element of a structure as a filename in an OPEN statement
  26681.  generates a protection violation when you compile under the OS/2
  26682.  operating system when you use Microsoft FORTRAN version 5.00. To work
  26683.  around this problem, assign the value of this member to a temporary
  26684.  variable and use this with your OPEN statement.
  26685.  
  26686.  There seems to be no problem compiling under DOS, and programs with
  26687.  this code appear to function correctly. Also, programs using this
  26688.  method of opening files, which are compiled under DOS but linked for use
  26689.  under OS/2, appear to run correctly under OS/2.
  26690.  
  26691.  Microsoft has confirmed this to be a problem in the FORTRAN compiler
  26692.  version 5.00. We are researching this problem and will post new
  26693.  information here as it becomes available.
  26694.  
  26695.  The program below illustrates this problem:
  26696.  
  26697.        program test
  26698.  
  26699.        structure /io/
  26700.          character* 12 name
  26701.        end structure
  26702.  
  26703.        record /io/ ioinst
  26704.  
  26705.        ioinst.name = 'test.dat'
  26706.  
  26707.        open (10, file=ioinst.name)
  26708.  
  26709.        end
  26710.  
  26711.  To work around this problem, change the program to the following:
  26712.  
  26713.        program test
  26714.  
  26715.        structure /io/
  26716.          character* 12 name
  26717.        end structure
  26718.        character* 12 tmp
  26719.  
  26720.        record /io/ ioinst
  26721.  
  26722.        ioinst.name = 'test.dat'
  26723.  
  26724.        tmp = ioinst.name
  26725.        open (10, file=tmp)
  26726.  
  26727.        end
  26728.  
  26729.  Another possible solution to this problem is to compile the program
  26730.  under DOS and link for use under OS/2.
  26731.  
  26732.  
  26733.  658. Problem Reading Direct-Access File When RECL > BLOCKSIZE
  26734.  
  26735.  Product Version(s): 4.01 4.10 5.00 | 4.10 5.00
  26736.  Operating System:   MS-DOS         | OS/2
  26737.  Flags: ENDUSER | buglist4.01 buglist4.10 buglist5.00
  26738.  Last Modified:  4-JAN-1991    ArticleIdent: Q68030
  26739.  
  26740.  In Microsoft FORTRAN versions 4.01 through 5.00, when a direct-access
  26741.  file is opened with a BLOCKSIZE set to a value that is less than the
  26742.  RECL (record length), incorrect records may be read from the file.
  26743.  
  26744.  The easiest way to avoid this problem is to always use a record length
  26745.  that is less than or equal to the BLOCKSIZE (the default BLOCKSIZE is
  26746.  1024). Other possible solutions are listed below.
  26747.  
  26748.  Microsoft has confirmed this to be a problem in FORTRAN versions 4.01,
  26749.  4.10, and 5.00. We are researching this problem and will post new
  26750.  information here as it becomes available.
  26751.  
  26752.  The following code demonstrates this problem:
  26753.  
  26754.        CHARACTER*514 ALINE
  26755.        CHARACTER*10  SHORT
  26756.  
  26757.        OPEN(9,ACCESS='DIRECT',RECL=514,
  26758.       +FORM='FORMATTED', BLOCKSIZE=512)
  26759.  
  26760.  C Note that the BLOCKSIZE is smaller than the record length
  26761.  
  26762.        DO 10 J=1,4                        ! Create a file to read.
  26763.           ALINE = 'TEST '// CHAR(#30+J)   ! Put the record number
  26764.           WRITE(9,30,REC=J) ALINE         ! in each record.
  26765.  10    CONTINUE
  26766.  
  26767.  C This is the start of the READ sequence where the problem occurs.
  26768.  
  26769.        READ(9,30,REC=3) SHORT   ! This is the partial read
  26770.                                 ! into record 3.
  26771.  
  26772.        DO 20 I=1,4
  26773.           READ(9,30,REC=I) ALINE
  26774.           WRITE(*,*) ALINE
  26775.  20    CONTINUE
  26776.  30    FORMAT(A)
  26777.        END
  26778.  
  26779.  The first DO-loop in the program constructs a four record
  26780.  direct-access scratch file. This is followed by a partial read of
  26781.  record 3 from the file. The following DO-loop reads the file from
  26782.  record 1 to record 4 and outputs the result to the screen.
  26783.  
  26784.  The program output indicates that the READ statement in the DO-loop
  26785.  improperly accesses the information in the scratch file. Because the
  26786.  RECL (record length) exceeds the BLOCKSIZE (buffer size), each READ
  26787.  forces the buffer to be filled twice. The extra information is not
  26788.  being flushed from the buffer, and is incorrectly read into the
  26789.  variable ALINE on every READ after the initial partial READ of record
  26790.  3.
  26791.  
  26792.  Some ways to avoid this problem:
  26793.  
  26794.  1. Make sure that RECL (record length) is less than BLOCKSIZE.
  26795.  
  26796.  2. Access the direct-access file with a variable or group of variables
  26797.     with a length in bytes that matches the record length, thus
  26798.     avoiding partial access to a record.
  26799.  
  26800.  3. Use a REWIND statement following any partial access to a record.
  26801.     This realigns the file pointer to the beginning of the file
  26802.     (BACKSPACE does not appear to solve the problem).
  26803.  
  26804.  This problem does not occur in FORTRAN versions 4.00 and 4.00a;
  26805.  however, it does occur in versions 4.01, 4.10, and 5.00.
  26806.  
  26807.  
  26808.  659. SELECT CASE with /4I2 Creates Oversized .OBJ Module
  26809.  
  26810.  Product Version(s): 5.00   | 5.00
  26811.  Operating System:   MS-DOS | OS/2
  26812.  Flags: ENDUSER | buglist5.00
  26813.  Last Modified: 10-JAN-1991    ArticleIdent: Q68104
  26814.  
  26815.  The FORTRAN 5.00 compiler can create greatly oversized object modules
  26816.  when a program that uses the SELECT CASE statement is compiled with
  26817.  the /4I2 switch in the DOS environment. When the same program is
  26818.  compiled under OS/2, the compiler appears to hang.
  26819.  
  26820.  Because of the size of the object module, the following warnings are
  26821.  also generated when you compile with the /4I2 switch:
  26822.  
  26823.     F4063: function too large for post-optimizer
  26824.     L4020: code segment size exceeds 65500
  26825.  
  26826.  The resulting executable can cause the machine to hang.
  26827.  
  26828.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  26829.  We are researching the problem and will post new information here as
  26830.  it becomes available.
  26831.  
  26832.  When the following sample program is compiled with the /4I2 compiler
  26833.  switch under DOS, the program produces an object file of over 160,000
  26834.  bytes. Without the /4I2 switch, an object module of several hundred
  26835.  bytes is generated. An assembly listing of the program shows that the
  26836.  compiler generates repetitive lines of invalid code.
  26837.  
  26838.  Program
  26839.  _______
  26840.  
  26841.        select case (i)
  26842.               case (  :-3)
  26843.               case (-2: 0)
  26844.               case ( 1 )
  26845.               case ( 2 )
  26846.        end select
  26847.        end
  26848.  
  26849.  To avoid this problem, do not use the /4I2 compiler switch when you
  26850.  are compiling programs that use the SELECT CASE...END SELECT
  26851.  statement.
  26852.  
  26853.  
  26854.  660. Problem Writing Array of Structure Variables with F1.EXE Patch
  26855.  
  26856.  Product Version(s): 5.00   | 5.00
  26857.  Operating System:   MS-DOS | OS/2
  26858.  Flags: ENDUSER | buglist5.00
  26859.  Last Modified: 28-JAN-1991    ArticleIdent: Q68528
  26860.  
  26861.  Programs compiled with FORTRAN 5.00 using the patched version of
  26862.  F1.EXE or the patched High-Capacity Compiler F1L.EXE can generate
  26863.  incorrect output when you write an array of structure variables.
  26864.  
  26865.  If you use the patched High-Capacity Compiler F1L.EXE with programs
  26866.  containing such code, and link for OS/2, you may generate the
  26867.  following error:
  26868.  
  26869.     Error L2002: fixup overflow at 13 in segment _DATA
  26870.     pos: 15F Record type: 9C
  26871.     frm seg NULL, tgt seg_BSS, tgt offset E05
  26872.  
  26873.  The resulting executable will not run.
  26874.  
  26875.  These errors do not occur when you use the unpatched versions of the
  26876.  F1.EXE or the High-Capacity Compiler F1L.EXE.
  26877.  
  26878.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  26879.  We are researching this problem and will post new information here as
  26880.  it becomes available.
  26881.  
  26882.  The F1.EXE patch is used to correct, among other things, the error:
  26883.  
  26884.     F1001: Internal Compiler Error
  26885.            compiler file omf_ms.c:1.118, line 1093
  26886.  
  26887.  This error often results when I/O operations are performed on elements
  26888.  of a structure after that structure has been passed to a subroutine.
  26889.  
  26890.  The High-Capacity Compiler F1L.EXE is an alternate form of the first
  26891.  pass of the compiler. It should be used to compile programs that
  26892.  receive the error:
  26893.  
  26894.     F1901: program too large for memory
  26895.  
  26896.  The following program illustrates the problem.
  26897.  
  26898.        structure / rec /
  26899.         character*12 num
  26900.        end structure
  26901.  
  26902.        record / rec / allrec(3)
  26903.  
  26904.        allrec(1).num= 'one'
  26905.        allrec(2).num= 'two'
  26906.        allrec(3).num= 'three'
  26907.  
  26908.  10    format(' ',a12)
  26909.        do 20 i=1, 3
  26910.         write(*,10) allrec(i).num
  26911.  20    continue
  26912.        end
  26913.  
  26914.  The program should produce the output:
  26915.  
  26916.     one
  26917.     two
  26918.     three
  26919.  
  26920.  Instead, when the program is compiled using the patched F1.EXE and
  26921.  linked for DOS or OS/2, it produces the following output:
  26922.  
  26923.     one
  26924.     one
  26925.     one
  26926.  
  26927.  When the program is compiled with the patched High Capacity Compiler
  26928.  F1L.EXE and linked for OS/2, the linker produces the fixup overflow
  26929.  error and the resulting executable is nonfunctional. When the program
  26930.  is linked for DOS after using the patched High Capacity Compiler, it
  26931.  can generate three repeated lines of random text output. It may also
  26932.  produce three blank lines of output.
  26933.  
  26934.  Workaround
  26935.  ----------
  26936.  
  26937.  A workaround to this problem is as follows:
  26938.  
  26939.  1. Declare a temporary variable.
  26940.  
  26941.  2. Assign the structure element to the temporary variable.
  26942.  
  26943.  3. Then use the temporary variable in all I/O operations.
  26944.  
  26945.  Note: This is also a suggested workaround to problems solved by using
  26946.  the F1.EXE patch.
  26947.  
  26948.  Sample
  26949.  ------
  26950.  
  26951.  For example:
  26952.  
  26953.        structure / rec /
  26954.          character*12 num
  26955.        end structure
  26956.  
  26957.        record / rec / allrec(3)
  26958.  
  26959.        character*12 temp           ! 1)
  26960.  
  26961.        allrec(1).num= 'one'
  26962.        allrec(2).num= 'two'
  26963.        allrec(3).num= 'three'
  26964.  
  26965.  10    format(' ',a12)
  26966.        do 20 i=1, 3
  26967.         temp=allrec(i).num         ! 2)
  26968.         write(*,10) temp           ! 3)
  26969.  20    continue
  26970.        end
  26971.  
  26972.  
  26973.  661. Incorrect Output with Element of Structure in CHAR Function
  26974.  
  26975.  Product Version(s):
  26976.  Operating System:   5.00   | 5.00
  26977.  Flags: MS-DOS | OS/2
  26978.  Last Modified:  7-FEB-1991    ArticleIdent: Q69002
  26979.  ENDUSER | buglist5.00
  26980.  
  26981.  In FORTRAN 5.00, a program using the CHAR intrinsic function on a
  26982.  structure element within a WRITE or PRINT statement can produce
  26983.  erroneous output when executed under DOS, or result in a protection
  26984.  violation when executed under OS/2.
  26985.  
  26986.  To avoid these problems, remove the intrinsic function from the WRITE
  26987.  or PRINT statement by assigning the result of the CHAR intrinsic
  26988.  function to a temporary variable, and then use this variable in the
  26989.  output statement.
  26990.  
  26991.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  26992.  We are researching this problem and will post new information here as
  26993.  it becomes available.
  26994.  
  26995.  The following example reproduces the problem:
  26996.  
  26997.         structure /a/
  26998.           integer*2 i
  26999.         end structure
  27000.  
  27001.         record /a/ name
  27002.         name.i=97                   ! ASCII lowercase a
  27003.         write(*,*) char(name.i)
  27004.         end
  27005.  
  27006.  1. When the above program is linked for DOS, the resulting executable
  27007.     prints the wrong character or no character at all.
  27008.  
  27009.  2. When it is linked for OS/2, the resulting executable generates a
  27010.     protection violation during runtime.
  27011.  
  27012.  3. When it is compiled under DOS with the patched version of F1.EXE
  27013.     (used to correct several problems with structures and NAMELIST
  27014.     statements) and linked for either DOS or OS/2, the executable
  27015.     generates the correct results.
  27016.  
  27017.  4. When it is compiled under OS/2 with the patched version of F1.EXE,
  27018.     a protection violation is generated during compilation in the F2.EXE
  27019.     pass of the compiler.
  27020.  
  27021.  One possible solution is to assign the result of the CHAR intrinsic
  27022.  function to a temporary variable as illustrated by the following
  27023.  example:
  27024.  
  27025.         structure /a/
  27026.           integer*2 i
  27027.         end structure
  27028.  
  27029.         character c
  27030.         record /a/ name
  27031.         name.i=97              ! ASCII lowercase a
  27032.  
  27033.         c=char(name.i)
  27034.         write(*,*) c
  27035.         end
  27036.  
  27037.  
  27038.  662. Problem Directing Listing and Object Files to a Directory
  27039.  
  27040.  Product Version(s): 5.00   | 5.00
  27041.  Operating System:   MS-DOS | OS/2
  27042.  Flags: ENDUSER | docerr
  27043.  Last Modified:  7-FEB-1991    ArticleIdent: Q69040
  27044.  
  27045.  The listing options and object file naming option used by FORTRAN 5.00
  27046.  do not function as documented in the "Microsoft FORTRAN Reference"
  27047.  manual. Compiling more than one source file at a time fails to create
  27048.  listing or object files in the specified path for every source file
  27049.  listed after the option on the command line. The first listing or
  27050.  object file is created in the specified path. The remaining listing or
  27051.  object files are either created in the current directory or not
  27052.  created at all.
  27053.  
  27054.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  27055.  We are researching this problem and will post new information here as
  27056.  it becomes available.
  27057.  
  27058.  If you compile more than one source file at a time with one of the
  27059.  following compiler switches set to a path other than the current
  27060.  directory, you will create the first listing or object file in the
  27061.  specified path. The listing or object files for the other source files
  27062.  are created in the current directory.
  27063.  
  27064.     Option                    File Type
  27065.     ------                    ---------
  27066.  
  27067.     /Fs[[listfile]]           Source Listing
  27068.     /Fc[[listfile]]           Combined Source-Object Listing
  27069.     /Fo[[objfile]]            Object
  27070.  
  27071.  If you compile more than one source file at a time with one of the
  27072.  following compiler switches set to a path other than the current
  27073.  directory, you will create the first listing in the specified path.
  27074.  Listings for the other source files are not created.
  27075.  
  27076.     Option                    File Type
  27077.     ------                    ---------
  27078.  
  27079.     /Fa[[listfile]]           Assembly Listing
  27080.     /Fl[[listfile]]           Object Listing
  27081.  
  27082.  Using Microsoft FORTRAN 5.00 to compile more than one source file at a
  27083.  time with the listing options or object file naming option set to a
  27084.  path other than the current directory should create listing or object
  27085.  files using the specified path for every source file listed after the
  27086.  option on the command line (see pages 338-342 of the "Microsoft
  27087.  FORTRAN Reference" manual).
  27088.  
  27089.  This problem does not occur in FORTRAN versions 4.x.
  27090.  
  27091.  The following command line illustrates the problem:
  27092.  
  27093.     FL /FsD:\LISTINGS\ A.FOR B.FOR C.FOR
  27094.  
  27095.  If the current directory is D:\FORTRAN and the source files are A.FOR,
  27096.  B.FOR, and C.FOR, then the source listings for file A.FOR will be
  27097.  generated in the D:\LISTINGS directory and the source listings for
  27098.  files B.FOR and C.FOR will be generated in the D:\FORTRAN directory.
  27099.  
  27100.  To have all of the source listings in the D:\LISTINGS directory,
  27101.  compile with the following command line:
  27102.  
  27103.     FL /FsD:\LISTINGS\ A.for /FsD:\LISTINGS\ B.FOR /FsD:\LISTINGS\ C.FOR
  27104.  
  27105.  
  27106.  663. NAMELIST in Internal READ Yields Error F1901 in FORTRAN
  27107.  
  27108.  Product Version(s): 5.00   | 5.00
  27109.  Operating System:   MS-DOS | OS/2
  27110.  Flags: ENDUSER | buglist5.00
  27111.  Last Modified: 12-FEB-1991    ArticleIdent: Q69071
  27112.  
  27113.  Using FORTRAN 5.OO, under DOS, to compile a program that uses an
  27114.  internal READ to read from a character variable into a NAMELIST
  27115.  generates the error:
  27116.  
  27117.     F1901:  Program too large for memory
  27118.  
  27119.  Under OS/2, a protection violation is generated during compilation.
  27120.  
  27121.  Using the high-capacity compiler F1L.EXE (normally used to correct the
  27122.  above error) can result in hanging the machine during compilation under
  27123.  DOS.
  27124.  
  27125.  An internal READ cannot be used in FORTRAN 5.00 to read in a NAMELIST.
  27126.  One solution is to put the NAMELIST data into a external file, either
  27127.  before or during program execution.
  27128.  
  27129.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  27130.  We are researching this problem and will post new information here as
  27131.  it becomes available.
  27132.  
  27133.  The following code illustrates the problem:
  27134.  
  27135.        character*21 test /' &in x=1 y=5 z=10 /'/
  27136.         namelist /in/ x,y,z
  27137.         read(test,in)
  27138.        end
  27139.  
  27140.  When compiling this code under DOS using the high-capacity compiler,
  27141.  the machine will hang. When compiling this code under OS/2 using the
  27142.  high-capacity compiler, a protection violation is generated. The
  27143.  high-capacity compiler F1L.EXE is a replacement for the first pass of
  27144.  the compiler, and is used to correct the error:
  27145.  
  27146.     F1901:  Program too large for memory
  27147.  
  27148.  The patched versions of F1.EXE and F1L.EXE, (used to correct problems
  27149.  with NAMELIST), produce the same results as F1.EXE and F1L.EXE
  27150.  respectively.
  27151.  
  27152.  One solution is to read in the NAMELIST data from an external file
  27153.  rather than an internal file:
  27154.  
  27155.  c test.for
  27156.         open(8,file='test.dat')
  27157.         namelist /in/ x,y,z
  27158.         read(8,in)
  27159.         write(*,in)
  27160.         close(8)
  27161.         end
  27162.  
  27163.  data file test.dat:
  27164.  
  27165.  &in
  27166.  x=1
  27167.  y=5
  27168.  z=10
  27169.  /
  27170.  c
  27171.  
  27172.  Alternatively, a scratch file can be created in which to temporarily
  27173.  store the NAMELIST data:
  27174.  
  27175.         character*21 test /' &in x=1 y=5 z=10 /'/
  27176.         namelist /in/ x,y,z
  27177.  
  27178.         open(8)
  27179.         write(8,*) test
  27180.         rewind(8)
  27181.         read(8,in)
  27182.         write(*,in)
  27183.         close(8)
  27184.         end
  27185.  
  27186.  
  27187.  664. Calling DOS and BIOS Interrupts Using FORTRAN 5.00 and MASM
  27188.  
  27189.  Product Version(s): 5.00
  27190.  Operating System:   MS-DOS
  27191.  Flags: ENDUSER | softlib INTERPT.ARC q68908
  27192.  Last Modified: 13-FEB-1991    ArticleIdent: Q69152
  27193.  
  27194.  DOS and BIOS interrupts can be accessed in FORTRAN without the
  27195.  functions INTDOS and INTDOSX. Two assembly code routines INTERRUPT and
  27196.  INTERRUPTX are available in the Software/Data Library that allow
  27197.  access to most interrupts including interrupt number 21. In addition,
  27198.  an INCLUDE file and two FORTRAN sample programs are included in the
  27199.  Software/Data Library article that demonstrate how to use the
  27200.  INTERRUPT and INTERRUPTX function calls.
  27201.  
  27202.  This file (FORINTER) can be found in the Software/Data Library by
  27203.  searching for the filename FORINTER, the Q number of this article, OR
  27204.  S12908.
  27205.  
  27206.  FORINTER was archived using the PKware file-compression utility.
  27207.  
  27208.  To utilize the INTERRUPT AND INTERRUPTX functions, the statement
  27209.  
  27210.     INCLUDE 'INTERRPT.INC'
  27211.  
  27212.  must be contained at the top of the source file making the call.
  27213.  The two statement functions documented at the end of the
  27214.  INTERRPT.INC file must be uncommented and added to the source code
  27215.  of any program, function, or subroutine block where the assembly
  27216.  procedures are called. These statement functions must appear before
  27217.  any executable statements. INTERRUPT.OBJ must be linked with the
  27218.  object file produced from compiling the main program.
  27219.  
  27220.  *********************
  27221.  INTERRPT.INC : include file for INTERRUPT and INTERRUPTX.
  27222.  This file includes the INTERFACE to the assembler routines and the
  27223.  register structures needed for these routines.
  27224.  
  27225.  Copy these statement functions after your other declarations but
  27226.  before other executable statements in the program, subroutine, or
  27227.  function in which you call INTERRUPT or INTERRUPTX
  27228.  
  27229.        gethibyte (dataword) = dataword / 256
  27230.        getlobyte (dataword) = iand(dataword , 255)
  27231.  *********************
  27232.  
  27233.  *********************
  27234.  INTERRPT.ASM The assembler source listing of the INTERRUPT and
  27235.  INTERRUPTX routines.
  27236.  ***************
  27237.  
  27238.  ***************
  27239.  INT.FOR      A sample program which uses the INT 21, function 2A
  27240.  hex to get the system date.
  27241.  ***************
  27242.  
  27243.  ***************
  27244.  INTX.FOR:  A sample program which uses the INT 21, function 41 hex
  27245.  to delete a file.
  27246.  
  27247.  This example uses the segment registers.
  27248.  
  27249.  ***************
  27250.  
  27251.  
  27252.  665. Key Entry Routines in MASM with FORTRAN 5.00
  27253.  
  27254.  Product Version(s): 5.00   | 5.00
  27255.  Operating System:   MS-DOS | OS/2
  27256.  Flags: ENDUSER | softlib q68703
  27257.  Last Modified: 12-FEB-1991    ArticleIdent: Q69153
  27258.  
  27259.  Two examples of simple key fetch routines written in the Microsoft
  27260.  Macro Assembler (MASM) version 5.10 for use with Microsoft FORTRAN are
  27261.  contained within the Software/Data Library. These routines use DOS
  27262.  interrupts and do not work under OS/2.
  27263.  
  27264.  This file (FORGETCH) can be found in the Software/Data Library by
  27265.  searching for the filename FORGETCH, the Q number of this article, or
  27266.  S12907.
  27267.  
  27268.  FORGETCH was archived using the PKware file-compression utility.
  27269.  
  27270.  Example A contains a function that, when called, waits for a
  27271.  keystroke and then passes back the keystroke to the FORTRAN calling
  27272.  program. This can be used to get single keystroke information from the
  27273.  user without requiring use of the ENTER key.
  27274.  
  27275.  Example B contains a function that checks to see if a keystroke has
  27276.  been previously entered. This function does not wait for the user to
  27277.  enter a character, but reports if a character has been entered. Once
  27278.  again, the user does not need to press the ENTER key for single-key
  27279.  data to be accepted.
  27280.  
  27281.  This program was not designed for redirected standard input.
  27282.  Furthermore, the interface routine is currently set up to only flag
  27283.  that a function or ALT+<KEY> sequence has been entered, and to print a
  27284.  message accordingly.
  27285.  
  27286.  
  27287.  666. ENTRY Statement Causes F2836: Statement Out of Order Error
  27288.  
  27289.  Product Version(s):
  27290.  Operating System:   4.00 4.01 4.10 5.00 | 4.10 5.00
  27291.  Flags: MS-DOS              | OS/2
  27292.  Last Modified: 13-FEB-1991    ArticleIdent: Q69188
  27293.  ENDUSER |
  27294.  
  27295.  Using the Microsoft FORTRAN compiler on code containing a subroutine
  27296.  that has an ENTRY statement preceding specification statements, type
  27297.  statements, implicit statements, or parameter statements will generate
  27298.  the following error:
  27299.  
  27300.     F2836: Statement Out of Order
  27301.  
  27302.  A subroutine that has an ENTRY statement preceding Statement Function
  27303.  statements will generate the following error:
  27304.  
  27305.     F2515: left side of assignment illegal
  27306.  
  27307.  A subroutine that has an ENTRY statement preceding the $LARGE or the
  27308.  $NOTLARGE metacommand (used with or without arguments) will generate
  27309.  the following respective errors:
  27310.  
  27311.     F2021: $LARGE illegal in executable statements
  27312.     F2021: $NOTLARGE illegal in executable statements
  27313.  
  27314.  Placing these statements before the ENTRY statement will not generate
  27315.  the errors.
  27316.  
  27317.  Microsoft has confirmed this to be a problem in FORTRAN versions 4.x
  27318.  and 5.00. We are researching this problem and will post new
  27319.  information here as it becomes available.
  27320.  
  27321.  The ENTRY statement on pages 162-163 of the "Microsoft FORTRAN
  27322.  Reference" manual specifies an entry point to a subroutine or
  27323.  external function.
  27324.  
  27325.  According to the Order of Statements chart in the "Microsoft FORTRAN
  27326.  Reference" manual on page 47, figure 2.1, the ENTRY statement should
  27327.  be able to appear before or after all statements inside a BLOCK DATA,
  27328.  FUNCTION, PROGRAM, or SUBROUTINE block.
  27329.  
  27330.  The following program, which uses the ENTRY statement and a type
  27331.  statement, demonstrates the problem:
  27332.  
  27333.        call in
  27334.        end
  27335.  
  27336.        subroutine sub
  27337.        entry in
  27338.        integer a
  27339.        end
  27340.  
  27341.  The error is not generated if the integer type statement is placed
  27342.  before the ENTRY statement.
  27343.  
  27344.  
  27345.  667. Protection Violation with Array Structure Element in I/O
  27346.  
  27347.  Product Version(s): 5.00   | 5.00
  27348.  Operating System:   MS-DOS | OS/2
  27349.  Flags: ENDUSER | buglist 5.00
  27350.  Last Modified: 20-FEB-1991    ArticleIdent: Q69405
  27351.  
  27352.  A protection violation is generated by the third pass of the Microsoft
  27353.  FORTRAN 5.00 compiler in OS/2 when you compile code containing a
  27354.  subroutine that uses an array structure element in an I/O statement.
  27355.  
  27356.  In DOS, the compiler will generate the error:
  27357.  
  27358.     warning F4202: Sub : formal argument : never used
  27359.     fatal error F1001: Internal Compiler Error
  27360.     (compiler file '@(#)omf_ms.c:1.118', line 1093)
  27361.     Contact Microsoft Technical Support
  27362.  
  27363.  The F1.EXE patch, which is used to correct structure element I/O
  27364.  within subroutines, produces identical errors as the unpatched F1.EXE.
  27365.  
  27366.  One possible solution is to assign the structure variable, which is
  27367.  passed to the subroutine, to a temporary structure variable, and use
  27368.  the temporary structure variable in all I/O statements.
  27369.  
  27370.  If you are experiencing invalid output with structure array elements,
  27371.  query on "invalid output" for a related article.
  27372.  
  27373.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  27374.  We are researching this problem and will post new information here as
  27375.  it becomes available.
  27376.  
  27377.  The following code reproduces the problem:
  27378.  
  27379.         structure /t/
  27380.            integer j(100)
  27381.         end structure
  27382.        record /t/ st
  27383.        call sub(st)
  27384.        end
  27385.  
  27386.        subroutine sub(st)
  27387.          structure /t/
  27388.            integer j(100)
  27389.          end structure
  27390.        record /t/ st
  27391.        write(*,*) st.j    ! line 6
  27392.        end
  27393.  
  27394.  Accessing an element of the array in line 6 instead of the entire
  27395.  array will not result in any error.
  27396.  
  27397.  Assigning a temporary structure variable to the structure variable
  27398.  that is passed to the subroutine and using the temporary structure
  27399.  variable in all I/O statements will prevent these errors.
  27400.  
  27401.  The following program illustrates this solution:
  27402.  
  27403.          structure /t/
  27404.            integer j(100)
  27405.          end structure
  27406.        record /t/ st
  27407.        call sub(st)
  27408.        end
  27409.  
  27410.        subroutine sub(st)
  27411.          structure /t/
  27412.            integer j(100)
  27413.          end structure
  27414.        record /t/ st,temp
  27415.        temp=st
  27416.        write(*,*) temp.j
  27417.        end
  27418.  
  27419.  
  27420.  668. Structure Element in Internal File Causes omf_ms.c:1.118
  27421.  
  27422.  Product Version(s): 5.00   | 5.00
  27423.  Operating System:   MS-DOS | OS/2
  27424.  Flags: ENDUSER | buglist5.00 err msg
  27425.  Last Modified: 20-FEB-1991    ArticleIdent: Q69481
  27426.  
  27427.  If you use Microsoft FORTRAN version 5.00 under DOS to compile a
  27428.  program that does an Internal READ or WRITE on a structure element,
  27429.  the following error may be generated:
  27430.  
  27431.     fatal error F1001: Internal Compiler Error
  27432.                 (compiler file '@(#)omf_ms.c:1.118', line 1093)
  27433.  
  27434.  When compiling under OS/2, a protection violation is generated by the
  27435.  second pass of the compiler.
  27436.  
  27437.  The F1.EXE patch, used to correct structure element I/O within
  27438.  subroutines, produces the same errors as the unpatched F1.EXE.
  27439.  
  27440.  One way to avoid this error is to assign the element of the structure
  27441.  to a temporary variable, and then use this temporary variable in the
  27442.  internal READ or WRITE.
  27443.  
  27444.  Microsoft has confirmed this to be a problem in FORTRAN version 5.00.
  27445.  We are researching this problem and will post new information here as
  27446.  it becomes available.
  27447.  
  27448.  The following program illustrates this problem:
  27449.  
  27450.        structure /a/
  27451.        character*5 b
  27452.        end structure
  27453.  
  27454.        record /a/ c
  27455.        real x
  27456.        c.b = '10.0'
  27457.        read(c.b,'(f5.0)') x
  27458.        write(*,*) x
  27459.        end
  27460.  
  27461.  If you assign the structure element to a temporary variable, as shown
  27462.  below, and then use this temporary variable in the internal READ,
  27463.  the error will not be generated.
  27464.  
  27465.        structure /a/
  27466.        character*5 b
  27467.        end structure
  27468.  
  27469.        record /a/ c
  27470.        real x
  27471.        character*5 tmp
  27472.        c.b = '10.0'
  27473.        tmp = c.b
  27474.        read(tmp,'(f5.0)') x
  27475.        write(*,*) x
  27476.        end
  27477.  
  27478.  
  27479.  
  27480.  
  27481.  
  27482.  Microsoft Programmer's Work Bench [Development Environment]
  27483.  =============================================================================
  27484.  
  27485.  
  27486.  1. Using the Features of PWB to Build a Program with Overlays
  27487.  
  27488.  Product Version(s): 1.00   | 1.00
  27489.  Operating System:   MS-DOS | OS/2
  27490.  Flags: ENDUSER |
  27491.  Last Modified: 18-APR-1990    ArticleIdent: Q60050
  27492.  
  27493.  A MAKE file built with PWB can be modified (within reason) with the
  27494.  user supplied information section. This section, coded as
  27495.  
  27496.     # << User_supplied_information >>
  27497.  
  27498.  can contain other instructions that PWB (actually NMAKE or NMK) is
  27499.  supposed to carry out during the MAKE cycle. All instructions that
  27500.  follow this "fence" are not changed by PWB.
  27501.  
  27502.  The following instructions detail two implementations of that "fence"
  27503.  to allow PWB to build a program that uses overlays.
  27504.  
  27505.  While the following steps appear tedious, they are simple in practice.
  27506.  
  27507.  Once the changes are made, the only time you need to edit the MAKE
  27508.  file directly is to change your overlay structure, or to add or delete
  27509.  modules. When adding or deleting modules, you must both edit the
  27510.  program list with Make.Edit Program List and modify the commands in
  27511.  the user section. If you are only modifying the overlay structure, you
  27512.  change just the user section.
  27513.  
  27514.  The overlay structure in the example is as follows:
  27515.  
  27516.     HELLO.OBJ  (root)
  27517.         |
  27518.         +----A.OBJ (first  overlay)
  27519.         |
  27520.         +----B.OBJ (second overlay)
  27521.  
  27522.  All of the .OBJs are built from .C files with the same base name.
  27523.  
  27524.  1. Use PWB to build the program list in the normal way. This step is
  27525.     the same for any new program list.
  27526.  
  27527.     a. Start PWB.
  27528.  
  27529.     b. Choose Make.Set Program List and specify a new name -- HELLO.MAK
  27530.        in this example.
  27531.  
  27532.     c. Add HELLO.C, A.C, and B.C to the list. (If you have additional
  27533.        .C or .OBJ files, you would add them as well.) When all the
  27534.        files are listed, select Set Dependencies.
  27535.  
  27536.     d. Choose Options.Build Options and click on the Set Initial
  27537.        Build Options button and select DOS EXE.
  27538.  
  27539.     e. From Options.Compile Options, select the proper memory model.
  27540.  
  27541.     f. From Options.Link Options.Set Debug Options, turn off
  27542.        Incremental Link.
  27543.  
  27544.     g. From the Options.Browse Options dialog box, turn Generate Browse
  27545.        Information on.
  27546.  
  27547.     h. Choose Make.Rebuild All to make sure that the program builds
  27548.        properly without overlays. If it doesn't, review your work in
  27549.        previous steps.
  27550.  
  27551.  2. Now that you have a working program list, add the non-PWB
  27552.     information to the end.
  27553.  
  27554.     a. Choose Make.Clear Program List so that you can edit the MAKE
  27555.        file. Attempting to edit the current program list results in the
  27556.        message "No-edit file may not be modified."
  27557.  
  27558.     b. Choose File.Open to open the MAKE file so you can modify it.
  27559.  
  27560.     c. Go to the end of the file and start a blank line.
  27561.  
  27562.        Starting in column 1, add the following line:
  27563.  
  27564.           # << User_supplied_information >>
  27565.  
  27566.        Be sure to enter the line exactly as shown -- spacing is
  27567.        significant. This line is a "fence". Everything below the fence
  27568.        is yours and is not modified by PWB. Conversely, you should not
  27569.        modify anything above the fence because that section belongs to PWB.
  27570.  
  27571.     d. Below the fence starting in column one, add the pseudo-target:
  27572.  
  27573.           OVERLAID : $(OBJS)
  27574.  
  27575.        Be sure it starts column 1. Do not put a blank line after this line.
  27576.  
  27577.     e. Copy the command section from the $(PROJ).EXE description block
  27578.        to immediately follow the pseudo-target. The command section begins
  27579.        on the line following the line that reads
  27580.  
  27581.           $(PROJ).exe : $(OBJS)
  27582.  
  27583.        and ends at the next blank line. Do not copy the $(PROJ).EXE
  27584.        line, and do not leave a blank after the target. After you have
  27585.        copied the commands, your file should appear as follows:
  27586.  
  27587.           ... PWB section here, unmodified ...
  27588.  
  27589.           # << User_supplied_information >>
  27590.  
  27591.           OVERLAID : $(OBJS)
  27592.           !IF $(DEBUG)                    # copy of commands...
  27593.                   $(LRF) @<<$(PROJ).lrf
  27594.           $(RT_OBJS: = +^
  27595.           ) $(OBJS: = +^
  27596.           )
  27597.           $@
  27598.           ...
  27599.  
  27600.     f. Use the following procedure to modify the commands to link an
  27601.        overlaid EXE instead of a normal EXE.
  27602.  
  27603.        Note: There are two subsections in this section: a debug section
  27604.        that starts at the first "!IF $(DEBUG)" and ends at "!ELSE", and
  27605.        a release section that starts after the "!ELSE" and ends at the
  27606.        first "!ENDIF".
  27607.  
  27608.        You need to make the following modifications to both
  27609.        subsections.
  27610.  
  27611.        i. Delete the line that reads as follows:
  27612.  
  27613.              ) $(OBJS: = +^
  27614.  
  27615.           After the right parenthesis on the line that moved up, put
  27616.           your list of .OBJ files with parentheses to indicate which
  27617.           ones go in which overlays. If you need to use more than one
  27618.           line for all of your objects, be sure to put a plus sign (+)
  27619.           at the end of each line except the last.
  27620.  
  27621.       ii. Replace "$@" on the next line with "$(PROJ).EXE".
  27622.  
  27623.           In our example,
  27624.  
  27625.                  $(LRF) @<<$(PROJ).lrf
  27626.              $(RT_OBJS: = +^
  27627.              ) $(OBJS: = +^     # delete this line
  27628.              )                  # append OBJ list here ...
  27629.              $@                 # replace this line with $(PROJ).EXE
  27630.  
  27631.           becomes:
  27632.  
  27633.                  $(LRF) @<<$(PROJ).lrf
  27634.              $(RT_OBJS: = +^
  27635.              ) hello.obj +
  27636.              (a.obj) +
  27637.              (b.obj)
  27638.              $(PROJ).exe
  27639.  
  27640.           Remember to make the changes in both branches of the !IF
  27641.           $(DEBUG).
  27642.  
  27643.     g. The last step is to modify the browser database build commands.
  27644.        These are the two lines at the very end of the file that begin
  27645.        with "$(NMAKEBSC...". PWB adds and deletes these lines in the
  27646.        PWB section as you turn browser information on and off.
  27647.  
  27648.        Since PWB won't delete and add these lines in the user section,
  27649.        enclose them in !IF $(BROWSE)...!ENDIF so they'll be executed
  27650.        only when you ask for browse information. You also need to
  27651.        delete the "$(NMFLAGS)" macro from the second line to prevent
  27652.        infinite NMAKE recursion.
  27653.  
  27654.        The following lines
  27655.  
  27656.           $(NMAKEBSC1) MAKEFLAGS=
  27657.           $(NMAKEBSC2) $(NMFLAGS) -f $(PROJFILE) $(PROJ).bsc
  27658.  
  27659.        become:
  27660.  
  27661.           !IF $(BROWSE)
  27662.               $(NMAKEBSC1) MAKEFLAGS=
  27663.               $(NMAKEBSC2) -f $(PROJFILE) $(PROJ).bsc
  27664.           !ENDIF
  27665.  
  27666.        If you need special NMAKE options for building the browser
  27667.        database, just add them where you removed $(NMFLAGS).
  27668.  
  27669.  3. Reactivate the MAKE file by selecting Make.Set Program List.
  27670.  
  27671.  4. With these changes, if you select Make.Rebuild All, you will still
  27672.     get a non-overlaid program because PWB normally builds the first
  27673.     target in the MAKE file. To build the overlaid program, modify the
  27674.     command line passed to NMAKE so that NMAKE builds your overlay
  27675.     target rather than the regular EXE. Select Options.NMAKE Options
  27676.     and specify "OVERLAID" as the target by putting it in the NMAKE
  27677.     options box, or use Make.Build Target.
  27678.  
  27679.  5. With "OVERLAID" in Options.NMAKE Options you can build your program
  27680.     by either selecting Make.Rebuild All or Make.Build *.EXE, as usual.
  27681.     If you want to build a non-overlaid program, delete "OVERLAID" from
  27682.     the NMAKE options box.
  27683.  
  27684.     Note that if you use debug options with overlays you will get a
  27685.     linker warning L4047. This warning, and the dialog box that says
  27686.     that CRT0DAT.ASM can't be found, are normal when building overlaid
  27687.     programs for debugging and can be ignored. You can debug the overlaid
  27688.     program normally, with full debugging information available.
  27689.  
  27690.     This MAKE file behaves almost identically to a regular PWB MAKE
  27691.     file. The only differences are that NMAKE options are NOT  passed
  27692.     to the browser build unless you add them to the browser build line,
  27693.     and that you must edit the user supplied section if you add or
  27694.     delete modules from the project.
  27695.  
  27696.  
  27697.  2.
  27698.  
  27699.  Product Version(s): 1.00   | 1.00
  27700.  Operating System:   MS-DOS | OS/2
  27701.  Flags: ENDUSER | buglist1.00 fixlist1.10 s_c
  27702.  Last Modified:  5-FEB-1991    ArticleIdent: Q60392
  27703.  
  27704.  TOOLS.PRE is a sample Programmer's WorkBench (PWB) initialization file
  27705.  that is installed (and modified) when C 6.00 is installed by running
  27706.  the Setup program. On pages 19 and 20 of "Microsoft C: Installing and
  27707.  Using the Professional Development System," it states that the
  27708.  contents of TOOLS.PRE can be merged with an existing TOOLS.INI file,
  27709.  if one exists, or it can be renamed to TOOLS.INI, if there isn't one.
  27710.  To work correctly, you must make sure that the contents of this file
  27711.  are preceded by a PWB tag (for example, [PWB]) because the supplied
  27712.  TOOLS.PRE lacks this tag.
  27713.  
  27714.  When merging the PWB 1.00 TOOLS.PRE file into an existing TOOLS.INI
  27715.  file, a [PWB] tag should be added just above the area where the file
  27716.  is merged. For example:
  27717.  
  27718.  [PWB]
  27719.    .
  27720.    .
  27721.    .
  27722.    (TOOLS.PRE contents)
  27723.    .
  27724.    .
  27725.    .
  27726.  
  27727.  [NEXT-TAG]
  27728.  
  27729.  If TOOLS.PRE is being renamed to TOOLS.INI, the tag should be added as
  27730.  the first line in the file. In either case, failure to add the tag
  27731.  will result in PWB ignoring the initialization information.
  27732.  
  27733.  Microsoft has confirmed this to be a problem in PWB version 1.00. This
  27734.  problem was corrected in PWB version 1.10.
  27735.  
  27736.  
  27737.  3. How to Abort Compilation When Using PWB
  27738.  
  27739.  Product Version(s): 1.00   | 1.00
  27740.  Operating System:   MS-DOS | OS/2
  27741.  Flags: ENDUSER | s_c
  27742.  Last Modified: 17-JUL-1990    ArticleIdent: Q60500
  27743.  
  27744.  Question:
  27745.  
  27746.  How do I abort a compile that is in progress when using the
  27747.  Programmer's WorkBench (PWB) environment?
  27748.  
  27749.  Response:
  27750.  
  27751.  Under MS-DOS (or the OS/2 3.x compatibility box), use CTRL+C to abort.
  27752.  
  27753.  Under OS/2, use "Arg Meta Compile" to abort a compilation taking place
  27754.  in the background.
  27755.  
  27756.  The default keystrokes for Arg Meta Compile are ALT+A F9 CTRL+F3.
  27757.  
  27758.  You can also create a macro and assign it to a key to abort the
  27759.  compile process. Below is a sample macro that you could place in your
  27760.  TOOLS.INI file under the [pwb] tag.
  27761.  
  27762.     [pwb]
  27763.     Abort:=Arg Meta Compile
  27764.     Abort:Ctrl+F5
  27765.  
  27766.  Note: In either OS/2 or MS-DOS, the ESC key and CTRL+BREAK do not
  27767.  abort a compilation.
  27768.  
  27769.  
  27770.  4. PWB Makefiles Are Read-Only When Set as Active Program List
  27771.  
  27772.  Product Version(s): 1.00   | 1.00
  27773.  Operating System:   MS-DOS | OS/2
  27774.  Flags: ENDUSER |
  27775.  Last Modified: 25-MAY-1990    ArticleIdent: Q60749
  27776.  
  27777.  When you choose the Make.Set Program List option within the
  27778.  Programmer's WorkBench (PWB) environment to set a program list for the
  27779.  current project, the makefile associated with the current program list
  27780.  is marked as read-only and is not editable.
  27781.  
  27782.  Code Example
  27783.  ------------
  27784.  
  27785.  // FOO.C
  27786.  
  27787.  #include <stdio.h>
  27788.  void main ( void )
  27789.  {
  27790.     printf ( "Foobar\n" ) ;
  27791.  }
  27792.  
  27793.  1. Using the above sample program, choose the Make.Set Program List
  27794.     menu options and call the program list FOO.MAK.
  27795.  
  27796.  2. Save the list.
  27797.  
  27798.  3. Choose the File.Open menu, and enter FOO.MAK as the file you want
  27799.     to open.
  27800.  
  27801.  4. Place your cursor anywhere in the file and press ENTER. You will be
  27802.     greeted with the following a pop-up message:
  27803.  
  27804.        No-edit file may not be modified.
  27805.  
  27806.  If you want to edit the makefile, choose the Make.Clear Program List
  27807.  options, and you can edit the makefile as you want.
  27808.  
  27809.  
  27810.  5. Why Zero-Length .SBR Files Are Left on the Disk by the PWB
  27811.  
  27812.  Product Version(s): 1.00   | 1.00
  27813.  Operating System:   MS-DOS | OS/2
  27814.  Flags: ENDUSER |
  27815.  Last Modified: 16-JAN-1991    ArticleIdent: Q61056
  27816.  
  27817.  When using the Source Browser functionality within the Programmer's
  27818.  WorkBench, you can expect to have zero-length .SBR files on your disk.
  27819.  This is by design of the PWBRMAKE utility.
  27820.  
  27821.  PWBRMAKE.EXE is a utility that converts the .SBR files created by the
  27822.  compiler for each program module into a single database file that can
  27823.  be read by the Programmer's WorkBench (PWB) Source Browser. The
  27824.  resulting Source Browser database file has the extension .BSC.
  27825.  
  27826.  When a Source Browser database (a .BSC file) is built from .SBR files,
  27827.  the .SBR files are truncated to zero length to save disk space since
  27828.  they can be quite large. .SBR files are truncated to zero length,
  27829.  rather than being deleted, because PWBRMAKE performs incremental
  27830.  updates to the database and, therefore, needs the time and date stamp
  27831.  from the files.
  27832.  
  27833.  When you rebuild part of your project, new .SBR files are built for
  27834.  those modules. Each .SBR file that has not been re-created during a
  27835.  build is included as a zero-length file. This tells PWBRMAKE that the
  27836.  file has no new contribution to make to the database, so no update of
  27837.  that part of the database is required.
  27838.  
  27839.  
  27840.  6. Do Not Start Programmer's WorkBench by Typing PWBED
  27841.  
  27842.  Product Version(s): 1.00
  27843.  Operating System:   MS-DOS
  27844.  Flags: ENDUSER |
  27845.  Last Modified: 11-JUL-1990    ArticleIdent: Q61307
  27846.  
  27847.  You cannot start the Programmer's WorkBench by typing PWBED. This is
  27848.  incorrect. Type PWB to start the Programmer's WorkBench environment.
  27849.  
  27850.  In the REAL MODE directory specified during setup, there will be two
  27851.  executables for the PWB, PWB.COM and PWBED.EXE. PWB.COM actually
  27852.  spawns PWBED.EXE. If you use PWBED to start the PWB, it will consume
  27853.  approximately 500K of memory. By executing a DOS SHELL from within the
  27854.  PWB and running CHKDSK, you will notice there is very little memory
  27855.  left.
  27856.  
  27857.  When you invoke the PWB the correct way (by typing PWB), then shell-
  27858.  out and do a CHKDSK, you will see that the PWB has only consumed
  27859.  approximately 8K of available memory.
  27860.  
  27861.  The PWB appears to work correctly if you invoke it with PWBED.
  27862.  However, since it is using so much memory, you will receive memory
  27863.  problems, such as "out of memory," "cannot compile," or "cannot
  27864.  build." These are caused because there is not enough memory to spawn
  27865.  either NMAKE, the compiler, or the linker.
  27866.  
  27867.  
  27868.  7. Steps Needed to Make Source Browser Usable
  27869.  
  27870.  Product Version(s): 1.00    | 1.00
  27871.  Operating System:   MS-DOS  | OS/2
  27872.  Flags: ENDUSER |
  27873.  Last Modified: 11-JUL-1990    ArticleIdent: Q61309
  27874.  
  27875.  Before using the Browse menu options, you must first define and build
  27876.  the database the Source Browser will use. If this database is not
  27877.  already built, all options on the Browse menu will be grayed out and
  27878.  unusable.
  27879.  
  27880.  The following steps must be taken to define a database that is usable
  27881.  by the Source Browser menu options:
  27882.  
  27883.  1. Generate a program list using the Set Program List command in the
  27884.     Make menu. The PWB creates one internally if you do not specify one
  27885.     and the program only uses one source file. If a program is larger
  27886.     than one source file and a program list is not set, it is
  27887.     impossible to generate a Source Browser database.
  27888.  
  27889.  2. Choose Browse Options from the Options menu. You must select the
  27890.     Generate Browse Information field in the dialog box to create the
  27891.     Source Browser database.
  27892.  
  27893.  3. Build your program using the Make Menu option. You MUST have a
  27894.     successful build (compile AND link) of the program for a Source
  27895.     Browser database to be generated.
  27896.  
  27897.  The Browse Menu options should now be available for use.
  27898.  
  27899.  If, after taking the steps outlined above, the Browse Menu options
  27900.  are still unavailable for use, query on the following keywords:
  27901.  
  27902.     Browse and Options and Unavailable and Strange and Circumstances
  27903.  For printed documentation explaining the setup and use of the Source
  27904.  Browser, see Pages 50-52 of "Installing and Using the Professional
  27905.  Development System." You can also find information about the Source
  27906.  Browser in the online help under Programmer's WorkBench, Using the PWB
  27907.  Source Browser.
  27908.  
  27909.  
  27910.  8. SYS2070 Issued When Executing PWB.EXE for the First Time
  27911.  
  27912.  Product Version(s): 1.00
  27913.  Operating System:   OS/2
  27914.  Flags: ENDUSER |
  27915.  Last Modified: 13-JUN-1990    ArticleIdent: Q61572
  27916.  
  27917.  When running the Programmer's WorkBench (PWB) for the first time, the
  27918.  following OS/2 system error may be issued:
  27919.  
  27920.     Session Title:
  27921.     PWBED.EXE
  27922.  
  27923.     SYS2070: The system could not demand load the
  27924.     application's segment. MSHELP HELPSHRINK is in error.
  27925.     For additional detailed information also see message SYS0127
  27926.  
  27927.  This system error is caused by the PWB's use of a version of
  27928.  MSHELP.DLL that is not as current as the one that was shipped with C
  27929.  version 6.00. For the PWB to function correctly, the correct version
  27930.  of MSHELP.DLL must be in the LIBPATH.
  27931.  
  27932.  The README.DOC on the C version 6.00 Setup/Compiler 1 Disk warns of
  27933.  this potential problem, and suggests that QuickHelp (QH) be terminated
  27934.  as a background keyboard monitor before Setup is run.
  27935.  
  27936.  This problem is usually caused as a result of the Setup program not
  27937.  being able to copy its version of MSHELP.DLL over the old version of
  27938.  MSHELP.DLL. If another process (most likely a detached session of
  27939.  QH.EXE) was accessing this file during the execution of Setup, the
  27940.  Setup program will issue a message similar to the following:
  27941.  
  27942.     ERROR: Could not create file C:\OS2\DLL\mshelp.dll
  27943.     ERROR: File copy failed: A:\the PWB\mshelp.dll to C:\OS2\dll\mshelp.dll
  27944.  
  27945.  To solve this problem, take the following steps:
  27946.  
  27947.  1. Disable QH as a keyboard monitor:
  27948.  
  27949.     a. Press ALT+Q (to invoke QH).
  27950.  
  27951.     b. Press O (for the Options menu).
  27952.  
  27953.     c. Press T (to Terminate the monitor).
  27954.  
  27955.  2. Copy the up-to-date version of MSHELP.DLL from the distribution
  27956.     disk:
  27957.  
  27958.     a. Insert the Setup/Compiler 1 Disk into Drive A.
  27959.  
  27960.     b. Change the default Drive A.
  27961.  
  27962.     c. Run Setup with the /copy option by typing the following:
  27963.  
  27964.           setup /copy
  27965.  
  27966.     d. Press ENTER
  27967.  
  27968.     e. Press ENTER again (unless the setup files are in a drive other
  27969.        than A).
  27970.  
  27971.     f. At the prompt asking for the name of the file to copy, type
  27972.        MSHELP.DLL and press ENTER.
  27973.  
  27974.     g. At the prompt asking for the name of the directory to which to
  27975.        copy this file, type the directory in which the old MSHELP.DLL
  27976.        is located (most likely C:\OS2\DLL).
  27977.  
  27978.     h. Setup should then ask for the Programmer's WorkBench/Utilities
  27979.        for OS/2 Disk to be inserted into the setup drive.
  27980.  
  27981.     i. When Setup is finished copying the file, press ENTER at the
  27982.        next prompt.
  27983.  
  27984.  The PWB should now start up correctly.
  27985.  
  27986.  
  27987.  9. U1355 Bad Command or File Name
  27988.  
  27989.  Product Version(s): 1.00   | 1.00
  27990.  Operating System:   MS-DOS | OS/2
  27991.  Flags: ENDUSER | docerr filename
  27992.  Last Modified: 27-SEP-1990    ArticleIdent: Q61607
  27993.  
  27994.  The following undocumented error may occur when attempting to run an
  27995.  executable file such as CL.EXE, LINK.EXE, NMAKE.EXE, etc., from inside
  27996.  the Programmer's WorkBench (PWB).
  27997.  
  27998.     U1355 Bad Command or File Name
  27999.  
  28000.  The error occurs because the directory containing the .EXE file is not
  28001.  specified in the search path or an incorrect LINK.EXE is being
  28002.  executed.
  28003.  
  28004.  This problem can be corrected by adding the missing directory name(s)
  28005.  to the path in the AUTOEXEC.BAT or STARTUP.CMD and rebooting, or
  28006.  executing NEW-VARS.BAT or NEW-VARS.CMD. If an incorrect linker is the
  28007.  problem, the search path can be rearranged to find the new version of
  28008.  the linker first, or the old linkers can be deleted or renamed.
  28009.  Finally, it may be necessary to delete the CURRENT.STS and PROG.STS
  28010.  files before the PWB will work correctly. This error is not documented
  28011.  in the PWB online help.
  28012.  
  28013.  
  28014.  10. Saving Compiler Results File in the PWB
  28015.  
  28016.  Product Version(s): 1.00   | 1.00
  28017.  Operating System:   MS-DOS | OS/2
  28018.  Flags: ENDUSER |
  28019.  Last Modified: 25-MAY-1990    ArticleIdent: Q61636
  28020.  
  28021.  The Programmer's WorkBench (PWB) deletes the compiler results file
  28022.  upon exiting the PWB. In DOS or OS/2, the file can be saved if the
  28023.  compiler results window is made current and the File.Save As menu
  28024.  option is selected.
  28025.  
  28026.  The compiler results file will appear similar to the following:
  28027.  
  28028.     +++ PWB  [E:\] Rebuild
  28029.             NMAKE  /z /a /f E:\pwb.mak
  28030.          cl /c /W4 /Fm /Ot /FoGLOBL.obj GLOBL.C
  28031.     Microsoft (R) C Optimizing Compiler Version 6.00
  28032.     Copyright (c) Microsoft Corp 1984-1990. All rights reserved.
  28033.  
  28034.     GLOBL.C
  28035.          echo @GLOBL.lrf > NUL
  28036.          link @GLOBL.lrf
  28037.  
  28038.     Microsoft (R) Segmented-Executable Linker  Version 5.10
  28039.     Copyright (C) Microsoft Corp 1984-1990.  All rights
  28040.     reserved.
  28041.  
  28042.     Object Modules [.OBJ]: GLOBL.obj,GLOBL.exe,NUL, /NOD:SLIBCE
  28043.     SLIBCEP , /NOI /BATCH /EXE /FAR /PACKC;
  28044.  
  28045.  
  28046.  11. Programmer's WorkBench Edit Switch Is Unimplemented
  28047.  
  28048.  Product Version(s): 1.00   | 1.00
  28049.  Operating System:   MS-DOS | OS/2
  28050.  Flags: ENDUSER | docerr
  28051.  Last Modified: 14-MAY-1990    ArticleIdent: Q61642
  28052.  
  28053.  The edit switch for the Programmer's WorkBench (PWB), documented on
  28054.  Page 79 of the version 6.00 "Microsoft C Reference" manual, is
  28055.  unimplemented in PWB version 1.00. The switch is designed to set the
  28056.  active file as read-only so that it cannot be edited.
  28057.  
  28058.  If you add an option in your TOOLS.INI file under the PWB tag to read
  28059.  either
  28060.  
  28061.     Edit:yes
  28062.     Edit:no
  28063.  
  28064.  PWB will return an error message saying "Edit is not an editor
  28065.  switch."
  28066.  
  28067.  As a workaround, invoke PWB with the /r option to open up the current
  28068.  file as read-only.
  28069.  
  28070.  
  28071.  12. Certain Key Sequences Cause R6003 or SYS1943 in PWB 1.00
  28072.  
  28073.  Product Version(s): 1.00   | 1.00
  28074.  Operating System:   MS-DOS | OS/2
  28075.  Flags: ENDUSER | buglist1.00 fixlist1.10
  28076.  Last Modified:  4-FEB-1991    ArticleIdent: Q61660
  28077.  
  28078.  In the Programmer's Workbench (PWB) version 1.00, it has been observed
  28079.  that certain unusual editing sequences can cause the following errors:
  28080.  
  28081.  In DOS:
  28082.  
  28083.     Run-time error R6003 - integer divide by 0
  28084.  
  28085.  In OS/2:
  28086.  
  28087.     SYS1943 protection violation, trap number 13
  28088.  
  28089.  The following sequences reproduce the errors:
  28090.  
  28091.     Procedure                             Keystrokes
  28092.     ---------                             ----------
  28093.  
  28094.  1. Bring up several files.               ALT+F O x3
  28095.     Select the Options menu.              ALT+O
  28096.     Select Linker options.                L
  28097.     Select Set Debug Options.             ALT+G
  28098.     Pull up help on the options.          F1
  28099.     Arg-refresh through several files.    ALT+A SHIFT+F7 x3
  28100.     Escape back to the Editor screen.     ESC x3
  28101.  
  28102.  2. Select the Options menu.              ALT+O
  28103.     Select Editor Settings.               S (or K)
  28104.     Go down thirteen lines.               DOWN ARROW key x13
  28105.     Backspace.                            BACKSPACE
  28106.     Undo.                                 ALT+BACKSPACE
  28107.  
  28108.  Note: Step 2 reproduces only the R6003 error in DOS, not the SYS1943
  28109.  error.
  28110.  
  28111.  
  28112.  13. PWB 1.00 Requires Decimal Value for Stack Size in LINK Options
  28113.  
  28114.  Product Version(s): 1.00    | 1.00
  28115.  Operating System:   MS-DOS  | OS/2
  28116.  Flags: ENDUSER | buglist1.00 fixlist1.10
  28117.  Last Modified:  5-FEB-1991    ArticleIdent: Q61871
  28118.  
  28119.  In the Programmer's WorkBench (PWB) version 1.00, there is a problem
  28120.  with changing a program's stack size in some situations. When
  28121.  specifying the stack size in the Link Options dialog box (from the
  28122.  Options menu), you must enter the value in the form of a decimal
  28123.  integer. Although the Help menu tells you this field accepts positive
  28124.  integers in octal and hexadecimal form, PWB 1.00 will not accept them.
  28125.  
  28126.  When an octal or hexadecimal value is entered in the stack-size field,
  28127.  any digits specified as A-F are discarded and replaced by 0 (zero). If
  28128.  digits precede a letter, the digits are retained and the letters are
  28129.  discarded.
  28130.  
  28131.  Microsoft has confirmed this to be a problem in PWB version 1.00. This
  28132.  problem was corrected in PWB version 1.10.
  28133.  
  28134.  
  28135.  14. SYS0002 Produced If MSHELP.DLL Not Installed
  28136.  
  28137.  Product Version(s): 1.00
  28138.  Operating System:   OS/2
  28139.  Flags: ENDUSER | pwbhelp
  28140.  Last Modified: 23-JAN-1991    ArticleIdent: Q61955
  28141.  
  28142.  Under OS/2, if MSHELP.DLL is not installed correctly or is not on the
  28143.  LIBPATH, the following error may appear in a window when starting the
  28144.  Programmer's WorkBench (PWB):
  28145.  
  28146.                      Cannot Autoload Extension
  28147.                      e:\c600\binp\pwbhelp.pxt
  28148.  MSHELP:  SYS0002:  The system cannot find the file specified
  28149.  
  28150.                          < OK >   < Help >
  28151.  
  28152.  Make sure that the latest version of MSHELP.DLL (the one that was
  28153.  included with the Microsoft C Compiler version 6.00) is installed in a
  28154.  directory contained in your LIBPATH.
  28155.  
  28156.  If this file was not copied off the disks during setup, you can
  28157.  execute the following command with your Setup disk in Drive A:
  28158.  
  28159.     a:setup /copy
  28160.  
  28161.  Specify the file MSHELP.DLL at the prompt, then specify the
  28162.  destination directory.
  28163.  
  28164.  The default for SETUP.EXE is to put OS/2 DLLs in the C:\OS2\DLL
  28165.  directory. If you choose to install the DLLs in some other directory,
  28166.  you must edit the LIBPATH in your CONFIG.SYS file and restart the
  28167.  system.
  28168.  
  28169.  
  28170.  15. Enabling of Source Browser Menu Related to .BSC and .MAK Files
  28171.  
  28172.  Product Version(s): 1.00   | 1.00
  28173.  Operating System:   MS-DOS | OS/2
  28174.  Flags: ENDUSER |
  28175.  Last Modified: 29-MAY-1990    ArticleIdent: Q61968
  28176.  
  28177.  The Source Browser feature of the Programmer's WorkBench (PWB) is
  28178.  enabled or disabled depending upon the existence of a database file
  28179.  (.BSC file) AND a program list (.MAK file). The existence of a .BSC
  28180.  database file alone does not guarantee that the Browse menu will be
  28181.  enabled for all modules in a project, even if the .BSC file was built
  28182.  from .SBR files for every module. The setting of a program list is
  28183.  also required.
  28184.  
  28185.  Thus, if a .BSC file is built outside of the PWB with PWBRMAKE, then
  28186.  upon entering the PWB, the Browser will be enabled for only one module
  28187.  at most (see below). The easiest method to enable the Browse menu for
  28188.  ALL modules is to select "Set program list" on the Make menu, then
  28189.  type in the base name of the .BSC file (with the .MAK or no extension)
  28190.  when it prompts you for the filename. If the .MAK file you enter does
  28191.  not exist, then the dialog box appears for adding files to the program
  28192.  list, whereas you can just select "Save List" without actually adding
  28193.  any files. At this point, the Browser menu will be enabled for all
  28194.  files you bring up into the PWB editor.
  28195.  
  28196.  The existence of a Source Browser database file means that the Browse
  28197.  menu will be enabled for a source file with a matching base name of
  28198.  the .BSC file.
  28199.  
  28200.  For example, assume a project consists of several modules, with the
  28201.  main source module called PROJECT.C. In addition, assume a Browser
  28202.  database file called PROJECT.BSC is built from the .SBR Browser
  28203.  information files produced by the compiler for every module in this
  28204.  project. If the file PROJECT.C is brought up in the PWB, the Browse
  28205.  menu will be enabled because the base name (PROJECT) is the same as
  28206.  the base name of the database file PROJECT.BSC.
  28207.  
  28208.  On the other hand, if any of the other source files in the project are
  28209.  opened in the PWB, the Browse menu will be disabled because the base
  28210.  names do not match the base name of the database file. Also, if
  28211.  PROJECT.C is made the current file (which enables the Browse menu) and
  28212.  an option is selected on the browse Menu, such as "Goto Reference"
  28213.  (which causes a jump to a different module), the Browse menu will
  28214.  become disabled. The only way to re-enable the Browse menu in this
  28215.  case is to make PROJECT.C the current file again.
  28216.  
  28217.  The way to enable the Browse menu for all modules is to set a program
  28218.  list to a file with the .MAK extension and the same base name as the
  28219.  .BSC file. Thus, in the example above, setting the program list to
  28220.  PROJECT.MAK will enable the Browse menu for all modules. In fact, this
  28221.  connection between the .BSC file and the .MAK file enables the Browse
  28222.  menu for the modules in the current project, and for ANY file opened
  28223.  under the PWB.
  28224.  
  28225.  The result is that if you bring up a file in the editor that is
  28226.  completely unrelated to the current project (and may not even have a
  28227.  related .BSC file), you can still use the Browse menu options.
  28228.  However, in this situation, the information available from the Browser
  28229.  still only pertains to the original project.
  28230.  
  28231.  In summary, the .MAK file and .BSC file relationship is based solely
  28232.  on the file existence, NOT the file contents. The program list does
  28233.  NOT need to contain the names of the modules in the current project
  28234.  (or even be an actual makefile) for the Browser to function.
  28235.  
  28236.  
  28237.  16. Modifying TOOLS.INI May Have No Effect on PWB Environment
  28238.  
  28239.  Product Version(s): 1.00   | 1.00
  28240.  Operating System:   MS-DOS | OS/2
  28241.  Flags: ENDUSER |
  28242.  Last Modified: 17-JUL-1990    ArticleIdent: Q62170
  28243.  
  28244.  Changing settings in the TOOLS.INI file to modify the behavior of the
  28245.  Programmer's WorkBench (PWB) may not work under certain circumstances.
  28246.  For instance, if you decide to change the PWB to 50-line mode by
  28247.  setting "height:50" in the TOOLS.INI file, it will not work if the PWB
  28248.  was previously used in the 25- or 43-line mode.
  28249.  
  28250.  This is because some environment information is also recorded in the
  28251.  CURRENT.STS file, which is read in after the TOOLS.INI file --
  28252.  overriding the TOOLS.INI settings.
  28253.  
  28254.  The following are three workarounds for this problem:
  28255.  
  28256.  1. Use the /DS switch when invoking the PWB. This will ignore the
  28257.     CURRENT.STS file. However, this option also causes the current file
  28258.     history (of files being edited) to be ignored.
  28259.  
  28260.  2. Delete the CURRENT.STS file. This also causes the current list of
  28261.     programs being edited to be ignored.
  28262.  
  28263.  3. The better option is to select Editor Settings from the Options
  28264.     menu. When the list of editor switch settings appears, it can be
  28265.     changed and saved to the TOOLS.INI file by pressing SHIFT+F2. This
  28266.     will save the settings and cause the selection to take effect.
  28267.  
  28268.  
  28269.  17. Reversing Mouse Buttons in the PWB Cannot Be Done
  28270.  
  28271.  Product Version(s): 1.00   | 1.00
  28272.  Operating System:   MS-DOS | OS/2
  28273.  Flags: ENDUSER |
  28274.  Last Modified: 25-JUL-1990    ArticleIdent: Q62330
  28275.  
  28276.  Currently under the Programmer's WorkBench (PWB) released with version
  28277.  6.00 of the Microsoft C Optimizing Compiler, it is not possible to
  28278.  reverse the functionality of the mouse buttons.
  28279.  
  28280.  It is possible to change the functionality of the mouse buttons under
  28281.  OS/2 and DOS, but this will be overridden by the PWB environment.
  28282.  
  28283.  
  28284.  18. Attempting to Expand a Help Dialog Box Hangs DOS
  28285.  
  28286.  Product Version(s): 1.00   | 1.00
  28287.  Operating System:   MS-DOS | OS/2
  28288.  Flags: ENDUSER | buglist1.00
  28289.  Last Modified: 25-JUL-1990    ArticleIdent: Q62331
  28290.  
  28291.  When one of the pull-down menus in the Programmer's WorkBench (PWB)
  28292.  version 1.00 is selected (File, Edit, View, etc.) and then F1 is
  28293.  chosen for help on that menu, a small help screen appears. If CTRL+F10
  28294.  is chosen in an attempt to expand the window to full screen, the
  28295.  machine will hang under DOS. If the machine doesn't hang, it may
  28296.  require another invocation of CTRL+F10 to cause the problem.
  28297.  
  28298.  Under OS/2, the machine may not hang, but the PWB's functionality will
  28299.  be disrupted and attempts to free oneself may cause a GP fault. It may
  28300.  be possible to exit the PWB, but at the very least, the CURRENT.STS
  28301.  file will be corrupted so that future entrances to PWB will result in
  28302.  very odd window configurations.
  28303.  
  28304.  Microsoft has confirmed this to be a problem with the PWB version
  28305.  1.00. We are researching this problem and will post new information
  28306.  here as it becomes available.
  28307.  
  28308.  
  28309.  19. PWB Doesn't Update Mark Location If Mark Moves Up or Left
  28310.  
  28311.  Product Version(s): 1.00 | 1.00
  28312.  Operating System:   OS/2 | 1.00
  28313.  Flags: ENDUSER | buglist1.00
  28314.  Last Modified: 13-JUN-1990    ArticleIdent: Q62388
  28315.  
  28316.  If you set a mark in a file, and that location then moves upward or
  28317.  toward the left in the file, PWB does not reset the mark location;
  28318.  however, it does correctly update marks that move downward or to the
  28319.  right in the file.
  28320.  
  28321.  Consider the following file:
  28322.  
  28323.  /* Test.dat */
  28324.  test1
  28325.  
  28326.  test2
  28327.  
  28328.  test3
  28329.  
  28330.  Place the cursor on the "2" in test2. Choose the Search.Define Mark
  28331.  menu option. Name the mark "mark1" and press ENTER. Now, move the
  28332.  cursor to another location in the file. Choose the Search.Go To Mark
  28333.  option from the menus. Go to "mark1". Note that the cursor is back on
  28334.  the "2" in test2.
  28335.  
  28336.  Next, add another blank line between test1 and test2. Again, move your
  28337.  cursor and go to mark1. Note that the cursor is back on the "2" in
  28338.  test2.
  28339.  
  28340.  Now, delete both the lines between test1 and test2. Select the
  28341.  Search.Go To Mark option from the menus. Note that the cursor is on
  28342.  the same location as it was before you deleted these lines. The same
  28343.  behavior will happen if you delete any of the characters before the
  28344.  "2" in the test2 line.
  28345.  
  28346.  Microsoft has confirmed this to be a problem in the Programmer's
  28347.  WorkBench (PWB) version 1.00. We are researching this problem and will
  28348.  post new information here as it becomes available.
  28349.  
  28350.  
  28351.  20. PWB 1.00 "Set Dependencies" Fails with Spaces in #include Line
  28352.  
  28353.  Product Version(s): 1.00   | 1.00
  28354.  Operating System:   MS-DOS | OS/2
  28355.  Flags: ENDUSER | buglist1.00 fixlist1.10 s_c
  28356.  Last Modified:  5-FEB-1991    ArticleIdent: Q62578
  28357.  
  28358.  The Programmer's WorkBench (PWB) version 1.00 (shipped with C version
  28359.  6.00) includes a "Set Dependencies" option in the "Set Program List"
  28360.  window. This option automatically sets up build dependencies for all
  28361.  include files used in the current project. This option will fail with
  28362.  a message that the include file does not exist if there are embedded
  28363.  spaces between the left angle bracket (<) and the include-file name in
  28364.  an include directive line.
  28365.  
  28366.  The Set Dependencies option will work correctly if the space(s) are
  28367.  removed or if a new build option is added to the TOOLS.INI file.
  28368.  
  28369.  Although embedded spaces are legal in C programming syntax, the
  28370.  Programmer's WorkBench fails to parse the include line correctly if
  28371.  spaces exist before the filename. The following line of code shows the
  28372.  situation where the "Set Dependencies" error will occur:
  28373.  
  28374.     #include < stdio.h >
  28375.  
  28376.  The space before the "s" in stdio.h prevents PWB from finding the
  28377.  STDIO.H include file. (The trailing space after stdio.h does not
  28378.  affect the behavior of "Set Dependencies".)
  28379.  
  28380.  The full text of the error message window for the line above is as
  28381.  follows:
  28382.  
  28383.          stdio.h does not exist
  28384.     Cannot build its dependency tree.
  28385.     Abort dependency lists generation?
  28386.          <Yes>    <No>    <Help>
  28387.  
  28388.  Selecting <Help> displays a help screen that describes the problem as
  28389.  being either a mistyped filename or a nonexistent file, but the actual
  28390.  file DOES exist. Removing the embedded space will correct the problem.
  28391.  
  28392.  You can also add two new "build" lines to the TOOLS.INI file to make
  28393.  the PWB recognize include directives that contain spaces. These lines
  28394.  should be included under the section with the [PWB] tag, and should
  28395.  have the following syntax:
  28396.  
  28397.     build: include .c                                              \
  28398.         "^[ \t]*#[ \t]*include[ \t]*\"[ \t]*\\([^\"]+[ \t]*\\)\""  \
  28399.         case
  28400.     build: include .c                                              \
  28401.        "^[ \t]*#[ \t]*include[ \t]*<[ \t]*\\([^>]+\\)[ \t]*>"      \
  28402.         case system
  28403.  
  28404.  (Note: These build switch statements are broken down into multiple
  28405.  lines with the line continuation character (\) because of space
  28406.  limitations; you may enter each of them into the TOOLS.INI file on a
  28407.  single line, rather than multiple lines.)
  28408.  
  28409.  There is one drawback to this workaround; you will still get the error
  28410.  message shown above because the "old" build switch is applied before
  28411.  the new one. To have the new build switch take effect, you need to
  28412.  select "No" when prompted to abort the dependency list generation.
  28413.  Once you have selected "No" for each file with spaces in the include
  28414.  directive, the dependencies will then be generated correctly.
  28415.  
  28416.  Microsoft has confirmed this to be a problem in the Programmer's
  28417.  WorkBench version 1.00. This problem was corrected in the Programmer's
  28418.  WorkBench version 1.10.
  28419.  
  28420.  
  28421.  21. PWB 1.10 Dialog Boxes May Blink After Dialog Help Is Obtained
  28422.  
  28423.  Product Version(s): 1.10
  28424.  Operating System:   MS-DOS
  28425.  Flags: ENDUSER | buglist1.10 flicker
  28426.  Last Modified: 19-FEB-1991    ArticleIdent: Q69347
  28427.  
  28428.  When working with the Programmer's WorkBench (PWB) version 1.10 under
  28429.  DOS, there are several instances where a dialog box may start flashing
  28430.  incorrectly. This situation occurs when you obtain help on a PWB
  28431.  informational pop-up dialog box and then return from the Help dialog
  28432.  screen. At this point you may find that the original dialog box is
  28433.  rapidly blinking.
  28434.  
  28435.  This problem may occur when trying to get help on a topic for which
  28436.  there is no help, trying to use an unassigned key, or when PWB informs
  28437.  you that you changed a file but didn't save it before you tried to
  28438.  exit. In each of these cases, PWB gives you a pop-up dialog box
  28439.  informing you of the situation. If you get help on this informational
  28440.  dialog box and then press ESC or click Cancel, the original dialog box
  28441.  will start blinking.
  28442.  
  28443.  This is not normal behavior, however, PWB is still fully functional
  28444.  and you may proceed by selecting an appropriate choice from the
  28445.  flashing dialog box.
  28446.  
  28447.  Microsoft has confirmed this to be a problem in the Programmer's
  28448.  WorkBench version 1.10. We are researching this problem and will post
  28449.  new information here as it becomes available.
  28450.  
  28451.  
  28452.  22. R6000 Stack Overflow After Deleting Current Makefile
  28453.  
  28454.  Product Version(s): 1.00   | 1.00
  28455.  Operating System:   MS-DOS | OS/2
  28456.  Flags: ENDUSER |
  28457.  Last Modified: 25-JUL-1990    ArticleIdent: Q62668
  28458.  
  28459.  If you are viewing your makefile in a window in PWB 1.00, then delete
  28460.  the makefile from a shell; attempting to make the window containing
  28461.  the makefile active will cause a run-time error R6000, stack overflow.
  28462.  
  28463.  To duplicate this problem, bring up a sample program and set the
  28464.  program list to that file's makefile. Next, open up another window
  28465.  and open the makefile in that window. Now, either from the Run.Run
  28466.  <DOS-OS/2> Command menu or the File.<DOS-OS/2> Shell, delete that
  28467.  makefile.
  28468.  
  28469.  After returning back to the PWB, make the window containing the
  28470.  makefile the active program list either by pressing the F6 key to
  28471.  toggle windows or by clicking the left mouse button in that window.
  28472.  
  28473.  You will be faced with a popup message saying "File has been deleted
  28474.  from disk. Delete from memory?" Answering "yes" brings up the popup
  28475.  six to eight more times. Then, PWB will abort to the system prompt
  28476.  with an R6000 (stack overflow) error message and another message, "File
  28477.  has been deleted from disk."
  28478.  
  28479.  Microsoft has confirmed this to be a problem in PWB version 1.00. We
  28480.  are researching this problem and will post new information here as it
  28481.  becomes available.
  28482.  
  28483.  
  28484.  23. PWB 1.00 Extensions Only Return True Under DOS
  28485.  
  28486.  Product Version(s): 1.00
  28487.  Operating System:   MS-DOS
  28488.  Flags: ENDUSER | buglist1.00
  28489.  Last Modified: 15-AUG-1990    ArticleIdent: Q63052
  28490.  
  28491.  Extensions written for use by the Programmer's WorkBench (PWB) version
  28492.  1.00 under the DOS operating system are recognized as returning true
  28493.  regardless of their actual return values.
  28494.  
  28495.  The use of return values as a way of providing conditional jumps
  28496.  inside PWB macros is a common practice that is affected by the above
  28497.  limitation for PWB extensions. The following sample extension and
  28498.  macro demonstrate the above problem. Once installed, both the foo()
  28499.  and foo2() functions will be seen as returning true to PWB.
  28500.  
  28501.  Sample Code
  28502.  -----------
  28503.  
  28504.  // foo.c
  28505.  
  28506.  #include <string.h>
  28507.  #include <stdlib.h>
  28508.  #include <ext.h>
  28509.  
  28510.  PWBFUNC foo( unsigned argData, ARG far *pArg, flagType fMeta );
  28511.  PWBFUNC foo2( unsigned argData, ARG far *pArg, flagType fMeta);
  28512.  
  28513.  // Switches.
  28514.  struct swiDesc swiTable[] =
  28515.  {
  28516.     { NULL, NULL, 0 }
  28517.  };
  28518.  
  28519.  // Commands.
  28520.  struct cmdDesc cmdTable[] =
  28521.  {
  28522.     { "foo", foo, 0, NOARG },
  28523.     { "foo2",foo2,0, NOARG },
  28524.     { NULL, NULL, 0, 0 }
  28525.  };
  28526.  
  28527.  void EXTERNAL WhenLoaded()
  28528.  {
  28529.      SetKey( "foo",         "alt+f" );
  28530.      SetKey( "foo2",       "ctrl+f" );
  28531.      return;
  28532.  }
  28533.  
  28534.  PWBFUNC foo( unsigned argData, ARG far *pArg, flagType fMeta )
  28535.  {
  28536.   return(FALSE);  /* FALSE is defined as 0 in ext.h */
  28537.  }
  28538.  
  28539.  PWBFUNC foo2( unsigned argData, ARG far *pArg, flagType fMeta)
  28540.  {
  28541.   return(TRUE);   /* TRUE is defined as 1 in ext.h  */
  28542.  }
  28543.  
  28544.  // End of foo.c
  28545.  
  28546.  ; macros in tools.ini to test foo and foo2
  28547.  
  28548.  load foo
  28549.  
  28550.  test:=foo ->loc1 arg "true" message => :>loc1 arg "false" message
  28551.  test2:=foo2 ->loc2 arg "true" message => :>loc2 arg "false" message
  28552.  
  28553.  test:alt+t
  28554.  test2:ctrl+2
  28555.  
  28556.  Microsoft has confirmed this to be a problem with PWB version 1.00. We
  28557.  are researching this problem and will post new information here as it
  28558.  becomes available.
  28559.  
  28560.  
  28561.  24. PWB Text Highlight with Mouse Acts Strange After Search
  28562.  
  28563.  Product Version(s): 1.00   | 1.00
  28564.  Operating System:   MS-DOS | OS/2
  28565.  Flags: ENDUSER |
  28566.  Last Modified: 15-AUG-1990    ArticleIdent: Q63059
  28567.  
  28568.  The click-and-drag method of selecting text with the mouse in the
  28569.  Programmer's Workbench (PWB) sometimes works incorrectly when used
  28570.  after a search function.
  28571.  
  28572.  To reproduce this problem, do the following:
  28573.  
  28574.  1. Select a word in the text using the mouse (double-click on a single
  28575.     word).
  28576.  
  28577.  2. Execute the search function (select the Search menu, choose Find,
  28578.     then OK).
  28579.  
  28580.  3. Now try to highlight the text a few lines below the word you used
  28581.     to search on (using the click-and-drag method).
  28582.  
  28583.  The text will be highlighted starting at the original word that was
  28584.  searched for, rather than at the starting mouse position.
  28585.  
  28586.  To work around this problem, click the left button anywhere in the
  28587.  text window, then perform the text highlight.
  28588.  
  28589.  Microsoft has confirmed this to be a problem with the Programmer's
  28590.  Workbench version 1.00. We are researching this problem and will post
  28591.  new information here as it becomes available.
  28592.  
  28593.  
  28594.  25. PWB Does Not Return from DOS Shell with ";" in TMP
  28595.  
  28596.  Product Version(s): 1.00
  28597.  Operating System:   MS-DOS
  28598.  Flags: ENDUSER |
  28599.  Last Modified: 25-JUL-1990    ArticleIdent: Q62702
  28600.  
  28601.  If there is a semicolon ";" in your TMP environment variable, you may
  28602.  not be able to return to the Programmer's Workbench by typing "exit"
  28603.  after selecting "DOS Shell" from the File menu in PWB.
  28604.  
  28605.  Since the TMP environment variable is used to specify a single
  28606.  directory rather than a path, the semicolon character should not be
  28607.  used.
  28608.  
  28609.  To re-create this situation, type the following at the command line:
  28610.  
  28611.     set TMP=C:\TMP;
  28612.  
  28613.  Then select DOS Shell from within PWB. Typing "exit" on the DOS
  28614.  command line will not bring you back into PWB.
  28615.  
  28616.  To correct the problem, remove the semicolon from the end of the TMP
  28617.  environment variable.
  28618.  
  28619.  
  28620.  26. PWB BACKUP.BAK Does Not Create Backup of Source File Correctly
  28621.  
  28622.  Product Version(s): 1.00   | 1.00
  28623.  Operating System:   MS-DOS | OS/2
  28624.  Flags: ENDUSER| buglist1.00
  28625.  Last Modified: 24-JUL-1990    ArticleIdent: Q63234
  28626.  
  28627.  Version 1.00 of the Programmer's Workbench does not create a backup of
  28628.  your source file correctly if the PROJECT.MAK has the same base name
  28629.  as the SOURCE.C file. When you build or rebuild the project, the file
  28630.  saved as your backup is a copy of the CURRENT.STS file.
  28631.  
  28632.  A workaround to this problem is to name your PROJECT.MAK with a
  28633.  different base name than your SOURCE.C file. This will still save a
  28634.  copy of your CURRENT.STS file with the base name of the PROJECT.MAK.
  28635.  However, it will correctly save a backup of the SOURCE.C as
  28636.  SOURCE.BAK.
  28637.  
  28638.  Microsoft has confirmed this to be a problem in version 1.00 of the
  28639.  Programmer's Workbench and will post new information here as it
  28640.  becomes available.
  28641.  
  28642.  
  28643.  
  28644.  27. PWB menukey Switch Resets to ALT When Shelling Out to DOS
  28645.  
  28646.  Product Version(s): 1.00
  28647.  Operating System:   MS-DOS
  28648.  Flags: ENDUSER | buglist1.00
  28649.  Last Modified: 10-JUL-1990    ArticleIdent: Q63267
  28650.  
  28651.  If the "menukey" switch in the DOS version of the Programmer's
  28652.  Workbench (PWB) version 1.00 is set to anything other than ALT (which
  28653.  is the default), it will be redefined to the ALT key after shelling
  28654.  out to DOS. This means the menukey switch will lose its assignment
  28655.  anytime you choose Compile, Run Program, Debug Program, or DOS Shell.
  28656.  
  28657.  The menukey switch determines which keystroke activates the PWB main
  28658.  menu bar. The ALT key is normally used for this, but menukey can be
  28659.  redefined to any keystroke. For example, menukey is automatically
  28660.  defined to F9 if you select Brief Editor emulation when installing the
  28661.  Programmer's WorkBench.
  28662.  
  28663.  Whenever you invoke any function (such as Build) that goes out to DOS
  28664.  for execution and then returns, the menukey switch is reset to ALT, so
  28665.  that both ALT AND the user-defined keystroke invoke the menu.
  28666.  
  28667.  To work around this problem, you can use the Restart command to invoke
  28668.  a macro that redefines the menukey to the desired value each time you
  28669.  return from a DOS SHELL command, which will then keep ALT from
  28670.  activating the menu. For example, to make it so that F9 is always
  28671.  reset as the only menukey, put the following line in the PWB tagged
  28672.  section of the TOOLS.INI file:
  28673.  
  28674.     restart:= arg "menukey:F9" assign
  28675.  
  28676.  Since the Restart command, if it exists in TOOLS.INI, is invoked
  28677.  automatically when returning from a SHELL command, this guarantees
  28678.  that the key assignment will always remain consistent.
  28679.  
  28680.  Microsoft has confirmed that the automatic reactivation of ALT as the
  28681.  menukey is a problem with the Programmer's WorkBench version 1.00. We
  28682.  are researching this problem and will post new information here as it
  28683.  becomes available.
  28684.  
  28685.  
  28686.  28. PWB: Print Does Not Put CR/LF at EOL If Text Selected
  28687.  
  28688.  Product Version(s): 1.00   | 1.00
  28689.  Operating System:   MS-DOS | OS/2
  28690.  Flags: ENDUSER | buglist1.00
  28691.  Last Modified: 25-JUL-1990    ArticleIdent: Q63318
  28692.  
  28693.  Using the Programmer's Workbench version 1.00, when a region of text
  28694.  is selected and the Print function is invoked, the resulting output
  28695.  contains linefeed characters (0x0A) at the end of each line, rather
  28696.  than a carriage return/linefeed (<CR><LF>) combination (0x0D and
  28697.  0x0A).
  28698.  
  28699.  Some printer drivers do not recognize this as a valid end-of-line
  28700.  (EOL) character and do not print correctly.
  28701.  
  28702.  To reproduce this problem, open a file that contains the <CR><LF>
  28703.  combination at the end of each line. Highlight a region of text in the
  28704.  file and from the File menu choose Print. Tab to the second field and
  28705.  type in the following:
  28706.  
  28707.     copy %s test.txt
  28708.  
  28709.  This will copy the region of selected to the file TEST.TXT. Using a
  28710.  standard hex file viewer, you can see that the end of a line is
  28711.  denoted by a single 0A. If you look at the original file using the hex
  28712.  viewer, it will contain 0A 0D at the end of each line.
  28713.  
  28714.  The Programmer's Workbench will recognize this type of file (with a
  28715.  single 0A at each end of line) and display it correctly if you try to
  28716.  open it within the Workbench, but many printer drivers do not
  28717.  understand this type of file.
  28718.  The workaround for this problem is to write a program that translates
  28719.  each 0x0A found in the output file to the bytes 0x0D and 0x0A, or use
  28720.  a printer driver that understands this type of file. In fact, most
  28721.  printers have an escape sequence or dip switch to make it recognize
  28722.  this type of file.
  28723.  
  28724.  Microsoft has confirmed this to be a problem with the Programmer's
  28725.  Workbench version 1.00. We are researching this problem and will
  28726.  post new information here as it becomes available.
  28727.  
  28728.  
  28729.  29. Unknown Function psrch with Brief Emulation in PWB
  28730.  
  28731.  Product Version(s): 1.00   | 1.00
  28732.  Operating System:   MS-DOS | OS/2
  28733.  Flags: ENDUSER |
  28734.  Last Modified: 25-JUL-1990    ArticleIdent: Q63319
  28735.  
  28736.  When using the Brief emulation feature of the Programmer's WorkBench
  28737.  version 1.00, reinitialization of the TOOLS.INI file will cause a
  28738.  number of unknown functions to appear when you try to use them. In
  28739.  short, most of the unknown functions that may be reported are related
  28740.  to search features such as the psearch switch. The error message
  28741.  associated with this search feature is commonly "Unknown function
  28742.  psrch."
  28743.  
  28744.  This error occurs only after you use the Initialize function.
  28745.  
  28746.  The Initialize function discards current macro definitions and rereads
  28747.  the appropriate section of TOOLS.INI. This is not exactly the same as
  28748.  restarting PWB; the Autostart macro is not executed after Initialize.
  28749.  The BRIEF emulation depends on the Autostart macro to define the
  28750.  search functions.
  28751.  
  28752.  To recover the definition of the missing macros, execute the toggle_re
  28753.  BRIEF emulation macro (CTRL+F6). To avoid having to remember to
  28754.  execute this macro, you can add this to the main section of TOOLS.INI:
  28755.  
  28756.     reinit:=Initialize Autostart
  28757.     reinit:Shift+F8
  28758.  
  28759.  Or you can define the macros as follows:
  28760.  
  28761.     psrch:=arg arg "String to Search for" prompt ->can
  28762.                                             psearch => :>can cancel
  28763.     msrch:=arg arg "String to Search for" prompt ->can
  28764.                                             msearch => :>can cancel
  28765.     qrepl:=arg arg qreplace
  28766.     srchname:="REoff"
  28767.  
  28768.  
  28769.  30. Problems Viewing README.DOC Inside PWB Online Help and QH
  28770.  
  28771.  Product Version(s): 1.00
  28772.  Operating System:   MS-DOS
  28773.  Flags: ENDUSER  |
  28774.  Last Modified: 15-AUG-1990    ArticleIdent: Q63661
  28775.  
  28776.  Problems can occur when attempting to access the README.DOC from
  28777.  within the DOS versions of Programmer's WorkBench (PWB) or QH via the
  28778.  online help.
  28779.  
  28780.  When attempting to view the README.DOC file using the online help
  28781.  inside the DOS version of PWB, the messages "Error displaying help"
  28782.  and then "Cannot process cross reference" may be displayed in
  28783.  successive dialog boxes.
  28784.  
  28785.  When attempting to view the README.DOC file from within QH, the
  28786.  message "The database README.DOC is not open, or the topic is not
  28787.  found" may be displayed.
  28788.  
  28789.  Again, these problems are found only in the DOS version of PWB and QH.
  28790.  Access of the README.DOC in this manner does not produce errors under
  28791.  the OS/2 versions of PWB or QH.
  28792.  
  28793.  The following are two possible workarounds for the problem in PWB:
  28794.  
  28795.  1. The README.DOC can be loaded into the help system by typing the
  28796.     following
  28797.  
  28798.        arg "$PATH:readme.doc!" arg pwbhelp
  28799.  
  28800.     with default keys:
  28801.  
  28802.        Alt+A $PATH:readme.doc! F1
  28803.  
  28804.     Note that this method may fail if there is another file named
  28805.     README.DOC in the path before the C 6.00 README.DOC. If this is the
  28806.     case, the other README.DOC will be loaded instead of the C 6.00
  28807.     README.DOC. This method can also fail if there is not enough memory
  28808.     to load the file into the help system.
  28809.  
  28810.  2. If the previous method fails, the C 6.00 README.DOC can be loaded
  28811.     into PWB as a normal text file via the File.Open menu option. The
  28812.     README.DOC can be found in the C 6.00 bound executable directory
  28813.     (for example, C:\C600\BINB).
  28814.  
  28815.  The following are three possible workarounds for the problem in QH:
  28816.  
  28817.  1. Inside QH, select View.Search, type "$PATH:readme.doc!" and press
  28818.     ENTER. Again, this will bring up the first README.DOC on the path.
  28819.  
  28820.  2. You can also select File.Open and load the the file by giving the
  28821.     full path and filename of the C 6.00 README.DOC. QH allows you to
  28822.     open any text file under 64K in size.
  28823.  
  28824.  3. To enable direct access of the README.DOC from within QH via the
  28825.     README.DOC button, it is necessary to point the QH environment
  28826.     variable to the directory where the README.DOC is located. For
  28827.     example:
  28828.  
  28829.        set qh=c:\c600\binb\readme.doc
  28830.  
  28831.     The QH environment variable is not documented in the C 6.00 printed
  28832.     or online documentation.
  28833.  
  28834.  Microsoft is researching this problem and will post new information
  28835.  here as it becomes available.
  28836.  
  28837.  
  28838.  31. CTRL+NUM/ May be Read as CTRL+/ in DOS with NUM LOCK On
  28839.  
  28840.  Product Version(s): 1.00 1.10 | 1.00 1.10
  28841.  Operating System:   MS-DOS    | OS/2
  28842.  Flags: ENDUSER | buglist1.10
  28843.  Last Modified: 15-NOV-1990    ArticleIdent: Q66740
  28844.  
  28845.  In versions 1.00 and 1.10 of Programmer's WorkBench (PWB), the
  28846.  CTRL+NUM/ (CTRL+/ on the numeric keypad) and ALT+NUM/ (ALT+/ on the
  28847.  numeric keypad) combinations may be interpreted as CTRL+/ and ALT+/
  28848.  (on the main keyboard). This problem happens only in DOS or the OS/2
  28849.  DOS 3.x box, and only on certain computers. This behavior will cause
  28850.  any macro or function assigned to CTRL+NUM/ or ALT+NUM/ to not execute
  28851.  when NUM LOCK is on.
  28852.  
  28853.  To reproduce this problem, assign a function or macro to CTRL+NUM/.
  28854.  Then execute the TELL function (CTRL+T by default) and press CTRL+NUM/.
  28855.  The TELL function prompts for a keystroke, then displays the name of
  28856.  the keystroke and the function assigned to it. With NUM LOCK on, TELL
  28857.  will return the following:
  28858.  
  28859.     unassigned:Ctrl+/.
  28860.  
  28861.  With NUM LOCK off, TELL will return the following:
  28862.  
  28863.     <function name>:Ctrl+num/.
  28864.  
  28865.  This behavior is identical for the ALT+NUM/ key name, but works
  28866.  properly for all other key names on the numeric keypad.
  28867.  
  28868.  If NUM LOCK is off, or if the protected-mode version of PWB is run,
  28869.  this behavior does not occur.
  28870.  
  28871.  This behavior has been observed on the following machines:
  28872.  
  28873.     Northgate 386-33
  28874.     PS/2 Model 70
  28875.     PS/2 Model 80-311
  28876.  
  28877.  Microsoft has confirmed this to be a problem in PWB version 1.00 and
  28878.  1.10. We are researching this problem and will post new information
  28879.  here as it becomes available.
  28880.  
  28881.  
  28882.  32. PWB Command-Line Option /DP Is Documented But Not Implemented
  28883.  
  28884.  Product Version(s): 1.00   | 1.00
  28885.  Operating System:   MS-DOS | OS/2
  28886.  Flags: ENDUSER | docerr
  28887.  Last Modified: 27-JUL-1990    ArticleIdent: Q63951
  28888.  
  28889.  The /DP switch for the Programmer's WorkBench (PWB), documented on
  28890.  Page 49 of the version 6.00 "Microsoft C Reference," is not
  28891.  implemented in version 1.00 of the PWB. This switch is designed to
  28892.  ignore the most recent program list upon starting the PWB.
  28893.  
  28894.  The /DP switch is mentioned only in the "Microsoft C Reference" and
  28895.  not in the online help.
  28896.  
  28897.  Upon invocation, the Programmer's WorkBench version 1.00 does not
  28898.  automatically set the program list to the last program list used.
  28899.  Therefore, the /DP command-line switch was not implemented because it
  28900.  would have no purpose.
  28901.  
  28902.  With the PWB version 1.00, there is no way to have the last program
  28903.  list set automatically at startup.
  28904.  
  28905.  
  28906.  33. With the "deflang" Switch PWB Prompts for Setting Program List
  28907.  
  28908.  Product Version(s): 1.00   | 1.00
  28909.  Operating System:   MS-DOS | OS/2
  28910.  Flags: ENDUSER | docerr
  28911.  Last Modified:  3-AUG-1990    ArticleIdent: Q64353
  28912.  
  28913.  As documented on Page 79 of the "Microsoft C Reference" shipped with C
  28914.  version 6.00 and in the online help, the "deflang" switch in the
  28915.  Programmer's WorkBench (PWB) sets the default filename extension for
  28916.  list boxes in PWB dialog boxes. Another (undocumented) feature of this
  28917.  switch is to enable you to be prompted to "Set Program List?" when
  28918.  loading a source file with a .MAK file associated with it in the
  28919.  current directory.
  28920.  
  28921.  By default, "deflang" is not set. You can set the deflang switch in
  28922.  the [PWB] tagged section of the TOOLS.INI file, for example:
  28923.  
  28924.     deflang:C
  28925.  
  28926.  This changes the default filename extension in the PWB's dialog boxes
  28927.  (such as Open in the File menu) from "*.*" to "*.c", so that only
  28928.  files with the .c extension show up by default. Other languages can be
  28929.  specified as well, as shown below:
  28930.  
  28931.     Switch Setting     Extension
  28932.     --------------     ---------
  28933.  
  28934.     no value            .*
  28935.     C                   .c
  28936.     Asm                 .asm
  28937.     BASIC               .bas
  28938.     FORTRAN             .for
  28939.     Pascal              .pas
  28940.     COBOL               .cbl
  28941.     LISP                .lsp
  28942.  
  28943.  Note that the online documentation specifies "Assembler" as the switch
  28944.  to use for .ASM files, but this is incorrect. "Asm" is the correct
  28945.  switch to use to make Assembler the default language.
  28946.  
  28947.  The deflang switch also enables you to be prompted as to whether or
  28948.  not the program list should be set automatically. If you load a file
  28949.  that has the extension specified by the "deflang" switch and you also
  28950.  have a .MAK file with the same base filename in the same directory,
  28951.  the PWB will prompt you about loading the program list.
  28952.  
  28953.  For example, assume that deflang is set to C and FOO.MAK and FOO.C are
  28954.  in the same directory. If you type PWB FOO.C at the command-prompt,
  28955.  the PWB will pause when loading and prompt with "Set Program List?
  28956.  FOO.MAK". At this point you can specify <yes> or <no>.
  28957.  
  28958.  When already in the PWB, if you select Open from the File menu, and
  28959.  select FOO.C as the file to open, the PWB will also prompt you at this
  28960.  point regarding whether or not you want FOO.MAK loaded as the program
  28961.  list, but only if NO program list is currently set.
  28962.  
  28963.  
  28964.  34. Can't Resize a Window with a Macro in PWB
  28965.  
  28966.  Product Version(s): 1.00   | 1.00
  28967.  Operating System:   MS-DOS | OS/2
  28968.  Flags: ENDUSER |
  28969.  Last Modified: 30-AUG-1990    ArticleIdent: Q64433
  28970.  
  28971.  A window cannot be resized using the "resize" function in a macro.
  28972.  After Programmer's WorkBench (PWB) performs the resize function, it
  28973.  waits for the you to respond with the UP ARROW or DOWN ARROW key.
  28974.  Functions that are placed in the macro after the resize function are
  28975.  ignored. If "record on" is selected and you try to record the resizing
  28976.  of a window, the macro will stop recording until the ENTER key on the
  28977.  numeric keypad is pressed.
  28978.  
  28979.  The following is an example:
  28980.  
  28981.     resizeit:= cancel arg arg nextmsg window resize up up up NumEnter
  28982.  
  28983.  The above example stops at the resize function and waits for you to
  28984.  resize the window. The remaining functions are ignored.
  28985.  
  28986.  To make a window a specified size, move the cursor to a location on
  28987.  the screen and then open the window with the "window" function.
  28988.  
  28989.  The following is an example of a macro that opens the "<compile>"
  28990.  window with a specified size:
  28991.  
  28992.  compile_size:= up up up up up up up up up up
  28993.  resize_it:=cancel meta down compile_size arg window window arg \
  28994.             "<compile>" setfile window
  28995.  resize_it:ALT+U
  28996.  
  28997.  Note: The size of the compile window can be adjusted by changing the
  28998.  number of ups on the compile_size line.
  28999.  
  29000.  
  29001.  35. PWB Hangs When Run with Some Communication Programs Under OS/2
  29002.  
  29003.  Product Version(s): 1.00
  29004.  Operating System:   OS/2
  29005.  Flags: ENDUSER |
  29006.  Last Modified: 30-AUG-1990    ArticleIdent: Q64435
  29007.  
  29008.  When running Programmer's WorkBench (PWB) under OS/2 while
  29009.  simultaneously running communication programs, PWB will appear to
  29010.  hang. To correct the problem, terminate any communication programs and
  29011.  PWB will resume as normal.
  29012.  
  29013.  
  29014.  36. "Cannot Open File current.$" May Mean Incorrect INIT Variable
  29015.  
  29016.  Product Version(s): 1.00   | 1.00
  29017.  Operating System:   MS-DOS | OS/2
  29018.  Flags: ENDUSER |
  29019.  Last Modified: 17-DEC-1990    ArticleIdent: Q64566
  29020.  
  29021.  When using the Programmer's Workbench (PWB), the following message may
  29022.  appear as a pop-up dialog box when selecting Compile or DOS Shell (or
  29023.  OS/2 Shell for OS/2):
  29024.  
  29025.     +----- Cannot open file! -----+
  29026.     |   D:\TEST\SRC\X\current.$   |
  29027.     |  No such file or directory  |
  29028.     |-----------------------------|
  29029.     |      < OK >   < Help >      |
  29030.     +-----------------------------+
  29031.  
  29032.  One cause for this error is an incorrect setting of the INIT
  29033.  environment variable. To remedy the situation, exit PWB and make sure
  29034.  that the INIT environment variable is set to a valid directory name
  29035.  (for example, a directory that exists).
  29036.  
  29037.  To reproduce this message, set your INIT environment variable to an
  29038.  invalid directory, for instance (if a directory named X does not exist
  29039.  on your drive):
  29040.  
  29041.     SET INIT=X
  29042.  
  29043.  Then start PWB and try to compile a program. The message will appear
  29044.  in the middle of the screen.
  29045.  
  29046.  One possible reason why your INIT environment variable may be set
  29047.  incorrectly, even if your AUTOEXEC.BAT sets it correctly, is that you
  29048.  might have run out of environment space in the setting of the
  29049.  variable. You can refer to the "MS-DOS Encyclopedia," Article 2, for
  29050.  more information about increasing your environment space.
  29051.  
  29052.  
  29053.  37. How to Use the PWB with the Windows 3.00 SDK
  29054.  
  29055.  Product Version(s): 1.00   | 1.00
  29056.  Operating System:   MS-DOS | OS/2
  29057.  Flags: ENDUSER |
  29058.  Last Modified: 15-AUG-1990    ArticleIdent: Q64788
  29059.  
  29060.  Detailed step-by-step instructions on how to set up the Programmer's
  29061.  WorkBench (PWB) for use with the Windows version 3.00 Software
  29062.  Development Kit (SDK) can be found in a file provided with the SDK
  29063.  called PWBINFO.WRI.
  29064.  
  29065.  The file explains how to set PWB switches so that Windows applications
  29066.  can be built from within PWB. The file also explains how to access the
  29067.  SDK's online help.
  29068.  
  29069.  This file can be viewed and printed with the WRITE program, which is
  29070.  packaged with the Windows 3.00 package.
  29071.  
  29072.  
  29073.  38. Tips for Using the Microsoft Advisor Online Help
  29074.  
  29075.  Product Version(s): 1.00 1.10 | 1.00 1.10
  29076.  Operating System:   MS-DOS    | OS/2
  29077.  Flags: ENDUSER | s_quickc s_c s_qh
  29078.  Last Modified: 23-JAN-1991    ArticleIdent: Q64829
  29079.  
  29080.  The following are some tips for more effectively using the online
  29081.  documentation included with the Microsoft C Compiler version 6.00
  29082.  Programmer's Workbench (PWB) as well as the Microsoft Advisor
  29083.  command-line help system:
  29084.  
  29085.  1. Finding help on a topic for which the exact name is not known.
  29086.  
  29087.     If the exact spelling of a topic is not known, the help for that
  29088.     topic can't be accessed directly (for instance, by using the F1 key
  29089.     in PWB), but it can usually be found indirectly.
  29090.  
  29091.     By using the table of contents and selecting links that pertain to
  29092.     the subject in question, the topic can usually be found. To get to
  29093.     the table of contents from within QuickHelp, select the Categories
  29094.     menu, then "C 6.00".  From within PWB, choose the Help menu, then
  29095.     select Contents.
  29096.  
  29097.     If you know the general spelling of the topic, an alphabetical
  29098.     index is available by choosing Index from the main contents screen.
  29099.  
  29100.  2. "Paging" through the online documentation.
  29101.  
  29102.     The online documentation can be "paged through" like you would page
  29103.     through a manual.
  29104.  
  29105.     In PWB, CTRL+F1 takes you from one topic to the next sequential
  29106.     topic in the help file. In QuickHelp, Choose Next or Back from the
  29107.     View menu to move in either direction.
  29108.  
  29109.  3. Scanning a list of available topics (as in a printed index).
  29110.  
  29111.     There are alphabetical indices for every major component of the
  29112.     product. Just choose Index from the main contents screen and select
  29113.     the appropriate topic.
  29114.  
  29115.  4. Techniques for using the online help.
  29116.  
  29117.     For more information on how to use the help system, as well as on
  29118.     the general organization and structure of the help system, choose
  29119.     Using Help from the main contents screen.
  29120.  
  29121.     For additional help, see Chapter 4, "Using the On-Line Reference,"
  29122.     of the "Microsoft C Installing and Using the Professional
  29123.     Development System" manual that comes with C version 6.00.
  29124.  
  29125.  5. Printing out the online help files.
  29126.  
  29127.     By using the HELPMAKE utility, the help files can be decoded to
  29128.     readable text files, which can then be printed. For more
  29129.     information about the HELPMAKE utility, see Chapter 7 of the
  29130.     "Microsoft C Advanced Programming Techniques" manual that comes
  29131.     with C version 6.00.
  29132.  
  29133.  
  29134.  39. Predefined Identifiers in Microsoft C 6.00
  29135.  
  29136.  Product Version(s): 6.00   | 6.00
  29137.  Operating System:   MS-DOS | OS/2
  29138.  Flags: ENDUSER | s_quickhelp s_c s_utils
  29139.  Last Modified: 24-OCT-1990    ArticleIdent: Q65472
  29140.  
  29141.  The following information is contained in the online help for the
  29142.  Microsoft C Compiler version 6.00.
  29143.  
  29144.  This information below can be accessed by using the following steps:
  29145.  
  29146.  1. Obtain help on the text "cl" using either the F1 key from the
  29147.     Programmer's WorkBench, or by using "qh cl" from the DOS or OS/2
  29148.     command lines.
  29149.  
  29150.  2. Select Preprocessor Options, then Predefined Identifiers.
  29151.  The compiler automatically defines identifiers useful in writing
  29152.  portable programs. You can use these identifiers to compile code
  29153.  sections conditionally. These identifiers are always defined unless
  29154.  otherwise stated.
  29155.  
  29156.     Identifier       Target Identified
  29157.     ----------       -----------------
  29158.  
  29159.     MSDOS            MS-DOS operating system
  29160.     M_I86            Member of the I86 processor family
  29161.     M_I86mM          Memory model type
  29162.                      <m> = T    Tiny
  29163.                            S    Small (default)
  29164.                            C    Compact model
  29165.                            M    Medium model
  29166.                            L    Large model
  29167.                            H    Huge model
  29168.     M_I8086          8088 or 8086 processor; default or with /G0
  29169.                         option
  29170.     M_I286           80286 processor; defined with /G1 or /G2 option
  29171.     _MSC_VER         Identifies the version of Microsoft C
  29172.     NO_EXT_KEYS      Disables Microsoft-specific language extensions
  29173.                         and extended keywords; defined only with /Za
  29174.                         option
  29175.     _CHAR_UNSIGNED   Changes default char type to unsigned; defined
  29176.                         only with /J option
  29177.  
  29178.  The _MSC_VER identifier has a value of 600 for the Microsoft C Compiler
  29179.  version 6.00. This identifier is not defined in Microsoft C versions
  29180.  5.10 and earlier.
  29181.  
  29182.  
  29183.  40. How to Add Other Language Compilers to PWB's Build Options
  29184.  
  29185.  Product Version(s): 1.00 1.10 | 1.00 1.10
  29186.  Operating System:   MS-DOS    | OS/2
  29187.  Flags: ENDUSER | s_pascal b_basiccom s_c h_masm h_fortran b_cobol
  29188.  Last Modified: 24-OCT-1990    ArticleIdent: Q65568
  29189.  
  29190.  The Programmer's WorkBench (PWB) is an environment capable of
  29191.  utilizing different compilers for mixed-language programming. When
  29192.  installed during BASIC version 7.10 setup, PWB version 1.10 shows
  29193.  build options for the BASIC language only. However, it is possible to
  29194.  include other language compilers to utilize the full features of the
  29195.  PWB utility.
  29196.  
  29197.  The following information applies to the Programmer's WorkBench
  29198.  version 1.10 utility supplied with Microsoft BASIC Professional
  29199.  Development System (PDS) version 7.10 for MS-DOS and MS OS/2.
  29200.  
  29201.  Note that the 1.00 version of PWB is shipped with Microsoft C
  29202.  Professional Development System (PDS) version 6.00. The steps below
  29203.  should also apply to PWB version 1.00.
  29204.  
  29205.  The Programmer's WorkBench (PWB.EXE) is an advanced development
  29206.  environment capable of integrating several language compilers,
  29207.  NMAKE.EXE, LINK.EXE, and the CodeView debugger. It offers the ability
  29208.  to accomplish tasks, such as program development under protected mode
  29209.  and mixed-language programming. This ability is not available in the
  29210.  QuickBASIC extended development environment (QBX.EXE).
  29211.  
  29212.  Two special files, PWBC.PX$ (for protected mode OS/2) and PWBC.MX$
  29213.  (for DOS mode), reside on the BASIC PDS 7.10 disks and support the
  29214.  option of using the C compiler in PWB. Since SETUP.EXE (in BASIC PDS
  29215.  7.10) does not copy PWBC.PX$ and PWBC.MX$ during installation, these
  29216.  files must be unpacked and transferred to your machine, for example to
  29217.  the \BINP subdirectory located in the \BC7 directory. (Note: The
  29218.  UNPACK.EXE utility is found on disk 1 of the BASIC PDS package.) After
  29219.  unpacking, the files will have the names PWBC.PXT and PWBC.MXT.
  29220.  
  29221.  Next, the following command lines must be added to the TOOLS.INI file
  29222.  to make the C compiler available to PWB:
  29223.  
  29224.     [pwb - .BAS .BI]
  29225.        LOAD: LogicalDrive:\[Path]\PWBC.PXT
  29226.  
  29227.  For further information about installing PWBC.PXT and PWBC.MXT, see
  29228.  Page 54 of the "Microsoft BASIC 7.1: Getting Started" manual.
  29229.  
  29230.  If you want to program in languages other than BASIC or C [such as
  29231.  Microsoft Macro Assembler (MASM), Microsoft Pascal, Microsoft FORTRAN,
  29232.  or Microsoft COBOL 3.00/3.00a], the following steps will insert the
  29233.  initial build options to include other languages to PWB's build
  29234.  options menu. In the example below, options to include the MASM.EXE
  29235.  assembler are specified. If some other language's compiler is desired,
  29236.  substitute appropriate changes for that compiler, where noted in the
  29237.  specified areas:
  29238.  
  29239.   1. In PWB, go to the Options menu and select Build Options.
  29240.  
  29241.   2. Choose Save Current Build Options.
  29242.  
  29243.   3. Enter a meaningful message, such as "Options to Include MASM" in
  29244.      the window's edit field (if some other language is desired, change
  29245.      MASM to the appropriate name). Select the OK button from the "Save
  29246.      Current Build Options" and "Build Options" windows.
  29247.  
  29248.   4. Open the "TOOLS.INI" file in the PWB utility and go down to the
  29249.      bottom of the file. Somewhere near the bottom should be the tag
  29250.      "[PWB-Build Options: Options to Include MASM]" (or the language
  29251.      that was specified).
  29252.  
  29253.   5. In this section, add the following NMAKE instructions:
  29254.  
  29255.         build: inference .asm.obj masm_asm_obj
  29256.         build: command masm_asm_obj "masm $<;"
  29257.  
  29258.      Note: For languages other than MASM, distinguish a variable name
  29259.      in the inference rule to be used in the commands line (such as
  29260.      masm_asm_obj has been used above) and then specify the appropriate
  29261.      compiler in the commands line within the quotation marks. The
  29262.      special filename macro specified in the quotation marks, "$<",
  29263.      applies the command to any object that has an out-of-date
  29264.      executable file.
  29265.  
  29266.   6. Press SHIFT+F8 to reinitialize the file and then close it.
  29267.  
  29268.   7. Go to the File menu and select New (it is a good idea to close any
  29269.      files that are currently open before this step).
  29270.  
  29271.   8. Go to the Options menu and select Build Options.
  29272.  
  29273.   9. Choose Initial Build Options.
  29274.  
  29275.  10. Select the "Options to Include MASM" option (it should be near the
  29276.      bottom of the list).
  29277.  
  29278.  After completing these instructions, the PWB utility will now be ready
  29279.  to compile assembler along with BASIC source code, provided that paths
  29280.  to the necessary compilers are furnished.
  29281.  
  29282.  
  29283.  41. PWB Err Msg: Out of Local Memory. Unable to Recover.
  29284.  
  29285.  Product Version(s): 1.00
  29286.  Operating System:   MS-DOS
  29287.  Flags: ENDUSER |
  29288.  Last Modified: 17-OCT-1990    ArticleIdent: Q65913
  29289.  
  29290.  When setting a program list inside of the Programmer's WorkBench
  29291.  (PWB), the following message may occur:
  29292.  
  29293.     Out of Local Memory.  Unable to Recover.
  29294.  
  29295.  The error is printed on the screen and the PWB exits to DOS. This
  29296.  error may occur when the program list contains too many names. To
  29297.  resolve the problem, combine object modules into libraries whenever
  29298.  possible. Remove the .OBJ files from the program list and replace them
  29299.  with the new libraries. This will reduce the number of object modules
  29300.  that need to be defined in the program list.
  29301.  
  29302.  Another method that sometimes helps to alleviate the error is to open
  29303.  the File menu and close as many unneeded files as possible. This
  29304.  should be done before setting the program list.
  29305.  
  29306.  
  29307.  42. Situation Where PWB Online Help Text Disappears
  29308.  
  29309.  Product Version(s): 1.00 1.10 | 1.00 1.10
  29310.  Operating System:   MS-DOS    | OS/2
  29311.  Flags: ENDUSER | SR# S901010-118 B_BasicCom S_C B_cobol
  29312.  Last Modified: 24-OCT-1990    ArticleIdent: Q66229
  29313.  
  29314.  When requesting help in Microsoft Programmer's WorkBench (PWB)
  29315.  versions 1.00 and 1.10, the following sequence of events will cause
  29316.  the Help screen text to disappear, leaving only the hyperlinks.
  29317.  
  29318.  This information applies to Programmer's WorkBench version 1.00 (which
  29319.  comes with Microsoft C Professional Development System version 6.00
  29320.  for MS-DOS and MS OS/2), and to Programmer's WorkBench version 1.10
  29321.  (which comes with Microsoft COBOL Professional Development System
  29322.  version 4.00 and with Microsoft BASIC Professional Development System
  29323.  (PDS) version 7.10 for MS-DOS and MS OS/2).
  29324.  
  29325.  Microsoft has confirmed this to be a problem in PWB. We are
  29326.  researching this problem and will post new information here as it
  29327.  becomes available.
  29328.  Follow these steps to reproduce the problem:
  29329.  
  29330.  1. From the DOS or OS/2 prompt, enter PWB. From the File menu, select
  29331.     New. Type PLINES and request help by pressing F1 or single-clicking
  29332.     the right mouse button.
  29333.  
  29334.  2. In the Help dialog, double-click the left mouse button with the
  29335.     cursor on the hyperlink "Using PWB Functions."
  29336.  
  29337.  3. Double-click the left mouse button with the cursor on the hyperlink
  29338.     "PWB Functions by Category."
  29339.  
  29340.  4. Double-click the left mouse button with the cursor on the hyperlink
  29341.     "Moving Through Files."
  29342.  
  29343.  5. The vertical scroll bar will show that you are at the bottom of the
  29344.     dialog. Press PGUP and you will notice that the hyperlinks to Up,
  29345.     Index, Contents, and Back have disappeared. Double-click the left
  29346.     mouse button with the cursor on any of these empty hyperlinks; the
  29347.     text on the screen will disappear, with empty hyperlinks appearing
  29348.     on the screen.
  29349.  
  29350.  
  29351.  43. How to Insert Spaces Before a Block of Text in PWB
  29352.  
  29353.  Product Version(s): 1.00   | 1.00
  29354.  Operating System:   MS-DOS | OS/2
  29355.  Flags: ENDUSER | S_EDITOR
  29356.  Last Modified: 24-OCT-1990    ArticleIdent: Q66231
  29357.  
  29358.  It is sometimes desirable to indent or move over a block of text in
  29359.  the Programmer's WorkBench (PWB) or the M Editor. The following steps
  29360.  can be used to insert spaces before a block of text to indent it:
  29361.  
  29362.  1. Get into boxarg mode. You can select this mode from the Edit menu
  29363.     under the Programmer's Workbench, or select the boxstream function
  29364.     under the Microsoft Editor.
  29365.  
  29366.  2. Highlight the area you want to contain the spaces. This may be
  29367.     anywhere in the file.
  29368.  
  29369.  3. Select the linsert function. By default, this is CTRL+N.
  29370.  
  29371.  The highlighted area should now be moved over and replaced by spaces.
  29372.  
  29373.  You don't have to be in boxarg mode for this to work; linsert always
  29374.  treats its argument as a boxarg regardless of the current mode.
  29375.  However, the highlight on the screen won't match the area that is
  29376.  going to be inserted unless you use boxarg mode.
  29377.  
  29378.  Also, ldelete can be used to unindent a block of text. However, you
  29379.  must be in boxarg or streamarg mode for it to work correctly. In
  29380.  linearg mode, it will delete entire lines.
  29381.  
  29382.  
  29383.  44. PWB's Use of Expanded Memory
  29384.  
  29385.  Product Version(s): 1.00 1.10
  29386.  Operating System:   MS-DOS
  29387.  Flags: ENDUSER |
  29388.  Last Modified: 23-OCT-1990    ArticleIdent: Q66308
  29389.  
  29390.  The DOS version of the Programmer's WorkBench (PWB) will utilize
  29391.  expanded memory to swap its own segment overlays if it detects that
  29392.  expanded memory is available in the system. When PWB needs a new
  29393.  overlay, the existing overlay in memory is first copied into expanded
  29394.  memory. If there is not enough room in expanded memory to copy the
  29395.  overlay, the least recently used overlay is discarded to make room for
  29396.  it. This scheme allows most overlays to be read from expanded memory
  29397.  instead of from disk.
  29398.  
  29399.  Note that this is the only method by which PWB will take advantage of
  29400.  available expanded memory, and that PWB versions 1.00 and 1.10 have no
  29401.  internal provisions to make use of extended memory in any way.
  29402.  
  29403.  
  29404.  45. PWB May Exit to DOS If TMP Not Set Correctly
  29405.  
  29406.  Product Version(s): 1.00 1.10
  29407.  Operating System:   MS-DOS
  29408.  Flags: ENDUSER | buglist1.00 buglist1.10
  29409.  Last Modified: 24-OCT-1990    ArticleIdent: Q66309
  29410.  
  29411.  If the tmp environment variable is set only to a drive (with no path
  29412.  specified), the PWB may "crash" out to DOS when a compile is
  29413.  attempted. The screen will still show the PWB, but there will be a
  29414.  prompt displayed.
  29415.  
  29416.  This problem may be reproduced using the following procedure:
  29417.  
  29418.  1. Set up the environment to run the PWB.
  29419.  
  29420.  2. Set the tmp environment variable to the current drive, without
  29421.     specifying a path. For example:
  29422.  
  29423.        SET TMP=C:
  29424.  
  29425.  3. Execute the PWB and create or load a simple source file.
  29426.  
  29427.  4. Attempt to compile the source file. (Note: If the COMPILE option is
  29428.     not available on the make menu, make sure the file has a name with a
  29429.     .c extension.)
  29430.  
  29431.  Microsoft has confirmed this to be a problem with the Programmer's
  29432.  WorkBench versions 1.00 and 1.10. We are researching this problem and
  29433.  will post new information here as it becomes available.
  29434.  
  29435.  
  29436.  46. MASM Build Switches for PWB 1.10
  29437.  
  29438.  Product Version(s): 1.10    | 1.10
  29439.  Operating System:   MS-DOS  | OS/2
  29440.  Flags: ENDUSER |
  29441.  Last Modified:  5-DEC-1990    ArticleIdent: Q66339
  29442.  
  29443.  When setting a program list containing .ASM files in Programmer's
  29444.  WorkBench (PWB) version 1.10, the following error message occurs:
  29445.  
  29446.     Program List: file 'filename' will be ignored
  29447.     File type unused by current build options
  29448.  
  29449.  The .ASM files are not recognized because PWB 1.10 does not contain
  29450.  build switches specific to any language. Build switches are now loaded
  29451.  from language extension files (.MXT for DOS and .PXT for OS/2). If you
  29452.  have an assembly language extension file, you will not see this error
  29453.  message. Language extensions are not necessary and are only a
  29454.  convenience for controlling the build process; only the build switches
  29455.  are really needed.
  29456.  
  29457.  The following build switches can be added to a tagged section in your
  29458.  TOOLS.INI file. To use these build options, first choose your language
  29459.  options from the Options Build Options menu, then initialize this
  29460.  section by typing {arg} tag_name {reinitialize} (type the following to
  29461.  invoke the sample build switch below:
  29462.  
  29463.     ALT+A asm_rules SHIFT+F8
  29464.  
  29465.  These switches can also be added to a custom set of build options
  29466.  saved by Save Current Build Options. They may then be initialized by
  29467.  choosing Build Options from the Options menu, and then selecting Set
  29468.  Initial Build Options to choose the new custom language options.
  29469.  
  29470.  Sample Build Switches
  29471.  ---------------------
  29472.  
  29473.  [pwb-asm_rules]
  29474.  ;
  29475.  ;   MASM build rules
  29476.  ;
  29477.  build:macro ASM "MASM"
  29478.  build:macro AFLAGS_G "/Mx /T"
  29479.  build:macro AFLAGS_D "/Zi"
  29480.  build:macro AFLAGS_R ""
  29481.  build:inference .asm.obj as_asm_obj
  29482.  build:release command as_asm_obj  \
  29483.              "$(ASM) $(AFLAGS_G) $(AFLAGS_R) $<, $@;"
  29484.  build:debug command as_asm_obj  \
  29485.              "$(ASM) $(AFLAGS_G) $(AFLAGS_D) $<, $@;"
  29486.  build:include .asm "^[ \t]*include[ \t]+\\([^ \t]+\\)"
  29487.  build:include .inc "^[ \t]*include[ \t]+\\([^ \t]+\\)"
  29488.  
  29489.  These assembly flags can then be modified from PWB by using the
  29490.  following macros. The macros must be assigned to keystrokes to be
  29491.  activated. This can be done using the <ASSIGN> pseudo file. They can
  29492.  then be used to redefine the flags to pass to MASM.
  29493.  
  29494.  ;
  29495.  ;   MASM option-setting macros
  29496.  ;
  29497.  setAFG:= arg "Global MASM Options?"  prompt -> cancel lasttext home \
  29498.          "build:macro AFLAGS_G \"" endline "\"" assign
  29499.  
  29500.  setAFD:= arg "Debug MASM Options?"   prompt -> cancel lasttext home \
  29501.          "build:macro AFLAGS_D \"" endline "\"" assign
  29502.  
  29503.  setAFR:= arg "Release MASM Options?" prompt -> cancel lasttext home \
  29504.          "build:macro AFLAGS_R \"" endline "\"" assign
  29505.  
  29506.  
  29507.  47. Unexpected Behavior with the /Gt Switch and the PWB
  29508.  
  29509.  Product Version(s): 1.00   | 1.00
  29510.  Operating System:   MS-DOS | OS/2
  29511.  Flags: ENDUSER | S_C
  29512.  Last Modified: 15-JAN-1991    ArticleIdent: Q66828
  29513.  
  29514.  Adding the /Gt compiler switch with an argument to the Additional
  29515.  Options section of the C Compiler Options on the Programmer's
  29516.  WorkBench (PWB) Options menu can cause the value of the argument to be
  29517.  changed or dropped.
  29518.  
  29519.  Microsoft has confirmed this to be a problem in the Programmer's
  29520.  WorkBench version 1.00. We are researching this problem and will post
  29521.  new information here as it becomes available.
  29522.  
  29523.  When you add the /Gt switch with an argument (for example, /Gt30) and
  29524.  click OK, then immediately go back into the Compiler Options dialog
  29525.  box; you will see that the /Gt30 switch you just set is now /Gt3.
  29526.  
  29527.  If you set a /Gt switch and specify a value, it will compile with that
  29528.  correct value because it was written to the file on disk that is used
  29529.  to build the program.
  29530.  
  29531.  If you go back in and look at the compiler options and see that the
  29532.  value is incorrect and Cancel the options dialog, you will still
  29533.  compile with your initial correct /Gt value.
  29534.  
  29535.  You will compile with the incorrect /Gt value only if you make another
  29536.  change in that dialog and select OK. This is because you changed the
  29537.  options, so PWB rewrites the options to the file on disk. In the case
  29538.  of /Gt, that option is written incorrectly and from that point on, you
  29539.  will compile with the incorrect /Gt value.
  29540.  
  29541.  Not all values of /Gt are incorrect. The most common incorrect values
  29542.  end in zero. The following are examples where the problem occurs:
  29543.  
  29544.     /Gt40 will turn into /Gt4
  29545.     /Gt0  will turn into /Gt
  29546.     /Gt20 will turn into /Gt
  29547.  
  29548.  Some other values that get changed are the following:
  29549.  
  29550.     /Gt113 will turn into /Gt3
  29551.     /Gt305 will turn into /Gt35
  29552.     /Gt14  will turn into /Gt4
  29553.     /Gt22  will turn into /Gt
  29554.  
  29555.  As a possible work around, do not set /Gt in the PWB, and set the
  29556.  environment variable CL to the desired threshold, as in the following
  29557.  example:
  29558.  
  29559.     set cl=/Gt40
  29560.  
  29561.  This value will be read by the compiler when it is called from the
  29562.  PWB.
  29563.  
  29564.  Also, you can set the /Gt switch on the Additional Options line in
  29565.  either Set Debug Options or Set Release Options, rather than the
  29566.  global Additional Options.
  29567.  
  29568.  
  29569.  48. REsearch() Function Prototype Not Found in EXT.H Header File
  29570.  
  29571.  Product Version(s): 1.00 1.10 | 1.00 1.10
  29572.  Operating System:   MS-DOS    | OS/2
  29573.  Flags: ENDUSER | buglist1.00 buglist1.10
  29574.  Last Modified:  4-DEC-1990    ArticleIdent: Q67274
  29575.  
  29576.  The Programmer's WorkBench (PWB) function REsearch(), although
  29577.  included in EXTSUP.LIB, is not prototyped in the EXT.H header file. To
  29578.  call REsearch(), use the following prototype:
  29579.  
  29580.  int REsearch( PFILE pFile, flagType fForward, flagType fAll,
  29581.                flagType fCase, flagType fWrap, char _far *pattern,
  29582.                fl *pflStart );
  29583.  
  29584.  For more information, see online help.
  29585.  
  29586.  Microsoft has confirmed this to be a problem in PWB versions 1.00 and
  29587.  1.10. We are researching this problem and will post new information
  29588.  here as it becomes available.
  29589.  
  29590.  
  29591.  49. PWB Help Crashes When Using "Moving Through a File"
  29592.  
  29593.  Product Version(s): 1.10   | 1.10
  29594.  Operating System:   MS-DOS | OS/2
  29595.  Flags: ENDUSER | buglist1.10
  29596.  Last Modified: 14-DEC-1990    ArticleIdent: Q67361
  29597.  
  29598.  When using the online help through the Programmer's WorkBench (PWB),
  29599.  the help system will crash if you do the following:
  29600.  
  29601.  1. After entering help, choose Contents.
  29602.  
  29603.  2. Select the Microsoft Advisor from the list of contents.
  29604.  
  29605.  3. Select the Programmer's WorkBench button followed by the "Moving
  29606.     Through a File" selection.
  29607.  
  29608.  At this point a header will appear on the screen and the elevator for
  29609.  the window will appear as though it is at the bottom of a page.
  29610.  
  29611.  The page can be scrolled up and the contents viewed, especially if
  29612.  highlighted, but the menu items at the top will be blacked out
  29613.  (although they are present). From this point, no further help can be
  29614.  accessed.
  29615.  
  29616.  If you exit help and then reenter, nothing will come up.
  29617.  Re-initializing does not reinstate the help system. Only shelling out,
  29618.  exiting, and reentering will allow you to access the help system.
  29619.  
  29620.  Microsoft has confirmed this to be a problem in the Programmer's
  29621.  WorkBench version 1.10. We are researching this problem and will post
  29622.  new information here as it becomes available.
  29623.  
  29624.  
  29625.  50. PWB Hangs with Novell NetWare
  29626.  
  29627.  Product Version(s): 1.00 1.11
  29628.  Operating System:   MS-DOS
  29629.  Flags: ENDUSER | s_quickc s_codeview s_c
  29630.  Last Modified: 14-DEC-1990    ArticleIdent: Q67483
  29631.  
  29632.  On certain installations of a Novell network, the network will cause
  29633.  the Programmer's WorkBench (PWB) to hang. This problem may also occur
  29634.  in CodeView or QuickC. The hang usually occurs when an attempt is made
  29635.  to use the mouse.
  29636.  
  29637.  If you have a peripheral (such as a mouse) that uses Interrupt Request
  29638.  Level (IRQ) 3, and your system is part of a network using Novell
  29639.  NetWare version 2.15 or earlier, your system may hang when you load
  29640.  QuickC, PWB, or CodeView. As a temporary solution, set your peripheral
  29641.  to use another interrupt. For more information, contact your Novell
  29642.  NetWare dealer.
  29643.  
  29644.  If taking these steps does not solve the problem, please contact
  29645.  Microsoft Product Support Services.
  29646.  
  29647.  
  29648.  51. PWB Menu Hyperlink in PWB.HLP is Inconsistent in Version 1.10
  29649.  
  29650.  Product Version(s): 1.10   | 1.10
  29651.  Operating System:   MS-DOS | OS/2
  29652.  Flags: ENDUSER |
  29653.  Last Modified: 23-JAN-1991    ArticleIdent: Q67614
  29654.  
  29655.  When selecting help on the Programmer's WorkBench (PWB) version 1.10
  29656.  from the Categories menu in QuickHelp version 1.70, the help screen
  29657.  for Microsoft Advisor Help System is presented instead. This behavior
  29658.  may be duplicated by following the procedure outlined below:
  29659.  
  29660.  1. Start QuickHelp without an argument to get help on any topic. This
  29661.     will bring up the main help screen.
  29662.  
  29663.  2. Select the Programmer's WorkBench choice under the Categories menu.
  29664.  
  29665.  Instead of bringing up the help screen for Programmer's WorkBench, you
  29666.  will see the screen for the Microsoft Advisor Help System.
  29667.  
  29668.  If the PWB.HLP help file is decoded using helpmake as follows
  29669.  
  29670.     helpmake /D /T /Opwb.doc pwb.hlp
  29671.  
  29672.  we can see that the reason for this is that the .context directive for
  29673.  Programmer's WorkBench appears in the wrong section in the decoded
  29674.  help file. The following line
  29675.  
  29676.     .context Programmer's Workbench
  29677.  
  29678.  appears above the section for "Microsoft Advisor Contents." To correct
  29679.  the problem, move the .context directive for Programmer's WorkBench to
  29680.  the proper section, which is the "Programmer's WorkBench Contents."
  29681.  
  29682.  The helpfile must then be recompressed, as follows:
  29683.  
  29684.     helpmake /E7 /T /Opwb.hlp pwb.doc
  29685.  
  29686.  The choice of /E7 is shown here for demonstration purposes only, and
  29687.  is strictly arbitrary in this case. If maximum compression is desired,
  29688.  the numerical argument to the /E switch may be left off, or /E15 may
  29689.  be specified. Maximum compression will restore the database as close
  29690.  to its original size and state as possible.
  29691.  
  29692.  
  29693.  52. "missing ':' in ->" Caused by Control Character
  29694.  
  29695.  Product Version(s): 1.00 1.10 | 1.00 1.10
  29696.  Operating System:   MS-DOS    | OS/2
  29697.  Flags: ENDUSER |
  29698.  Last Modified: 14-DEC-1990    ArticleIdent: Q67736
  29699.  
  29700.  When invoking the Programmer's WorkBench (PWB), if there is a control
  29701.  character at the end of the TOOLS.INI file, [usually a CTRL+Z (ASCII
  29702.  26) end-of-file marker] and you only have a [pwb] tagged section, an
  29703.  error message will appear stating "missing ':' in ->". Note that the
  29704.  "->" is the graphic right-arrow symbol.
  29705.  
  29706.  This is not a problem in the PWB. A control character is a legal macro
  29707.  name. The message indicates that a macro definition or key assignment
  29708.  is expected after the character. To keep this message from appearing,
  29709.  place the tag
  29710.  
  29711.     [end]
  29712.  
  29713.  before the control character at the end of your TOOLS.INI file. With
  29714.  this tag at the end of the file, you always suppress the message, even
  29715.  if you edit TOOLS.INI with an editor that inserts CTRL+Z's at the end
  29716.  of the file. This is because the -> symbol must be within the [pwb]
  29717.  tagged section for this error message to be displayed, and the [end]
  29718.  tag forces the -> into its own tagged section.
  29719.  
  29720.  Simply deleting the control character will work until you edit the
  29721.  file with an editor that replaces the CTRL+Z, then this message
  29722.  reappears. This may also when using the COPY command to concatenate
  29723.  files.
  29724.  
  29725.  
  29726.  53. Inconsistent Error Attempting to Load Nonexistent Extension
  29727.  
  29728.  Product Version(s): 1.00 1.10
  29729.  Operating System:   OS/2
  29730.  Flags: ENDUSER |
  29731.  Last Modified: 28-DEC-1990    ArticleIdent: Q67777
  29732.  
  29733.  When attempting to load a Programmer's WorkBench extension through a
  29734.  macro definition in the TOOLS.INI file, if the extension file does not
  29735.  exist, or is not in the current path, the following error message is
  29736.  displayed in a dialog box:
  29737.  
  29738.     pwbhelp:  SYS0123:  A file name or volume label contains an
  29739.                         incorrect character
  29740.  
  29741.  This error message should indicate that the extension file could not
  29742.  be found; however, the message is generated by the OS/2 operating
  29743.  system's DLL loading code, and therefore, cannot be changed by PWB.
  29744.  
  29745.  The following error message is generated in the DOS version of PWB,
  29746.  which displays this message in a dialog box:
  29747.  
  29748.     No such file or directory
  29749.  
  29750.  To correct the problem, make sure that the directory in which the
  29751.  extension resides is in the current path.
  29752.  
  29753.  
  29754.  54. PWB May Record Incorrect Paths for Dependencies in Makefile
  29755.  
  29756.  Product Version(s): 1.00 1.10  | 1.00 1.10
  29757.  Operating System:   MS-DOS     | OS/2
  29758.  Flags: ENDUSER | buglist1.00 buglist1.10
  29759.  Last Modified:  6-FEB-1991    ArticleIdent: Q67780
  29760.  
  29761.  Creating a program list with dependencies in directories other than
  29762.  the project (makefile) directory may result in the Programmer's
  29763.  WorkBench (PWB) recording the wrong paths to these dependencies.
  29764.  
  29765.  The following steps illustrate the problem:
  29766.  
  29767.  1. Create subdirectories named TEST and TESTA under the same
  29768.     directory, with sample files FOO.C in TEST and GOO.C in TESTA.
  29769.  
  29770.  2. Invoke PWB from the TESTA directory.
  29771.  
  29772.  3. Create a program list.
  29773.  
  29774.  4. Add FOO.C and GOO.C with full path.
  29775.  
  29776.  5. Save the list.
  29777.  
  29778.  The resulting makefile will contain the line:
  29779.  
  29780.     OBJS = goo.c foo.c
  29781.  
  29782.  The correct line should read:
  29783.  
  29784.     OBJS = goo.c ..\TEST\foo.c
  29785.  
  29786.  Changing the location of the project makefile or changing the names of
  29787.  the subdirectories will generate the correct paths for dependencies in
  29788.  the makefile.
  29789.  
  29790.  Microsoft has confirmed this to be a problem in the Programmer's
  29791.  WorkBench versions 1.00 and 1.10. We are researching this problem and
  29792.  will post new information here as it becomes available.
  29793.  
  29794.  
  29795.  55. PWB Extensions in DOS Cannot Shell to DOS
  29796.  
  29797.  Product Version(s): 1.00 1.10
  29798.  Operating System:   MS-DOS
  29799.  Flags: ENDUSER |
  29800.  Last Modified:  6-FEB-1991    ArticleIdent: Q67792
  29801.  
  29802.  Extensions written for the Programmer's WorkBench (PWB) that require a
  29803.  call to the operating system do not work correctly under DOS. One
  29804.  example of this is the FILTER.C sample extension packaged with
  29805.  Microsoft C 6.00.
  29806.  
  29807.  When PWB.COM is executed under DOS, it spawns the main editor
  29808.  (PWBED.EXE). PWBED.EXE is cleared from memory when a DOS shell is
  29809.  executed from within the editor. Once the shell has completed,
  29810.  PWBED.EXE is reloaded from disk and initialized. The initialization is
  29811.  what causes the problem because it also initializes any extensions to
  29812.  the editor at the same time. This means that any information that the
  29813.  extension was keeping track of is lost.
  29814.  
  29815.  
  29816.  56. Not Enough Core Message Caused by Lack of Memory
  29817.  
  29818.  Product Version(s): 1.00 1.10
  29819.  Operating System:   MS-DOS
  29820.  Flags: ENDUSER |
  29821.  Last Modified:  6-FEB-1991    ArticleIdent: Q68070
  29822.  
  29823.  When loading the Programmer's WorkBench (PWB), a message box may
  29824.  appear on the screen containing the message "Cannot Autoload
  29825.  Extension, not enough core." The extension file that could not be
  29826.  loaded will be indicated. You need to free more memory so that the
  29827.  extensions can be loaded.
  29828.  
  29829.  
  29830.  57. Windows DLL Build Options Ignore .RC Files in PWB 1.10
  29831.  
  29832.  Product Version(s): 1.10   | 1.10
  29833.  Operating System:   MS-DOS | OS/2
  29834.  Flags: ENDUSER | buglist1.10 S_C P_WINSDK
  29835.  Last Modified: 11-JAN-1991    ArticleIdent: Q68155
  29836.  
  29837.  In the Programmer's WorkBench version 1.10, the default build options
  29838.  for creating a Windows DLL will ignore any .RC files included in the
  29839.  Program List, and therefore, will not build them into the project.
  29840.  
  29841.  Use the following steps to correct this problem:
  29842.  
  29843.   1. If there is a Program List currently set, clear it.
  29844.  
  29845.   2. Set the Main Language to C.
  29846.  
  29847.   3. Set the Initial Build Options to Windows DLL.
  29848.  
  29849.   4. Create a new Program List containing all the files you want in your
  29850.      project.
  29851.  
  29852.   5. Save the Program List. At this point, PWB will tell you that your
  29853.      .RC file will be ignored. Choose OK when that dialog box appears.
  29854.  
  29855.   6. Choose Editor Settings from the Options menu.
  29856.  
  29857.   7. Find the line that starts:
  29858.  
  29859.         build: target $(PROJ).dll
  29860.  
  29861.   8. Change the word "res_dll" on that line to "rc_dll".
  29862.  
  29863.   9. Move the cursor off that line to highlight the change. Press SHIFT+F2
  29864.      to save the new settings.
  29865.  
  29866.  10. Press F2 to exit the ASSIGN pseudofile.
  29867.  
  29868.  11. Choose Edit Program List from the Make menu.
  29869.  
  29870.  12. Choose Save List. The .RC file will now be saved in the Program
  29871.      List and used as expected.
  29872.  
  29873.  After these steps are taken, the settings will be saved in the .STS
  29874.  file for that project, and will remain correct as long as Set Initial
  29875.  Build Options is never selected when this Program List is set. In
  29876.  order to keep from repeating these steps for future projects, the
  29877.  build options should be saved under a descriptive name, such as
  29878.  "Corrected Windows DLL Settings." They can then be chosen for any
  29879.  future Windows DLLs.
  29880.  
  29881.  Microsoft has confirmed this to be a problem in the Programmer's
  29882.  WorkBench version 1.10. We are researching this problem and will post
  29883.  new information here as it becomes available.
  29884.  
  29885.  
  29886.  58. PWB Build Switch Reference Available as an Application Note
  29887.  
  29888.  Product Version(s): 1.00 1.10 | 1.00 1.10
  29889.  Operating System:   MS-DOS    | OS/2
  29890.  Flags: ENDUSER | appnote softlib SW0330
  29891.  Last Modified: 29-JAN-1991    ArticleIdent: Q68367
  29892.  
  29893.  The "PWB Build Switch Reference" contains detailed descriptions and
  29894.  examples for customizing PWB build switches.
  29895.  
  29896.  The Programmer's WorkBench (PWB) can build various types of projects
  29897.  based on the information contained in "build switches." These build
  29898.  switches are interpreted by PWB in order to create a makefile for a
  29899.  project. The switches are normally set for you by PWB for common types
  29900.  of projects, but you may define your own build switches to handle an
  29901.  advanced project where you require more control over the build
  29902.  process. For example, customized build switches will allow you to
  29903.  utilize different languages, to incorporate other tools into a
  29904.  project, or to build new kinds of targets.
  29905.  
  29906.  Although build switch customization is documented in the PWB online
  29907.  help, the information is somewhat limited. Therefore, an application
  29908.  note was created to cover the customization process in detail. The
  29909.  title of this application note is "PWB Build Switch Reference" and it
  29910.  can be obtained by calling Microsoft Product Support Services at (206)
  29911.  637-7096.
  29912.  
  29913.  The "PWB Build Switch Reference" can also be found in the Software/
  29914.  Data Library (as file SW0330.ARC) by searching on the keyword SW0330,
  29915.  the Q number of this article, or S12875. SW0330 was archived using the
  29916.  PKware file-compression utility.
  29917.  
  29918.  Note that the application note found in the Software/Data Library is
  29919.  an ordinary text file, which lacks the typefaces and formatting of the
  29920.  printed version that is available by calling Microsoft Product Support
  29921.  Services. Because the printed application note is clearer and easier
  29922.  to follow, it is highly recommended that you call for the printed
  29923.  version, and that you use the downloaded version only as an interim
  29924.  copy.
  29925.  
  29926.  Also note that you normally DO NOT need to modify build switches just
  29927.  to customize the compile and link operations -- this can generally be
  29928.  done by selecting commands from the Options menu. By selecting options
  29929.  from the Compile or LINK Options dialog boxes, the correct build
  29930.  switches are automatically modified to contain the desired
  29931.  information.
  29932.  
  29933.  
  29934.  59. Brown Screen Color Changes to Yellow After Running PWB
  29935.  
  29936.  Product Version(s): 1.00 1.10
  29937.  Operating System:   MS-DOS
  29938.  Flags: ENDUSER | s_c buglist1.00 buglist1.10 remapping
  29939.  Last Modified:  6-FEB-1991    ArticleIdent: Q69064
  29940.  
  29941.  After running PWB, the brown screen color changes to yellow until the
  29942.  system is rebooted or the video mode is reset.
  29943.  
  29944.  For example, if you run PWB and then run the Microsoft editor, the
  29945.  brown characters will appear yellow.
  29946.  
  29947.  To work around this problem, you can create a batch file called
  29948.  PWB.BAT. In this file, you can start PWB and then reset the video
  29949.  mode. For example:
  29950.  
  29951.      pwb.bat
  29952.              pwb %1 %2 %3 %4
  29953.              mode co80,25
  29954.  
  29955.  Microsoft has confirmed this to be a problem in PWB versions 1.00 and
  29956.  1.10. We are researching this problem and will post new information
  29957.  here as it becomes available.
  29958.  
  29959.  
  29960.  60. Reinitializing After Changing Editor Settings Is Very Slow
  29961.  
  29962.  Product Version(s): 1.10   | 1.10
  29963.  Operating System:   MS-DOS | OS/2
  29964.  Flags: ENDUSER |
  29965.  Last Modified: 11-FEB-1991    ArticleIdent: Q69142
  29966.  
  29967.  The current editor settings in the Programmer's WorkBench (PWB) may be
  29968.  changed by choosing Editor Settings from the Options menu, making a
  29969.  change to the <assign> pseudofile, and then saving that file. If
  29970.  SHIFT+F8 (initialize) is pressed while the <assign> pseudofile is
  29971.  still displayed, PWB may appear as though it is hung; it is actually
  29972.  reinitializing each statement of the editor settings (<assign>)
  29973.  pseudofile.
  29974.  
  29975.  The following steps will reproduce this behavior:
  29976.  
  29977.  1. Enter PWB and select the Options menu.
  29978.  
  29979.  2. Choose the Editor Settings menu.
  29980.  
  29981.  3. Make a change in the <assign> pseudofile and then save it.
  29982.  
  29983.  4. Press the "initialize" keystroke combination (SHIFT+F8) and a popup
  29984.     box will appear stating "reinitializing...". The reinitialization
  29985.     is actually taking place but it is very slow because PWB is
  29986.     rebuilding the <assign> pseudofile for each entry in your TOOLS.INI
  29987.     file.
  29988.  
  29989.  This behavior does not occur in PWB version 1.00. Version 1.10
  29990.  includes a change to the earlier version; you can see a new assignment
  29991.  (made via "arg textarg <assign>") immediately updated if you are
  29992.  viewing the <assign> pseudofile.
  29993.  
  29994.  This is expected behavior because the <assign> pseudofile is meant to
  29995.  show the settings that were in effect at the time the file was
  29996.  displayed. It is not recommended that it be dynamically updated except
  29997.  via the mechanism of actually editing the file. If you changed a
  29998.  setting via "arg textarg assign" (ALT+A textarg ALT+=), a better way
  29999.  to view your new setting(s) is by using "refresh" (SHIFT+F7), or by
  30000.  switching away and back again via "setfile" (F2).
  30001.  
  30002.  
  30003.  61. PWB Ignores Certain Compiler Switches in Additional Options
  30004.  
  30005.  Product Version(s): 1.00 1.10 | 1.00 1.10
  30006.  Operating System:   MS-DOS    | OS/2
  30007.  Flags: ENDUSER | s_c
  30008.  Last Modified: 25-FEB-1991    ArticleIdent: Q69145
  30009.  
  30010.  The compiler switches
  30011.  
  30012.     /Fo, /Fe, /F hexnum, /Fm, and /link link-info
  30013.  
  30014.  are ineffective when entered in the Additional Options field of the C
  30015.  Compiler Options dialog box from the Options menu of the Programmer's
  30016.  Workbench (PWB). This is the intended behavior. The functionality of
  30017.  all of these switches is provided through the Compiler, Link, and
  30018.  Build Options dialog boxes from the Options menu.
  30019.  
  30020.  The /Fo switch is overridden by PWB as it creates the .MAK file needed
  30021.  to build the project. To perform this function correctly:
  30022.  
  30023.  1. Set a program list from the Make menu.
  30024.  2. Choose Build Options from the Options menu.
  30025.  3. Choose the Build Directory button.
  30026.  4. Enter the destination path in that field, such as:
  30027.  
  30028.        C:\C600\PROJECT\
  30029.  
  30030.  5. Rebuild the project, and both the .EXE and .OBJ files will be placed
  30031.     in that directory.
  30032.  
  30033.  The other switches are used only to pass information to the linker
  30034.  when the CL command is used outside PWB without the /c option. Because
  30035.  PWB always compiles and links separately, these switches are lost. To
  30036.  utilize these switches from within PWB, select the appropriate options
  30037.  in the Link Options dialog box from the Options menu.
  30038.  
  30039.  
  30040.  62. How to Increase the Size of the PWB Build Status Box Under DOS
  30041.  
  30042.  Product Version(s): 1.00 1.10
  30043.  Operating System:   MS-DOS
  30044.  Flags: ENDUSER | window dialog
  30045.  Last Modified: 22-FEB-1991    ArticleIdent: Q69475
  30046.  
  30047.  In the DOS version of the Microsoft Programmer's WorkBench (PWB)
  30048.  versions 1.00 and 1.10, the status box displayed in the center of the
  30049.  screen during a compile can be made larger by increasing the length of
  30050.  the command being executed.
  30051.  
  30052.  When Build or Rebuild All is selected from the Make menu in PWB, a
  30053.  build status box appears on the screen showing the command currently
  30054.  being executed. Unfortunately, this box is often too small and the
  30055.  current command being displayed gets truncated. One way to increase
  30056.  the size of this box is to increase the length of the NMAKE command
  30057.  line.
  30058.  
  30059.  To increase the length of the NMAKE command line, add the following
  30060.  text (without the quotation marks) to the NMAKE Options dialog box,
  30061.  which can be selected from the Options menu:
  30062.  
  30063.     "                                                /NOLOGO"
  30064.  
  30065.  Be sure to include the spaces when you type this line. Then, when you
  30066.  select Build or Rebuild All from the Make menu, the build status box
  30067.  will be almost as wide as the screen, allowing most of the subsequent
  30068.  commands to fit completely into the box.
  30069.  
  30070.  If you use the PWB "compile" command, or choose the Compile File
  30071.  option from the Make menu, the build status box behaves similarly --
  30072.  the longer the command to be executed command, the larger the box will
  30073.  be.
  30074.  
  30075.  
  30076.  
  30077.  
  30078.  
  30079.  
  30080.  Microsoft CodeView
  30081.  =============================================================================
  30082.  
  30083.  
  30084.  1. Sequential Mode Not Available in CodeView Version 3.00
  30085.  
  30086.  Product Version(s): 3.00 3.01 3.11  | 3.00 3.01 3.11
  30087.  Operating System:   MS-DOS          | OS/2
  30088.  Flags: ENDUSER |
  30089.  Last Modified:  6-FEB-1991    ArticleIdent: Q69065
  30090.  
  30091.  The CodeView sequential mode (/T option) is not available in CodeView
  30092.  version 3.00.
  30093.  
  30094.  In CodeView versions 2.30 and earlier, the /T option caused the
  30095.  debugger to operate in "sequential mode," which means that only a
  30096.  command-line interface was available. You could then type the command
  30097.  "=COM1" to redirect the input and output to the COM port, which
  30098.  allowed debugging via a remote terminal.
  30099.  
  30100.  The /T option and the "=COM1" command are not available in CodeView
  30101.  3.00, 3.10, and 3.11 because of the new windowing environment used in
  30102.  these versions.
  30103.  
  30104.  However, you can still redirect CodeView output to COM1 using the
  30105.  Redirected Output command.
  30106.  
  30107.  The Redirected Output command causes the CodeView debugger to write
  30108.  all subsequent command output to a device, such as another terminal, a
  30109.  printer, or a file. The term "output" includes not only the output
  30110.  from commands but also the command characters that are echoed as you
  30111.  type them.
  30112.  
  30113.  The second greater-than symbol (optional) appends the output to an
  30114.  existing file. If you redirect output to an existing file without this
  30115.  symbol, the existing file will be replaced. For example:
  30116.  
  30117.     >>COM1
  30118.  
  30119.  In the example above, output is redirected to the device designated as
  30120.  COM1 (probably a remote terminal). You might want to enter this
  30121.  command, for example, when you are debugging a graphics program and
  30122.  want CodeView commands to be displayed on a remote terminal while the
  30123.  program display appears on the originating terminal.
  30124.  
  30125.     >>OUTFILE.TXT
  30126.  
  30127.  In the example above, output is redirected to the file OUTFILE.TXT.
  30128.  This command is helpful in keeping a permanent record of a CodeView
  30129.  session.
  30130.  
  30131.  
  30132.  2. How Interrupts Are Handled in CodeView
  30133.  
  30134.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30
  30135.  Operating System:   MS-DOS
  30136.  Flags: ENDUSER | TAR55548
  30137.  Last Modified:  9-AUG-1989    ArticleIdent: Q11817
  30138.  
  30139.  Question:
  30140.  
  30141.  How does CodeView handle interrupt vectors? Does it mask any
  30142.  interrupts when it runs?
  30143.  
  30144.  Response:
  30145.  
  30146.  CodeView saves and restores about 60 interrupt vectors as a safety
  30147.  feature. However, it only redirects the following nine vectors for its
  30148.  own use:
  30149.  
  30150.     0       Divide By 0
  30151.     1       Single Step
  30152.     2       NMI
  30153.     3       Breakpoint
  30154.     9       Keyboard
  30155.     21H     DOS functions
  30156.     22H     DOS terminate
  30157.     23H     ^C
  30158.     24H     Critical Error
  30159.  
  30160.  The remaining estimated 51 vectors are never altered by CodeView
  30161.  unless something else (e.g. the program being debugged) alters them
  30162.  after CodeView has started up. In this case, CodeView restores them to
  30163.  their original value as it exits.
  30164.  
  30165.  When you enter G(o) and let your program run, CodeView relinquishes
  30166.  control and lets all interrupts (except the nine listed above) flow
  30167.  into your application for processing. However, when you hit a
  30168.  breakpoint, the 8259 Programmable Interrupt Controller is masked. This
  30169.  prevents interrupts from coming into your application while your
  30170.  program is suspended. If you enter G(o) again, CodeView reenables
  30171.  interrupts to your application.
  30172.  
  30173.  To avoid a bug in the 8086 family, CodeView masks the interrupt
  30174.  controller during T(race) commands and some P(rogram step) commands.
  30175.  CodeView Versions 2.00 and above solve this restriction by emulating
  30176.  the interrupts for your application.
  30177.  
  30178.  You normally do not single-step or trace real-time code, so this
  30179.  should not be a problem for developers writing interrupt-driven code.
  30180.  However, it is something you should be aware of if you are depending
  30181.  on interrupts to get to your application. For example, it will not
  30182.  work if you enter "T 1000" and expect your program to catch and
  30183.  process interrupts during the trace. You will need to set a breakpoint
  30184.  at the instruction with which you are concerned, then enter G(o).
  30185.  
  30186.  
  30187.  3. Debugging Routines That Are in Libraries
  30188.  
  30189.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
  30190.  Operating System:   MS-DOS                        | OS/2
  30191.  Flags: ENDUSER | TAR55321
  30192.  Last Modified: 21-AUG-1989    ArticleIdent: Q11877
  30193.  
  30194.  Question:
  30195.  
  30196.  When CodeView attempts to debug a function from a library module, it
  30197.  is unable to find the source even when that module was compiled with
  30198.  -Zi. It prompts me to "Enter Directory for Program (CR for None)?". I
  30199.  enter the directory in which PROGRAM.C resides, but CodeView cannot
  30200.  find it. Is there any solution other than not placing modules I wish
  30201.  to debug in libraries?
  30202.  
  30203.  Response:
  30204.  
  30205.  This is a consequence of the way the LIB utility works. When adding an
  30206.  object module to a library, LIB records only the source file's base
  30207.  name, not its extension. Therefore, "c:\c\source\module1.c" becomes
  30208.  "c:\c\source\module1" (no extension). When you are debugging an
  30209.  application that calls "module1", CodeView attempts to find
  30210.  "c:\c\source\module1". However, it does not accept the filename you
  30211.  give because the file is really named "module1.c".
  30212.  
  30213.  One way to work around this restriction is to rename your source file
  30214.  from "c:\c\source\module1.c" to "c:\c\source\module1" (no extension)
  30215.  after you have compiled it and put it into a library. This way, the
  30216.  actual name will match the name CodeView is searching for.
  30217.  
  30218.  Another solution is to use Library Manager Version 3.07 (which came
  30219.  with MASM 5.00) or later; this solves the problem by not stripping the
  30220.  file's extension as it is put into a library.
  30221.  
  30222.  
  30223.  4. CVP May Generate a Trap B with Large Programs Under OS/2 1.30
  30224.  
  30225.  Product Version(s): 2.20 2.30 3.00 3.10 3.11
  30226.  Operating System:   OS/2
  30227.  Flags: ENDUSER | gp fault protection violation
  30228.  Last Modified: 25-FEB-1991    ArticleIdent: Q69348
  30229.  
  30230.  Debugging a large application with CodeView under OS/2 version 1.30
  30231.  may result in a Trap B system error. Trap B is a "segment not present"
  30232.  exception, which results from changes that were made to this version
  30233.  of the operating system.
  30234.  
  30235.  In version 1.30 of OS/2, the code for DosPTrace() was made swappable,
  30236.  while in previous versions it was not. DosPTrace() is part of the OS/2
  30237.  API that allows a parent process to control the execution of a child
  30238.  process, and to access the child process's memory directly to insert
  30239.  breakpoints or change data.
  30240.  
  30241.  Because CodeView relies heavily on DosPTrace(), problems arise if this
  30242.  code is swapped from memory. The majority of problems occur when
  30243.  execution reaches a breakpoint while the DosPTrace() code is not
  30244.  present; control should then jump to code that is not currently in
  30245.  RAM.
  30246.  
  30247.  Because large programs (or heavily loaded systems) tend to result in
  30248.  more swapping, this problem appears much more readily when debugging
  30249.  large applications.
  30250.  
  30251.  The only sure workaround for this problem is to turn off swapping
  30252.  while debugging, but it also may help to increase or free up available
  30253.  memory. To disable swapping, modify the MEMMAN switch in CONFIG.SYS as
  30254.  follows:
  30255.  
  30256.     MEMMAN=NOSWAP
  30257.  
  30258.  To increase available memory, either install more memory in the
  30259.  computer itself or terminate all other unnecessary processes before
  30260.  debugging (to remove them from memory).
  30261.  
  30262.  This problem is the result of a design change with OS/2 1.30 and is
  30263.  not a problem with CodeView. This change is being reconsidered for
  30264.  future versions of OS/2. New information will be posted here as it
  30265.  becomes available.
  30266.  
  30267.  
  30268.  5. Using Two Monitors with CodeView
  30269.  
  30270.  Product Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
  30271.  Operating System:   MS-DOS                        | OS/2
  30272.  Flags: ENDUSER | TAR56465
  30273.  Last Modified: 11-SEP-1989    ArticleIdent: Q11966
  30274.  
  30275.  Question:
  30276.  
  30277.  How do I use CodeView with two monitors? Where is this option
  30278.  documented?
  30279.  
  30280.  Response:
  30281.  
  30282.  Invoke CodeView with the following command:
  30283.  
  30284.     CV /2 PROGRAM
  30285.  
  30286.  This command tells CodeView to put its display on your secondary
  30287.  monitor and lets your program's output go to the default display. This
  30288.  option is documented in the "CodeView Options" section of the
  30289.  "Microsoft CodeView and Utilities Software Development Tools for the
  30290.  MS-DOS Operating System" manual in all products except Microsoft C
  30291.  Version 4.00, where it is documented in the README file.
  30292.  
  30293.  You must have two monitors and two display adapters to use this
  30294.  feature. You must have a monochrome and a non-monochrome monitor;
  30295.  because a monochrome monitor's video memory is in a different
  30296.  location than a CGA, EGA, or VGA's. This is how CodeView implements
  30297.  the /2 option, by writing to both sets of video memory.
  30298.  
  30299.  When you use the /2 option, your program's display appears on the
  30300.  current default adapter and monitor, while the debugging display
  30301.  appears on the secondary adapter and monitor. You can switch which
  30302.  monitor is the current default adapter with the MS-DOS MODE command.
  30303.  "MODE MONO" causes standard output to go to the MDA, while "MODE CO80"
  30304.  causes standard output to go to your CGA, EGA, or VGA.
  30305.  
  30306.  For example, if you have both a CGA and an MDA, you might want to set
  30307.  the CGA up as the default adapter. You could then debug a graphics
  30308.  program with the graphics display appearing on the graphics monitor
  30309.  and the debugging display appearing on the monochrome adapter.
  30310.  
  30311.  
  30312.  6. /L Must Give Full Pathname to .DLL Unless in Current Directory
  30313.  
  30314.  Product Version(s): 2.20 2.30 | 2.20 2.30
  30315.  Operating System:   MS-DOS    | OS/2
  30316.  Flags: ENDUSER |
  30317.  Last Modified: 16-AUG-1989    ArticleIdent: Q47937
  30318.  
  30319.  When debugging dynamic link modules with CodeView Protect (CVP), you
  30320.  must use the /L switch. Before invoking CVP, make certain that the
  30321.  .DLL is in the LIBPATH specified in the CONFIG.SYS file. When invoking
  30322.  CVP with the /L switch, if the .DLL is not located in the current
  30323.  directory, you must specify the full drive and pathname to the DLL. An
  30324.  example is the following:
  30325.  
  30326.     CVP /L d:\os2\dll\stdll.dll stmain.exe
  30327.  
  30328.  In this example, the full drive and pathname are given for the DLL to
  30329.  be debugged. If the full pathname is not given, CodeView will come up.
  30330.  However, you will be unable to step into the DLL. CodeView will simply
  30331.  step over that call.
  30332.  
  30333.  
  30334.  7. CodeView Cannot Trace into Single-Line Functions
  30335.  
  30336.  Product Version(s): 2.20 2.30 | 2.20 2.30
  30337.  Operating System:   MS-DOS    | OS/2
  30338.  Flags: ENDUSER |
  30339.  Last Modified: 15-SEP-1989    ArticleIdent: Q47624
  30340.  
  30341.  CodeView Versions 2.20 and 2.30 do not trace into a function that is
  30342.  contained in a single line of code. For example, if the following
  30343.  program is compiled and loaded into CodeView, an attempt to trace into
  30344.  the function funct() results in the trace stepping over the function,
  30345.  rather than tracing into it.
  30346.  
  30347.  Sample Program
  30348.  --------------
  30349.  
  30350.  /* SIMPLE.C ... a very simplistic sample program                    */
  30351.  
  30352.  int funct(void);
  30353.  int x;
  30354.  
  30355.  void main(void)
  30356.  {
  30357.    x = funct()
  30358.   }
  30359.  
  30360.  /* single-line function. It does nothing more than return a value.  */
  30361.  
  30362.  int funct(void){return 1;}
  30363.  
  30364.  If the above function is modified so that it performs exactly the same
  30365.  task but is located on multiple lines, as follows, then CodeView
  30366.  handles it correctly:
  30367.  
  30368.  int funct(void)
  30369.   {
  30370.     return 1;
  30371.    }
  30372.  
  30373.  
  30374.  
  30375.  8. Trace Stops on Line Following a Loop Before Loop Is Done
  30376.  
  30377.  Product Version(s): 2.20 2.30 | 2.20 2.30
  30378.  Operating System:   MS-DOS    | OS/2
  30379.  Flags: ENDUSER | S_C
  30380.  Last Modified: 15-SEP-1989    ArticleIdent: Q47625
  30381.  
  30382.  In trace mode, CodeView stops on the line following a loop that does
  30383.  not have open and close braces ({}), before the loop is done.
  30384.  
  30385.  When tracing through a loop without the braces ({}), the trace stops
  30386.  on the statement immediately following the loop each time through the
  30387.  loop, giving the impression that the statement is being executed
  30388.  inside the loop. Actual program execution is correct.
  30389.  
  30390.  The following program was compiled with C Version 5.10 with the
  30391.  command line
  30392.  
  30393.     cl /Zi /Od program.c
  30394.  
  30395.  and run using CodeView 2.20, as follows:
  30396.  
  30397.      cv program.exe
  30398.  
  30399.  The trace stops at the printf each time through the loop even though
  30400.  printf is not part of the loop, but does not print anything until the
  30401.  end of the program.
  30402.  
  30403.  Sample Program
  30404.  --------------
  30405.  
  30406.  #include <stdio.h>
  30407.  
  30408.  void main(void)
  30409.  {
  30410.      int i;
  30411.      int count;
  30412.  
  30413.      count = 0;
  30414.  
  30415.      for(i=0;i<3;i++)
  30416.          if(i)
  30417.              count++;
  30418.  
  30419.      printf("Count is %d\n",count);
  30420.  }
  30421.  
  30422.  
  30423.  9. The 37th Call Added to the Calls Menu Corrupts CodeView Screen
  30424.  
  30425.  Product Version(s): 2.20   | 2.20
  30426.  Operating System:   MS-DOS | OS/2
  30427.  Flags: ENDUSER | buglist2.20 fixlist2.30
  30428.  Last Modified: 10-NOV-1989    ArticleIdent: Q50496
  30429.  
  30430.  The CodeView Calls menu shows the current depth of function calls as
  30431.  well as the line number the routine was called from and the parameters
  30432.  passed. The current routine is always at the top and the routine from
  30433.  which the current routine was called is directly below.
  30434.  
  30435.  The routines in the Calls menu are first labeled 0-9, and if you are
  30436.  nested more than ten levels deep, CodeView labels the next 26 calls
  30437.  A-Z, for a display that can accept 36 levels of subroutine calls. If
  30438.  you exceed this limit and then select the Calls menu, the CodeView
  30439.  display becomes corrupted.
  30440.  
  30441.  If the display is corrupted in this manner, the Redraw ("@") dialog
  30442.  command can be used to restore the display to it's original state.
  30443.  
  30444.  The Stack Trace dialog command (K) has the same function as the Calls
  30445.  menu and correctly handles nesting of more than 36 levels deep.
  30446.  
  30447.  Microsoft has confirmed this to be a problem with CodeView Version
  30448.  2.20. This problem was corrected in Version 2.30.
  30449.  
  30450.  
  30451.  10. Quickwatch Seems to Hang When Expanding Very Large Arrays
  30452.  
  30453.  Product Version(s): 3.00 3.10 3.11 | 3.00 3.10 3.11
  30454.  Operating System:   MS-DOS         | OS/2
  30455.  Flags: ENDUSER | s_quickc
  30456.  Last Modified:  6-FEB-1991    ArticleIdent: Q68010
  30457.  
  30458.  When expanding an element in a large array (usually greater than 1000
  30459.  elements, but system dependent), the quickwatch function appears to
  30460.  hang. This apparent problem is caused by the time it takes to re-align
  30461.  the data in the window, and is actually normal operation. If you place
  30462.  the same array element in the Watch Window, it will expand instantly.
  30463.  
  30464.  
  30465.  11. Structures Declared with Near, Far, Pascal, and Fortran
  30466.  
  30467.  Product Version(s): 2.20 2.30 | 2.20 2.30
  30468.  Operating System:   MS-DOS    | OS/2
  30469.  Flags: ENDUSER | S_C S_QuickC buglist2.20 buglist2.30
  30470.  Last Modified: 16-AUG-1989    ArticleIdent: Q47694
  30471.  
  30472.  CodeView is unable to display elements of structures declared with the
  30473.  following keywords:
  30474.  
  30475.     near
  30476.     far
  30477.     pascal
  30478.     fortran
  30479.  
  30480.  Using ?? to display a structure yields the structure table with only
  30481.  one value inside. This value is the first element in the structure.
  30482.  Using w? or ? yields the following error message:
  30483.  
  30484.     Operand types incorrect for this operation
  30485.  
  30486.  Microsoft has confirmed this to be a problem with CodeView Versions
  30487.  2.20 and 2.30. We are researching this problem and will post new
  30488.  information as it becomes available.
  30489.  
  30490.  To work around this problem, recompile without these keywords, or
  30491.  obtain the address of the structure element and put a watch on the
  30492.  memory location.
  30493.  
  30494.  Consider the following large model program:
  30495.  
  30496.  struct { int x;
  30497.           int y;
  30498.           int z;} near a;    /* or far, pascal, fortran */
  30499.  
  30500.  void main(void)
  30501.  {
  30502.    a.x = 1;
  30503.  }
  30504.  
  30505.  To put a watch on a.x, you could issue the following commands:
  30506.  
  30507.  ? &a
  30508.  0x0345:0000       <- result is the address of the structure
  30509.  ww 0x0345:0x0     <- address of x
  30510.  ww 0x0345:0x2     <- address of y (two byte int from x)
  30511.  
  30512.  This puts a watch on the first and second elements (x and y) in the
  30513.  structure.
  30514.  
  30515.  
  30516.  12. Older Vega VGAs Hang CodeView When in VGA Mode
  30517.  
  30518.  Product Version(s): 2.10 2.20 2.30 | 2.20 2.30
  30519.  Operating System:   MS-DOS         | OS/2
  30520.  Flags: ENDUSER |
  30521.  Last Modified: 14-AUG-1989    ArticleIdent: Q27212
  30522.  
  30523.  Question:
  30524.  
  30525.  Why does my old Vega VGA card cause CodeView to hang when I start it
  30526.  in VGA mode? It works properly when I start CodeView when the card is
  30527.  in CGA mode.
  30528.  
  30529.  Response:
  30530.  
  30531.  Some of the older Vega VGAs do not work correctly with CodeView. The
  30532.  Vega VGA card uses the same maskable interrupt for detecting graphics
  30533.  mode as CodeView.
  30534.  
  30535.  We recommend that you contact Vega by calling 1 (800) 248-1850 for
  30536.  advice if you experience this problem.
  30537.  
  30538.  
  30539.  13. Ambiguous Documentation of Enter ASCII (EA) Command
  30540.  
  30541.  Product Version(s): 2.10 2.20 | 2.10 2.20
  30542.  Operating System:   MS-DOS    | OS/2
  30543.  Flags: ENDUSER |
  30544.  Last Modified: 16-AUG-1989    ArticleIdent: Q47764
  30545.  
  30546.  In the "Microsoft C 5.1 Optimizing Compiler" manual, the "CodeView and
  30547.  Utilities" section does not thoroughly document the EA command for
  30548.  CodeView. The following is a more complete explanation:
  30549.  
  30550.     EA address [list]
  30551.  
  30552.     The Enter ASCII (EA) command modifies array to the value of [list].
  30553.     Address refers to what you want to modify. [list] refers to a
  30554.     string literal such as "hello". EA wil