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

Home » Public Forums » archive » the type parser
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
the type parser [message #44075] Sun, 15 May 2005 02:27 Go to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Dear all

I am searching for the function which tells idl what kind of type a variable
gets by it's assignment. e.g.


IDL> a=1
IDL> help,a
A INT = 1

IDL> a=50000
IDL> help,a
A LONG = 50000

IDL> a=1.
IDL> help,a
A FLOAT = 1.00000

Any ideas otherwise I will write such a parser. To duplicate one is always
bad.

cheers
Reimar

--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
Re: the type parser [message #44471 is a reply to message #44075] Thu, 16 June 2005 06:04 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
m_schellens@hotmail.com wrote:
> Thats a different issue:
> In an *expression*, IDL always converts the lower to the higher type in
> this order:
> STRING<BYTE<(INT|UINT)<(LONG|ULONG)<(LONG64|ULONG64)<FLOAT <DOUBLE<COMPLEX<COMPLEXDBL
> before evaluation.
> Before we were taking about reading a string and determining the type
> (for storing it appropriately).
> Note that for proper conversion one of the types has to have the proper
> type beforehand:
> IDL> print,'1.23' gt '2e-10'
> 0
> IDL> print,1.23 gt 2e-10
> 1
> but:
> IDL> print,1 gt '2e-10'
> 0
>
> Cheers,
> marc
>


You are right,

I missed this test.

cheers

Reimar

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
Re: the type parser [message #44480 is a reply to message #44075] Wed, 15 June 2005 12:01 Go to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
Thats a different issue:
In an *expression*, IDL always converts the lower to the higher type in
this order:
STRING<BYTE<(INT|UINT)<(LONG|ULONG)<(LONG64|ULONG64)<FLOAT <DOUBLE<COMPLEX<COMPLEXDBL
before evaluation.
Before we were taking about reading a string and determining the type
(for storing it appropriately).
Note that for proper conversion one of the types has to have the proper
type beforehand:
IDL> print,'1.23' gt '2e-10'
0
IDL> print,1.23 gt 2e-10
1
but:
IDL> print,1 gt '2e-10'
0

Cheers,
marc
Re: the type parser [message #44481 is a reply to message #44075] Wed, 15 June 2005 11:53 Go to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
Addendum:
PLOT implictely converts everything to DOUBLE.
Thats why strings work here fine.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Input from 10 button Joy Stick
Next Topic: Re: IDL error message

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

Current Time: Wed Oct 08 13:36:47 PDT 2025

Total time taken to generate the page: 0.00719 seconds