Re: A little problem defining a variable
Jean-Luc Arnaud <jean-luc-E/[email protected]>
| Newsgroups | gmane.comp.lang.realbasic.user |
|---|---|
| Organization | Centre Direct du Multimédia |
| Message-ID | <[email protected]> |
Thanks for these ideas, François. I will test that. Have a good day, too. Very hot currently around Paris. Jean-Luc Arnaud Le 20/06/2017 à 11:54, François Van Lerberghe a écrit : > 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 > > Le 20 juin 2017 à 11:44, Jean-Luc Arnaud <jean-luc-E/[email protected]> a écrit : > >> 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/eJwNzMsNwyAMANBpwo0oOHziA4eOYmNMkUIq0WT_9g3wJMMh7jA9h6A1okYbQcESoFjYMFkpB1cOjJxw8VuR8Zx3H1U6rTrNO-8cVYuC946YfYxBPbodkVhqScHM3Mo5HzsrnUzfXuz1tH811jboqutnNnPnBV4_fNorJw>