Jump to content

Sending Edit Box data to Notepad slow


Fractured
 Share

Recommended Posts

Ok..so ive got my proggy almost done. Now the only problem is I have an EditBox being used as a Console Window, so that while im testing I can see the data returned from the Unit.  The data is appened to last line in the edit Box, and it can make for a long string. At the end of testing I have a Send to File button, so that I can see all that was done during the testing...

So this is the code I have...

Func _OutFile()

    $TempEdit = GUICtrlRead($Edit1)
    $OutEdit = StringReplace($TempEdit, @LF, "")

    Run("notepad.exe")

    WinWaitActive("Untitled - Notepad")
    Sleep(1000)
    ;Send("Untitled - Notepad", "", "Edit1", $OutEdit)
    Send($OutEdit)
EndFunc

Problem is, when it sends the code to notepad, its slow like im typing it character by character. Is there a faster way to send the data to Notepad? Ive scanned the forum and tried some different variations, but still cant seem to speed things up! Thanks in advance!

P.S. I would just write to file but the save space is different depending on the test station im at. 

Edited by Fractured
Link to comment
Share on other sites

@Fractured

Send is used to simulate user interactions, so, it is almost "normal" that is not so fast.

You could use File* functions, to create a file, open it, write into it, close it, and run it in order to see it's content ( without reading it in a variable ).

I think that this should be faster than using Send command :)

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

ContolSetText is another quick option

Func _OutFile()

    $TempEdit = GUICtrlRead($Edit1)
    $OutEdit = StringReplace($TempEdit, @LF, "")

    Run("notepad.exe")

    WinWaitActive("Untitled - Notepad")
    Sleep(1000)
    ControlSetText("Untitled - Notepad", "", "Edit1", $OutEdit)
EndFunc

 

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...