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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matching array values

Status
Not open for further replies.

KM8888

Programmer
Nov 21, 2011
69
US
Hi everyone, hopefully I can explain well enough for you experts to understand. Basically I am trying to see if values within two arrays match so it can create a third array that displays those values......... For example

Array()
Array1()

Arrays run in separate For loops kind of like this

For i = 0 to #

Array(i) = .gettext (row, cursor)

i = i+1

Next

Repeat the above step for Array1()

What can I do to see what values that I got from the first array match with the second one? So if the first array has like

Apple
Banana
Coconut
Orange

And the second has

Apple
Strawberry
Orange
Kiwi

Array and Array1 = Orange and Apple

Hopefully I explained that well and it's possible to pull off, any information anybody can provide will surely get a star, I will probably have a follow up question as well. Thanks all :)
 
I would use dictionary (aka hash), which keys will be words from the first array and values something else - maybe the count of each word - so I could use the hash like a word frequency counter, when I need it.

Here is an example:
Code:
[COLOR=#0000ff]' create arrays[/color]
array01 [COLOR=#804040][b]=[/b][/color] [COLOR=#a020f0]split[/color][COLOR=#804040][b]([/b][/color][COLOR=#ff00ff]"Apple Banana Coconut Orange Banana Coconut Banana"[/color][COLOR=#804040][b])[/b][/color]
array02 [COLOR=#804040][b]=[/b][/color] [COLOR=#a020f0]split[/color][COLOR=#804040][b]([/b][/color][COLOR=#ff00ff]"Apple Strawberry Orange Kiwi"[/color][COLOR=#804040][b])[/b][/color]

[COLOR=#0000ff]' create Dictionary object[/color]
[COLOR=#804040][b]set[/b][/color] hash [COLOR=#804040][b]=[/b][/color] [COLOR=#008080]CreateObject[/color][COLOR=#804040][b]([/b][/color][COLOR=#ff00ff]"Scripting.Dictionary"[/color][COLOR=#804040][b])[/b][/color]

[COLOR=#0000ff]'create hash, i.e. word frequency counter of array01[/color]
[COLOR=#804040][b]for[/b][/color] [COLOR=#804040][b]each[/b][/color] word [COLOR=#804040][b]in[/b][/color] array01
 [COLOR=#0000ff] 'wscript.echo word[/color]
 [COLOR=#0000ff] ' add words to hash (i.e. dictionary)[/color]
  [COLOR=#804040][b]if[/b][/color] hash[COLOR=#804040][b].[/b][/color][COLOR=#a020f0]exists[/color][COLOR=#804040][b]([/b][/color]word[COLOR=#804040][b])[/b][/color] [COLOR=#804040][b]then[/b][/color]
    hash[COLOR=#804040][b].[/b][/color][COLOR=#a020f0]item[/color][COLOR=#804040][b]([/b][/color]word[COLOR=#804040][b])[/b][/color] [COLOR=#804040][b]=[/b][/color] hash[COLOR=#804040][b].[/b][/color][COLOR=#a020f0]item[/color][COLOR=#804040][b]([/b][/color]word[COLOR=#804040][b])[/b][/color] [COLOR=#804040][b]+[/b][/color] [COLOR=#ff00ff]1[/color]
  [COLOR=#804040][b]else[/b][/color]
    hash[COLOR=#804040][b].[/b][/color][COLOR=#a020f0]item[/color][COLOR=#804040][b]([/b][/color]word[COLOR=#804040][b])[/b][/color] [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]1[/color]
  [COLOR=#804040][b]end[/b][/color] [COLOR=#804040][b]if[/b][/color]
[COLOR=#804040][b]next[/b][/color]

[COLOR=#0000ff]' to see what's in hash:[/color]
wscript[COLOR=#804040][b].[/b][/color]echo [COLOR=#ff00ff]"words in array01:"[/color]
[COLOR=#a020f0]keys[/color] [COLOR=#804040][b]=[/b][/color] hash[COLOR=#804040][b].[/b][/color][COLOR=#a020f0]keys[/color]
[COLOR=#804040][b]for[/b][/color] i[COLOR=#804040][b]=[/b][/color][COLOR=#ff00ff]0[/color] [COLOR=#804040][b]to[/b][/color] hash[COLOR=#804040][b].[/b][/color][COLOR=#a020f0]count[/color][COLOR=#804040][b]-[/b][/color][COLOR=#ff00ff]1[/color]
  wscript[COLOR=#804040][b].[/b][/color]echo hash[COLOR=#804040][b].[/b][/color][COLOR=#a020f0]item[/color][COLOR=#804040][b]([/b][/color][COLOR=#a020f0]keys[/color][COLOR=#804040][b]([/b][/color]i[COLOR=#804040][b]))[/b][/color] [COLOR=#804040][b]&[/b][/color] [COLOR=#ff00ff]" x "[/color] [COLOR=#804040][b]&[/b][/color] [COLOR=#a020f0]keys[/color][COLOR=#804040][b]([/b][/color]i[COLOR=#804040][b])[/b][/color]  
[COLOR=#804040][b]next[/b][/color]
wscript[COLOR=#804040][b].[/b][/color]echo

[COLOR=#804040][b]for[/b][/color] [COLOR=#804040][b]each[/b][/color] word [COLOR=#804040][b]in[/b][/color] array02
  [COLOR=#804040][b]if[/b][/color] hash[COLOR=#804040][b].[/b][/color][COLOR=#a020f0]exists[/color][COLOR=#804040][b]([/b][/color]word[COLOR=#804040][b])[/b][/color] [COLOR=#804040][b]then[/b][/color]
    wscript[COLOR=#804040][b].[/b][/color]echo [COLOR=#ff00ff]"word '"[/color] [COLOR=#804040][b]&[/b][/color] word [COLOR=#804040][b]&[/b][/color] [COLOR=#ff00ff]"' of array01 found in array02"[/color]
  [COLOR=#804040][b]end[/b][/color] [COLOR=#804040][b]if[/b][/color]
[COLOR=#804040][b]next[/b][/color]
Output:
Code:
C:\_mikrom\Work\VBscript>cscript /NoLogo hash.vbs
words in array01:
1 x Apple
3 x Banana
2 x Coconut
1 x Orange

word 'Apple' of array01 found in array02
word 'Orange' of array01 found in array02
 
Thanks for the response Mikrom, do you happen to know off hand if I can apply this to PCOMM? I know PCOMM macro's are written with VBScript but this just isn't a function I am too familiar with.

Secondly say I am able to identify the matching ones and say for instance I switch screens, can I then only identify the two matching ones on the screen?

I.e. Apple found, Orange found?

Thanks!
 
KM8888 said:
do you happen to know off hand if I can apply this to PCOMM? I know PCOMM macro's are written with VBScript but this just isn't a function I am too familiar with.
I thing YES, you can use everything what VBscript supports.

I know PCOMM only in relation with IBM iSeries Navigator. In the past I wrote some little macros for automating work with an iSeries (aka AS/400) green screen application.

Consider, you get a CSV-file, which each line contains data for a contract and you should process every contract (i.e. one line of the CSV) with a green screen application.

First you can record the PCOMM macro for a particular case. You get a Vbscript code in a file (for example *.mac extension in iSeries Navigator).
Second, you can change the macro and create a subroutine with arguments for general case.
Third you can enhance your VBscript code, so it reads the CSV-file line by line and extracts the essential data from it and call the subroutine you created in the previous step and pass the data as argumets to it.

Example: The next sxripts reads contract numbers (BSSTAMMNR and BSVNR) from a CSV-file and process each contract though several green screens on IBM iSeries using a subroutine created by macro recorder:
Code:
[PCOMM SCRIPT HEADER]
LANGUAGE[COLOR=#804040][b]=[/b][/color]VBSCRIPT
DESCRIPTION[COLOR=#804040][b]=[/b][/color]
[PCOMM SCRIPT SOURCE]
[COLOR=#804040][b]option[/b][/color] [COLOR=#804040][b]explicit[/b][/color]
autECLSession[COLOR=#804040][b].[/b][/color]SetConnectionByName[COLOR=#804040][b]([/b][/color]ThisSessionName[COLOR=#804040][b])[/b][/color]

[COLOR=#804040][b]dim[/b][/color] oDlg[COLOR=#804040][b],[/b][/color] rcDlg[COLOR=#804040][b],[/b][/color] oFSO[COLOR=#804040][b],[/b][/color] oInFile

[COLOR=#0000ff]'show help[/color]
[COLOR=#804040][b]call[/b][/color] help
[COLOR=#0000ff]'Open dialog and select the CSV-file[/color]
[COLOR=#804040][b]set[/b][/color] oDlg [COLOR=#804040][b]=[/b][/color] [COLOR=#008080]CreateObject[/color][COLOR=#804040][b]([/b][/color][COLOR=#ff00ff]"UserAccounts.CommonDialog"[/color][COLOR=#804040][b])[/b][/color] 
oDlg[COLOR=#804040][b].[/b][/color]Filter [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]"All CSV-Files|*.csv"[/color]
rcDlg [COLOR=#804040][b]=[/b][/color] oDlg[COLOR=#804040][b].[/b][/color][COLOR=#a020f0]ShowOpen[/color] 
[COLOR=#804040][b]if[/b][/color] [COLOR=#804040][b]not[/b][/color] rcDlg [COLOR=#804040][b]then[/b][/color] 
 [COLOR=#0000ff] 'print message and exit program[/color]
  [COLOR=#804040][b]call[/b][/color] [COLOR=#008080]msgbox[/color] [COLOR=#804040][b]([/b][/color][COLOR=#ff00ff]"Nie je nič na spracovanie !"[/color][COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]vbExclamation[/color][COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]"Upozornenie"[/color][COLOR=#804040][b])[/b][/color]
[COLOR=#804040][b]else[/b][/color]
 [COLOR=#0000ff] 'create FileSystemObject[/color]
  [COLOR=#804040][b]set[/b][/color] oFSO [COLOR=#804040][b]=[/b][/color] [COLOR=#008080]CreateObject[/color][COLOR=#804040][b]([/b][/color][COLOR=#ff00ff]"Scripting.FileSystemObject"[/color][COLOR=#804040][b])[/b][/color]
 [COLOR=#0000ff] 'open the input file[/color]
  [COLOR=#804040][b]set[/b][/color] oInFile [COLOR=#804040][b]=[/b][/color] oFSO[COLOR=#804040][b].[/b][/color]OpenTextFile[COLOR=#804040][b]([/b][/color]oDlg[COLOR=#804040][b].[/b][/color]FileName[COLOR=#804040][b])[/b][/color]

  [COLOR=#804040][b]dim[/b][/color] str_CurrentLine[COLOR=#804040][b],[/b][/color] message[COLOR=#804040][b],[/b][/color] title[COLOR=#804040][b],[/b][/color] rc[COLOR=#804040][b],[/b][/color] bsv_nr[COLOR=#804040][b],[/b][/color] str_array[COLOR=#804040][b],[/b][/color] bsstammnr[COLOR=#804040][b],[/b][/color] bsvnr
 [COLOR=#0000ff] 'ignore first line with header[/color]
  [COLOR=#804040][b]if[/b][/color] [COLOR=#804040][b]not[/b][/color] oInFile[COLOR=#804040][b].[/b][/color]AtEndOfStream [COLOR=#804040][b]then[/b][/color]
    str_CurrentLine [COLOR=#804040][b]=[/b][/color] oInFile[COLOR=#804040][b].[/b][/color][COLOR=#a020f0]ReadLine[/color][COLOR=#804040][b]()[/b][/color]
  [COLOR=#804040][b]end[/b][/color] [COLOR=#804040][b]if[/b][/color]  
 [COLOR=#0000ff] 'for each line in the input file [/color]
  bsv_nr [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]0[/color]
  [COLOR=#804040][b]do[/b][/color] [COLOR=#804040][b]while[/b][/color] [COLOR=#804040][b]([/b][/color]rc [COLOR=#804040][b]<>[/b][/color] [COLOR=#ff00ff]vbCancel[/color][COLOR=#804040][b])[/b][/color] [COLOR=#804040][b]and[/b][/color] [COLOR=#804040][b](not[/b][/color] oInFile[COLOR=#804040][b].[/b][/color]AtEndOfStream[COLOR=#804040][b])[/b][/color]
   [COLOR=#0000ff] 'read line from the input file[/color]
    str_CurrentLine [COLOR=#804040][b]=[/b][/color] oInFile[COLOR=#804040][b].[/b][/color][COLOR=#a020f0]ReadLine[/color][COLOR=#804040][b]()[/b][/color]
   [COLOR=#0000ff] 'split line into array[/color]
    str_array [COLOR=#804040][b]=[/b][/color] [COLOR=#a020f0]split[/color][COLOR=#804040][b]([/b][/color]str_CurrentLine[COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]";"[/color][COLOR=#804040][b])[/b][/color]
   [COLOR=#0000ff] 'select first 2 array elements[/color]
    bsstammnr[COLOR=#804040][b]=[/b][/color]str_array[COLOR=#804040][b]([/b][/color][COLOR=#ff00ff]0[/color][COLOR=#804040][b])[/b][/color]
    bsvnr[COLOR=#804040][b]=[/b][/color]str_array[COLOR=#804040][b]([/b][/color][COLOR=#ff00ff]1[/color][COLOR=#804040][b])[/b][/color]    
   [COLOR=#0000ff] 'show MsgBox[/color]
    message [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]"Spracovať zmluvu: "[/color] [COLOR=#804040][b]&[/b][/color] bsstammnr [COLOR=#804040][b]&[/b][/color] [COLOR=#ff00ff]"-"[/color] [COLOR=#804040][b]&[/b][/color] bsvnr [COLOR=#804040][b]&[/b][/color][COLOR=#ff00ff]" ?"[/color]
    title [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]"Otázka"[/color]
    rc [COLOR=#804040][b]=[/b][/color] [COLOR=#008080]msgbox[/color] [COLOR=#804040][b]([/b][/color]message[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]vbYesNoCancel[/color][COLOR=#804040][b]+[/b][/color][COLOR=#ff00ff]vbQuestion[/color][COLOR=#804040][b],[/b][/color] title[COLOR=#804040][b])[/b][/color]
   [COLOR=#0000ff] 'msgbox ("MsgBox ReturnCode = " & rc)[/color]
    [COLOR=#804040][b]if[/b][/color] rc[COLOR=#804040][b]=[/b][/color][COLOR=#ff00ff]vbYes[/color] [COLOR=#804040][b]then[/b][/color]
     [COLOR=#0000ff] 'call  macro subroutine aplied on selected BSSTAMMNR[/color]
      bsv_nr [COLOR=#804040][b]=[/b][/color] bsv_nr [COLOR=#804040][b]+[/b][/color] [COLOR=#ff00ff]1[/color]
      [COLOR=#804040][b]call[/b][/color] subSub1_[COLOR=#804040][b]([/b][/color]bsstammnr[COLOR=#804040][b],[/b][/color] bsvnr[COLOR=#804040][b])[/b][/color]
    [COLOR=#804040][b]end[/b][/color] [COLOR=#804040][b]if[/b][/color]
  [COLOR=#804040][b]loop[/b][/color]

 [COLOR=#0000ff] 'close the input file[/color]
  oInFile[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]close[/b][/color]
 [COLOR=#0000ff] 'end of processing[/color]
  message [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]"Koniec spracovania !"[/color] [COLOR=#804040][b]&[/b][/color] [COLOR=#ff00ff]vbCr[/color] [COLOR=#804040][b]&[/b][/color] [COLOR=#ff00ff]vbCr[/color][COLOR=#804040][b] _[/b][/color]
          [COLOR=#804040][b]&[/b][/color] [COLOR=#ff00ff]"Počet spracovaných zmlúv: "[/color] [COLOR=#804040][b]&[/b][/color] bsv_nr 
  [COLOR=#804040][b]call[/b][/color] [COLOR=#008080]msgbox[/color] [COLOR=#804040][b]([/b][/color]message[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]vbExclamation[/color][COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]"Upozornenie"[/color][COLOR=#804040][b])[/b][/color]
[COLOR=#804040][b]end[/b][/color] [COLOR=#804040][b]if[/b][/color]

[COLOR=#804040][b]sub[/b][/color] help[COLOR=#804040][b]()[/b][/color]
  [COLOR=#804040][b]dim[/b][/color] nessage
  message [COLOR=#804040][b]=[/b][/color] _ 
  [COLOR=#ff00ff]"Makro načíta najprv CSV-súbor a spracováva ho po riadkoch."[/color] [COLOR=#804040][b]&[/b][/color] [COLOR=#ff00ff]vbCr[/color] [COLOR=#804040][b]& _[/b][/color]
  [COLOR=#ff00ff]"Z každého riadku vyberie ako prvé 2 stĺpce BSSTAMMNR a BSVNR"[/color] [COLOR=#804040][b]&[/b][/color] [COLOR=#ff00ff]vbCr[/color] [COLOR=#804040][b]& _[/b][/color]
  [COLOR=#ff00ff]"Na každú zmluvu sa aplikuje vygenerovaná funkcia, realizujúca"[/color] [COLOR=#804040][b]&[/b][/color] [COLOR=#ff00ff]vbCr[/color] [COLOR=#804040][b]& _[/b][/color]
  [COLOR=#ff00ff]"prechod cez rôzne obrazovky."[/color]
  [COLOR=#804040][b]call[/b][/color] [COLOR=#008080]msgbox[/color] [COLOR=#804040][b]([/b][/color]message[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]vbInformation[/color][COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]"Macro test_zmluv"[/color][COLOR=#804040][b])[/b][/color]
[COLOR=#804040][b]end[/b][/color] [COLOR=#804040][b]sub[/b][/color]

[COLOR=#0000ff]'--------------- subroutine generated by macro recorder -------------------[/color]
[COLOR=#804040][b]sub[/b][/color] subSub1_[COLOR=#804040][b]([/b][/color]bsstammnr[COLOR=#804040][b],[/b][/color] bsvnr[COLOR=#804040][b])[/b][/color]
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"52"[/color]
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[enter]"[/color]
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForAttrib [COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]31[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"00"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"3c"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForCursor [COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]32[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] bsstammnr
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[backtab]"[/color]
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[tab]"[/color]
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[tab]"[/color]
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] bsvnr
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[enter]"[/color]
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForAttrib [COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]31[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"00"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"3c"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]Wait [COLOR=#ff00ff]5843[/color] 

   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[pf14]"[/color]
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForAttrib [COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]28[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"00"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"3c"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]Wait [COLOR=#ff00ff]7266[/color] 

   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[pf21]"[/color]
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForAttrib [COLOR=#ff00ff]22[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]5[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"00"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"3c"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]Wait [COLOR=#ff00ff]3328[/color] 

   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[pf21]"[/color]
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForAttrib [COLOR=#ff00ff]21[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]5[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"00"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"3c"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForCursor [COLOR=#ff00ff]21[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]6[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"51"[/color]
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[enter]"[/color]
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForAttrib [COLOR=#ff00ff]22[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]5[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"00"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"3c"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]Wait [COLOR=#ff00ff]3062[/color] 

   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[pf3]"[/color]
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForAttrib [COLOR=#ff00ff]21[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]5[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"00"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"3c"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]Wait [COLOR=#ff00ff]688[/color] 

   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[pf3]"[/color]
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForAttrib [COLOR=#ff00ff]22[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]5[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"00"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"3c"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]Wait [COLOR=#ff00ff]1281[/color] 

   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[pf3]"[/color]
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForAttrib [COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]28[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"00"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"3c"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]Wait [COLOR=#ff00ff]2250[/color] 

   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[pf3]"[/color]
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForAttrib [COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]31[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"00"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"3c"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]Wait [COLOR=#ff00ff]2344[/color] 

   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[pf6]"[/color]
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForAttrib [COLOR=#ff00ff]5[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]29[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"00"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"3c"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]Wait [COLOR=#ff00ff]9000[/color] 

   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[pf3]"[/color]
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]WaitForAttrib [COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]31[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"00"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]"3c"[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]3[/color][COLOR=#804040][b],[/b][/color][COLOR=#ff00ff]10000[/color]

   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color]Wait [COLOR=#ff00ff]7515[/color] 

   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForAppAvailable
   
   autECLSession[COLOR=#804040][b].[/b][/color]autECLOIA[COLOR=#804040][b].[/b][/color]WaitForInputReady
   autECLSession[COLOR=#804040][b].[/b][/color]autECLPS[COLOR=#804040][b].[/b][/color][COLOR=#804040][b]SendKeys[/b][/color] [COLOR=#ff00ff]"[pf3]"[/color]
[COLOR=#804040][b]end[/b][/color] [COLOR=#804040][b]sub[/b][/color]
KM8888 said:
Secondly say I am able to identify the matching ones and say for instance I switch screens, can I then only identify the two matching ones on the screen?
Sorry, don't understand what you exactly mean...


 
Wow that seems quite too complicated for my level of expertise, some of that code I mean, that is exactly the language I use though. The Russian was a bit confusing to me as well hah but really thank you for taking the time!

Basically what I meant by my question that say if I did the gettext to put a bunch of values in my two arrays. After I filter out which ones match up within both I then take those new values and see if I can find them on a completely different screen of my session. So I store the two values then switch to a different screen and then find any values that match up and do some more gettext to store them into a brand new array. Hopefully that explains it a bit better I'm still quite the amateur with this stuff, thank you so far!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top