initializing an array of user-defined data types
- From: Bart Vandewoestyne <MyFirstName.MyLastName@xxxxxxxxxx>
- Date: Wed, 28 Nov 2007 18:38:59 GMT
I have a rank 2 array of a user-defined type as follows:
type(piece), dimension(:,:), allocatable, private :: board
After allocating it, I want to initialize it so that after
initialization, I can check whether board(i,j) contains a piece
or not.
I've tried things like
board = NULL
.... assign some pieces to board positions and leave others empty ...
if (board(i,j) == NULL) then
... do something ...
end if
but that doesn't seem to work.
What is the proper way to do this?
Thanks,
Bart
--
"Share what you know. Learn what you don't."
.
- Follow-Ups:
- Re: initializing an array of user-defined data types
- From: Bart Vandewoestyne
- Re: initializing an array of user-defined data types
- From: Paul van Delst
- Re: initializing an array of user-defined data types
- From: Richard Maine
- Re: initializing an array of user-defined data types
- Prev by Date: Re: Read DOS or Unix files with the same fortran code
- Next by Date: Re: Pointers and DLLs/shared libraries
- Previous by thread: dynamic filename string
- Next by thread: Re: initializing an array of user-defined data types
- Index(es):
Relevant Pages
|
|