Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find minimum and maximum 1

Status
Not open for further replies.

limeg95

Programmer
Oct 22, 2009
124
CA
hi!
i am trying to figure it out earlist starting time and latest finished time
here is the code. but i could not find out max and min
thanks in advance.
*****************************
If Right(JobName, 1) = "*" Then
For j = 1 To 16 '''

If Right(Trim(MyScreen.GetString(MyRw, 14)), 1) <> "p" Or _
Right(Trim(MyScreen.GetString(MyRw, 14)), 1) <> "z" Then '''
MyScreen.PutString "S", 6, 4
MyScreen.SendKeys ("<Enter>")
MyScreen.WaitHostQuiet (g_HostSettleTimE)
MyScreen.SendKeys ("F")
MyScreen.SendKeys (" '" + "STARTED - TIME" + "'")
MyScreen.SendKeys ("Enter")
MyRw = MyScreen.Row
myarray(j) = Trim(MyScreen.GetString(MyRw, 54, 6))
myarray2(j) = Trim(MyScreen.GetString(MyRw, 54, 6))
End If

Next j

MyStart = WorksheetFunction.Min(myarray2)

MyFinish = WorksheetFunction.Max(myarray)
Myjobloop = True
End If
'''''''''''''''''''''''''''''''''''''''''''''


 
skip
thanks could you please clarify
first screen shows x = 10.35 (start time)
second screen shows y = 9.25 ( start time)
if x < y then
x = z ( third variable
elseif x > y then
y = z
and 'do i have to check second and third one
 


What do you mean by a third?
Code:
PrevMaxStart =  10.35 
PrevMinStart =  10.35 
'....
Start = 9.25
If PrevMaxStart < Start  Then
   PrevMaxStart = Start  
End If
If PrevMinStart > Start  Then
   PrevMaxStart = Start  
End If

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Oh! thanks skip. will check it tomorrow and let you know
 


...oops
Code:
PrevMaxStart =  10.35 
PrevMinStart =  10.35 
'....
Start = 9.25
If PrevMaxStart < Start  Then
   PrevMaxStart = Start  
End If
If PrevMinStart > Start  Then
   PrevMinStart = Start  
End If

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
skip
the same thing i need to do for ending time also ? is it?thansk a lot skip.
 
Great Great! you have vast knwoledge about Attachmate. Thanks a lot Skip. You are reallly Really Helped me lot. not only me. so many people helped from you. "Without you"
we canot help anywere for Attachmate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top