View previous topic :: View next topic |
Author |
Message |
WDG
Joined: 13 May 2008 Posts: 14
|
Posted: Tue May 20, 2008 6:58 pm Post subject: ENCODE AND DECODE |
|
|
How can I convert numbers to character strings
(and vice-versa)?
I used to use ENCODE and DECODE but I don't dee these in the help.
For example looking at a hex dump I have the following two bytes
32 38 i.e. 28 I need an integer with 28. |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Tue May 20, 2008 8:16 pm Post subject: |
|
|
I don't think that ENCODE and DECODE were ever part of the fortran standard. I remember they were VAX extensions. Certainly on the VAX they were equivalent to an internal read and write, where instead of reading from and writing to a unit number a character string variable replaced the unit number. This is part of the fortran standard.
READ(character_string_variable,*)K
and
WRITE(character_string_variable,'(I')K |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Tue May 20, 2008 8:18 pm Post subject: |
|
|
came out wrong !
Code: | READ(character_string_variable,*)K
WRITE(character_string_variable,'(I8)')K |
|
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2391 Location: Yateley, Hants, UK
|
Posted: Tue May 20, 2008 11:22 pm Post subject: |
|
|
I have a feeling that they were more than VAX-only extensions, and existed prior to the VAX. You can also give the statement number of a format statement if you wish.
E |
|
Back to top |
|
|
j clark
Joined: 29 Mar 2008 Posts: 20 Location: Bala Cynwyd (Pennsylvania)
|
Posted: Thu May 22, 2008 7:45 pm Post subject: ENCODE and DECODE trivia |
|
|
Actually, ENCODE and DECODE go back much farther than VAX/VMS.
Before there was even a Digital Equipment Corp. The oldest implementation I am aware of was as library routines on the IBM 1620. That would be circa 1960, but it may be even older. |
|
Back to top |
|
|
|