In VB speak, a variable is either something or it is nothing. The only
way to have a variable is to declare it. Thus, a variable that is
declared, but doesn't have a value is nothing.

Matt Liotta
President & CEO
Montara Software, Inc.
http://www.montarasoftware.com/
888-408-0900 x901

> -----Original Message-----
> From: Shawn Grover [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 09, 2002 2:27 PM
> To: CF-Talk
> Subject: RE: VB
> 
> I haven't seen the "if x is nothing" method used for native variable
types
> -
> only for class objects.  Does this work right?
> 
> As for trying to see if a variable has a value after it's been
declared,
> that's the purpose of the IsEmpty function IIRC.
> 
> HTH
> 
> Shawn Grover
> 
> -----Original Message-----
> From: Matt Liotta [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 09, 2002 3:18 PM
> To: CF-Talk
> Subject: RE: VB
> 
> 
> Alright, a couple of things to note...
> 
> First, Dim is for declaring variables, but if you don't specify a type
> then the variable is declared as a variant. Thus, instead of...
> 
>       Dim x
>       x = ""
> 
> You should use...
> 
>       Dim x as String
>       x = ""
> 
> Next, to check to see if a variable is null you would use the
> following...
> 
>       If x Is Nothing Then
>               ...
>       End If
> 
> So, I think the code you are looking for is...
> 
>       If x Is Nothing Then
>               X = ""
>       End If
> 
> Matt Liotta
> President & CEO
> Montara Software, Inc.
> http://www.montarasoftware.com/
> 888-408-0900 x901
> 
> > -----Original Message-----
> > From: Scott Mulholland [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, September 09, 2002 2:04 PM
> > To: CF-Talk
> > Subject: RE: VB
> >
> > But foo is only "" if it does not already exist.  Benoit was correct
> in
> > his understanding of what I am looking for.
> >
> > -----Original Message-----
> > From: Tony Carcieri [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, September 09, 2002 3:56 PM
> > To: CF-Talk
> > Subject: RE: VB
> >
> >
> > Hmm, maybe I am having a brainfart.
> >
> > If I do:
> > <cfparam name="foo" default="">
> >
> > doesn't that set the value to "" ? If so, then doing what I
suggested
> in
> > VB should work the same. Again, my brain ain't working today.
> >
> > HTH,
> > T
> >
> > -----Original Message-----
> > From: Benoit Martin [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, September 09, 2002 4:48 PM
> > To: CF-Talk
> > Subject: RE: VB
> >
> >
> > Unfortunately I don't know the answer but I don't think that what
you
> > proposed would work. This will initialize the var to "" no matter
> what.
> > In my understanding Scott is looking for code that would declare the
> var
> > only if it's not already defined
> >
> > Ben
> >
> > -----Original Message-----
> > From: Tony Carcieri [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, September 09, 2002 10:24 AM
> > To: CF-Talk
> > Subject: RE: VB
> >
> >
> > Dim only declares the var..
> >
> > Try this:
> > Dim x
> > x = ""
> >
> >
> > -----Original Message-----
> > From: Robert Everland [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, September 09, 2002 4:17 PM
> > To: CF-Talk
> > Subject: RE: VB
> >
> >
> > Isn't it DIM
> >
> > Robert Everland III
> > Web Developer Extraordinaire
> > Dixon Ticonderoga Company
> > http://www.dixonusa.com
> >
> > -----Original Message-----
> > From: Scott Mulholland [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, September 09, 2002 4:15 PM
> > To: CF-Talk
> > Subject: OT: VB
> >
> >
> > Anyone know if there is an equivalent of what cfparam in VB.
> > I need to set a default for a variable in case it does not exist.
> >
> > Thanks,
> > Scott
> >
> >
> >
> >
> >
> >
> >
> 
> 
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to