Mr. Arnold,
The C# "Var" is simple the same as the VB "Dim" as used with option Infer On
in VB. They both are then strongly typed
The Visual Basic Var is a variable, behaves like a kind of non strongly
typed object but then on the stack (Does not exist in to be build VB
versions later then version 6).
Cor
"Mr. Arnold" <MR.
(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> "Andrew" <(E-Mail Removed)> wrote in message
> news:A7E052DA-2A38-4032-9718-(E-Mail Removed)...
>>
>>
>> "Family Tree Mike" wrote:
>>
>>> "Andrew" <(E-Mail Removed)> wrote in message
>>> news:730C3BD7-1FA5-4688-A0A1-(E-Mail Removed)...
>>> >I am trying to access a web service method (that was written in C#)
>>> >which
>>> > returns a structure. I am programming my side in VB.Net.
>>> >
>>> > So the c# struct looks like:
>>> > public struct mystruc {
>>> > public string result;
>>> > public int error;
>>> > }
>>> >
>>> > This is what I have in my code, or more to the point, what I have
>>> > figured out that works:
>>> > Dim xSvc As some.server.WebService
>>> > Dim gString As String = xSvc.mystruct().result
>>> >
>>> > So, the question is how do I return the structure into an object
>>> > (using
>>> > only
>>> > one call) which will allow me to access each of the structures values.
>>> > Something like this for example:
>>> >
>>> > Dim xSvc As some.server.WebService
>>> > Dim gOB As Object = xSvc.mystruct()
>>> >
>>> > gString = gOB.Result
>>> > dError = gOB.Error
>>> >
>>> >
>>> > I can't seem to find any info on this?
>>> >
>>> >
>>>
>>>
>>> Is xSvc.mystruct() a function returning a WebService.mystruct object?
>>>
>>> I believe that your code above would be:
>>>
>>> dim xSvc as some.server.WebService
>>> dim gOB as some.server.WebService.mystruct
>>>
>>> gString = gOB.Result
>>> dError = gOB.Error
>>>
>>>
>>> --
>>> Mike
>>>
>>
>>
>> Cool! Actually it was:
>>
>> dim xSvc as some.server.WebService
>> dim gOB as some.server.mystruct
>>
>> Thanks Mike! Most appreciated.
>>
>
> I don't know if this is in VB.net, as I have not had the opportunity to
> use VB.Net for a while now. But with "var", you can just do this.
>
> var gOB = WebService.mystruct;
>
> http://wiki.asp.net/page.aspx/421/ne...rquot-keyword/