- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I have a character*72 Name
and Name is all blank characters coming in from a file from another program - how do I test for blankness --
Ta
John
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My experience was with the 3600 first, then the 6600 (batch only) and 6400 (time-shared). Those were superb machines with easy to learn operating systems (MOMS, Kronos) and well-written manuals, the software was excellent and programs were quite easy to debug using the error dumps. By the standards of the era, and in particular in comparison to the IBM machines, the CDCs were fast and well-suited for scientific work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Vautier, Gilles wrote:
Sure
A character(n) Fortran string is an array of n bytes whose values range from 0 to 255.
That's at the level of implementation detail. It won't be true if the storage for the default character kind is not a byte, or if the default character kind for the processor does not support the full range of values of a byte (e.g. ascii only uses 7 bits of the range).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ianh wrote:
Quote:
Vautier, Gilles wrote:
Sure
A character(n) Fortran string is an array of n bytes whose values range from 0 to 255.
That's at the level of implementation detail. It won't be true if the storage for the default character kind is not a byte, or if the default character kind for the processor does not support the full range of values of a byte (e.g. ascii only uses 7 bits of the range).
The real problem arose when I got two blank lines on printing out the results, I did not want the two blank lines for a empty string. I used VS debug to look at the variable after it was assigned from STRAND7 and it had about 20 empty spots (possibly char(0) in a string. I had forgotten about the char(0) - old age and tiredness, let us blame tiredness. In looking at the uninitialized Intel Fortran string it appeared to be set to char(0) - not sure if this is true or just a quirk of the debugger.
The problem is that the sort of people I work with are likely to do anything, so the simplest method seemed to be to count the number of characters in the string, whatever they are, report the number and then return the string. It is not perfect -- but the original code was an old dog.
Complete side issue: I ported some C# code into Mono on a Linux box. The NET2.0 dll's from the developer of that code caused no end of problems, I could get one set running, but if I changed the C# code in VS in Windows and then ported it -- all hell broke loose. Ended up doing it all again in Mono. Works a treat, although the color change features for the screen in a cmd window do not work in Linux on Mono. I decompiled the dll's and attempted to recompile in NET 4.5.1 and that proved to be an interesting exercise. I am sure I can get it to work, but the VS 2103 compiler in C# is stricter than the VS 2005 that the original DLL's were compiled on and I am on a tight time constraint.
just give me Fortran so much easier.
Fun in the sun. Merry Christmas.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »