Peter,
I would suggest simply creating a global object and then adding properties
to it. 

Public oGlobal
oGlobal=CreateObject("clsGlobal")


Define class clsGlobal as Relation
  cProperty1="Test Property"
  nProperty2=100
  *
Enddefine

Or you can create the object with 

With _Screen
  .AddObject("oGlobal", "clsGlobal")
   * 
Endwith

Obviously you could simply use the createobject with "Relation" as the class
but doing it this way you can add properties at design time as well as
methods if required. The whole methodology is much better than simply adding
to the _Screen or Application object.

If you still want to do it your way then I suggest looking at the _VFP
Application object as opposed to _Screen.

Dave Crozier

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Peter Hart
Sent: 13 September 2007 19:58
To: ProFox Email List
Subject: RE: Problem with AddProperty

Hi All

I have some lines of code in main.prg which add properties to the Screen
object

E.G. _Screen.AddProperty("cStockCode","",1,"Holder for selected Stock
Code")

In design mode and running the exe through the debugger the properties
are created but when I compile the exe and run it I get an error that
cStocKCode is not found.  And trying to show any of the added properties
using MESSAGEBOX("cStockCode = " + ALLTRIM(_Screen.cStockCode)) shows
that they have not been created.
Any one got any ideas.

T.I.A.

Cheers

Peter

Peter Hart Computers




[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** 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.

Reply via email to