Discussion:
A little problem defining a variable
Jean-Luc Arnaud
2017-06-20 09:44:05 UTC
Permalink
Hi all,

I'm facing a little problem when defining a variable.

My project has two ContainerControls, each of them representing
graphically two objects very equivalent but not totally identical.

In my code, I have to define a variable representing only one of these
objects, but I don't know, when defining it, what object.

Here is my problem: How to define a variable I don't know the type
(Object1 or Object2), based on class ContainerControl?

I tried to define it as ContainerControl, but can't assign it later the
type Object1 or Object2.

I tried to define it as Object1, but can't redefine it as Object2 is needed.

I'm sure the solution is obvious, but can't figure it out.

TIA for your help.
--
Jean-Luc Arnaud




To unsubscribe click: <http://email.lists.xojo.com/u/eJwVyzsOAiEQANDTLB1k-A8FhUfBGYjoQgxhPb9avuJxNsgaRc8Ygi-JkiTQLFssIAGjl9hSSTbpUAkPB8TjOncflXtRbYlHjsgJ0ZFBxxWMD_c_PRYL6GMlsfJ82vfvjlP2qWZZr_6patYtdj7M7QuCvCX9>
François Van Lerberghe
2017-06-20 09:54:00 UTC
Permalink
Hello Jena-Luc,

I see 2 ways :
1) you can cast the ContainerControl object :

dim obj1 As Object1
dim obj2 As Object2

if myContainerControlObject isa Object1 then
obj1 = Object1(myContainerControlObject)
elseif myContainerControlObject isa Object1 then
obj2 = Object2(myContainerControlObject)
end if

2) you can use ClassInterface and play with method defined in this ClassInterface

Have a good day.

François Van Lerberghe
Thier Monty, 15 A
4570 Marchin (Belgium)
+32 (0) 85 25 08 25
Post by Jean-Luc Arnaud
Hi all,
I'm facing a little problem when defining a variable.
My project has two ContainerControls, each of them representing graphically two objects very equivalent but not totally identical.
In my code, I have to define a variable representing only one of these objects, but I don't know, when defining it, what object.
Here is my problem: How to define a variable I don't know the type (Object1 or Object2), based on class ContainerControl?
I tried to define it as ContainerControl, but can't assign it later the type Object1 or Object2.
I tried to define it as Object1, but can't redefine it as Object2 is needed.
I'm sure the solution is obvious, but can't figure it out.
TIA for your help.
--
Jean-Luc Arnaud
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNzMsNwyAMANBpwo2IhAL2gUNHMf4kSKGVUNr52zfAk7qDbOB6hZwTIaPnsIm3QsEHKMmDIWHELSvD8ggs43Pdfah0Wm26s0LKYClJs8ayQyqMUYNGKJytIblZbX7pdelsOo9T_8sxqF8rv4e767I_fx57KG8>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNy0EOwiAQAMDXlBtkF1jAA4cC7T9IoYoWNE3j-3XuU7x0BR1r3tpEesHAk4nE9c1pHmJEvqwzprAGUmQnDfee2yG2d2cPr-2uALBWMPtGriIYp4omLJBRgWSnH0_1-a9-8DbEyOerfasY9WKXn-T8AwwuIm0>
Jean-Luc Arnaud
2017-06-20 10:21:02 UTC
Permalink
Thanks for these ideas, François. I will test that.

Have a good day, too. Very hot currently around Paris.

