Re: question on character-like variable defination




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

.



Relevant Pages

  • Re: [PHP] newbie question
    ... padding the results to the right string size. ... This may be a space character ... a width specifier that says how many characters ...
    (php.general)
  • Re: [PHP] newbie question
    ... padding the results to the right string size. ... This may be a space character ... a width specifier that says how many characters ...
    (php.general)
  • Re: question on character-like variable defination
    ... In a character declaration, the length of the strings is specified ... type name itself or as a specifier on each variable being declared. ...
    (comp.lang.fortran)
  • Re: InStr does not return position of $ symbol
    ... '$' character, rather than being formatted to appear as though it does. ... What is the data type of the 'Specifier' field? ... Brendan Reynolds ... else can I do this in an Access 2002 query? ...
    (microsoft.public.access.queries)
  • Re: Proper way to return a string
    ... function may not have an explicit interface, ... Assumed character length for functions is an irregularity in the ... assumed character length functions being obsolescent. ... requiring diagnosis. ...
    (comp.lang.fortran)