comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Fortran External Calls
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Fortran [message #14940 is a reply to message #13846] Mon, 12 April 1999 00:00 Go to previous messageGo to previous message
mallors is currently offline  mallors
Messages: 76
Registered: November 1997
Member
Yes, Paul is correct, I should have been more
specific. It's terminal input that seems to
cause problems.

I also assumed the original poster did not
want to edit the FORTRAN, as was my case.


Regards,

-bob



In article <3711EC13.7EF73D55@sandia.gov>,
>
> I have been using an IDL / Fortran interface for over 10 years and had
> no problem with file I/O.
> I agree that using terminal I/O is to be avoided. If you have a big
> Fortran library for file I/O, use it with no problems. For terminal
> input, I have no suggestions other than returning to IDL. For terminal
> output the IDL routine IDL_Message can be easily linked to your
> Fortran. A sample program which has
> been used with Sun, HP, SGI, DEC, MAC and WIN is below.
>
> Paul Mix, lpmix@sandia.gov
>
> *deck idl_write
> subroutine idl_write(INPUT, FLAG)
> cDEC$ ALIAS IDL_Message, '_IDL_Message'
> cDEC$ ATTRIBUTES C :: IDL_Message
> c
> c This routine writes a string to an IDL display
> c
> c If flag is zero, no leading characters will be printed.
> c If flag is not zero, then the value of the IDL system variable
> c !MSG_PREFIX will be printed. (Default value = '% ')
> c
> CHARACTER *(*) INPUT
> CHARACTER *1 CHAR
> INTEGER FLAG
> INTEGER I, LEN, DONE
> INTEGER MAXLEN
> PARAMETER (MAXLEN=512)
> CHARACTER*(MAXLEN) TEMP
> C Some Fortran compilers require external definitions for IDL routines
>
> EXTERNAL IDL_Message !$pragma C(IDL_Message)
> C check the length and set the last character to a char(0)
> I = LEN(INPUT)
> DONE = 0
> DO WHILE (I .GT. 0 .AND. DONE .EQ. 0)
> IF (ICHAR(INPUT(I:I)) .GE. 33 .AND.
> & ICHAR(INPUT(I:I)) .LE. 126) THEN
> DONE = 1
> ELSE
> I = I-1
> ENDIF
> ENDDO
>
> IF (I .GT. 0) THEN
> IF (I .GE. MAXLEN) I = MAXLEN-1
> TEMP = INPUT(1:I)//CHAR(0)
> ELSE
> TEMP = ' '//CHAR(0)
> ENDIF
> IF (FLAG .EQ. 0) THEN
> CALL IDL_Message(%VAL(-1), %VAL(262144), %REF(TEMP))
> ELSE
> CALL IDL_Message(%VAL(-1), %VAL(0), %REF(TEMP))
> ENDIF
> c ************************************************************ **********
>
> RETURN
> END
>
>

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
Robert S. Mallozzi 256-544-0887
Mail Code ES 84
Work: http://www.batse.msfc.nasa.gov/ Marshall Space Flight Center
Play: http://cspar.uah.edu/~mallozzir/ Huntsville, AL 35812
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: 24-bit color with writable color maps
Next Topic: Re: arrays within structures

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Dec 03 14:13:58 PST 2025

Total time taken to generate the page: 0.32350 seconds