Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
greatest value
Logged in as: Guest
arrSession:exec spGetSession 2,2,56219
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[Scripting]
>>
WSH & Client Side VBScript
>> greatest value
Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page:
[1]
Login
Message
<< Older Topic
Newer Topic >>
greatest value -
1/31/2008 10:20:02 PM
arednuk
Posts: 2
Score: 0
Joined: 1/31/2008
Status:
offline
Short question:
maybe too easy for some of the people here, but...
does somebody know, if you have an array of values, which is the shortest way to get the greatest value of all of them?
thanks a lot!
Post #: 1
RE: greatest value -
1/31/2008 10:53:39 PM
ehvbs
Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status:
offline
Hi arednuk,
short answer:
Dim aTest : aTest = Array( 1, 3, 2 ) Dim vMax : vMax = Empty ' explicit init to smallest value possible Dim vVal For Each vVal In aTest ' loop over all items If vMax < vVal Then ' hope that < is implemented correctly for *all* datatypes vMax = vVal End If Next WScript.Echo vMax
Good luck!
ehvbs
(in reply to
arednuk
)
Post #: 2
RE: greatest value -
1/31/2008 11:40:32 PM
arednuk
Posts: 2
Score: 0
Joined: 1/31/2008
Status:
offline
Thanks!!!
Always the same... when you see it written looks so simple, so neat...
(in reply to
ehvbs
)
Post #: 3
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[Scripting]
>>
WSH & Client Side VBScript
>> greatest value
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
New Messages
No New Messages
Hot Topic w/ New Messages
Hot Topic w/o New Messages
Locked w/ New Messages
Locked w/o New Messages
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI