Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,790| Members 17,820, Newest waheguruhelpme| Online 226
Home Contact
 (Forgotten?): 
    Sikhism

   
                                                                     Your Banner Here!    

Sikh Philosophy Network » Sikh Philosophy Network » Current Affairs » Information Technology » Make instant of a Class persistent for whole session.

Make instant of a Class persistent for whole session.

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 400 USD, Received: 35 USD (9%)
Please Donate...
Related Topics...
Thread Thread Starter Forum Replies Last Post
India To make class 10 boards Exam optional kds1980 World 0 01-Sep-2009 01:09 AM
How can i verify my e-mail address in Instant Messaging? Lee Information Technology 1 19-Nov-2005 22:00 PM
Communicator Instant Message Linda Information Technology 1 18-Nov-2005 13:59 PM
Study Confirms Effectiveness of Drug for Persistent Asthma SPN Reporter Interfaith Dialogues 0 23-Mar-2005 03:30 AM
Instant messenger could control hacked computers Arvind Interfaith Dialogues 0 14-Oct-2004 02:28 AM


Tags
class, instant, make, persistent, session, whole
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #10 (permalink)  
Old 28-Jul-2006, 08:41 AM
sime's Avatar sime
Guest
 
Posts: n/a
   
   
Re: Make instant of a Class persistent for whole session.

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
That is in a normal module I am guessing. Won't "TheClass" die once the
code finishes executing?


Smartin wrote:

> > I thought I was doing something similar at work, but I will check the
> > code tomorrow to be sure and clarify or withdraw my proposition. Thanks
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/13794-make-instant-class-persistent-whole-session.html
> > for the heads-up.
> >

>
> My error, the declaration I am using is actually
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13794
>
> Option Compare Database
> Option Explicit
>
> Public TheClass As New MyClass
> --------------------------------------
>
> Works great. The class is accessible to other modules and forms.
>
> --
> Smartin





 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #11 (permalink)  
Old 28-Jul-2006, 08:41 AM
Smartin's Avatar Smartin
Guest
 
Posts: n/a
   
   
Re: Make instant of a Class persistent for whole session.

sime wrote:
> That is in a normal module I am guessing. Won't "TheClass" die once the
> code finishes executing?
>
>
> Smartin wrote:
>
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13794
>>> I thought I was doing something similar at work, but I will check the
>>> code tomorrow to be sure and clarify or withdraw my proposition. Thanks
>>> for the heads-up.
>>>

>> My error, the declaration I am using is actually
>>
>> Option Compare Database
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13794
>> Option Explicit
>>
>> Public TheClass As New MyClass
>> --------------------------------------
>>
>> Works great. The class is accessible to other modules and forms.
>>
>> --
>> Smartin

>


Yes, the declaration is in a normal module. Without meaning to be
argumentative, explain when should object TheClass die? The module does
not "close". It merely exists, and no code is fired to instantiate the
object. In better days I could probably have given a better explanation.
I hope this makes sense.

I will look into this a little further to be sure, but AFAICT the
instantiation of the class persists as long as the application is open.

Kind Regards,
--
Smartin
Reply With Quote
  #12 (permalink)  
Old 28-Jul-2006, 08:42 AM
Smartin's Avatar Smartin
Guest
 
Posts: n/a
   
   
Re: Make instant of a Class persistent for whole session.

Smartin wrote:
> sime wrote:
>> That is in a normal module I am guessing. Won't "TheClass" die once the
>> code finishes executing?
>>
>>
>> Smartin wrote:
>>
>>>> I thought I was doing something similar at work, but I will check the
>>>> code tomorrow to be sure and clarify or withdraw my proposition. Thanks
>>>> for the heads-up.
>>>>
>>> My error, the declaration I am using is actually
>>>
>>> Option Compare Database
>>> Option Explicit
>>>
>>> Public TheClass As New MyClass
>>> --------------------------------------
>>>
>>> Works great. The class is accessible to other modules and forms.
>>>
>>> --
>>> Smartin

>>

