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


 


Hi,

Loop thru your array and find the min & max values.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Skip thanks it worked out min and max
but ihave antoehr issue
there are 14 jobs each job go into and find out for going into the job press s in row 6 and column 4 first job and second job row 7 and column 4
each start row 6 to 21
how do i find the job and rows.
14 josb i put for j = 1 to 14
and in that job i find rows for k = 6 to 21
suppost first job go in and come out and before next job k shows 7 but the first job has gone second job shows up in 6th position. how do i do this one
 


you are very difficult to understand.

Do you mean that for each job, you enter an S] in column 6?

What do you do with the JobID?

Please answer BOTH questions.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
each job enter s in column 6 and only jobname no need to look job id
jobname there are 14 jobs
jobname ending with a to e or 1 to 9
 


I'd loop thur each job for each row.
Code:
dim i as integer, j as integer

for i = 6 to 21
  for j = 1 to 14
' enter jobname in row i

  next
next


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
skip
thanks for helping out
this the code i tryed but first job going through picksup
but instead of going second job the same first job going
i just tryed increment k = k+1
and this one after first job second job goes in first job positon in row 6 so it goes to third job. could you help me regarding this. my head is spinning round
-------------------------------------
For k = 6 To 21 ' screen row
For j = 1 To 16 ''' this is for 16 jobs
MyScreen.PutString "S", k, 4 ''if it starts in row 4
MyScreen.SendKeys ("<Enter>")

MyScreen.Moveto 2, 15

MyScreen.SendKeys ("F")
MyScreen.SendKeys (" '" + "STARTED - TIME" + "'")
MyScreen.SendKeys ("<Enter>")
MyRw = MyScreen.ROW
MyStart = Trim(MyScreen.GetString(MyRw, 54, 5))
' MsgBox (MyStart)
'''''' you need a loop here you need to modify the screen location and increment it for the loop''''

MyScreen.Moveto 2, 15
MyScreen.SendKeys ("F")
MyScreen.SendKeys (" '" + "ENDED - TIME" + "'")
MyScreen.SendKeys ("<Enter>")
MyRw = MyScreen.ROW
MyFinish = Trim(MyScreen.GetString(MyRw, 53, 5))
' MsgBox (MyFinish)

myarray(j) = Trim(MyScreen.GetString(MyRw, 54, 5)) ''<<<<< you need the frameinfo here
myarray2(j) = Trim(MyScreen.GetString(MyRw, 54, 5)) ''<<<<< you need the frameinfo here

MyStart = WorksheetFunction.Min(myarray2) ''' this portion of my code determins min/max
MsgBox (MyStart)
MyFinish = WorksheetFunction.Max(myarray) ''' this portion of my code determins min/max
MsgBox (MyFinish)
MyScreen.SendKeys ("<pf3>")
Next j


Next k
 


each job enter s in column 6 and only jobname

There is no place in the code you posted, where you ENTER JOBNAME on the screen. The only place you use the counter, j is in your array!!!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
skip
there are job names already there
so just put "s" in row 6.
just i am still not getting your point what are you exactly mention
 


there are job names already there
So what is the point of the For j = 1 To 16 loop?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
skip
i got it
how do i mention a to e and 0 to 9 here
if Right(JobName,1) ' "a"
 


What is it that you want to do? Please explain in detail.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
for k = 6 to 21
If Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "a" Then
 
skip
jobs with * then go with each job find min and max
jobs with * has 14 jobs ending with a or b or c like upto e and with 1 or 2 upto 9
and the row positon is each job starts from row 6 to 21
go inot each job and find out
i tried to
 


I cannot understand what you mean.

Please post an example of data from your screen and what results you expect from each row.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
this is the code i am trying to
i am trying to do from excel sheet ot screen job with *
if job with * there are 14 jobs each job go in there and check the starting time and ending tiem out of 14 jobs which is the earliest starting time and latest finished time

---------------------------


If Right(JobName, 1) = "*" Then '' this only for jobs ending with *

For k = 6 To 21 ''put code here to go to correct scrren row for the first loop you need to incremet the MyRw to correct screen row
For j = 1 To 16 ''' this is for 16 lines
If Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "A" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "B" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "C" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "D" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "E" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "1" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "2" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "3" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "4" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "5" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "6" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "7" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "8" Or Right(Trim(MyScreen.GetString(k, 7, 8)), 1) = "9" Then
' if Right(JobName, 1) = "a" or Right(JobName, 1) = "b" or Right(JobName, 1) = "c" or Right(JobName, 1) = "d" or Right(JobName, 1) = "e" or Right(JobName, 1) = "1"
MyScreen.PutString "S", k, 4 ''if it starts in row 4 then ok
MyScreen.SendKeys ("<Enter>")

MyScreen.Moveto 2, 15

MyScreen.SendKeys ("F")
MyScreen.SendKeys (" '" + "STARTED - TIME" + "'")
MyScreen.SendKeys ("<Enter>")
MyRw = MyScreen.ROW
MyStart = Trim(MyScreen.GetString(MyRw, 54, 5))
' MsgBox (MyStart)
'''''' you need a loop here you need to modify the screen location and increment it for the loop''''

MyScreen.Moveto 2, 15
MyScreen.SendKeys ("F")
MyScreen.SendKeys (" '" + "ENDED - TIME" + "'")
MyScreen.SendKeys ("<Enter>")
MyRw = MyScreen.ROW
MyFinish = Trim(MyScreen.GetString(MyRw, 53, 5))
' MsgBox (MyFinish)

myarray(j) = Trim(MyScreen.GetString(MyRw, 54, 5)) ''<<<<< you need the frameinfo here
myarray2(j) = Trim(MyScreen.GetString(MyRw, 54, 5)) ''<<<<< you need the frameinfo here

''''' Not sure how your code works but you may not need all of this you jus need to increment the screen location '''

MyScreen.SendKeys ("<pf3>")
End If
k = k + 1

Next j


Next k
 
skip
for example
rows 6 to 21 14 jobs
each job go in there
for that press s in column 4 and enter
and find starting time and ending time
within 14 jobs find the earlist starting time and latest finished time

i do the coding part
it goes find the starting time and ending tim everyhting is working only one part i am struggling with
first time go that job next time go to next row what happens
the next job positon go into first
how do i do that.
could you please help me
the above code i did
thanks skip
 



That is NOT an example. It is an EXPLANATION.

I want to see a screen shot.\DATA PLEASE!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
screen shot
sysoutid jobname jobix
s xxxxxa 'position row 6 press s position row 5
xxxxxb 'postion row 7
xxxxxc 'posiotn row 8
xxxxxd 'postion row 9


go into the job find star time
and finish time
if there are 14 sysoutid
each job go in and find starting time and finished time

 
skip
for example xxxxx* in postion row 5, 7, 5
how i put instad of * put "a" in last letter
or put" B"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top