Jean-Luc Arnaud
Post by François Van Lerberghe
Hello Jena-Luc,
dim obj1 As Object1
dim obj2 As Object2
if myContainerControlObject isa Object1 then
obj1 = Object1(myContainerControlObject)
elseif myContainerControlObject isa Object1 then
obj2 = Object2(myContainerControlObject)
end if
2) you can use ClassInterface and play with method defined in this ClassInterface
Have a good day.
François Van Lerberghe
Thier Monty, 15 A
4570 Marchin (Belgium)
+32 (0) 85 25 08 25
Post by Jean-Luc Arnaud
Hi all,
I'm facing a little problem when defining a variable.
My project has two ContainerControls, each of them representing graphically two objects very equivalent but not totally identical.
In my code, I have to define a variable representing only one of these objects, but I don't know, when defining it, what object.
Here is my problem: How to define a variable I don't know the type (Object1 or Object2), based on class ContainerControl?
I tried to define it as ContainerControl, but can't assign it later the type Object1 or Object2.
I tried to define it as Object1, but can't redefine it as Object2 is needed.
I'm sure the solution is obvious, but can't figure it out.
TIA for your help.
--
Jean-Luc Arnaud
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNzMsNwyAMANBpwo2IhAL2gUNHMf4kSKGVUNr52zfAk7qDbOB6hZwTIaPnsIm3QsEHKMmDIWHELSvD8ggs43Pdfah0Wm26s0LKYClJs8ayQyqMUYNGKJytIblZbX7pdelsOo9T_8sxqF8rv4e767I_fx57KG8>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNy0sOgyAUAMDTyA7D7_FZsBDQexAetDRgE6P3b2c_6IVFbkn3xiRQOw806QhUOatoiJHT_dh4CkcACWZR7DVzH2v5TvL2rRZ01lndmlRFVIboGAADLqSWIMnlPzWfdDzlPwvOZ9x9Vux5bRe5_SK2H3oCI9w>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNy0ESAxEQAMDXrBtlB4ODQ55iDBXJUill8_6k780JAp9B9ORcqxgbSoQGMkNkCTp6ySVQJUeRfDysLjzua_dRuWfVlngmH0GfxgTMaAMTkMYGxhfiYp0pXqw0X-bzv-OSfaqZ17t_q5p1i50OePwAvtEmxw>
emile.a.schwarz
2017-06-20 09:54:29 UTC
Permalink
Variant ?

 

 

 

 
Message du 20/06/17 11:44
De : "Jean-Luc Arnaud"
A : "Nug"
Objet : A little problem defining a variable
Hi all,
I'm facing a little problem when defining a variable.
My project has two ContainerControls, each of them representing
graphically two objects very equivalent but not totally identical.
In my code, I have to define a variable representing only one of these
objects, but I don't know, when defining it, what object.
Here is my problem: How to define a variable I don't know the type
(Object1 or Object2), based on class ContainerControl?
I tried to define it as ContainerControl, but can't assign it later the
type Object1 or Object2.
I tried to define it as Object1, but can't redefine it as Object2 is needed.
I'm sure the solution is obvious, but can't figure it out.
TIA for your help.
--
Jean-Luc Arnaud
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNy0sOwiAQANDTlJ2E-cDAgoVbEw8xgRKxlZimKdfXt381Y6wQTc-IjllIwHoEtsBJkkcOCV20D730qX23c86F3Zx9NNhQzCtTcb40qp5YuAKrNkhRYyghCVUxRx5v-v7XZ7_1YYceW79WO9bTnHnB-w_3qiTq>
Jean-Luc Arnaud
2017-06-20 10:22:28 UTC
Permalink
Yes, maybe!

I'm not used to using Variant, will test that.

Thanks, Emile.

Friendly

Jean-Luc Arnaud
Post by emile.a.schwarz
Variant ?
Message du 20/06/17 11:44
Objet : A little problem defining a variable
Hi all,
I'm facing a little problem when defining a variable.
My project has two ContainerControls, each of them representing
graphically two objects very equivalent but not totally identical.
In my code, I have to define a variable representing only one of
these
objects, but I don't know, when defining it, what object.
Here is my problem: How to define a variable I don't know the type
(Object1 or Object2), based on class ContainerControl?
I tried to define it as ContainerControl, but can't assign it
later the
type Object1 or Object2.
I tried to define it as Object1, but can't redefine it as
Object2 is needed.
I'm sure the solution is obvious, but can't figure it out.
TIA for your help.
--
Jean-Luc Arnaud
<http://email.lists.xojo.com/u/eJwVzEsKwyAQANDTxJ0y_seFix5ldJQIsQGbEujp274DPM4GWaMYGUPwlGqSFTTLHgkkYPQSe6Jkkw6t4uag8nwf15iNB6m-xJ5LjMU4srExgDOeEH0LFqj44HV3YuU2x9EUqVfdb1qfX3PTk_g8_8OVN_P4Aj1mKAI>
unsubscribe
<http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThK3INiaGgaFrpR7CfKLSJhmipFy_ffuriULFYHoiAmZxgtYTskWOEj3xHAmCfehXn9pXO8aYGMbo-4IfEvNKXnIkzMQoAEUyh-AIctXmxc2ezZHeTffbepX_LHW71rNvrXa1y2HONNH9ByuyJWQ>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThA3EL2AGhh7F2KDSBlQh0vO3b3-cLbAB0XOw0SCcKBsSSPDGS0dcZNTe-hpYI4fDa-JxX7uPyh1VW-KZYyrF6tDOxpyaJ6CEyWoiB6VAYLHyfLnP_45L9qkmrnf_VjXrFjsf9vED1sgneA>
Jon Ogden
2017-06-20 11:51:09 UTC
Permalink
I had a situation where I had to do this myself and what I did was I created a master subclass for my two objects that had all the “common” items. I then created two subclasses of that custom subclass and put what was different in those.

Now you can treat them as a common subclass of type MySubclassObject for example. But then in your code you can check which you are dealing with using IsA. So your property is of type MySubclassObject but each on is say MySubclassObject1 and MySubclassObject2.

Then you do:

If MyProperty IsA MySubclassObject1 Then

