In IBM Reflection host, i am trying to run a VBA macro for traversing through different screens and fill required information (in a predefined template kind of a screen) to create orders in the system.
In the process, i am trying to utilise the functions- "Session.MoveCursor" and "Session.CursorRow", "Session.CursorColumn" for moving the cursor to a desired position and then reading the cursor position information (to verify the position before writing data on HOST screen)
Code:
Dim currRowPos as Integer
Dim currColPos as Integer
Session.MoveCursor targetRowPos, targetColPos ' move cursor position
DoEvents ' custom logic to wait or inlcude delay 1 sec or more, mentioned only single code statement here
currRowPos = Session.CursorRow 'get cursor current row position
currColPos = Session.CursorColumn 'get cursor current column position
'check current cursor position and write data onto HOST screen
If targetRowPos = currRowPos And targetColPos = currColPos Then
Session.TransmitANSI "xyz" 'write xyz on HOST screen
End If
I am trying to write some information on to Host at the desired cursor position and traverse to next screen. In the due process, i am going going back and forth to fill information for multiple items (one at a time).
Sometimes I am facing an issue where the above logic (code) is executed and the cursor is still in old position (not in the desired new row, column position) and the program started writing data in the old position rather than the desired/ target position resulting in a programming error (i.e. 'Session.CursorRow' and 'Session.CursorColumn' are outputting new desired cursor position, when in real time the cursor in its old position on HOST screen).
If anyone has encountered this issue before and/ or have any solution in mind, can you please share the same . Thank you.
IBM HOST Programming Reference: http://ift.tt/2beETXC
Aucun commentaire:
Enregistrer un commentaire