taylor@sdccsu3.UUCP (Dave Taylor) (08/31/84)
I am curious as to whether the dialect of Fortran that I use at work is a standard one or not...specifically, it allows you to do string slicing (ie, if STR is declared; Character*50 STR Then you can get a substring from it by using the expression <variable>(<first>:<last>) (for example, STR(1:20) would be a substring of the first 20 characters.... Is this standard? Thanks! Dave Taylor
barmar@mit-eddie.UUCP (Barry Margolin) (09/01/84)
In article <2233@sdccsu3.UUCP> taylor@sdccsu3.UUCP writes: > Character*50 STR > >Then you can get a substring from it by >using the expression <variable>(<first>:<last>) (for example, >STR(1:20) would be a substring of the first 20 >characters.... > >Is this standard? I believe that this is standard Fortran-77. -- Barry Margolin ARPA: barmar@MIT-Multics UUCP: ..!genrad!mit-eddie!barmar
joe@petsd.UUCP (Joe Orost) (09/04/84)
<> ANSI X3.9-1978 FORTRAN 77 Chapter 5 |5.7 Character Substring | |A character substring is a contiguous portion of a character datum and is of |type character. A character substring is identified by a substring name and |may be assigned values and referenced. | |5.7.1 Substring Name. The forms of a substring name are: | | v ( [e1] : [e2] ) | | a ( s [,s]... ) ( [e1] : [e2] ) | |where: v is a character variable name | | a ( s [,s]... ) is a character array element name | | e1 and e2 are each an integer expression and are called substring | expressions Substrings are not included in the subset language. regards, joe -- Full-Name: Joseph M. Orost UUCP: ..!{decvax,ucbvax,ihnp4}!vax135!petsd!joe US Mail: MS 313; Perkin-Elmer; 106 Apple St; Tinton Falls, NJ 07724 Phone: (201) 870-5844