forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trouble running code

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Mon Feb 28, 2005 11:36 pm    Post subject: Trouble running code Reply with quote

I have a code that compiles and builds without any errors. It runs just fine in Intel Visual Fortran. But when I try to build it and run it from FTN95, it builds without errors but running it give the error "An exception 'System.TypeInitializationException' has occured." I have no idea what this means or what to do about it. Anyone have suggestions?
Back to top
Anonymous
Guest





PostPosted: Tue Mar 01, 2005 1:37 pm    Post subject: Trouble running code Reply with quote

I have found that if I have code where uninitialized variables are used and the code is compiled using the command line compiler, (ftn95.exe), the uninitialized variables will be initialized by the compiler to be some negative number and the code runs without any runtime exceptions.

However, when the same code is compiled using Salford Fortran in the Visual Studio .NET development environment, then the uninitialized variables cause a runtime exception. You may be having a similar problem with Intel Visual Fortran.

Ron Coutts
Back to top
Andrew



Joined: 09 Sep 2004
Posts: 232
Location: Frankfurt, Germany

PostPosted: Sat Mar 05, 2005 5:03 am    Post subject: Trouble running code Reply with quote

There is another potential difference here. Intel Visual Fortran only compiles in Win32 mode. The error that was seen is a .NET runtime error. Do you really intend to build the program in .NET mode? If not then you can change the configuration by selecting a Win32 mode from the dropdown combo at the top of the IDE.
Back to top
View user's profile Send private message
MarcusMaximus



Joined: 28 Feb 2005
Posts: 1

PostPosted: Fri Mar 11, 2005 3:13 am    Post subject: Trouble running code Reply with quote

That was it. I changed to Win32 and now it runs just fine. Thanks!
Back to top
View user's profile Send private message
Andrew



Joined: 09 Sep 2004
Posts: 232
Location: Frankfurt, Germany

PostPosted: Fri Mar 11, 2005 3:34 am    Post subject: Trouble running code Reply with quote

There may be another cause for this too. When you compile and run from the command line - do you use the switch /CHECK? If not then no runtime checks are placed and your code may execute where there are actually uninitialised variables. When running inside Visual Studio (depending on the configuration) /CHECK may be turned on. If this is the case and an unitialised variable is encountered at runtime then a runtime exception will be thrown. There may also be differences between running code in Win32 mode and .NET mode with /CHECK. Make sure you are comparing like with like, as otherwise you may see differing behaviour.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group