通过个人通信创建和调用数组

时间:2019-02-21 15:01:49

标签: vba vb.net ibm-midrange iseries-navigator

我正在尝试在个人通信(iSeries等)中调用数组 我有一个应该的脚本

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

在其他任何VB情况下,我都会使用

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

但是在这里它不断告诉我Expected end of statement

这里有明显的地方我做错了吗?

第二,我需要知道如何将数组称为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

1 个答案:

答案 0 :(得分:0)

因此,在Natha_Sav的帮助下,这是有效的答案:

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