Re: initializing an array of user-defined data types
- From: dpb <none@xxxxxxx>
- Date: Wed, 28 Nov 2007 13:47:45 -0600
garylscott@xxxxxxxxxxxxx wrote:
On Nov 28, 1:12 pm, nos...@xxxxxxxxxxxxx (Richard Maine) wrote:Bart Vandewoestyne <MyFirstName.MyLastN...@xxxxxxxxxx> wrote:I have a rank 2 array of a user-defined type as follows:What is this NULL thing you seem to expect? There is no such thing. The
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
only thing named NULL in Fortran is an intrinsic function that returns a
pointer or allocatable. ...
....
In CVF, NULL is simply an integer variable of value zero imported from
one of the windows support modules. Used alot for c interperability.
And, of course, the usage notes to the NULL() intrinsic include the following warning --
Note: If you use module DFWIN or DFWINTY, you will have a name conflict if you use the NULL intrinsic. To avoid this problem, rename the integer parameter constant NULL to something else; for example:
USE DFWIN, NULL0 => NULL
--
.
- References:
- initializing an array of user-defined data types
- From: Bart Vandewoestyne
- Re: initializing an array of user-defined data types
- From: Richard Maine
- Re: initializing an array of user-defined data types
- From: garylscott
- initializing an array of user-defined data types
- Prev by Date: Re: initializing an array of user-defined data types
- Next by Date: Re: Fortran Error Reporting Requirements (Was: GFORTRAN PROBLEM WITH SAVE STATEMENT)
- Previous by thread: Re: initializing an array of user-defined data types
- Next by thread: Re: initializing an array of user-defined data types
- Index(es):
Relevant Pages
|