replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Problem with GO TO (assigned)
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 

Problem with GO TO (assigned)

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



Joined: 26 May 2011
Posts: 66

PostPosted: Thu May 26, 2011 11:47 am    Post subject: Problem with GO TO (assigned) Reply with quote

I know that the assigned GO TO statement has been deleted in Fortran 95 but we try to port your Fortran 77 programs to Fortran 95 now.

You write that the feature is not deleted from ftn95, so I can compile and link my program but I get an access violation at this point when I run it!

My simple program:

Code:
     
      PROGRAM LTEST
C     
      INTEGER*2 LABEL1
C     
     
      ASSIGN 50 TO LABEL1
      GOTO LABEL1
C     
50    CONTINUE     
C           
      END


Is there a hack how I can use the goto assigned label without an access violation??
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Thu May 26, 2011 12:28 pm    Post subject: Reply with quote

When the error message says you can only ASSIGN to integer (KIND=3), that means to INTEGER* 4!

INTEGER*4 LABEL1

Eddie
Back to top
View user's profile Send private message
dgurok



Joined: 26 May 2011
Posts: 66

PostPosted: Thu May 26, 2011 12:39 pm    Post subject: Reply with quote

there are no errors while compiling

ftn95 test.for /debug

[FTN95/Win32 Ver. 6.10.0 Copyright (c) Silverfrost Ltd 1993-2011]
NO ERRORS [<LTEST> FTN95/Win32 v6.10.0]


When I execute the program I get the error:
---------------------------------------------------
Access Violation

main - in file test.for at line 6 [+0021]
---------------------------------------------------

line 6 is the "ASSIGN 50 TO LABEL1 " statement...
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Thu May 26, 2011 12:50 pm    Post subject: Reply with quote

I'm using an older version. Have you tried it with INTEGER*4? All labels must be 32-bit.

Eddie
Back to top
View user's profile Send private message
dgurok



Joined: 26 May 2011
Posts: 66

PostPosted: Thu May 26, 2011 1:29 pm    Post subject: Reply with quote

When I use INTEGER*4 then I get this error:

Quote:
[FTN95/Win32 Ver. 6.10.0 Copyright (c) Silverfrost Ltd 1993-2011]
0006) ASSIGN 50 TO LABEL1
*** Only INTEGER(KIND=2) variables may be ASSIGNed to
1 ERROR [<LTEST> FTN95/Win32 v6.10.0]
*** Compilation failed
Back to top
View user's profile Send private message
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Thu May 26, 2011 1:41 pm    Post subject: Reply with quote

Your code works for me if I use INTEGER*4 or INTEGER(Kind=3) or INTEGER. All of these are same 32 bit integer type.
Back to top
View user's profile Send private message
dgurok



Joined: 26 May 2011
Posts: 66

PostPosted: Thu May 26, 2011 1:53 pm    Post subject: Reply with quote

Thats strang...

Which version of ftn95 do you use??

Do you have some special compilation settings??

I use these:

Quote:
/ALL_WARNINGS
/ALT_KINDS
/FIXED_FORMAT
/INTS
/LOGS
/OLD_ARRAYS
/PERSIST
/SAVE
/SINGLE_THREADED
/UNLIMITED_ERRORS
/WINDOWS
/ZEROISE


Edit:

I have removed all my settings in the config and I get no violation now..
I check which option produces this strange behavior

Edit2:

/INTS needs label with integer*2 and works fine..
/SAVE needs label with integer*4 and produces an error..
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Thu May 26, 2011 2:20 pm    Post subject: Reply with quote

I use 4.90 (Academic licence). For some bizarre and unfathomable reason that I do not understand, this machine (at my University) appears to be licensed for 5.20.1, but nevertheless it has my name on it !

I only use the Win32 / Clearwin options, and as far as I know, don't have anything set as standard in a config file.

/SINGLE_THREADED looks to be a hangover from the DBOS version of FTN77 - is it still valid?

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Thu May 26, 2011 2:56 pm    Post subject: Reply with quote

/ALT_KINDS will mess things up for you.

You need INTEGER(kind = 4) when using /ALT_KINDS.

That is, the kind values are 1, 2, 4 and 8 when you use ALT_KINDS.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Thu May 26, 2011 8:57 pm    Post subject: Reply with quote

Paul,

ALT_KINDS will upset the apple cart if you use KIND. It shouldn't for INTEGER*2, surely?

What puzzles me is that he doesn't get an error message. There is a very clear message with my licensed version, and also PE version 6.10.

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Fri May 27, 2011 8:08 am    Post subject: Reply with quote

With the current version of FTN95 you should be able to use


INTEGER if the default KIND has not been changed

INTEGER*4

INTEGER(KIND=3) if the default KIND values have not been changed

INTEGER(KIND=4) if /ALT_KINDS has been used

Anything else should produce a compile time error.
Back to top
View user's profile Send private message AIM Address
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