Click here to Skip to main content
15,881,852 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to make print preview maximized? Pin
blakeb_130-Jan-04 11:11
blakeb_130-Jan-04 11:11 
GeneralRe: How to make print preview maximized? Pin
Tom Larsen30-Jan-04 11:31
Tom Larsen30-Jan-04 11:31 
GeneralMaximum value of an array Pin
crushinghellhammer30-Jan-04 9:37
crushinghellhammer30-Jan-04 9:37 
GeneralRe: Maximum value of an array Pin
Heath Stewart30-Jan-04 10:05
protectorHeath Stewart30-Jan-04 10:05 
GeneralRe: Maximum value of an array Pin
crushinghellhammer30-Jan-04 11:19
crushinghellhammer30-Jan-04 11:19 
GeneralRe: Maximum value of an array Pin
Heath Stewart30-Jan-04 11:36
protectorHeath Stewart30-Jan-04 11:36 
GeneralRe: Maximum value of an array Pin
crushinghellhammer30-Jan-04 11:59
crushinghellhammer30-Jan-04 11:59 
GeneralRe: Maximum value of an array Pin
Heath Stewart30-Jan-04 12:03
protectorHeath Stewart30-Jan-04 12:03 
The whole point of using Math.Max is to compare the current array value with the previous max value. Whichever one is greater gets stored as the max value and compared to the next value, and so on. My code works under normal circumstances, but it might not work for the constraints you have (like your starting indexes, etc.). You must not reset the max each time, though, otherwise you're comparing the current array value with 0, so the last positive number in your array (or subset - whatever you're comparing) will be stored as the max value. You must remember it as I did in my example so you only store the max. If you want to take negative numbers into account, set the max value initially to Int32.MinValue.

 

Microsoft MVP, Visual C#
My Articles
Generalconsuming a class defined in another assembly Pin
godzooky30-Jan-04 8:56
godzooky30-Jan-04 8:56 
GeneralRe: consuming a class defined in another assembly Pin
Heath Stewart30-Jan-04 10:13
protectorHeath Stewart30-Jan-04 10:13 
GeneralRe: consuming a class defined in another assembly Pin
godzooky30-Jan-04 10:39
godzooky30-Jan-04 10:39 
GeneralRe: consuming a class defined in another assembly Pin
Heath Stewart30-Jan-04 10:46
protectorHeath Stewart30-Jan-04 10:46 
GeneralRe: consuming a class defined in another assembly Pin
Nick Parker30-Jan-04 11:19
protectorNick Parker30-Jan-04 11:19 
GeneralRe: consuming a class defined in another assembly Pin
godzooky30-Jan-04 15:41
godzooky30-Jan-04 15:41 
GeneralWindows Services using C# Pin
Todd J Christensen30-Jan-04 8:19
sussTodd J Christensen30-Jan-04 8:19 
GeneralRe: Windows Services using C# Pin
David R. Tosi30-Jan-04 8:52
David R. Tosi30-Jan-04 8:52 
GeneralRe: Windows Services using C# Pin
Member 64105530-Jan-04 11:29
Member 64105530-Jan-04 11:29 
GeneralComponents: Design-Time support for properties Pin
UB30-Jan-04 6:51
UB30-Jan-04 6:51 
GeneralRe: Components: Design-Time support for properties Pin
Heath Stewart30-Jan-04 9:57
protectorHeath Stewart30-Jan-04 9:57 
GeneralRe: Components: Design-Time support for properties Pin
UB1-Feb-04 6:13
UB1-Feb-04 6:13 
GeneralC# controls in W2K... Pin
EyeOfTheSky30-Jan-04 5:58
EyeOfTheSky30-Jan-04 5:58 
GeneralRe: C# controls in W2K... Pin
Tom Larsen30-Jan-04 6:25
Tom Larsen30-Jan-04 6:25 
GeneralRe: C# controls in W2K... Pin
EyeOfTheSky30-Jan-04 7:17
EyeOfTheSky30-Jan-04 7:17 
GeneralRe: C# controls in W2K... Pin
Heath Stewart30-Jan-04 9:53
protectorHeath Stewart30-Jan-04 9:53 
GeneralRe: C# controls in W2K... Pin
Nick Parker30-Jan-04 11:09
protectorNick Parker30-Jan-04 11:09 

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.