User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » fortran---tell me why this wont compile Page [1]  
ncsu919
All American
1067 Posts
user info
edit post

PROGRAM mod
IMPLICIT NONE

integer :: a


a=mod(8,2)

write(*,*)a

END PROGRAM mod


i get the error
line 7 : invalid recursive self-reference to MOD detected at )@<end-of-statement>

4/14/2008 2:31:43 PM

GraniteBalls
Aging fast
12262 Posts
user info
edit post

TWW isn't gonna do your homework for you.

4/14/2008 2:40:20 PM

ncsu919
All American
1067 Posts
user info
edit post

its not hw, it was a sample thing i was testing. and i figured it out neways, i called the program mod....that dont work to well.

4/14/2008 2:51:05 PM

YOMAMA
Suspended
6218 Posts
user info
edit post

;

4/14/2008 3:12:11 PM

sarijoul
All American
14208 Posts
user info
edit post

"mod" is a protected word (implicit function in fortran) call the program something else



[Edited on April 14, 2008 at 3:20 PM. Reason : ^^ oh you figured it out.]

4/14/2008 3:19:29 PM

tl
All American
8430 Posts
user info
edit post

goddamn if that same error wasted me a good 5 hours over the course of my fortran writing sessions. I'd whip up a short "test" program to see if an equation or two were correct, and i'd always name them something that the compiler would trip over. Spend a hour beating my head against the desk; spend 3 seconds renaming it.

4/14/2008 5:42:19 PM

Novicane
All American
15416 Posts
user info
edit post

Quote :
"something that the compiler would trip over. Spend a hour beating my head against the desk; spend 3 seconds renaming it."


welcome to programming.

4/15/2008 10:37:01 AM

qntmfred
retired
40726 Posts
user info
edit post

haha seriously

4/15/2008 10:51:17 AM

ncsu919
All American
1067 Posts
user info
edit post

finally just finished the final proj for fortran, i know a lot of the things i did in it were i guess the really long way to do it, but i dont care, it all works, 3000 lines for an RSA decryption program haha

4/15/2008 12:44:16 PM

DirtyMonkey
All American
4269 Posts
user info
edit post

what class is that for?

4/15/2008 1:07:07 PM

Novicane
All American
15416 Posts
user info
edit post

fortran is the language for people with real problems.

4/15/2008 1:46:27 PM

ncsu919
All American
1067 Posts
user info
edit post

its for basic fortran class, csc 112. and btw after looking in the book for the class for the first time this yr, i just replaces 2000 lines of my code with 1 line, made me feel real smart...so glad its over haha.

4/15/2008 11:31:29 PM

darkone
(\/) (;,,,;) (\/)
11610 Posts
user info
edit post

Quote :
"fortran is the language for people with real problems. "


This is true on so many levels.

4/15/2008 11:33:11 PM

skokiaan
All American
26447 Posts
user info
edit post

^spell out the levels for us

4/15/2008 11:45:14 PM

Wraith
All American
27257 Posts
user info
edit post

I use fortran all the time here at NASA.

Good thing I taught fortran for a while when I was at NCSU, I know it like the back of my hand.

4/16/2008 9:23:06 AM

DeltaBeta
All American
9417 Posts
user info
edit post

Quote :
"fortran is the language for a cause of people with real problems."


Fixed that for you.

4/16/2008 9:40:51 AM

 Message Boards » Tech Talk » fortran---tell me why this wont compile Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.