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

Home » Public Forums » archive » Re: AVALANCHE.PRO .... games in IDL FTW
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: AVALANCHE.PRO .... games in IDL FTW [message #69091 is a reply to message #69062] Mon, 21 December 2009 14:42 Go to previous message
munka is currently offline  munka
Messages: 36
Registered: December 2009
Member
On Dec 15, 7:46 am, David Fanning <n...@dfanning.com> wrote:
> Reimar Bauer writes:
>> you should kill that chapter where you explain "goto"
>
> You know, it's kinda like when you are trying to get
> your teenagers to pick up a book now and then. You
> can't be too fussy about what gets them excited.
> It's the passion that pushes them along.
>
> I predict we will see more programs by this young
> man with fewer GoTos, and maybe even some instructions,
> soon. :-)
>
> 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.")

Well then whats the best way to kill the program when you get hit? I
use the 'goto, theend' line of code in almost all of my programs


My classmate sent me this. He added the option to remove stars, which
is good, but he used a goto loops instead of a while loop.....



choice2=0
print,'Enter 1 to remove data points or 2 to skip:'
read,choice2
if choice2 eq 1 then goto,datarm
if choice2 eq 2 then goto,plot
if choice2 ne 1 && choice2 ne 2 then goto,theend

datarm:
removestars,dataR,dataV,dataB,6 ;LAST NUMBER IS raduis SIZE

choice3=0
print,'Enter 1 to remove more points or 2 to plot:'
read,choice3
if choice3 eq 1 then goto,datarm
if choice3 eq 2 then goto,plot
if choice3 ne 1 && choice3 ne 2 then goto,theend

plot:
plot,dataR


-------------------
And so i fixed it and sent it back...

ans = 'str'
print, "Remove Stars? y/n (default is n)"
read, ans
while ans eq 'y' do begin
device, decomposed=0
removestars,dataR,dataV,dataB,6 ;LAST NUMBER IS raduis SIZE
print , "Remove Stars? y/n (deafult is n)"
read , ans
endwhile





see? I'm not that bad... Also, is there a better way to make the
program bomb (in case of some error) without making it 'go to' the
end?

~Bill
PS. I actually didn't read the chapter on goto.
PPS. https://tigerbytes2.lsu.edu:443/users/wfreem2/web/test5.pro if
you already haven't... just mouse over the colored circles and avoid
the neutrinos.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: all membars comming here an super girls stils
Next Topic: line generalization

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

Current Time: Wed Oct 08 18:03:57 PDT 2025

Total time taken to generate the page: 0.00523 seconds