// Do this

Else

// Do something else

End If

Now you can also use class methods and events to help define the master property/variable as well.


Hope this helps.

Jon
Post by Jean-Luc Arnaud
Hi all,
I'm facing a little problem when defining a variable.
My project has two ContainerControls, each of them representing graphically two objects very equivalent but not totally identical.
In my code, I have to define a variable representing only one of these objects, but I don't know, when defining it, what object.
Here is my problem: How to define a variable I don't know the type (Object1 or Object2), based on class ContainerControl?
I tried to define it as ContainerControl, but can't assign it later the type Object1 or Object2.
I tried to define it as Object1, but can't redefine it as Object2 is needed.
I'm sure the solution is obvious, but can't figure it out.
TIA for your help.
--
Jean-Luc Arnaud
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThI3I_M3A0KMYG7dUpZGi5P7t2580j-LQzIY5J6pcLYMTq4XAApZkUSvVUF0ejFsElnV_rrmGTNr1NK8WRXVw0MDYY_ddYVQfsXAK5AN4c7b38ZTx_e9FvPOxzNU2__gBkrEkHw>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwVy0EOwiAQAMDXlBtkyy4LHDgUqf9AwIi2aJrG9xvnPjVoV2cnevAQbYocZXR2lZQgyZjISr4SrhcwmhaYCPZcVHnv4hG4ZfYeda6Ub4zsAI2lAu4OgHMz4gjjiZ__2WQfauTj1b9NjXaKM0x6-QGySiGL>
Rucker, Michael
2017-06-20 12:40:03 UTC
Permalink
Something is wrong with these emails. I have one here where it looks like I
can unsubscribe myself and the person who the email was sent to. Also, not
sure why they started coming out individually when they used to be a daily
digest.

Weird.




*Michael Rucker*

*IT Manager*
Secure Care Products, LLC

39 Chenell Drive

Concord, NH 03301

Phone: 800-451-7917 x 3005

Cell: 603-568-4972
*INTERNET E-MAIL CONFIDENTIALITY CLAUSE*

The information contained in this transmission (including any attached
files) is CONFIDENTIAL and is intended only for the person(s) named above.
No WARRANTIES or assurances are made to the safety and content of this
e-mail and any attachments. No LIABILITY is accepted for any consequences
arising from it. If you received this transmission in error, please delete
it from your system and notify us immediately. If you are not an intended
recipient, please note that any use or dissemination of the information
contained in this transmission (including any attached files) and the
copying, printing, or retransmission of that information is strictly
prohibited. You can notify us by return email, by phone at 800-451-7917 or
by fax at 603-227-0200. Thank you.
Post by Jon Ogden
I had a situation where I had to do this myself and what I did was I
created a master subclass for my two objects that had all the “common”
items. I then created two subclasses of that custom subclass and put what
was different in those.
Now you can treat them as a common subclass of type MySubclassObject for
example. But then in your code you can check which you are dealing with
using IsA. So your property is of type MySubclassObject but each on is say
MySubclassObject1 and MySubclassObject2.
If MyProperty IsA MySubclassObject1 Then
// Do this
Else
// Do something else
End If
Now you can also use class methods and events to help define the master
property/variable as well.
Hope this helps.
Jon
Post by Jean-Luc Arnaud
Hi all,
I'm facing a little problem when defining a variable.
My project has two ContainerControls, each of them representing
graphically two objects very equivalent but not totally identical.
Post by Jean-Luc Arnaud
In my code, I have to define a variable representing only one of these
objects, but I don't know, when defining it, what object.
Post by Jean-Luc Arnaud
Here is my problem: How to define a variable I don't know the type
(Object1 or Object2), based on class ContainerControl?
Post by Jean-Luc Arnaud
I tried to define it as ContainerControl, but can't assign it later the
type Object1 or Object2.
Post by Jean-Luc Arnaud
I tried to define it as Object1, but can't redefine it as Object2 is
needed.
Post by Jean-Luc Arnaud
I'm sure the solution is obvious, but can't figure it out.
TIA for your help.
--
Jean-Luc Arnaud
To unsubscribe click: <http://email.lists.xojo.com/
u/eJwNyzsOwyAMANDThI3I_M3A0KMYG7dUpZGi5P7t2580j-
LQzIY5J6pcLYMTq4XAApZkUSvVUF0ejFsElnV_rrmGTNr1NK8WRXVw0MDYY_
ddYVQfsXAK5AN4c7b38ZTx_e9FvPOxzNU2__gBkrEkHw>
To unsubscribe click: <http://email.lists.xojo.com/u/
eJwdyzEOwyAMAMDXhI3KEINh8BBC-g9iiNoBVSLt_xN1Pekq21BNUG-
OkCgnn3QKtGnMkHXKSNo_cd5WcBYXmBB6kYd8unpx3UGMmw8h58mUw_
qGt1HdJUawQQ3uMu5yNvmNJmW0__zyZJcLVNohMg>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwdy7sOgjAYQOGnoZuk_QulHTpUTDQ6aB0cWEwFAhUohBJEnt7LGb7tFBJ4QTiyMlVqJcfX3Vd77TOY3rc1oDvfXMaBXX2P0_OWieywpELPJ2j0UlOmgwh3xrZh9TfvO1RLzOIHFWCSPDY8AiD4GykLLgyjLAE0Svekw29tN9aFzoyNncvQlROaZADqA1GILTE>
Jon Ogden
2017-06-20 12:43:18 UTC
Permalink
1.) Xojo moved to a new list server software.

