Click here to Skip to main content
15,905,414 members
Home / Discussions / C#
   

C#

 
Questionlooping windows forms datagrid in c# Pin
Sivaprasad C29-Jan-07 19:36
Sivaprasad C29-Jan-07 19:36 
Questionreturning more than single value from a single function Pin
sukaan29-Jan-07 19:01
sukaan29-Jan-07 19:01 
AnswerRe: returning more than single value from a single function Pin
Sylvester george29-Jan-07 20:05
Sylvester george29-Jan-07 20:05 
AnswerRe: returning more than single value from a single function Pin
andre_swnpl29-Jan-07 20:05
andre_swnpl29-Jan-07 20:05 
AnswerRe: returning more than single value from a single function Pin
blackjack215029-Jan-07 20:20
blackjack215029-Jan-07 20:20 
GeneralRe: returning more than single value from a single function Pin
aSarafian30-Jan-07 0:36
aSarafian30-Jan-07 0:36 
AnswerRe: returning more than single value from a single function Pin
Colin Angus Mackay29-Jan-07 21:36
Colin Angus Mackay29-Jan-07 21:36 
AnswerRe: returning more than single value from a single function Pin
Luc Pattyn30-Jan-07 2:31
sitebuilderLuc Pattyn30-Jan-07 2:31 
In summary, you can use (in decreasing 'quality' order):

1 returning one reference value (say an instance of class myResults) holding all the results
this is the preferred way, certainly if lots of results need to be made available

2 returning a small struct
small here means no more than 8 bytes (e.g.2 ints)

3 one ref or out parameter holding a struct
this avoids the creation of the myResults instance

4 returning a large struct
this causes a lot of data moving around when there are many results to report

5 out or ref parameters each holding a simple variable
this gets clumsy and cumbersome very soon

6 public class members in the class that contains your method, so you can obtain
whatever subresult you may need
not structured, not thread-safe, the complete opposite of modern OO techniques


So I suggest you try and stick to 1, 2 and 3.

Smile | :)

Luc Pattyn

GeneralRe: returning more than single value from a single function Pin
Martin#30-Jan-07 3:23
Martin#30-Jan-07 3:23 
QuestionInvalidActiveXSateException was unhandled- MSChart control 6.0 Pin
GunaChinna29-Jan-07 18:13
GunaChinna29-Jan-07 18:13 
QuestionSimple calculator using ASP.NET Pin
coolgoose1329-Jan-07 13:30
coolgoose1329-Jan-07 13:30 
AnswerRe: Simple calculator using ASP.NET Pin
Christian Graus29-Jan-07 13:31
protectorChristian Graus29-Jan-07 13:31 
AnswerRe: Simple calculator using ASP.NET Pin
Vasudevan Deepak Kumar29-Jan-07 21:28
Vasudevan Deepak Kumar29-Jan-07 21:28 
GeneralRe: Simple calculator using ASP.NET Pin
coolgoose1331-Jan-07 5:01
coolgoose1331-Jan-07 5:01 
QuestionDiagramming Component Pin
Ranjan Banerji29-Jan-07 13:19
Ranjan Banerji29-Jan-07 13:19 
QuestionInherited default values Pin
Chris_McGrath29-Jan-07 13:15
Chris_McGrath29-Jan-07 13:15 
AnswerRe: Inherited default values Pin
Martin#29-Jan-07 22:19
Martin#29-Jan-07 22:19 
GeneralRe: Inherited default values Pin
Chris_McGrath30-Jan-07 12:54
Chris_McGrath30-Jan-07 12:54 
GeneralRe: Inherited default values Pin
Martin#30-Jan-07 19:51
Martin#30-Jan-07 19:51 
QuestionAdding the Application Output to the Installer Package Pin
Eyungwah29-Jan-07 12:24
Eyungwah29-Jan-07 12:24 
Questionreplace strings in file Pin
netJP12L29-Jan-07 12:08
netJP12L29-Jan-07 12:08 
AnswerRe: replace strings in file Pin
Luc Pattyn29-Jan-07 13:30
sitebuilderLuc Pattyn29-Jan-07 13:30 
AnswerRe: replace strings in file Pin
Guffa29-Jan-07 13:30
Guffa29-Jan-07 13:30 
QuestionListView windows forms Question Urgant Pin
Mustafa Magdy29-Jan-07 11:53
Mustafa Magdy29-Jan-07 11:53 
AnswerRe: ListView windows forms Question Urgant [modified] Pin
Alaric_29-Jan-07 12:03
professionalAlaric_29-Jan-07 12:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.