VB.NET Boolean vs Visual Fortran Logical

  • Thread starter Thread starter ags5406
  • Start date Start date
A

ags5406

Hi --

I posted this in a Fortran group but thought I'd post here as well.
Any help is appreciated.

I have a IVF10 DLL that is the calculation engine for a frontend
application written in VB.NET 2005.

I've noticed that when I pass a Boolean/Logical from VB.NET to IVF10
as part of an argument list, when I try to evaluate it it only
evaluates correctly if I type it without the "dots" before and after
the TRUE.

IF ( BVAR.EQ.TRUE ) THEN

BVAR is declared this way:

LOGICAL*2, INTENT(IN) :: BVAR

And on the VB.NET side BVAR is declared this way:

Dim bVar as Boolean

However, if I declare a variable that exists solely withing the IVF10
DLL and assign it's value from with the DLL, rather that having its
value passed from VB.NET, then the "dots" are necessary or it won't
evaluate correctly.

IF ( CVAR.EQ..TRUE. ) THEN

CVAR is declared this way:

LOGICAL*2 CVAR

Can anyone please shed some light on this behavior? Thanks in advance.
 
My Fortran is a bit rusty, but if the variables are Logical, then you should
not need to compare them to .TRUE., I believe.

I suspect that VB booleans are 1 byte, not compatible with Logical*2.
 
Back
Top