Home > Archive > Fortran > June 2005 > DATA Statement syntax question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
DATA Statement syntax question
|
|
| cgilley@bravesw.com 2005-06-07, 4:02 pm |
| Given the following code snippet:
BYTE ICHARS(6,37)
INTEGER LUNP,WPARAM(6),SPARAM(6),VER
DATA SPACES/7*0/,EPCR/141/
DATA ICHARS/"360,"50,"50,"360,0,0,"370,"250,"250,"120,0,0,
2 "160,"210,"210,"120,0,0,"370,"210,"210,"160,0,0,
3 "370,"250,"250,"210,0,0,"370,"50,"50,"10,0,0,
4 "160,"210,"350,"120,0,0,"370,"40,"40,"370,0,0,
5 "210,"370,"210,0,0,0, "100,"210,"170,"10,0,0,
6 "370,"40,"120,"210,0,0,"370,"200,"200,"200,0,0,
7 "370,"20,"40,"20,"370,0,"370,"20,"40,"370,0,0,
| |
| Jan Vorbrüggen 2005-06-07, 4:02 pm |
| > What does the ICHARS/"360... do?
It says that what follows is a number in octal notation.
Jan
| |
| Richard E Maine 2005-06-07, 4:02 pm |
| In article <3gltcrFcu43rU1@individual.net>,
Jan Vorbrüggen <jvorbrueggen-not@mediasec.de> wrote:
>
> It says that what follows is a number in octal notation.
>
And let me add that it is a nonstandard syntax. Not all compilers will
support it. F90 does have a standard syntax for octal - O"360", for
example, but there are also other nonstandard things in this code (such
as the byte type).
Do be aware that code using octal literals like this is often (though
not always) system-dependent in ways other than just simple syntax
issues. It depends what those octal values are used for.
The variable name makes it sound like they are characters. However,
unless I messed something up (possible), the values don't make a lot of
sense as either ASCII or EBCDIC. They could be some less common
character set, though... or the name might just be misleading me.
Anyway, if, for example, these are values in some particular character
set, then they aren't likely to be appropriate values on a machine that
uses a different character set.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
| |
| glen herrmannsfeldt 2005-06-07, 4:02 pm |
| Richard E Maine wrote:
> In article <3gltcrFcu43rU1@individual.net>,
> Jan Vorbrüggen <jvorbrueggen-not@mediasec.de> wrote:
(previously snipped DATA statement restored)
DATA ICHARS/"360,"50,"50,"360,0,0,"370,"250,"250,"120,0,0,
2 "160,"210,"210,"120,0,0,"370,"210,"210,"160,0,0,
3 "370,"250,"250,"210,0,0,"370,"50,"50,"10,0,0,
4 "160,"210,"350,"120,0,0,"370,"40,"40,"370,0,0,
5 "210,"370,"210,0,0,0, "100,"210,"170,"10,0,0,
6 "370,"40,"120,"210,0,0,"370,"200,"200,"200,0,0,
7 "370,"20,"40,"20,"370,0,"370,"20,"40,"370,0,0,
[color=darkred]
> And let me add that it is a nonstandard syntax. Not all compilers will
> support it. F90 does have a standard syntax for octal - O"360", for
> example, but there are also other nonstandard things in this code (such
> as the byte type).
I believe that this, and the BYTE type were from some DEC compilers
from before 1980. Maybe for the PDP-11, which is byte addressable
though memory is based on 16 bit words.
> Do be aware that code using octal literals like this is often (though
> not always) system-dependent in ways other than just simple syntax
> issues. It depends what those octal values are used for.
> The variable name makes it sound like they are characters. However,
> unless I messed something up (possible), the values don't make a lot of
> sense as either ASCII or EBCDIC. They could be some less common
> character set, though... or the name might just be misleading me.
I don't recognize it, either. DEC often used other codes, though SIXBIT
for a 64 character ASCII subset, and RAD50, which is actually a base 40
character set, the 50 is in octal. Three base 40 characters will fit
into a 16 bit word. RT-11 would store file names, six characters
with a three character extension, in three 16 bit words.
> Anyway, if, for example, these are values in some particular character
> set, then they aren't likely to be appropriate values on a machine that
> uses a different character set.
Another possibility is that it is executable code to be downloaded to
some other processor.
-- glen
|
|
|
|
|