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

Creating and Calling Arrays via Personal Communication

我正在尝试在个人通信(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

因此,在 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