Index
2014-04-09 15:10Lew Schwartz : Obj reference to most recently added control
2014-04-09 15:14Man-wai Chang : Re: Obj reference to most recently added control
2014-04-09 15:18Lew Schwartz : Re: Obj reference to most recently added control
2014-04-09 15:32Tracy Pearson : RE: Obj reference to most recently added control
2014-04-09 15:32Allen : RE: Obj reference to most recently added control
2014-04-09 15:35Lew Schwartz : Re: Obj reference to most recently added control
2014-04-09 15:42Allen : RE: Obj reference to most recently added control
2014-04-09 19:25Ken Dibble : Re: Obj reference to most recently added control
2014-04-09 19:42Lew Schwartz : Re: Obj reference to most recently added control
Back to top
Obj reference to most recently added control

Author: Lew Schwartz

Posted: 2014-04-09 15:10:02   Link

Ok, I haven't written a program for 5 years, so please excuse the rust &

don't all jump at once.

I'm calling this.AddObject("Blah","Image") on a form and now I've got to

populate the properties of the new image object. How do I get a reference

to it so I can do stuff like:

oLastImageObject.Picture = "c:\foobar.jpg"

?

-Lew The dunce

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CAFuU78cDQyFPqMOVPnu_eiX1kw6S+ozeptp5kbGbjyn=jJ7+nw@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Lew Schwartz
Back to top
Re: Obj reference to most recently added control

Author: Man-wai Chang

Posted: 2014-04-09 15:14:28   Link

with thisform.path.to.Blah

.Picture = "c:\foobar.jpg"

endwith

On Thu, Apr 10, 2014 at 4:10 AM, Lew Schwartz <lew1716@gmail.com> wrote:

> Ok, I haven't written a program for 5 years, so please excuse the rust &

> don't all jump at once.

>

> I'm calling this.AddObject("Blah","Image") on a form and now I've got to

> populate the properties of the new image object. How do I get a reference

> to it so I can do stuff like:

>

> oLastImageObject.Picture = "c:\foobar.jpg"

>

> ?

>

> -Lew The dunce

>

>

> --- StripMime Report -- processed MIME parts ---

> multipart/alternative

> text/plain (text body -- kept)

> text/html

> ---

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CAGv=MJBtWGC2YnDjTmqOkW7L3DcqHXQv6wPFdiYM3v_h2tJJ5g@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Man-wai Chang
Back to top
Re: Obj reference to most recently added control

Author: Lew Schwartz

Posted: 2014-04-09 15:18:37   Link

Guess I should have added that there will be many image controls on this

form. I need a way to work with the most recently added one individually.

-Lew Schwartz

On Wed, Apr 9, 2014 at 4:14 PM, Man-wai Chang <changmw@gmail.com> wrote:

> with thisform.path.to.Blah

> .Picture = "c:\foobar.jpg"

> endwith

>

>

> On Thu, Apr 10, 2014 at 4:10 AM, Lew Schwartz <lew1716@gmail.com> wrote:

> > Ok, I haven't written a program for 5 years, so please excuse the rust &

> > don't all jump at once.

> >

> > I'm calling this.AddObject("Blah","Image") on a form and now I've got to

> > populate the properties of the new image object. How do I get a reference

> > to it so I can do stuff like:

> >

> > oLastImageObject.Picture = "c:\foobar.jpg"

> >

> > ?

> >

> > -Lew The dunce

> >

> >

> > --- StripMime Report -- processed MIME parts ---

> > multipart/alternative

> > text/plain (text body -- kept)

> > text/html

> > ---

> >

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CAFuU78dJYh5SYD_aMKEBdGTYNNXiMTq=Dg5GPKgCh7kf_Q7kaw@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Lew Schwartz
Back to top
RE: Obj reference to most recently added control

Author: Tracy Pearson

Posted: 2014-04-09 15:32:01   Link

Lew Schwartz wrote on 2014-04-09:

> Guess I should have added that there will be many image controls on this

> form. I need a way to work with the most recently added one individually.

>

> -Lew Schwartz

>

> On Wed, Apr 9, 2014 at 4:14 PM, Man-wai Chang <changmw@gmail.com> wrote:

Lew,

Expecting you are in a loop

cNewObjectName = "image001"

this.AddObject(cNewObjectName, "image")

