For Programmers: Free Programming Magazines  


Home > Archive > Fortran > May 2004 > ENCODE and DECODE









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 ENCODE and DECODE
John Collins

2004-05-12, 9:09 pm

We are writing a tool to convert ENCODE and DECODE statements
to internal READ and WRITE. However, I have a distant memory that
there are alternative formats for ENCODE and DECODE on different
systems.

On Gould-SEL (where all this started) and CVF we have:

ENCODE ( n, f, v, IOSTAT=ios, ERR=9999 ) LIST1,LIST2 ...
and
DECODE ( n, f, v, IOSTAT=ios, ERR=9999 ) LIST1,LIST2 ...

where n is the number of characters, f is the format label or string
and v is the variable to which data is written (ENCODE) or from which
it is read (DECODE).

Have these (ancient and non-standard) commands been implemented
differently anywhere else?

Many thanks for your help,

Best wishes,

John
john_collins@simcon.uk.com
Tim Prince

2004-05-12, 9:09 pm


"John Collins" <John_Collins@simcon.uk.com> wrote in message
news:b13fd5ba.0405100922.574ca1e3@posting.google.com...
> We are writing a tool to convert ENCODE and DECODE statements
> to internal READ and WRITE. However, I have a distant memory that
> there are alternative formats for ENCODE and DECODE on different
> systems.
>
> On Gould-SEL (where all this started) and CVF we have:
>
> ENCODE ( n, f, v, IOSTAT=ios, ERR=9999 ) LIST1,LIST2 ...
> and
> DECODE ( n, f, v, IOSTAT=ios, ERR=9999 ) LIST1,LIST2 ...
>
> where n is the number of characters, f is the format label or string
> and v is the variable to which data is written (ENCODE) or from which
> it is read (DECODE).
>
> Have these (ancient and non-standard) commands been implemented
> differently anywhere else?
>

http://www.thinkage.ca/english/gcos/expl/fort/hint.html

confirming the gcos Fortran style, where the number of characters was taken
from the LIST. They still did it that way up to 20 years ago. Note also,
that to some people, FORTRAN didn't necessarily denote the most widespread
compiler, even though there was no distinction made between standard and
vendor-dependent syntax.


August Miller

2004-05-12, 9:09 pm

John Collins <John_Collins@simcon.uk.com> wrote:
> We are writing a tool to convert ENCODE and DECODE statements
> to internal READ and WRITE. However, I have a distant memory that
> there are alternative formats for ENCODE and DECODE on different
> systems.


My old UNIVAC 1100 FORTRAN V manual has a slightly different form:

ENCODE(size,f,block,trans) list

The first three parameters are the same as John quoted.
The fourth "trans" is the number of characters actually scanned, but its
presence is optional. If "size is ommitted then it is assumed to be 132, but
if "size" is omitted then "trans" must also be omitted.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com