CMD to verify data has been written completely?? small script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gviteri
    New Member
    • Feb 2008
    • 5

    CMD to verify data has been written completely?? small script

    This is my first coding attempt at VBA (6.3) and I'm very ill-rehearsed. I was hoping that someone with more experience would be able to help me out here. This is what I have:

    Code:
    Sub Macro1()
        On Error GoTo ErrorHandler
    
        Const NEVER_TIME_OUT = 0
        Dim x
        x=InputBox("How many times should this loop?")
    
        With Session
            
           Do
    	.TransmitTerminalKey rcAnsiF2Key
            .Wait (0.15)
       	.TransmitTerminalKey rcAnsiF3Key
            .Wait (0.15)
    	
    	x = x-1
    	Loop while x>0	
        Exit Sub
    
    ErrorHandler:
        .MsgBox Err.Description, vbExclamation + vbOKOnly
        End With
    
    End Sub
    Instead of the horribly inefficient .Wait (.15) I was hoping that someone might be able to describe a better way to ensure that the data has been written. There are occasions that the program itself (on my network of 200+ users) can experiece some latency which will render the (.15) useless. I am unable to find the happy medium because if the (.15) is not long enough even a single time then the macro itself becomes useless. Making it (.1 or .2) would possibly work but in extreme lag spikes.... you get where I'm going.

    Thanks!!!!!
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    What is this VBA embedded in?

    Comment

    • gviteri
      New Member
      • Feb 2008
      • 5

      #3
      I use it for a program called WRQ Reflections for Unix.

      Comment

      Working...