- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am doing something like this:
-----------------------------------------------
CHARACTER(*) :: MyString
CHARACTER(*) :: Ticker
INTEGER :: TLen
!...
!...
TLen = LEN(Ticker)
WRITE(MyString, "(A)") Ticker
-----------------------------------------------
(Note that I have to mention to avoid spaces in MyString for some later processing.)
Since length of Ticker changes each time (varies from 3 to 10) I have to compute it each time I write it into MyString. Is there a more efficient way of doing this, which could perhaps save me from computing LEN(Ticker) each time.
-Kulachi
I am doing something like this:
-----------------------------------------------
CHARACTER(*) :: MyString
CHARACTER(*) :: Ticker
INTEGER :: TLen
!...
!...
TLen = LEN(Ticker)
WRITE(MyString, "(A
-----------------------------------------------
(Note that I have to mention
Since length of Ticker changes each time (varies from 3 to 10) I have to compute it each time I write it into MyString. Is there a more efficient way of doing this, which could perhaps save me from computing LEN(Ticker) each time.
-Kulachi
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - kulachi
Hi,
I am doing something like this:
-----------------------------------------------
CHARACTER(*) :: MyString
CHARACTER(*) :: Ticker
INTEGER :: TLen
!...
!...
TLen = LEN(Ticker)
WRITE(MyString, "(A)") Ticker
-----------------------------------------------
(Note that I have to mention to avoid spaces in MyString for some later processing.)
Since length of Ticker changes each time (varies from 3 to 10) I have to compute it each time I write it into MyString. Is there a more efficient way of doing this, which could perhaps save me from computing LEN(Ticker) each time.
-Kulachi
I am doing something like this:
-----------------------------------------------
CHARACTER(*) :: MyString
CHARACTER(*) :: Ticker
INTEGER :: TLen
!...
!...
TLen = LEN(Ticker)
WRITE(MyString, "(A
-----------------------------------------------
(Note that I have to mention
Since length of Ticker changes each time (varies from 3 to 10) I have to compute it each time I write it into MyString. Is there a more efficient way of doing this, which could perhaps save me from computing LEN(Ticker) each time.
-Kulachi
First of all it would be good if you tell us EXACTLY what you do... "Something like this" is not very helpful ;-)
Second: Why do you want to get rid of LEN? I cant imagine that this will take much CPU time.
Third: You dont have to use LEN to count the spaces. write(mystring,'(a)') trim(Ticker) will do just fine, it removes the trailing blanks. Maybe you want to use write(mystring,'(a)') trim(adjustl(Ticker)) too to get rid of leading blanks as well.
Markus
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page