2.) It appears that the digest mode does not exist any longer or maybe needs to be reset.

3.) You don’t get a copy of the emails you send yourself (NOT GOOD).

4.) I see your point about unsubscribing - this is NOT good as well.

Xojo really wants to get rid of the mailing lists and get everyone on the forums

Something is wrong with these emails. I have one here where it looks like I can unsubscribe myself and the person who the email was sent to. Also, not sure why they started coming out individually when they used to be a daily digest.
Weird.
Michael Rucker
IT Manager
Secure Care Products, LLC
39 Chenell Drive
Concord, NH 03301
Phone: 800-451-7917 x 3005
Cell: 603-568-4972
INTERNET E-MAIL CONFIDENTIALITY CLAUSE
The information contained in this transmission (including any attached files) is CONFIDENTIAL and is intended only for the person(s) named above. No WARRANTIES or assurances are made to the safety and content of this e-mail and any attachments. No LIABILITY is accepted for any consequences arising from it. If you received this transmission in error, please delete it from your system and notify us immediately. If you are not an intended recipient, please note that any use or dissemination of the information contained in this transmission (including any attached files) and the copying, printing, or retransmission of that information is strictly prohibited. You can notify us by return email, by phone at 800-451-7917 or by fax at 603-227-0200. Thank you.
I had a situation where I had to do this myself and what I did was I created a master subclass for my two objects that had all the “common” items. I then created two subclasses of that custom subclass and put what was different in those.
Now you can treat them as a common subclass of type MySubclassObject for example. But then in your code you can check which you are dealing with using IsA. So your property is of type MySubclassObject but each on is say MySubclassObject1 and MySubclassObject2.
If MyProperty IsA MySubclassObject1 Then
// Do this
Else
// Do something else
End If
Now you can also use class methods and events to help define the master property/variable as well.
Hope this helps.
Jon
Post by Jean-Luc Arnaud
Hi all,
I'm facing a little problem when defining a variable.
My project has two ContainerControls, each of them representing graphically two objects very equivalent but not totally identical.
In my code, I have to define a variable representing only one of these objects, but I don't know, when defining it, what object.
Here is my problem: How to define a variable I don't know the type (Object1 or Object2), based on class ContainerControl?
I tried to define it as ContainerControl, but can't assign it later the type Object1 or Object2.
I tried to define it as Object1, but can't redefine it as Object2 is needed.
I'm sure the solution is obvious, but can't figure it out.
TIA for your help.
--
Jean-Luc Arnaud
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThI3I_M3A0KMYG7dUpZGi5P7t2580j-LQzIY5J6pcLYMTq4XAApZkUSvVUF0ejFsElnV_rrmGTNr1NK8WRXVw0MDYY_ddYVQfsXAK5AN4c7b38ZTx_e9FvPOxzNU2__gBkrEkHw <http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThI3I_M3A0KMYG7dUpZGi5P7t2580j-LQzIY5J6pcLYMTq4XAApZkUSvVUF0ejFsElnV_rrmGTNr1NK8WRXVw0MDYY_ddYVQfsXAK5AN4c7b38ZTx_e9FvPOxzNU2__gBkrEkHw>>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwdyzEOwyAMAMDXhI3KEINh8BBC-g9iiNoBVSLt_xN1Pekq21BNUG-OkCgnn3QKtGnMkHXKSNo_cd5WcBYXmBB6kYd8unpx3UGMmw8h58mUw_qGt1HdJUawQQ3uMu5yNvmNJmW0__zyZJcLVNohMg <http://email.lists.xojo.com/u/eJwdyzEOwyAMAMDXhI3KEINh8BBC-g9iiNoBVSLt_xN1Pekq21BNUG-OkCgnn3QKtGnMkHXKSNo_cd5WcBYXmBB6kYd8unpx3UGMmw8h58mUw_qGt1HdJUawQQ3uMu5yNvmNJmW0__zyZJcLVNohMg>>
unsubscribe <http://email.lists.xojo.com/u/eJwdyzEOwiAUANDTwGgoVKQDA2Ki0UFxcOhi8IO01oopjdae3oTlbc9JKlwhcCu1UnOx_15T2JpU0_F3mRHbpO40vPk5RaKPa17Vu0lX5nOgnZkaxg0qSW_b5yJkIfa4kf7OvaAAhFkuiKWC-dvSAhMrD9byEg_yEYPzr5whr1Eiqv4xhCvm>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwVy0sOwiAQANDTlB0EZviMCxZA4z3ogBG1aJrG8xvf_rUI1AyJEdGYFApeJYYM0sKaZLbgJNkQMq6ulKwXq_fKit-7uEfPnnv1zlWtb9TJtHZh8GRo2xigiSPOB37-5yXHVLMez_HtavZTnHGB9APJpyJT>
Jean-Luc Arnaud
2017-06-20 16:09:41 UTC
Permalink
Post by Jon Ogden
3.) You don’t get a copy of the emails you send yourself (NOT GOOD).
You should have written : VERY BAD !

