473,396 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VB.NET Boolean vs Visual Fortran Logical

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.
Nov 15 '07 #1
1 1939
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.

"ags5406" wrote:
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.
Nov 15 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Markus Faust | last post by:
Hi, I'm trying to link Fortran files generated with “Compaq Visual Fortran Optimizing Compiler Version 6.6 (Update B)” under “Enthought Edition build 1028, Python 2.3 (#46, Aug 11 2003,...
1
by: Ed | last post by:
Apparently my Visual Studio 6.0 cannot support any Fortran files, so I'm abounding with problems compiling. One of my coworker's Visual Studio does support it in some mysterious way I cannot...
4
by: Cyde Weys | last post by:
I'm currently working on converting a simulator program from Visual Basic 6.0 to Visual C++ .NET. I've figured out most of the stuff, but there's still one thing I haven't gotten to and I've never...
1
by: Sam | last post by:
Hello all I have a two dimensional array (the dimensions are not known) that needs to be passed to fortran from c++, allocate the dimensions of the array in fortran code, do some filling up of...
3
by: Holger (David) Wagner | last post by:
Hi all, we're currently developing an application in the .NET environment that needs to access a DLL implemented in Fortran. There is one procedure with about 17 parameters, most of them arrays....
7
by: Charles | last post by:
I have Visual Studio 6.0 stand-alone (with C++) and as part of Compaq Visual Fortran 6.6c. I am moving my development from a Win 98 SE machine w/2x 10 Gb HDD (each w/ 1Gb free), 768 Mb RAM to a...
2
by: Ray J. | last post by:
I have a C++ program written and compiled on Solaris 8 with gcc. With gcc lets me compile fortran code along with the C++ program to be able to call the fortran code as a subroutine. The...
7
by: rguarnieri | last post by:
Hi! I'm trying to create a query with a boolean expression like this: select (4 and 1) as Value from Table1 this query return always -1, but when I make the same calculation in visual...
11
by: KiranJyothi | last post by:
Hello All, I am writing a code in C where I have to use the Boolean data type. I am doing - typedef int flag; #define FALSE 0 #define TRUE 1 void main()
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.