Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Storing value to property array
Message
De
21/07/2011 07:35:31
 
 
À
21/07/2011 07:02:36
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Application:
Desktop
Divers
Thread ID:
01518733
Message ID:
01518744
Vues:
35
>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 :-}
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform