Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return 2 values from a function
Message
From
16/10/2008 05:22:19
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01355203
Message ID:
01355315
Views:
18
>>>Hi All,
>>>
>>>I need to return 2 values from a VB.NET function. One is data type integer and the other string.
>>>What is the best approach to acomplish that?
>>>
>>>Thanks,
>>>Daniel
>>
>>
>>You may wish to look at your design. A function should perform a single job and return a single value, if you have the need to do more, then I think inherently something is wrong.
>
>Do I spot a 'VFP' mindset here :-}.
>C (and large junks of the windows API) regularly make use of out and ref parameters - even when a structure is used it is often returned as an out parameter. In these cases the main parameter is usually simply a success/fail indicator.
>What do you think is wrong with this approach?
>
>Regards,
>Viv

Viv,
No it is not a "VFP" mindset, if it were would have the correct answer in the first place.
I have been posting the solution in 'VFP' which is the same as returning a Type in C# much before .Net was not even a project at MS;)
PS: And even in fox2x days we were using "ref" approach for multiple parameters, weren't we? Looks like your foxpro really got rusty;)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform