AnsweredAssumed Answered

vrf FW: Create multiple objects of same "Vee Class"

Question asked by losikv on Apr 8, 2004


-----Original Message-----
From: Losik, Vlad
Sent: Thursday, April 08, 2004 3:57 PM
To: 'SPANGENBERG,SASCHA (A-Scotland,ex1)'
Subject: RE: [vrf] Create multiple objects of same "Vee Class"

Hello Sascha!
As I am sure you now VEE is not OOP language. As such there is no way to
make real classes with it. You will have to emulate classes using user
functions. How you do it depends on GUI . If you need to see two or more
panels from the same "class" simultaneously than you have no choice but put
your code for a class in user functions and then load this library under
different names as many times as number of objects you need. It is memory
inefficient but as far as I know the only way to display multiple panels of
the same class. If you do not need to display them simultaneously then
simply create private variable in your library to hold class data. Make it
an array. Now every time you instantiate an object from this class add
another element to array. All functions in the library need an array index
as one of parameters. In short you end up with single library of functions (
methods of the class) and multiple data items ( properties ) each
representing single object .
Hope this helps

Regards Vlad

-----Original Message-----
From: SPANGENBERG,SASCHA (A-Scotland,ex1)
[mailto:sascha_spangenberg@agilent.com]
Sent: Thursday, April 08, 2004 12:30 PM
To: VRF
Subject: [vrf] Create multiple objects of same "Vee Class"

Hello -

I would like to encapsulate some functionality in a "Vee Class" and
create
multiple objects in my vee program that are based on this class.

Basic Example:
I want several "smart" panels that contain a display of some sorts which

is driven by the output of a formula that does some computation based on

an input value. E.g. lets say all displays should show A^2 instead of
the
smart panels input value A.

The key thing is that if I need to change e.g. the looks of the panels
then
I would like to only have to do it in one place and all panels within
the program
should get updated automatically.


Now this problem is similar to one that was emailed a while back and to
which
Rob Marquardt replied with the "Alarmogram" in June last year (see
attachement).

However, I am looking for a more efficient way to do this and hope for
some suggestions.

Alarmogram does a neat trick with dynamically creating several replica
of a function
by means of library imports but maybe there is a better solution to
achieve the same since
this program seems a bit crude(?) (no offense Rob, it's still a neat
trick!

Problems:
    a) it takes time to create those imported functions (especially due
to
       the harddisk access) and
    b) I have to manually edit (understand;-) vee _code_ if I want to
change the template.

Ultimately I would like to create lots of different "classes" in my vee
programs
so the Alarmogram solution is not really going to work very well of at
least it
is very difficult to maintain.

Is it not possible to create the equivalent of a class object in vee?

Kind regards    ,
    Sascha.



---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes