error with struct expression [message #89304] |
Fri, 15 August 2014 00:52  |
g.nacarts
Messages: 148 Registered: November 2013
|
Senior Member |
|
|
Hi
I have a function and I return the following as a structure.
RETURN, {A:A, $
B:B, $
C:C}
When I want to return just one RETURN, {A:A} I got the following error ''Struct expression not allowed in this context: <STRUCT Array[1]>.''
Does anyone came across with something like this before?
With thanks
|
|
|
Re: error with struct expression [message #89305 is a reply to message #89304] |
Fri, 15 August 2014 06:31  |
Mats Löfdahl
Messages: 263 Registered: January 2012
|
Senior Member |
|
|
Can you show us a minimal example that gives that error message?
Because this appears to work:
stru.pro:
----
function test, X
A = X
RETURN, {A:A}
end
help, test(15)
end
----
IDL> .rn stru
% Compiled module: TEST.
% Compiled module: $MAIN$.
** Structure <cf57b8>, 1 tags, length=2, data length=2, refs=1:
A INT 15
|
|
|