Jean-Luc Arnaud
Post by Jon Ogden
1.) Xojo moved to a new list server software.
2.) It appears that the digest mode does not exist any longer or maybe needs to be reset.
3.) You don’t get a copy of the emails you send yourself (NOT GOOD).
4.) I see your point about unsubscribing - this is NOT good as well.
Xojo really wants to get rid of the mailing lists and get everyone on the forums

Post by Rucker, Michael
Something is wrong with these emails. I have one here where it looks
like I can unsubscribe myself and the person who the email was sent
to. Also, not sure why they started coming out individually when they
used to be a daily digest.
Weird.
*Michael Rucker*
*IT Manager*
Secure Care Products, LLC
39 Chenell Drive
Concord, NH 03301
Phone: 800-451-7917 x 3005
Cell: 603-568-4972
*_INTERNET E-MAIL CONFIDENTIALITY CLAUSE_*
The information contained in this transmission (including any
attached files) is CONFIDENTIAL and is intended only for the
person(s) named above. No WARRANTIES or assurances are made to the
safety and content of this e-mail and any attachments. No LIABILITY
is accepted for any consequences arising from it. If you received
this transmission in error, please delete it from your system and
notify us immediately. If you are not an intended recipient, please
note that any use or dissemination of the information contained in
this transmission (including any attached files) and the copying,
printing, or retransmission of that information is strictly
prohibited. You can notify us by return email, by phone at
800-451-7917 or by fax at 603-227-0200. Thank you.
I had a situation where I had to do this myself and what I did
was I created a master subclass for my two objects that had all
the “common” items. I then created two subclasses of that custom
subclass and put what was different in those.
Now you can treat them as a common subclass of type
MySubclassObject for example. But then in your code you can
check which you are dealing with using IsA. So your property is
of type MySubclassObject but each on is say MySubclassObject1 and
MySubclassObject2.
If MyProperty IsA MySubclassObject1 Then
// Do this
Else
// Do something else
End If
Now you can also use class methods and events to help define the
master property/variable as well.
Hope this helps.
Jon
On Jun 20, 2017, at 4:44 AM, Jean-Luc Arnaud
Hi all,
I'm facing a little problem when defining a variable.
My project has two ContainerControls, each of them representing
graphically two objects very equivalent but not totally identical.
In my code, I have to define a variable representing only one
of these objects, but I don't know, when defining it, what object.
Here is my problem: How to define a variable I don't know the
type (Object1 or Object2), based on class ContainerControl?
I tried to define it as ContainerControl, but can't assign it
later the type Object1 or Object2.
I tried to define it as Object1, but can't redefine it as
Object2 is needed.
I'm sure the solution is obvious, but can't figure it out.
TIA for your help.
--
Jean-Luc Arnaud
<http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThI3I_M3A0KMYG7dUpZGi5P7t2580j-LQzIY5J6pcLYMTq4XAApZkUSvVUF0ejFsElnV_rrmGTNr1NK8WRXVw0MDYY_ddYVQfsXAK5AN4c7b38ZTx_e9FvPOxzNU2__gBkrEkHw
<http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThI3I_M3A0KMYG7dUpZGi5P7t2580j-LQzIY5J6pcLYMTq4XAApZkUSvVUF0ejFsElnV_rrmGTNr1NK8WRXVw0MDYY_ddYVQfsXAK5AN4c7b38ZTx_e9FvPOxzNU2__gBkrEkHw>>
<http://email.lists.xojo.com/u/eJwdyzEOwyAMAMDXhI3KEINh8BBC-g9iiNoBVSLt_xN1Pekq21BNUG-OkCgnn3QKtGnMkHXKSNo_cd5WcBYXmBB6kYd8unpx3UGMmw8h58mUw_qGt1HdJUawQQ3uMu5yNvmNJmW0__zyZJcLVNohMg
<http://email.lists.xojo.com/u/eJwdyzEOwyAMAMDXhI3KEINh8BBC-g9iiNoBVSLt_xN1Pekq21BNUG-OkCgnn3QKtGnMkHXKSNo_cd5WcBYXmBB6kYd8unpx3UGMmw8h58mUw_qGt1HdJUawQQ3uMu5yNvmNJmW0__zyZJcLVNohMg>>
unsubscribe
<http://email.lists.xojo.com/u/eJwdyzEOwiAUANDTwGgoVKQDA2Ki0UFxcOhi8IO01oopjdae3oTlbc9JKlwhcCu1UnOx_15T2JpU0_F3mRHbpO40vPk5RaKPa17Vu0lX5nOgnZkaxg0qSW_b5yJkIfa4kf7OvaAAhFkuiKWC-dvSAhMrD9byEg_yEYPzr5whr1Eiqv4xhCvm>
unsubscribe
<http://email.lists.xojo.com/u/eJwNyzEOwyAMAMDXhI0I24DpwACJ-g9kQKUKrRQl_29vvxoxVAhqRAJIvNFTE2fUFveks0Wng2XOtLtty2axZhZZ5TvVK0pHZPCeHt5j6Ui9BTTAgZ1pAUSd8d3KRx-3_J_UeR_XmK2OsvZTXXHB9APjKCJX>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNzMENwyAMAMBpwg8EGCf0waOjgG1U2oAqRDp_M8AdJx_ZRdVSFaADeNehgNWEyJp39joQVueIAT1twRL361ytC7ds6lSvVEAcBATMGO8By8NhLjHwYUWqsJppvOF7237qNszI89N-YoYstdLmn3_koCdn>
Jean-Luc Arnaud
2017-06-20 16:01:31 UTC
Permalink
Thanks for replying, Jon.

