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
'''''''''''''''''''''''''''''''''''''''''''''


 


There you go. You don't need to do anything with i, other than what I just suggested.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
skip
could you looked at the code in 8 Dec 09 18:19
i have the code it works fine. is that any modificaiton in that code?
 

change all the i's to 1's...
Code:
    If Cells(i, "B").Value = "s" Then
     Cells(i, Mycol).NumberFormat = "h:mm"
 Cells(i, Mycol) = TimeSerial(Left(myStart3, 2), Right(myStart3, 2), 0)
 ElseIf Cells(i, "B").Value = "f" Then
     Cells(i, Mycol).NumberFormat = "h:mm"
 Cells(i, Mycol + 1) = TimeSerial(Left(myEnd3, 2), Right(myEnd3, 2), 0)
        End If

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
skip
this i from excel that i already mention in this code i dont mention excel sheet loop
but screen part only . could you please look at screen part which i have had it 8 Dec 09 18:19 . the screen part is it possible any reduce the code or modify the code in better way.
 

could you please look at screen part which i have had it 8 Dec 09 18:19
What is not working?

Please be specific and supply relevant information regarding error messges and contents of variables.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
skip
starting time if teh screen prev find starting time first part and after pf3 the screen new find another starting time
pf3 go to next screen
for example screen 1 after pf3 screen2 again screen2 after next
repeat two times the same screen and get the values.
 



I thnk that your basic control logic is off.

You have 14 screens. Usually, each individual screen has a unique screenID. Then if a screen has multiple pages, the paging key is either ENTER, a PF key or a PA key.

So please tell me

1. what unique screenids are used to get each of these 14 screens

2. what key is used to page within the screen.

3. what message indicates that there are no more pages, and where is that message on the screen.

Please answer each one of these questions entirely.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
thanks skip
1 to 14 jobids
1. prev = Trim(MyScreen.GetString(1, 19, 8)) jobid
2. finding starttime and endtime within job id
so there is no page further
next job id press pf3


 


So the general screen accessing is...

1. MyScreen.SendKeys ("F '" + "STARTED - TIME=" + "'") <Enter>")
ONE TIME


2. MyScreen.SendKeys ("<PF3>")
13 times


YES or NO?


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
yes the same thing finised time also one time
 


I do not understand what you just stated.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
each screen find starting time and ending time search for 14 scrheens and out of 14 screens minimum of starting time into excel and maximum of ending time to excel
 
each jobid find start time and ending time
from one job id to another jobid press pf3
totally 14 jobids. out of 14 jobids min of starting time and maxof ending time go to excel
 


So now lets focus on the very first screen.

what data are you intreested in on this screen? Give the 1) NAME of the data and it's 2) location (one row or multi rows?) & 3) size.

Please answer ALL questions.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
skip
first screen Trim(MyScreen.GetString(MyRw, 2, 5)) = job id

MyScreen.Moveto 2, 15
MyScreen.SendKeys ("F")
MyScreen.SendKeys (" '" + "STARTED - TIME=" + "'")
MyScreen.SendKeys ("<Enter>")
MyScreen.WaitHostQuiet (g_HostSettleTimE1)
MyRw = MyScreen.Row
myStart = Trim(MyScreen.GetString(MyRw, 2, 5))
MyScreen.WaitHostQuiet (g_HostSettleTimE1)
MyScreen.Moveto 2, 15
MyScreen.SendKeys ("F")
MyScreen.SendKeys (" '" + "ENDED - TIME=" + "'")
MyScreen.SendKeys ("<Enter>")
MyScreen.WaitHostQuiet (g_HostSettleTimE1)
MyRw = MyScreen.Row

myEnd = Trim(MyScreen.GetString(MyRw, 2, 5))
 



I DID NOT ASK FOR YOUR VBA CODE!!!

Please answer ALL THREE ITEMS!!!



Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
name of the data starting time and ending time
only one row and size 5
 
Only ONE ROW.

One START and one END time per screen, correct?

So here's the basic screen control...
Code:
'get the FIRST screen using...
MyScreen.SendKeys ("F '" + "STARTED - TIME=" + "' <Enter>")

'get the first START & END and store in a prev variable for comparison

'now loop thru the next 13 screens
for j = 1 to 13

'get the START & END from this screen

'compare to the previous values to determine min & max

'next screen
MyScreen.SendKeys ("<PF3>")

next

'write ONE ROW of min & max values for START & END (4 values)


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
thanks a lot skip and your valuble time
let you know
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top