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

Home » Public Forums » archive » Re: How to send a CHARACTER to a C/C++/FORTRAN function via CALL_EXTERNAL?
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: How to send a CHARACTER to a C/C++/FORTRAN function via CALL_EXTERNAL? [message #83241] Thu, 14 February 2013 01:25 Go to previous message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Thursday, February 14, 2013 6:08:24 AM UTC+1, Bogdanovist wrote:
> On Thursday, 14 February 2013 05:44:34 UTC+11, Brian J. Daniel wrote:
>
>> A character is one byte. You could try the byte data type defined with the appropriate ASCII value.
>
>>
>
>>
>
>>
>
>> On Tuesday, February 12, 2013 8:36:16 PM UTC-5, Bogdanovist wrote:
>
>>
>
>>> I'm having trouble getting a CALL_EXTERNAL call to work. I think the issue is the requirement to send a CHARACTER*1. To be specific, I'm trying to call dgels from LAPACK, see here
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> http://www.netlib.org/lapack/explore-html/d7/d3b/group__doub le_g_esolve.html#ga225c8efde208eaf246882df48e590eac
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> I know from previous experience that you have to be careful to get all arguments to CALL_EXTERNAL exactly right, making IDL INTs into LONGs, making sure to get single/double precision etc correct. However this one I can't seem to crack. It doesn't surprise me that the IDL STRING is not equivalent to CHARACTER, but how can I send this correctly?
>
>
>
> Thanks! I've tried using:
>
>
>
> trans='N'
>
> c_trans=BYTE(N[0])
>
>
>
> but my IDL session still dies when I send this to the routine. There may be other problems with the other arguments though. Do you know if BYTE() will assign the correct ASCII Byte code or do I need to look that up and assign it directly (numerically)?


Fortran arguments are passed by reference, try an IDL byte array: BYTE('N').

regards,
Lajos
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Confusing and suspicious PROFILER output
Next Topic: Excluding Decimal Places in the Values of a Variable

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

Current Time: Wed Oct 08 18:56:39 PDT 2025

Total time taken to generate the page: 0.00348 seconds