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

Home » Public Forums » archive » Referencing structure inline
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: Referencing structure inline [message #89836 is a reply to message #89834] Tue, 09 December 2014 02:55 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Tuesday, December 9, 2014 9:42:57 AM UTC+1, Heinz Stege wrote:
> Seems to be a bug in your IDL version. The following works in IDL 8.0:
>
> IDL> help,file_info(!dir)
> ** Structure FILE_INFO, 21 tags, length=64, data length=63:
> NAME STRING 'C:\idl\idl80'
> EXISTS BYTE 1
> READ BYTE 1
> WRITE BYTE 1
> EXECUTE BYTE 1
> REGULAR BYTE 0
> DIRECTORY BYTE 1
> BLOCK_SPECIAL BYTE 0
> CHARACTER_SPECIAL
> BYTE 0
> NAMED_PIPE BYTE 0
> SETUID BYTE 0
> SETGID BYTE 0
> SOCKET BYTE 0
> STICKY_BIT BYTE 0
> SYMLINK BYTE 0
> DANGLING_SYMLINK
> BYTE 0
> MODE LONG 511
> ATIME LONG64 1418112222
> CTIME LONG64 1299161262
> MTIME LONG64 1349551389
> SIZE LONG64 0
> IDL> print,(file_info(!dir)).name
> C:\idl\idl80
> IDL> print,(file_info(!dir)).ctime
> 1299161262
> IDL> print,!version
> { x86 Win32 Windows Microsoft Windows 8.0.1 Oct 5 2010 32
> 64}


Hi,
If this is a bug then it's still out there. Implied print seems to be the problem:

IDL> ({x:1,y:2}).x
% Object reference type required in this context: <STRUCT Array[1]>.
% Execution halted at: $MAIN$
IDL> print, ({x:1,y:2}).x
1
IDL> !version
{
"ARCH": "x86_64",
"OS": "Win32",
"OS_FAMILY": "Windows",
"OS_NAME": "MicrosoftWindows",
"RELEASE": "8.4",
"BUILD_DATE": "Sep272014",
"MEMORY_BITS": 64,
"FILE_OFFSET_BITS": 64
}

In other words, such indexing does not work with implied print.

I also tried this with a function:

function testPrintFunction
return, {x:1,y:2}
end

IDL> (testPrintFunction()).x
% Object reference type required in this context: <STRUCT Array[1]>.
% Execution halted at: $MAIN$
IDL> print, (testPrintFunction()).x
1

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Type conversion error: Unable to convert given STRING to Long.
Next Topic: loop for XML

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

Current Time: Wed Oct 08 19:28:15 PDT 2025

Total time taken to generate the page: 0.00212 seconds