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 #83242 is a reply to message #83241] Wed, 13 February 2013 21:08 Go to previous messageGo to previous message
Matt Francis is currently offline  Matt Francis
Messages: 94
Registered: May 2010
Member
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)?
[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: Sun Oct 12 02:26:11 PDT 2025

Total time taken to generate the page: 0.64041 seconds