Search code examples
vbavb.netibm-midrangeiseries-navigator

Creating and Calling Arrays via Personal Communication


I am trying to call an Array in Personal Communication (iSeries etc) I have a script that should

Open the query screen
Run query 1
Wait for query 1 to finish
Run query 2

etc

In any other VB situation, I would use

Dim qryArray() as string = {“salesrep1”, “salerep28”, “salepay34”, “prod_inv_1”}

But here it keeps telling me Expected end of statement

Is there something obvious I'm doing wrong here?

Secondly I need to know how to call an Array as a SendKeys

'Open Query
    autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "2" 'Run
    autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys 'Query Name Goes Here
    autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[field+]" 'Next
    autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "techops" 'Library
    autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[field+]" 'To top
    autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]" 'Go to query
    autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[pf3]" 'Exit to run query

Solution

  • So with help from Natha_Sav, here is the working answer:

    For each v in qryArray
    'Then we are opening the query, running it, closing it and waiting for the message to confirm
    'snippet:
    autECLSession.autECLPS.SendKeys "2" 'Run
       autECLSession.autECLPS.SetCursorPos 8, 26
    autECLSession.autECLPS.SendKeys(cstr(v)) 'send query name
       autECLSession.autECLPS.SetCursorPos 9, 28
    'autECLSession.autECLPS.SendKeys "salesrep1" 'This would be the equivalent
    'then close the library etc 
    'run the query
    next