MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Simple question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg59293] Re: Simple question
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 5 Aug 2005 01:21:22 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <dcschl$q3c$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

something like:

p = Which[
  S === "Hi", 1,
  P === "Bye", 2,
  C === "Ooops", 3,
  True, "Panic"
]

??

Regards
  Jens

"Tun Myint Aung" <tma at nus.edu.sg> schrieb im 
Newsbeitrag news:dcschl$q3c$1 at smc.vnet.net...
|
| Dear Mathgroup,
|
|    My question may be simple but I don't know 
how to do. I have an
| input which can be three strings or characters 
(i.e. S or C or F ). I
| would like to use interactive input by using
|
|    For example:
|
|        p = Input["please type the conditions"]
|
| Then I would like to assign p to the three 
expressions depending on the
| input
|
| For example
|
| If  p is S then, p = p1 (p1 may be long 
expression)
| If p is C then, p= p2.. and so on.
|
| If the input is other than those three 
conditions, the I would like give
| a message and redo the loop.
|
| Thank!
|
|
| Best Regards,
|
| Tun Myint Aung
| Graduate Student
| National University of Singapore
| E1A #02-18
| E-mail g0202015 at nus.edu.sg 
<mailto:g0202015 at nus.edu.sg>
|
| 



  • Prev by Date: Re: New Style Sheet
  • Next by Date: Re: Expression transformation
  • Previous by thread: Re: Simple question
  • Next by thread: Re: Simple question