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

Home » Public Forums » archive » Re: Binary (0s and 1s) output
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: Binary (0s and 1s) output [message #41794 is a reply to message #41792] Tue, 07 December 2004 08:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
josegomez@gmx.net writes:

> I'm very new to IDL, and I'm trying to convert 5 integers into a series
> of 40 logical (0/1) values. I have done this in fortran in the past
> using an internal write, and then converting each element in the output
> string into a 0 or 1. Given my limited knowledge of IDL, I tried to use
> print with a format specifier, as follows:
> IDL> print,format='(2B8.8)',0,255
> % Unexpected text in format.
> "(2B8.8)"
> ^
> % Execution halted at: $MAIN$
>
> According to my notes, the B format is there and can be used (this is
> IDL 6.0).
>
> The other problem is how to convert the (potentially!) resulting test
> string into an array of integers.

Well, this is new to me, but it seems to work here
on IDL 6.1.1 in Windows:

IDL> print,format='(2B8.8)',0,255
0000000011111111

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: query dicom
Next Topic: combinatory analysis with restrictions

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

Current Time: Tue Dec 02 05:52:11 PST 2025

Total time taken to generate the page: 1.19930 seconds