I tried that but had some issues. Probably something I did wrong. Well,
will try again.

I think my mistake was to create the SuperClass AFTER creating the
SubClass. I guess I have to do that in the natural way, that is
SuperClass BEFORE SubClass.

Thanks a lot.

Jean-Luc Arnaud
Post by Jon Ogden
I had a situation where I had to do this myself and what I did was I created a master subclass for my two objects that had all the “common” items. I then created two subclasses of that custom subclass and put what was different in those.
Now you can treat them as a common subclass of type MySubclassObject for example. But then in your code you can check which you are dealing with using IsA. So your property is of type MySubclassObject but each on is say MySubclassObject1 and MySubclassObject2.
If MyProperty IsA MySubclassObject1 Then
// Do this
Else
// Do something else
End If
Now you can also use class methods and events to help define the master property/variable as well.
Hope this helps.
Jon
Post by Jean-Luc Arnaud
Hi all,
I'm facing a little problem when defining a variable.
My project has two ContainerControls, each of them representing graphically two objects very equivalent but not totally identical.
In my code, I have to define a variable representing only one of these objects, but I don't know, when defining it, what object.
Here is my problem: How to define a variable I don't know the type (Object1 or Object2), based on class ContainerControl?
I tried to define it as ContainerControl, but can't assign it later the type Object1 or Object2.
I tried to define it as Object1, but can't redefine it as Object2 is needed.
I'm sure the solution is obvious, but can't figure it out.
TIA for your help.
--
Jean-Luc Arnaud
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThI3I_M3A0KMYG7dUpZGi5P7t2580j-LQzIY5J6pcLYMTq4XAApZkUSvVUF0ejFsElnV_rrmGTNr1NK8WRXVw0MDYY_ddYVQfsXAK5AN4c7b38ZTx_e9FvPOxzNU2__gBkrEkHw>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNy0sOgyAQANDTyA4zZYbfgoUUew9kIKURmxi9f_v2j4Ny_HCiBw_RpmiijM6ukhIkGRNZaV6E6xO0ogUmgpHLXL5DvANUrbluhrJTxnPxltuGjRAVIngUZ_jUfMj9Lv9XeNz71Uflnud2iitMavkBGxkjEQ>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNyzEOwyAMAMDXhA0ENiEwMPQpBhuVNqAqIn1_e_txhsguqp4L4V5dChorVi1gm2ZC1CAulkQxiYTN28rjPlcfwp1Mu9QzgwQfQiNf-YgMFjwTJBIsPhy7WHXl-cLP_45T92kmXe_-FTNlqZU3ePwA5R8nPA>
Jon Ogden
2017-06-20 16:49:57 UTC
Permalink
Yes, I would do that. I can send you an example file if you like…

