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 

COMPILE ERROR ?

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



Joined: 13 May 2008
Posts: 14

PostPosted: Wed May 14, 2008 6:46 pm    Post subject: COMPILE ERROR ? Reply with quote

Program MegaMoney
CHARACTER*10 FUNCTION DATE@()
CHARACTER*10 DRAW_DATE

DRAW_DATE = DATE@()
PRINT *,'PROGRAM RUN ON',DRAW-DATE

Stop
END PROGRAM MegaMoney

What is wrong with this SYNTAX?

C:\Projects\MegaMoney.FOR(2) : error 28 - CHARACTER cannot be declared inside PROGRAM block (perhaps missing CONTAINS or END statement?)
Back to top
View user's profile Send private message
IanLambley



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Wed May 14, 2008 8:10 pm    Post subject: Reply with quote

Remove ther word "FUNCTION"

It is shown in the help as

CHARACTER*10 FUNCTION DATE@()

as that is effectively the first line of the function - it tells you it is a function and returns a character result rather than a subroutine, but you must not define it that way in your program. You just need to define it as

CHARACTER*10 DATE@

You have also used an underscore in the definition of DRAW_DATE, but when you print it, you have put a hyphen, the result would be DRAW minus DATE, where DRAW and DATE are two real numbers, possibly initialised to zero if you used /zeroise in the compile command, and therefore it will print
PROGRAM RUN ON 0.000000000

Regards

Ian
Back to top
View user's profile Send private message Send e-mail
WDG



Joined: 13 May 2008
Posts: 14

PostPosted: Thu May 15, 2008 2:53 am    Post subject: THANK YOU Reply with quote

Very Happy
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