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

Home » Public Forums » archive » REPEAT BEGIN turns into & END... why?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
REPEAT BEGIN turns into & END... why? [message #12529] Fri, 21 August 1998 00:00 Go to next message
clovis21 is currently offline  clovis21
Messages: 4
Registered: February 1998
Junior Member
Hello,

I'm trying to write an interactive version of the procedure in David
Fannning's book that makes an iso-surface of a head (p. 125)

Anyway...

The compiler insist on reading my REPEAT BEGIN statement as an & END
statement.

Why?

the script is attached. I know it won't work yet, as the value returned from
the histogram isn't the right one, but that's a minor problem at the moment)

Chris





window, 1, xsize=400, ysize=400

head=loaddata(8)
s=size(head)
xs=s(1)-1
ys=s(2)-1
zs=s(3)-1
topcolor=!d.n_colors-1

histwindow=!d.window

Plot, Histogram(head), Max_Value=5000

window, 2, xsize=400, ysize=400
Empty

headwindow=!d.window

Shade_Volume, head, 50, vertices, polygons, /Low
Scale3, XRange=[0,xs], YRange=[0,ys], ZRange=[0,zs]
isosurface = PolyShade(vertices, polygons, /T3D)
LoadCT, 0, NColors=topColor+1
TV, isosurface

!Mouse.Button = 0

; get to right window

wset, histwindow

;create pixmap window and enter it

window, 3, /pixmap, xsize=400, ysize=400
tv, bytscl(histogram(head), top=topcolor-1)

pixwindow=!d.window

; return to the histogram

wset, histwindow

; Get initial cursor location. Draw cross-hair.

Cursor, col, row, /Device, /Down
PlotS, [col,col], [0,400], /Device, Color=topColor
print, col

; Loop.

REPEAT BEGIN

; Get new cursor location.

Cursor, colnew, rownew, /change, /Device

IF !mouse.button eq 1 then BEGIN

; Erase old cross-hair.

device, copy=[0,0,400,400,0,0,pixwindow]

; Draw new cross-hair.
print, col

col = colnew
row = rownew

ENDIF

IF !mouse.button eq 2 then BEGIN

; update head

;temporarily disabled
;wset, headwindow
;
;
;Shade_Volume, head, col, vertices, polygons, /Low
;isosurface = PolyShade(vertices, polygons, /T3D)
;TV, isosurface
;
;
;wset, histwindow

ENDIF

REP UNTIL !Mouse.Button eq 4

;Erase the final cross-hair.

wset, histwindow
device, copy=[0,0,400,400,0,0,pixwindow]

END

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
Re: REPEAT BEGIN turns into & END... why? [message #12617 is a reply to message #12529] Mon, 24 August 1998 00:00 Go to previous message
davidf7203 is currently offline  davidf7203
Messages: 12
Registered: August 1998
Junior Member
Joe Zawodny writes:

>> I'm trying to write an interactive version of the procedure in David
>> Fannning's book that makes an iso-surface of a head (p. 125)
>>
>> Anyway...
>>
>> The compiler insist on reading my REPEAT BEGIN statement as an & END
>> statement.
>>
>> Why?

The purpose of a REPEAT statement is to perform the loop test
at the END of the loop, instead of at the beginning. Thus,
the correct syntax is:

REPEAT statement UNTIL test

For a multiple-statement REPEAT the syntax will look like this:

REPEAT BEGIN
Statement1
Statement2
ENDREP UNTIL test

Cheers,

David

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
Re: REPEAT BEGIN turns into & END... why? [message #12625 is a reply to message #12529] Fri, 21 August 1998 00:00 Go to previous message
Joe[2] is currently offline  Joe[2]
Messages: 11
Registered: May 1998
Junior Member
> Hello,
>
> I'm trying to write an interactive version of the procedure in David
> Fannning's book that makes an iso-surface of a head (p. 125)
>
> Anyway...
>
> The compiler insist on reading my REPEAT BEGIN statement as an & END
> statement.
>
> Why?
>
> the script is attached. I know it won't work yet, as the value returned
from
> the histogram isn't the right one, but that's a minor problem at the
moment)
>
> Chris

> REP UNTIL !Mouse.Button eq 4


Should this not be

ENDREP UNTIL .... ?


Joe Zawodny
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Porting IDL
Next Topic: Colors Common Block?

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

Current Time: Fri Oct 10 02:41:23 PDT 2025

Total time taken to generate the page: 0.71954 seconds