Jon
Post by Jean-Luc Arnaud
Thanks for replying, Jon.
I tried that but had some issues. Probably something I did wrong. Well, will try again.
I think my mistake was to create the SuperClass AFTER creating the SubClass. I guess I have to do that in the natural way, that is SuperClass BEFORE SubClass.
Thanks a lot.
Jean-Luc Arnaud
Post by Jon Ogden
I had a situation where I had to do this myself and what I did was I created a master subclass for my two objects that had all the “common” items. I then created two subclasses of that custom subclass and put what was different in those.
Now you can treat them as a common subclass of type MySubclassObject for example. But then in your code you can check which you are dealing with using IsA. So your property is of type MySubclassObject but each on is say MySubclassObject1 and MySubclassObject2.
If MyProperty IsA MySubclassObject1 Then
// Do this
Else
// Do something else
End If
Now you can also use class methods and events to help define the master property/variable as well.
Hope this helps.
Jon
Post by Jean-Luc Arnaud
Hi all,
I'm facing a little problem when defining a variable.
My project has two ContainerControls, each of them representing graphically two objects very equivalent but not totally identical.
In my code, I have to define a variable representing only one of these objects, but I don't know, when defining it, what object.
Here is my problem: How to define a variable I don't know the type (Object1 or Object2), based on class ContainerControl?
I tried to define it as ContainerControl, but can't assign it later the type Object1 or Object2.
I tried to define it as Object1, but can't redefine it as Object2 is needed.
I'm sure the solution is obvious, but can't figure it out.
TIA for your help.
--
Jean-Luc Arnaud
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThI3I_M3A0KMYG7dUpZGi5P7t2580j-LQzIY5J6pcLYMTq4XAApZkUSvVUF0ejFsElnV_rrmGTNr1NK8WRXVw0MDYY_ddYVQfsXAK5AN4c7b38ZTx_e9FvPOxzNU2__gBkrEkHw>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNy0sOgyAQANDTyA4zZYbfgoUUew9kIKURmxi9f_v2j4Ny_HCiBw_RpmiijM6ukhIkGRNZaV6E6xO0ogUmgpHLXL5DvANUrbluhrJTxnPxltuGjRAVIngUZ_jUfMj9Lv9XeNz71Uflnud2iitMavkBGxkjEQ>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNy0sOwiAQANDTlB0NzFQcFix6lPmhGLFJU--vb_-sAVmmMJow3jTXElFRo0Pq0RgxgmeSylTdy7Iltfl9X2O6DV77GZ7NirNb6prNiUR6QtYKyhXkbraFs72Oh_nnvyfrqscMV1tg_wHvciWy>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwVy0sOgyAQANDTyA4yMiMwCxYa9B78mtJW2hjT89fu3uYVr10ZnWie1hmt2YI0YSJJ4wZyoUsuBFwYABF4INhjVvm9i7t3U0KwqSadUOcYmU2mwpRrtKTrTRy-P_DzPy_ZuurxeLZvVb2e4vSDnn_McCJy>
Jean-Luc Arnaud
2017-06-21 07:59:05 UTC
Permalink
Yes, with pleasure.

Off list, of course.

Thanks a lot, Jon.

