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

Home » Public Forums » archive » Re: IDL input files.
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: IDL input files. [message #54528 is a reply to message #54527] Mon, 18 June 2007 11:40 Go to previous messageGo to previous message
ryanselk is currently offline  ryanselk
Messages: 16
Registered: May 2007
Junior Member
On Jun 18, 12:35 pm, ryans...@gmail.com wrote:
> On Jun 18, 11:38 am, David Fanning <n...@dfanning.com> wrote:
>
>
>
>> ryans...@gmail.com writes:
>>> ive been reading some manuals and books for IDL but im not sure how to
>>> solve this likely simple problem.
>
>> Oh, dear. Which books have you been reading!?
>
>> You need to explain your problem a little bit better
>> for us. You code doesn't work for many reasons, but
>> one big reason is that you are trying to read from
>> a file you opened for writing. And I can't tell from
>> your example, what it is you are trying to do.
>
>> Do you wish to *create* a file (OPENW and PRINTF), or
>> do you wish to *read* from a file (OPENR and READF)?
>
>> Or, do you wish to ask the user a question (maybe you
>> needhttp://www.dfanning.com/widget_tips/popup.html)
>> and then write the answers in a file?
>
>> I'm very confused by your question. Do you think you
>> could clarify for us?
>
>> Cheers,
>
>> David
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> Whoops, its just reading from a file, I messed with it earlier and
> forgot to change it back, It should be:
>
> PRO inputer
> print, 'starting input'
>
> getfile = DIALOG_PICKFILE (/READ)
>
> print, getfile
>
> OPENR, 1, getfile
> POINT_LUN, 1, 0
>
> IDL_Name = ' ' ; want extendable length if possible.
>
> READU, 1, IDL_Name
>
> print, IDL_Name
>
> POINT_LUN, 1, 0
> CLOSE, 1
>
> END
>
> Ideally,
> This idl file just reads whatever file is selected and stores the name
> variable to IDL_Name .
> But what I want to do is 'search' the file opened for certain words,
> when it finds them I want to be able to store that value to an IDL
> variable.
> Im going to need to declare more variables then IDL_Name, but im
> unsure how to do it.
>
> ie: if the user selects this file:
>
> Name = {Joe}
> Department = {CS}
> Age = {25}
>
> I want in IDL to have those 3 variables stored ie:
>
> IDL_Name = Joe
> IDL_DEPARTMENT = CS
> IDL_AGE = 25
>
> But, if the file reads:
>
> Age = {30}
> Department = {Science}
>
> I would want IDL to return;
>
> IDL_DEPARTMENT = Science
> IDL_Age = 30
>
> I think i need to use some sort of 'search file' command. I hope this
> is clearer, sorry for being unclear before.
>
> Thank you! and David your website has been of help to me frequently in
> the past.

Crap, again, i messed it up. It should be a readf not a readu.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: how get data from iSurface
Next Topic: Re: FSC_color and loadct clashing

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

Current Time: Sat Oct 11 01:49:50 PDT 2025

Total time taken to generate the page: 1.12086 seconds