Re: variable length strings
From: Steve Lionel (Steve.Lionel_at_REMOVEintelME.com)
Date: 08/19/04
- Next message: Gene Wagenbreth: "Re: Really wierd bug"
- Previous message: Mr. Adam Burry: "Re: variable length strings"
- In reply to: Mr. Adam Burry: "Re: variable length strings"
- Next in thread: Richard Maine: "Re: variable length strings"
- Reply: Richard Maine: "Re: variable length strings"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 19 Aug 2004 13:16:43 -0400
On 19 Aug 2004 09:50:02 -0700, aburry@ieee.org (Mr. Adam Burry) wrote:
>aburry@ieee.org (Mr. Adam Burry) wrote in message news:<f3e1fd4d.0408181158.51dd9a67@posting.google.com>...
>The problem seems to have been: "!DEC$ ATTRIBUTES REFERENCE ::
>strFilename"
>I expected this to be redundant given the earlier REFERENCE directive,
>but apparently it actually does something. Presumably removing the
>hidden length argument?
Yes, that's what it does. This combination specifies that the caller passes
only the address of the character argument, not the length. There is a full
chapter on mixed-language programming in the Visual Fortran Programmer's Guide
which discusses this and related issues.
> CHARACTER*60 fname
> INTEGER strLen
>
> fname = strFilename
> strLen = LEN( fname )
>
>In this case, strLen will be 60 even if LEN( strFilename ) is only 10.
>How does one get the actual length of fname?
You want LEN_TRIM(fname), I assume. (It is not clear what you mean by "actual
length", but I'll assume you mean (with trailing blanks removed).
Steve Lionel
Software Products Division
Intel Corporation
Nashua, NH
User communities for Intel Software Development Products
http://softwareforums.intel.com/
Intel Fortran Support
http://developer.intel.com/software/products/support/
- Next message: Gene Wagenbreth: "Re: Really wierd bug"
- Previous message: Mr. Adam Burry: "Re: variable length strings"
- In reply to: Mr. Adam Burry: "Re: variable length strings"
- Next in thread: Richard Maine: "Re: variable length strings"
- Reply: Richard Maine: "Re: variable length strings"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|