Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Storing value to property array
Message
From
21/07/2011 07:35:31
 
 
To
21/07/2011 07:02:36
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Application:
Desktop
Miscellaneous
Thread ID:
01518733
Message ID:
01518744
Views:
34
>My Pseudo code had an error, but I have got the following syntax to work ;
>
>
>Dim MyParentObject As Webservice.ParentObjectClass = New Webservice.ParentObjectClass
>Dim MyBuiltMessage(1) As WebService.MessageClass = New WebService.MessageClass
>
>MyBuiltMessage(0).Property1 = "Hello"
>MyBuiltMessage(0).Property2 = 1
>
>MyParentObject.message = MyBuiltMessage
>
>
>Thanks for pointing me in the right direction.

I think the original problem was that you were expecting the array to be populated with instances of MessageClass. My VB is rusty but I still don't understand the second code line above. Thought you'd need something like this:
        Dim MyBuiltMessage As MessageClass() = New MessageClass(1) {}
        MyBuiltMessage(0) = New MessageClass()

        MyBuiltMessage(0).Property1 = "Hello"
        MyBuiltMessage(0).Property2 = 1
But anyway as long as it's working :-}
Previous
Reply
Map
View

Click here to load this message in the networking platform