- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can I do an internal read writing real array values to a string like below?
Or is there an intrinsic function for this?
character*80 aatemp
Read(( xread1(k), k=1,nv(1) ),'(a)') aatemp
Write(lin2,*) aatemp
Thanks for any advice.
Ken
Or is there an intrinsic function for this?
character*80 aatemp
Read(( xread1(k), k=1,nv(1) ),'(a)') aatemp
Write(lin2,*) aatemp
Thanks for any advice.
Ken
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You want an internal write.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
I rewrote and tried but do not see value when viewing aatemp with the debugger.There is a value is the array.
character*80 aatemp
Write( xread1(1),'(a)') aatemp
Write(lin2,*) aatemp
I assumed the full array would look like below.
Write(( xread1(1), k=1,nv(1) ),'(a)') aatemp
Write(lin2,*) aatemp
Do you see anything wrong?
Thanks
Ken
I rewrote and tried but do not see value when viewing aatemp with the debugger.There is a value is the array.
character*80 aatemp
Write( xread1(1),'(a)') aatemp
Write(lin2,*) aatemp
I assumed the full array would look like below.
Write(( xread1(1), k=1,nv(1) ),'(a)') aatemp
Write(lin2,*) aatemp
Do you see anything wrong?
Thanks
Ken
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Think of the character variable as a file. What you want is something like this:
write (aatemp, '(5F10.2)') (xread(k),k=1,nv(1))
Be aware that if you get to the end of the format and still have more elements, it will try to go to the "next record". In internal I/O, that means the next element of an array. Since aatemp is not an array, it will fail.
I suggest reading the Language Reference Manual section on internal write.
Steve
write (aatemp, '(5F10.2)') (xread(k),k=1,nv(1))
Be aware that if you get to the end of the format and still have more elements, it will try to go to the "next record". In internal I/O, that means the next element of an array. Since aatemp is not an array, it will fail.
I suggest reading the Language Reference Manual section on internal write.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks

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