>
> Yes, the declaration is in a normal module. Without meaning to be
> argumentative, explain when should object TheClass die? The module does
> not "close". It merely exists, and no code is fired to instantiate the
> object. In better days I could probably have given a better explanation.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13794
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13794
> I hope this makes sense.
>
> I will look into this a little further to be sure, but AFAICT the
> instantiation of the class persists as long as the application is open.
>
> Kind Regards,


Just to follow up and (hopefully) clarify, a publicly declared object is
accessible to the application for the life of the application. Unless,
of course, you set the object to Nothing.

Think of a publicly declared variable. It doesn't go away even though
the code asking for it is in another class/form/module.

Getting off topic somewhat, I would be interested to hear comments on
the virtues and pitfalls of using a class vs. a collection of variables
and functions in a module.

Personally, when I have a group of processes I want to apply to a
"thing" I like to create a class for it. I can swiftly reuse the code if
I need to use the "thing" in another application -- I simply drop in its
class module.

In the long run I find it is much easier to have the thing's methods and
properties on hand by typing a dot, rather than try to recall what Subs
and Functions are available. Plus, if I want to have multiple "things"
at the same time, a class makes this a snap.

For instance one "thing" I've been reusing quite a bit lately is
basically a text container I use to build up email messages in Access.
VBA and A97 do not provide a very robust collection of text manipulation
features, so I built functionality into the class like search and
replace, a tabulation mechanism for aligning columns of data, append,
automatic insertion of CrLf, etc. This reduces the amount of code I have
to write later -- and cleans up the code considerably.

HTH
--
Smartin
Reply With Quote
  #13 (permalink)  
Old 28-Jul-2006, 08:42 AM
sime's Avatar sime
Guest
 
Posts: n/a
   
   
Re: Make instant of a Class persistent for whole session.

  Donate Today!  
OOP is quite cool of course. Encapsulation and modulation.

Regarding Global/Public variables, I found I was losing the values I'd
assigned. The reason for these are better described by others (see
link). Maybe you could comment on the difference in your approach.
http://groups.google.com.au/groups?a...=2006&safe=off
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13794

..s


Smartin wrote:
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13794

> >
> > Yes, the declaration is in a normal module. Without meaning to be
> > argumentative, explain when should object TheClass die? The module does
> > not "close". It merely exists, and no code is fired to instantiate the
> > object. In better days I could probably have given a better explanation.
> > I hope this makes sense.
> >
> > I will look into this a little further to be sure, but AFAICT the
> > instantiation of the class persists as long as the application is open.
> >
> > Kind Regards,

>
> Just to follow up and (hopefully) clarify, a publicly declared object is
> accessible to the application for the life of the application. Unless,
> of course, you set the object to Nothing.
>
> Think of a publicly declared variable. It doesn't go away even though
> the code asking for it is in another class/form/module.
>
> Getting off topic somewhat, I would be interested to hear comments on
> the virtues and pitfalls of using a class vs. a collection of variables
> and functions in a module.
>
> Personally, when I have a group of processes I want to apply to a
> "thing" I like to create a class for it. I can swiftly reuse the code if
> I need to use the "thing" in another application -- I simply drop in its
> class module.
>
> In the long run I find it is much easier to have the thing's methods and
> properties on hand by typing a dot, rather than try to recall what Subs
> and Functions are available. Plus, if I want to have multiple "things"
> at the same time, a class makes this a snap.
>
> For instance one "thing" I've been reusing quite a bit lately is
> basically a text container I use to build up email messages in Access.
> VBA and A97 do not provide a very robust collection of text manipulation
> features, so I built functionality into the class like search and
> replace, a tabulation mechanism for aligning columns of data, append,
> automatic insertion of CrLf, etc. This reduces the amount of code I have
> to write later -- and cleans up the code considerably.
>
> HTH
> --
> Smartin


Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism Who is "Mohan"?
Today 08:46 AM
22 Replies, 335 Views
sikhism How important is Matha...
Today 08:12 AM
59 Replies, 1,038 Views
sikhism need urgent advice.......
Today 06:46 AM
6 Replies, 81 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 53 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 116 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,837 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 229 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,277 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 44 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 66 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 47 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 49 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 414 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 51 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,258 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 09:43 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.34942 seconds with 30 queries