[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Frederique Soulard wrote in message
>We are trying to use the CALL_EXTERNAL function in order to get strings
>a C routine. The variables are defined as IDL_STRING and have to be
>modifyable into the C routine. Our C routine reads strings from a binary
>file into C string variables. Then we are trying to copy the C strings into
>the IDL_STRING pointers (copy byte after byte). We encounter problems while
>doing this (memory overlaping probably). Does someone has any advice to
>in order to solve our problems (no question to re-develop the reading in
>routine) ? Is a ByteArr method a solution ?

Yes, I always use byte arrays for this.  In IDL dimension your byte arrays
so that the dimension
which is the string length is greater than it will ever need to be in the C
code.  Have the C code
fill in the byte array with trailing NULLs.  On return to IDL convert to a
string or string array using the string() function.

Mark Rivers