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

Home » Public Forums » archive » Re: Correct format of "included" files (using "at" sign)
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: Correct format of "included" files (using "at" sign) [message #1848 is a reply to message #1847] Tue, 01 March 1994 17:26 Go to previous messageGo to previous message
paul is currently offline  paul
Messages: 22
Registered: June 1991
Junior Member
In article <Mar1.191234.31054@acs.ucalgary.ca>, steele@wesson.phys.ucalgary.ca (Dave Steele) writes:
|> I'm trying to use the "at" sign (the $%^&*! 'xrn' editor won't let
|> me type it!) to substitute some code into IDL. The procedure is
|> tersely described on p. 2-7 of the User's Guide for v3.1. I'm
|> getting a problem that I think has to do with the format of the
|> code I'm including. It is an IF_THEN_ELSE block with no header
|> line (like PRO ... or FUNCTION ...) and no trailer lines (like
|> RETURN, END, EXIT). If I run the routine that invokes the code
|> substitution, I get syntax errors in the first lines following the
|> invocation. If I add a line saying 'END' to the substituted code,
|> I get dropped back to the IDL> prompt at the end of the substituted
|> code.

...text deleted

The IDL interpreter treats input from a file using the at sign command just
as if the contents of the file were typed in at the prompt. This results in
different behavior than if the file were compiled with the .run command. In
particular multi-line compound statements that contain BEGIN and END statements
are not recognized unless you tell the interpreter that a given command line
is not complete. Here is how to do it...


j=0
k=0
for i=0,10 do begin &$
if i le 2 then begin &$
j=j+1 &$
k=k+2 &$
endif else begin &$
j=j-1 &$
k=k-2 &$
endelse &$
print,i,j,k &$
endfor

If you leave out the &$ the interpreter gets confused because each line of
input is not an independently excutable statement.

____________________________________________________________ _______________
Paul Ricchiazzi Internet: paul@esrg.ucsb.edu
Earth Space Research Group, UCSB
____________________________________________________________ _______________
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: What's happening at support@pvi.com
Next Topic: rotate y axis values

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

Current Time: Wed Oct 08 19:20:27 PDT 2025

Total time taken to generate the page: 0.00397 seconds