Sign in to follow this  
Followers 0
Dhorn

Retain Form values after copy/paste from another program

4 posts in this topic

Hi guys, I seem to be stumped and am hitting a brick wall. Hopefully you can help. I have a GUI form which values consists of (A starting question number, A total number of questions, A layout #, A Title, A Direction Text). You enter your values into the form and it will place these values into Ultra Edit with extra information (tags around each). Then what I am trying to do is go over to a word document and extract 1 line of text at a time and paste it into Ultra Edit with it's proper tags. Then based on the Form question start number it will increment to the next question and grab the next line in Word and copy it over to Ultra Edit. This will continue in a loop until the count is equal to the total number of questions. The problem I am having is I can't get my script to pull the data from the form and increment the numbers. It's like it won't copy and or remember the form number to increment itself

I have attached a sample of what the word document looks like (Sample word doc) and a copy of my script (test.au3) along with what the final outcome should look like (Edit1.txt). Within the Edit1 text I placed where the values from the form would be populating to give you an idea of what I am trying to do. The only thing incrementing is the $Read2 value. Hopefully I was able to explain what I am trying to accomplish and hopefully you will be able to help.

Thanks in advance,

Don

sample_word_doc.doc

Edit1.TXT

Test.au3

Share this post


Link to post
Share on other sites



Hi guys, I seem to be stumped and am hitting a brick wall. Hopefully you can help. I have a GUI form which values consists of (A starting question number, A total number of questions, A layout #, A Title, A Direction Text). You enter your values into the form and it will place these values into Ultra Edit with extra information (tags around each). Then what I am trying to do is go over to a word document and extract 1 line of text at a time and paste it into Ultra Edit with it's proper tags. Then based on the Form question start number it will increment to the next question and grab the next line in Word and copy it over to Ultra Edit. This will continue in a loop until the count is equal to the total number of questions. The problem I am having is I can't get my script to pull the data from the form and increment the numbers. It's like it won't copy and or remember the form number to increment itself

I have attached a sample of what the word document looks like (Sample word doc) and a copy of my script (test.au3) along with what the final outcome should look like (Edit1.txt). Within the Edit1 text I placed where the values from the form would be populating to give you an idea of what I am trying to do. The only thing incrementing is the $Read2 value. Hopefully I was able to explain what I am trying to accomplish and hopefully you will be able to help.

Thanks in advance,

Don

At first glance:

You GUICtrlRead() your inputs when the user press "OK," but then you re-declare all of those variables in the QuestionAnswer() functions. This clears out whatever value they had been assigned. Check out "Dim" in the help doc for a good explanation.

Also, a couple things that probably don't effect this issue directly, but might be habits you'll want to break.

It's probably not a real good idea to declare variables as Global inside a function. Declare all of your Globals before you start your first While loop.

Also, you are forcing your poor app to redraw your GUI every time Form1() is called. Pull all that GUI creation stuff out of that function and put it up before your first while loop, too. The just wait to show the GUI until Form1() is called.

I hope this helps.

Share this post


Link to post
Share on other sites

Thanks for the quick reply. That seemed to help and thanks for the tip about the bad habits. I will try to look out for them in the future.

On a side note, do you know how can I increment by letter instead of by number? If I could figure this out I think I could make my code even smaller. My ABCDE sections are basically the same code but I couldn't figure out, through help, how to increment it by letter.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks for the quick reply. That seemed to help and thanks for the tip about the bad habits. I will try to look out for them in the future.

On a side note, do you know how can I increment by letter instead of by number? If I could figure this out I think I could make my code even smaller. My ABCDE sections are basically the same code but I couldn't figure out, through help, how to increment it by letter.

For Caps:

For $x = 65 to 69
    MsgBox (0, "", Chr ($x))
NextoÝ÷ Ù±h¬º0z·±ïÛjëh×6For $x = 97 to 101
    MsgBox (0, "", Chr ($x))
Next

Check the Appendix for the full listing of Ascii Characters.

Edited by exodius

Share this post


Link to post
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
Sign in to follow this  
Followers 0