oNewObject = eval("this." + cNewObjectName)

...

* I have gotten in the habit of releasing the object in the loop

oNewObject = .NULL.

Tracy Pearson

PowerChurch Software

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/001401cf5432$c34c4fd0$49e4ef70$@powerchurch.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Tracy Pearson
Back to top
RE: Obj reference to most recently added control

Author: Allen

Posted: 2014-04-09 15:32:01   Link

If there are many can you use createobject? Then you have your reference

Al

-----Original Message-----

Guess I should have added that there will be many image controls on this

form. I need a way to work with the most recently added one individually.

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/007d01cf5432$c36c0cd0$4a442670$@com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Allen
Back to top
Re: Obj reference to most recently added control

Author: Lew Schwartz

Posted: 2014-04-09 15:35:27   Link

It's gotta be this.CreateObject(), I think. Otherwise it won't be a control

owned by the form. I dpn't think this.CreateObject() returns anything.

-Lew Schwartz

On Wed, Apr 9, 2014 at 4:32 PM, Allen <profox@gatwicksoftware.com> wrote:

> If there are many can you use createobject? Then you have your reference

> Al

>

> -----Original Message-----

>

> Guess I should have added that there will be many image controls on this

> form. I need a way to work with the most recently added one individually.

>

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CAFuU78cyPLe_1HuQde98vFsMa8pujy3ONHVrUie8UCAA6jnv3w@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Lew Schwartz
Back to top
RE: Obj reference to most recently added control

Author: Allen

Posted: 2014-04-09 15:42:39   Link

Thing = createobject("other thing")

For example

objExcel = createobject("excel.application")

you may even use an array or collection. I have used arrays of classes to

create calendar's for example.

Al

-----Original Message-----

It's gotta be this.CreateObject(), I think. Otherwise it won't be a control

owned by the form. I dpn't think this.CreateObject() returns anything.

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/008701cf5434$3fe29440$bfa7bcc0$@com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Allen
Back to top
Re: Obj reference to most recently added control

Author: Ken Dibble

Posted: 2014-04-09 19:25:19   Link

>It's gotta be this.CreateObject(), I think. Otherwise it won't be a control

>owned by the form. I dpn't think this.CreateObject() returns anything.

Containers don't have a CreateObject() method, they only have AddObject()

and NewObject().

1. You could issue DODEFAULT(Parms...) in one of those methods and then add

code to that method to return a reference to the object added:

PROCEDURE AddObject()

PARAMETERS cName, cClass, Init1, Init2, ...

DODEFAULT(cName,cClass,Init1,Init2...)

RETURN THIS.&cName.

ENDPROC

2. You could, as suggested, manipulate the object immediately after it's added:

THIS.AddObject("oBlah","ClassBlah")

WITH THIS.oBlah

....etc.

ENDWITH

3. You could increment a counter property on the container object and

concatenate its value to the name of the object when you add it, so you

will always be able to find the most recently-added object by the appended

digit(s).

PROCEDURE AddObject

PARAMETERS cName, cClass, Init1, Init2, ...

NODEFAULT

cName = TRANSFORM(THIS.ObjectCounter) + cName

THIS.ObjectCounter = THIS.ObjectCounter + 1

DODEFAULT(cName,cClass,Init1,Init2...)

ENDPROC

4. You could do number 3, above, using a timestamp instead of a number.

Ken Dibble

www.stic-cil.org

>-Lew Schwartz

>

>

>On Wed, Apr 9, 2014 at 4:32 PM, Allen <profox@gatwicksoftware.com> wrote:

>

> > If there are many can you use createobject? Then you have your reference

> > Al

> >

> > -----Original Message-----

> >

> > Guess I should have added that there will be many image controls on this

> > form. I need a way to work with the most recently added one individually.

> >

> >

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/5.2.1.1.1.20140409201354.01c6d4b8@POP-Server.stny.rr.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Ken Dibble
Back to top
Re: Obj reference to most recently added control

Author: Lew Schwartz

Posted: 2014-04-09 19:42:10   Link

Yes, .addObject(). I actually used that in my code, but wrote "create..."

in my email. The duhs abound.

-Lew Schwartz

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CAFuU78ff2tfrs6_MOQqYYSwcC+dptG42LX_4o_MOZTGz5KmD8A@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Lew Schwartz