Jean-Luc Arnaud
Post by Jon Ogden
Yes, I would do that. I can send you an example file if you like…
Jon
Post by Jean-Luc Arnaud
Thanks for replying, Jon.
I tried that but had some issues. Probably something I did wrong. Well, will try again.
I think my mistake was to create the SuperClass AFTER creating the SubClass. I guess I have to do that in the natural way, that is SuperClass BEFORE SubClass.
Thanks a lot.
Jean-Luc Arnaud
Post by Jon Ogden
I had a situation where I had to do this myself and what I did was I created a master subclass for my two objects that had all the “common” items. I then created two subclasses of that custom subclass and put what was different in those.
Now you can treat them as a common subclass of type MySubclassObject for example. But then in your code you can check which you are dealing with using IsA. So your property is of type MySubclassObject but each on is say MySubclassObject1 and MySubclassObject2.
If MyProperty IsA MySubclassObject1 Then
// Do this
Else
// Do something else
End If
Now you can also use class methods and events to help define the master property/variable as well.
Hope this helps.
Jon
Post by Jean-Luc Arnaud
Hi all,
I'm facing a little problem when defining a variable.
My project has two ContainerControls, each of them representing graphically two objects very equivalent but not totally identical.
In my code, I have to define a variable representing only one of these objects, but I don't know, when defining it, what object.
Here is my problem: How to define a variable I don't know the type (Object1 or Object2), based on class ContainerControl?
I tried to define it as ContainerControl, but can't assign it later the type Object1 or Object2.
I tried to define it as Object1, but can't redefine it as Object2 is needed.
I'm sure the solution is obvious, but can't figure it out.
TIA for your help.
--
Jean-Luc Arnaud
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThI3I_M3A0KMYG7dUpZGi5P7t2580j-LQzIY5J6pcLYMTq4XAApZkUSvVUF0ejFsElnV_rrmGTNr1NK8WRXVw0MDYY_ddYVQfsXAK5AN4c7b38ZTx_e9FvPOxzNU2__gBkrEkHw>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNy0sOgyAQANDTyA4zZYbfgoUUew9kIKURmxi9f_v2j4Ny_HCiBw_RpmiijM6ukhIkGRNZaV6E6xO0ogUmgpHLXL5DvANUrbluhrJTxnPxltuGjRAVIngUZ_jUfMj9Lv9XeNz71Uflnud2iitMavkBGxkjEQ>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNy0sOwiAQANDTlB0NzFQcFix6lPmhGLFJU--vb_-sAVmmMJow3jTXElFRo0Pq0RgxgmeSylTdy7Iltfl9X2O6DV77GZ7NirNb6prNiUR6QtYKyhXkbraFs72Oh_nnvyfrqscMV1tg_wHvciWy>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThI3Ixi6fgSERzT0oBpUqtFKU3L_Z3vIkGi_oVY_8XMjZLWmbHqwZN9Ar3_Ip0RoAiCBMDCOXufyGekds6DIyg1iHwRTLJAhWqms-tJdTR_zU_NX7Ve5XZFz72UeVnud2qDNOZvkD7ckipA>
To unsubscribe, email ***@xojo.com
Jon Ogden
2017-06-21 12:11:47 UTC
Permalink
Done! If anyone else would like to see this let me know..
Post by Jean-Luc Arnaud
Yes, with pleasure.
Off list, of course.
Thanks a lot, Jon.
Jean-Luc Arnaud
Post by Jon Ogden
Yes, I would do that. I can send you an example file if you like…
Jon
Post by Jean-Luc Arnaud
Thanks for replying, Jon.
I tried that but had some issues. Probably something I did wrong. Well, will try again.
I think my mistake was to create the SuperClass AFTER creating the SubClass. I guess I have to do that in the natural way, that is SuperClass BEFORE SubClass.
Thanks a lot.
Jean-Luc Arnaud
Post by Jon Ogden
I had a situation where I had to do this myself and what I did was I created a master subclass for my two objects that had all the “common” items. I then created two subclasses of that custom subclass and put what was different in those.
Now you can treat them as a common subclass of type MySubclassObject for example. But then in your code you can check which you are dealing with using IsA. So your property is of type MySubclassObject but each on is say MySubclassObject1 and MySubclassObject2.
If MyProperty IsA MySubclassObject1 Then
// Do this
Else
// Do something else
End If
Now you can also use class methods and events to help define the master property/variable as well.
Hope this helps.
Jon
Post by Jean-Luc Arnaud
Hi all,
I'm facing a little problem when defining a variable.
My project has two ContainerControls, each of them representing graphically two objects very equivalent but not totally identical.
In my code, I have to define a variable representing only one of these objects, but I don't know, when defining it, what object.
Here is my problem: How to define a variable I don't know the type (Object1 or Object2), based on class ContainerControl?
I tried to define it as ContainerControl, but can't assign it later the type Object1 or Object2.
I tried to define it as Object1, but can't redefine it as Object2 is needed.
I'm sure the solution is obvious, but can't figure it out.
TIA for your help.
--
Jean-Luc Arnaud
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThI3I_M3A0KMYG7dUpZGi5P7t2580j-LQzIY5J6pcLYMTq4XAApZkUSvVUF0ejFsElnV_rrmGTNr1NK8WRXVw0MDYY_ddYVQfsXAK5AN4c7b38ZTx_e9FvPOxzNU2__gBkrEkHw>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNy0sOgyAQANDTyA4zZYbfgoUUew9kIKURmxi9f_v2j4Ny_HCiBw_RpmiijM6ukhIkGRNZaV6E6xO0ogUmgpHLXL5DvANUrbluhrJTxnPxltuGjRAVIngUZ_jUfMj9Lv9XeNz71Uflnud2iitMavkBGxkjEQ>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNy0sOwiAQANDTlB0NzFQcFix6lPmhGLFJU--vb_-sAVmmMJow3jTXElFRo0Pq0RgxgmeSylTdy7Iltfl9X2O6DV77GZ7NirNb6prNiUR6QtYKyhXkbraFs72Oh_nnvyfrqscMV1tg_wHvciWy>
To unsubscribe click: <http://email.lists.xojo.com/u/eJwNyzsOwyAMANDThI3Ixi6fgSERzT0oBpUqtFKU3L_Z3vIkGi_oVY_8XMjZLWmbHqwZN9Ar3_Ip0RoAiCBMDCOXufyGekds6DIyg1iHwRTLJAhWqms-tJdTR_zU_NX7Ve5XZFz72UeVnud2qDNOZvkD7ckipA>
To unsubscribe, email ***@xojo.com

Continue reading on narkive:
Loading...