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

Home » Public Forums » archive » Changing variable type
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: Changing variable type [message #93277 is a reply to message #93233] Sat, 28 May 2016 19:03 Go to previous messageGo to previous message
andrewcool777 is currently offline  andrewcool777
Messages: 27
Registered: November 2012
Junior Member
On Tuesday, 17 May 2016 01:49:20 UTC+9:30, Mats Löfdahl wrote:
> Den måndag 16 maj 2016 kl. 17:36:18 UTC+2 skrev alx:
>> Le lundi 16 mai 2016 12:43:54 UTC+2, Mats Löfdahl a écrit :
>>> Is there a way in IDL to change the type of an array, specifically a 16-bit integer into a 16 bit unsigned integer?
>>>
>>> No, I do not mean b = uint(a). This makes a new array and keeps the values. I want to change the variable type of the existing array (from 2 to 12), so the bit values are interpreted differently. Is this possible?
>>>
>>> /Mats
>>
>> Would not a = uint(a,0,Size(a, /DIM)) do what you want ("the bit values are interpreted differently") ?
>> alx.
>
> Right, I was confused there. But the main thing was not having to create a new variable.

IDL> b=2
IDL> a=temporary(b)
IDL> help,a
A INT = 2
IDL> help,b
B UNDEFINED = <Undefined>

Andrew


a=temporary(b)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: HDF-Browser
Next Topic: PDE

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

Current Time: Wed Oct 08 20:04:20 PDT 2025

Total time taken to generate the page: 0.01226 seconds