Re: question on character-like variable defination
- From: robert.corbett@xxxxxxx
- Date: 30 Mar 2006 19:11:02 -0800
James Giles wrote:
In a character declaration, the length of the strings is specified
in one of two ways: either as a length parameter on the CHARACTER
type name itself or as a specifier on each variable being declared.
The default length (if neither of the above is given) is one character.
An explicit length on an individual variable overrides what's specified
on the typename.
Hence:
Character V1
Character*10 V2
Character V3*15
Character*20 V4, V5*40, V6
The V1 variable has a length of one. The V2 string has length
10. The V3 string has length of 15. The V4 and V6 variables
have lengths of 20. And the V5 variable has a length of 40.
Note that the form CHARACTER*char-length has been declared
obsolescent. For new code, the examples on the second and
fourth line should be written
CHARACTER(10) V2
and
CHARACTER(20) V4, V5*40, V6
Bob Corbett
.
- Follow-Ups:
- Re: question on character-like variable defination
- From: James Giles
- Re: question on character-like variable defination
- References:
- question on character-like variable defination
- From: sunnylele
- Re: question on character-like variable defination
- From: James Giles
- question on character-like variable defination
- Prev by Date: Re: question on character-like variable defination
- Next by Date: Re: question on character-like variable defination
- Previous by thread: Re: question on character-like variable defination
- Next by thread: Re: question on character-like variable defination
- Index(es):
Relevant Pages
|