From: marwk@levels.unisa.edu.au
Newsgroups: unisa.cis.prog.f.02462
Subject: FAQ
Date: 29 Oct 92 15:34:24 +0930
Organization: University of South Australia

Frequently Asked Questions for UNISA.CIS.PROG.F.02462

TABLE of CONTENTS

* means changed since last posting

   1. How do I compile, link and run programs on the VAX using VMS?

   2. What does INVALID IMAGE HEADER mean when I try to run a program?

   3. When are assignments actually due?

*  4. What is the code in VAX FORTRAN to clear the screen.

*  5. What is the code in VAX FORTRAN to display values at a certain position
      on the screen.


ANSWERS

 1. How do I compile and run programs on the VAX using VMS?

>>  FOR P3      compiles the file called P3.FOR
                if no errors
                    the file P3.OBJ is produced (object code with calls to
                        routines in machine code)

    LINK P3     attempts to link your routines in P3.OBJ with the routines
                if successful
                    produces the file P3.EXE, the executable image

    RUN P3      attempts to run the file P3.EXE

    Do not put any extensions on the end of any of these commands.

    The only command where the extension is added is: LUDwig P3.FOR
    that is, when the source code file is produced.

 2. What does INVALID IMAGE HEADER mean when I try to run or link a program?

>>  You are attempting to run the source code with the command: RUN P3.FOR
    or you are attempting to link the source code rather than the object code
    like: LINK P3.FOR.

    See the answer to FAQ 1 for the correct method and an explanation.

 3. When are assignments actually due?

>>  Some students have argued that to have them due at the beginning of
    the Monday session disadvantages the Monday class as others can
    hand them up on Friday.

    I have listened to this and henceforth and retrospectively the due
    day is Friday!

 4. What is the code in VAX FORTRAN to clear the screen.

>>  The following subroutine may be called to clear the screen.  It is
    specific to the VAX.  Each computer and compiler will have its own
    method.

      SUBROUTINE CLS
      INTEGER X,Y

      X = 1
      Y = 1

      CALL LIB$ERASE_PAGE(Y,X)

      RETURN
      END

 5. What is the code in VAX FORTRAN to display values at a certain position
    on the screen.

>>  The following subroutine may be called to put a string S on the screen
    on row ROW and column COL with a specified atrribute.  It is
    specific to the VAX.  Each computer and compiler will have its own
    method.

      SUBROUTINE PUT_STRING(S, ROW, COL, ATTRIBUTE)

      INTEGER ROW, COL, ATTRIBUTE
      CHARACTER * (*) S

      CALL LIB$PUT_SCREEN(S, ROW, COL, ATTRIBUTE)

      RETURN
      END


    The second subroutine will display a string of characters on the screen
    at the given location.

    To place the value of an integer variable on the screen it must firstly
    be written to an INTERNAL FILE, which is a character string, as follows:

      CHARACTER *20 STR
      REAL R

      R = 76.4

      WRITE (R, '(F6.2)') R

      CALL PUT_STRING(STR, 6, 1, 0)

      You can use different values for the attribute to specify underline
      or blinking or bold, etc.  Experiment with a DO loop from 0 to 512 to
      discover what these are.

--
Raymond Kennington
LECTURER
University of South Australia   | Act in haste and repent at leisure
P.O. Box 1                      | Code too soon and debug forever
Ingle Farm                      | Knobs, knobs everywhere,
South Australia                 |              just vary a knob to think!
#! rnews 480