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 

Pointers (3)

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



Joined: 15 Jun 2006
Posts: 46

PostPosted: Thu Jul 20, 2006 5:19 am    Post subject: Pointers (3) Reply with quote

As you can see, I am having troubles with pointers - lol

Please review the following code:

=============================================

Module Managerie

Type stFerret
Integer*4, Pointer :: iTeeth(Smile
End Type

Type stZoo
Type(stFerret) pstFerret
End Type

Type(stZoo) pstZoo

End Module Managerie


=============================================

Module Point

USE Module Managerie

Type(stFerret), Pointer :: pstFerret

pstFerret => pstZoo%pstFerret
Call DoSomething(pstFerret)

End Module Point

=============================================

Module Direct

USE Module Managerie

Type(stFerret) pstFerret

Call DoSomething(pstFerret)

End Module Direct

=============================================

Module DoIt

Subroutine DoSomething(pstFerretP)

(A) Type(stFerret), Pointer :: pstFerretP
(B) Type(stFerret) pstFerretP

End Subroutine

End Module DoIt

=============================================

I guess you get the gist.
Now in Module DoIt, should I use (A) or (B)?
Does it matter.
Is there a better way to set up things.
Should I use "TARGET" somewhere?

Agian, thanx in advance for any help.

Bri
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