Passing Variables from Microsoft FORTRAN to Basic

ID: Q27477


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0
  • Microsoft BASIC Professional Development System (PDS) for MS-DOS, versions 7.0, 7.1
  • Microsoft QuickBASIC for MS-DOS, version 4.5


SUMMARY

Below is an example of passing variables from Microsoft FORTRAN for MSDOS, version 5.1 to Microsoft Visual Basic for MS-DOS, version 1.0. This example also works with Microsoft Quick Basic for MS-DOS, version 4.5 and Microsoft FORTRAN for MS-DOS version 4.1; and Microsoft Basic Professional Development System for MS-DOS, version 7.1 and Microsoft FORTRAN for MS-DOS, version 5.0.


MORE INFORMATION

The Basic program is as follows:


DECLARE SUB forsub ()
CALL forsub

SUB subbas (a%, b&, c!, d#)
  PRINT a%, b&, c!, d#
END SUB 
The FORTRAN subroutine is as follows:

      *The equivalent of a Basic DECLARE statement

       INTERFACE TO SUBROUTINE SUBBAS (N1,N2,N3,N4)
       INTEGER*2 N1 [NEAR]
       INTEGER*4 N2 [NEAR]
       REAL*4 N3 [NEAR]
       REAL*8 N4 [NEAR]
       END

      *Actual subroutine that is called

       SUBROUTINE FORSUB
       INTEGER*2 A [NEAR]
       INTEGER*4 B [NEAR]
       REAL*4 C [NEAR]
       REAL*8 D [NEAR]
       A = 9
       B = 999
       C = 99.99
       D = 999.999
       CALL SUBBAS(A,B,C,D)
       END 
The OUTPUT is as follows:

9       999        99.99        999.999 

Additional query words: VBmsdos QuickBas BasicCom

Keywords :
Version : MS-DOS:1.0,4.5; :7.0,7.1
Platform : MS-DOS
Issue type :


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