Microsoft KB Archive/27477

= Passing Variables from Microsoft FORTRAN to Basic =

Article ID: 27477

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft Visual Basic for MS-DOS
 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1
 * Microsoft QuickBasic 4.5 for MS-DOS

-



This article was previously published under Q27477



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: KB27477

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.