Path: ...!npeer.as286.net!npeer-ng0.as286.net!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!nntp.comgw.net!newsfeed.bofh.team!paganini.bofh.team!not-for-mail From: R Daneel Olivaw Newsgroups: comp.lang.fortran Subject: Re: Is there a way in Fortran to designate an integer value as integer*8 ? Date: Sun, 13 Oct 2024 17:21:38 +0200 Organization: To protect and to server Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 13 Oct 2024 15:21:38 -0000 (UTC) Injection-Info: paganini.bofh.team; logging-data="219411"; posting-host="XBJBjenliTep7OIZ0g9xdw.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A"; User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 SeaMonkey/2.53.18.2 X-Notice: Filtered by postfilter v. 0.9.3 X-Received-Bytes: 2365 Bytes: 2492 Lines: 25 Thomas Koenig wrote: > R Daneel Olivaw schrieb: > >> Equivalences are an effective way of building data structures, you can >> do that with Common as well but sometimes equivalence is more suitable. > > Can you give an example? I have a hard time imagining what it would > be useful for. > integer record (100), reckey, reccod c or integer*4 character*40 recnam, recstr, rectwn c equivalence (record, reckey), (record (2), recnam) equivalence (record (12), recstr), (record (22), rectwn) equivalence (record (32), reccod) c and so on I have used constructs like that to handle database structures, although obviously we were restricted to whole-word fields and multiple-word fields - with everything being on word boundaries. One Fortran implementation I used for years allowed us to use statement functions to implement partial-word fields, these functions could be used on the left or the right sides of an assignment. That permitted far more fine tuning.