Re: initializing an array of user-defined data types



Hello,

At the risk of entering a beauty contest, ;-)

Paul van Delst wrote:
Bart Vandewoestyne wrote:

What is the proper way to do this?

What about this sort of thing:


type :: piece
integer :: i = -1
real :: x = -999.99
end type piece
...
type(piece), dimension(:,:), allocatable :: board

If you need an answer to a predicate, use a logical

type ...

logical :: has_piece ! or occupied etc

....

end type ...

Real equality should be avoided where possible.

YMMV ;-)

--

Dan Nagle
Purple Sage Computing Solutions, Inc.
.



Relevant Pages

  • Re: Mountain Mayhem 2008 (UK 24hr race)
    ... If Ian and Dave are willing to commit to this then it's probably worth ... the risk of entering and just hoping we find another team member ...
    (rec.sport.unicycling)
  • Re: My first sale to the United Arab Emirates
    ... I daresay we will never find out, as this thread is at high ... risk of entering a death sprial discussion leading off with ... opinions about the recent outcry on UAE investment in ...
    (alt.marketing.online.ebay)
  • Re: Heathrow Express Scanners
    ... > But if this is such an important issue, why aren't people entering the ... does this guarantee that they can wander about inside the ... > terminal for hours without the risk of 'acquiring' something later? ... > mean, terrorists are devious, right? ...
    (uk.legal)
  • Re: Ping Coroner
    ... Cheri wrote: ... declared dead. ... All persons entering will be at their own risk and with full responsibility for all consequences. ...
    (alt.support.diabetes)