- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now I'm developping a 64bit program. I define some variables in a batfile,but when I build my project I getting error that the variableis not declear as an array or a function. The everything will be OK when I changed my dat file to another file type.
I have many code files, I don't want to change my dat file's type, what should I do ?
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My compiler is Intel Fortran 9.0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How are you declaring a fortran variable in a bat file? You can declare environment variables in bat files, and determine their values by using a system call, and go from there. You cannot declare a variable in a bat file and have it recognized by Fortran!
What you may be trying to do is to declare a variable to be interpreted by the Fortran pre-processor (FPP), which does variable substitution in a copy of the source file.
So ... there are two choices.
1) Declare variable in bat file
Read value of variable via system call (getenvqq)
Act on value of variable
2) Declare variable in bat file
Pass Fortran program with appropriate preprocessor statements through fpp, (or, if you prefer, cpp), thence to compiler.
No higher level language of which I am aware can use a variable declared in a different language. From my personal experience one cannot do it in C, C++, Fortran, PL/1, Cobol, SQL, JCL, DCL.....
What you may be trying to do is to declare a variable to be interpreted by the Fortran pre-processor (FPP), which does variable substitution in a copy of the source file.
So ... there are two choices.
1) Declare variable in bat file
Read value of variable via system call (getenvqq)
Act on value of variable
2) Declare variable in bat file
Pass Fortran program with appropriate preprocessor statements through fpp, (or, if you prefer, cpp), thence to compiler.
No higher level language of which I am aware can use a variable declared in a different language. From my personal experience one cannot do it in C, C++, Fortran, PL/1, Cobol, SQL, JCL, DCL.....
Message Edited by emc-nyc on 09-06-2005 10:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DAT or BAT? That's the question.
Hans

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page