Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Releasing Variables

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Releasing Variables
DS <bootybox[ at ]optonline.net> 03.09.2006 13:52:28
I know noe that release a String Variable without closing a form the
synax is:
strA = ""
But how dou you clear the other types variables?
Like Date, Long, Integer etc...
Thanks
DS
Re: Releasing Variables
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 03.09.2006 13:57:04
What do you mean by "release"?

Numeric fields can only take numeric values. If you declare a variable as
numeric and don't assign it a value, by default its value will be 0. Is that
what you want?

Date fields are actually numeric fields under the covers, so they get set to
0 by default as well (which corresponds to midnight on 30 Dec, 1899)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"DS" <bootybox[ at ]optonline.net> wrote in message
news:u6BKg.300$pN.292[ at ]newsfe12.lga...
[Quoted Text]
>I know noe that release a String Variable without closing a form the synax
>is:
> strA = ""
> But how dou you clear the other types variables?
> Like Date, Long, Integer etc...
> Thanks
> DS


Re: Releasing Variables
"Rick Brandt" <rickbrandt2[ at ]hotmail.com> 03.09.2006 14:02:37
DS wrote:
[Quoted Text]
> I know noe that release a String Variable without closing a form the
> synax is:
> strA = ""
> But how dou you clear the other types variables?
> Like Date, Long, Integer etc...
> Thanks
> DS

You cannot release any variable other than a variant. It might seem like
setting a text variable to "" is releasing it, but you are just setting it to
its default value. All variables other than variants contain the default value
for their type the moment they are dimmed. These are...

String ""
Date #12/30/1899 00:00:00#
All Numeric 0

So, if your definition of "releasing" a variable is to reset it to its default
value then the above are what you would set them to.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


Re: Releasing Variables
DS <bootybox[ at ]optonline.net> 03.09.2006 17:02:36
Douglas J. Steele wrote:

[Quoted Text]
> What do you mean by "release"?
>
> Numeric fields can only take numeric values. If you declare a variable as
> numeric and don't assign it a value, by default its value will be 0. Is that
> what you want?
>
> Date fields are actually numeric fields under the covers, so they get set to
> 0 by default as well (which corresponds to midnight on 30 Dec, 1899)
>
Ok...I mean to clear out, make empty, null or zero. Bring it back to
it's original state before you sent a value to it.
Thanks
DS
Re: Releasing Variables
DS <bootybox[ at ]optonline.net> 03.09.2006 17:03:33
Rick Brandt wrote:

[Quoted Text]
> DS wrote:
>
>>I know noe that release a String Variable without closing a form the
>>synax is:
>>strA = ""
>>But how dou you clear the other types variables?
>>Like Date, Long, Integer etc...
>>Thanks
>>DS
>
>
> You cannot release any variable other than a variant. It might seem like
> setting a text variable to "" is releasing it, but you are just setting it to
> its default value. All variables other than variants contain the default value
> for their type the moment they are dimmed. These are...
>
> String ""
> Date #12/30/1899 00:00:00#
> All Numeric 0
>
> So, if your definition of "releasing" a variable is to reset it to its default
> value then the above are what you would set them to.
>
Excellent, Just what I needed.
thanks
DS
Re: Releasing Variables
"Terry Kreft" <terry.kreft[ at ]mps.co.uk> 04.09.2006 13:57:33
If you want to set a date variable back to it's default value you can just
let it be 0.

Why anyone would bother though is beyond me, unless they're improperly using
global vars of course.


--

Terry Kreft


"Rick Brandt" <rickbrandt2[ at ]hotmail.com> wrote in message
news:1gBKg.23513$gY6.17062[ at ]newssvr11.news.prodigy.com...
[Quoted Text]
> DS wrote:
> > I know noe that release a String Variable without closing a form the
> > synax is:
> > strA = ""
> > But how dou you clear the other types variables?
> > Like Date, Long, Integer etc...
> > Thanks
> > DS
>
> You cannot release any variable other than a variant. It might seem like
> setting a text variable to "" is releasing it, but you are just setting it
to
> its default value. All variables other than variants contain the default
value
> for their type the moment they are dimmed. These are...
>
> String ""
> Date #12/30/1899 00:00:00#
> All Numeric 0
>
> So, if your definition of "releasing" a variable is to reset it to its
default
> value then the above are what you would set them to.
>
> --
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt at Hunter dot com
>
>


Re: Releasing Variables
"Terry Kreft" <terry.kreft[ at ]mps.co.uk> 04.09.2006 13:57:43
There is no technical need to do this, the only variables you need to
release are those which are acting as a pointer to an object.

--

Terry Kreft


"DS" <bootybox[ at ]optonline.net> wrote in message
news:u6BKg.300$pN.292[ at ]newsfe12.lga...
[Quoted Text]
> I know noe that release a String Variable without closing a form the
> synax is:
> strA = ""
> But how dou you clear the other types variables?
> Like Date, Long, Integer etc...
> Thanks
> DS


Re: Releasing Variables
"Nick 'The database Guy'" <nick.mcmillen[ at ]eads.com> 04.09.2006 16:09:54
There is no need to release variables unless they are object variables,
in which case you would use the syntax:

Set ObjectVariable = Nothing

Good Luck

Nick

DS wrote:
[Quoted Text]
> I know noe that release a String Variable without closing a form the
> synax is:
> strA = ""
> But how dou you clear the other types variables?
> Like Date, Long, Integer etc...
> Thanks
> DS

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net