Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: Basic conditional statement question.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg48697] Re: Basic conditional statement question.
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Thu, 10 Jun 2004 02:44:54 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 6/9/04 at 4:17 AM, jujio77 at yahoo.com (Scott) wrote:

>Here is a question I would think has a simple solution.  Let's say
>I have some variable "a" which is an integer, but I haven't defined
>it in Mathematica.  I want to run a conditional statement on it.
>Basically

>If[a!=0,Print["such and such"]]

If "a" hasn't been defined then Head[a]==Symbol ought to evaluate as True

>When I do something like this, Mathematica I asume is spitting out
>a null statement, because it doesn't do anything.  So, how can I
>define "a" such that Mathematica knows it isn't =0 yet, still some
>integer.

Now you seem to be asking a different question. If "a" is known to be an integer it must have an assigned value. Or do you mean you *intend* for "a" to be assigned integer values at some later time? If this is the case, there is no test in Mathematica that can determine your *intention* to assign some value later to "a".
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: transforming exponential of sums into product of exponentials
  • Next by Date: Re: transforming exponential of sums into product of exponentials
  • Previous by thread: Re: Basic conditional statement question.
  • Next by thread: Re: Basic conditional statement question.