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

Home » Public Forums » archive » Re: template for READ_ASCII
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: template for READ_ASCII [message #25478 is a reply to message #25477] Sun, 24 June 2001 19:23 Go to previous message
m.hadfield is currently offline  m.hadfield
Messages: 36
Registered: April 2001
Member
From: "Bob Fugate" <rqfugate@mindspring.com>

> My question is, can I save the template somehow so I don't have to
> regenerate it with ASCII_TEMPLATE each time I restart IDL and want to
read
> new tables? I realize I only have to run ASCII_TEMPLATE once each session
> but I would like to make this completely automatic and so I don't have to
> manually go through the GUI each day. It is not a really big deal but I am
> getting greedy.

The template is an IDL structure. You can save it to disk with SAVE and
restore it with RESTORE.

Here's how I would do it:

function read_myfile, file
common myblock, template
if n_elements(template) eq 0 then begin
template_file = <specify your template file name here>
case file_test(template_file, /READ) of
0: begin
template = ascii_template(file)
save, FILENAME=template_file
end
1: restore, FILENAME=template_file
endif
return, read_ascii(file, TEMPLATE=template)
end

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research



--
Posted from clam.niwa.cri.nz [202.36.29.1]
via Mailgate.ORG Server - http://www.Mailgate.ORG
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Disappearing IDL panel with XFree86 Version 4.
Next Topic: contour boundaries

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

Current Time: Fri Oct 10 06:01:38 PDT 2025

Total time taken to generate the page: 0.80080 seconds