Declaring a global object...


Author
Message
StarkMike
StarkMike
Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)
Group: Forum Members
Posts: 436, Visits: 944
I would like to declare a global object but not instantiate it and I dont want the 'Dim' statement in any of my forms... I was thinking I could put it in the AppMain class, but I'm not sure where to put it. Could you provide some direction?

Thanks

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
One of those "Shared" classes would be perfect for you.  You can "Dim" the business object within the class and it becomes publicly available as a global variable from anywhere within your application.

Public NotInheritable Class MyBOContainer

    Public MyGlobalBusinessObject As New MyBOType()

End Class

You can then access it anywhere with this:

MyBOContainer.MyGlobalBusinessObject

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search