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

Home » Public Forums » archive » procedure in case statement
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: procedure in case statement [message #82142 is a reply to message #82049] Mon, 19 November 2012 07:42 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Here's what I am assuming:
1) you have a separate file called "proc_one.pro" (all lower case) that
contains the "proc_one" procedure.
2) you have a separate file called "proc_two.pro" (all lower case) that
contains the "proc_two" procedure.

Based on that, why can't you just do:

read,rot,prompt='rot via proc one or two? (1 or 2)'
case rot of
1: proc_one,a,b,c
2: proc_two,d,e,f
endcase

Note I use an integer selector rather than typing out the actual name of
the procedure required (after a couple of tests, all that typing would
drive me nuts).

Once you get this working, then you might want to start to get fancier
using CALL_PROCEDURE, or EXECUTE, or similar.

cheers,

paulv



On 11/19/12 09:06, hannah_ue@web.de wrote:
> Am Montag, 19. November 2012 14:36:19 UTC+1 schrieb hann...@web.de:
>> hi there,
>>
>> i'm relatively new to IDL programming. is there any way to run a
>> PROcedure in a CASE statement? i want to ask myself via READ which
>> PROcedure i want to use.
>>
>> thanks for your help!
>>
>> ich
>
> hm... i get the same error. what i have is: 2 procedures i wrote
> whichwork. instead of using two different files for each procedure, i want
> one file where i can choose the one procedure i like. lets call them
> proc_one,a,b,c and proc_two,d,e,f. i tried it like the following:
>
> read,rot,prompt='rot via proc one or two? (proc_one,proc_two)'
> case rot of
> 'proc_one': call_procedure,proc_one,a,b,c
> 'proc_two': call_procedure,porch_two,d,e,f
> endcase
>
> maybe this is not very clever but i have no idea how to do it in another way
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Can't get out of define mode in ncdf, not specific to variable.
Next Topic: Can't get out of define mode in ncdf, not specific to variable.

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

Current Time: Sun Oct 12 04:35:38 PDT 2025

Total time taken to generate the page: 0.16310 seconds