 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Mkbailey755
Joined: 20 Aug 2007 Posts: 178
|
Posted: Thu Jul 17, 2008 7:04 pm Post subject: Having trouble with gLabel and variable of edit box |
|
|
I have the following line of code that uses account numbers to pull information from text files. I'm using the variable from the first Edit box vAccount. I tried changing it to vNumber thinking it was a problem with the gLabe but no luck I have a similar edit box setup the same way that works fine. also before I added the glabel it worked.
| Code: | #NoEnv
Gui, Add, DateTime, x206 y7 w100 h30,
;Edit box for Account number
Gui, Add, Edit,vAccount x16 y40 w110 h25 gAccount,
;end edit box
Gui, Add, DropDownList, x16 y70 w110 h400 Choose1 gDDL_Application vLabel, Application||WinXP|Vista|MacOs|I.E|Firefox|Other
Gui, Add, DropDownList, x16 y100 w110 h400 gDDL_Problem vProblem Choose1, Problem,
Gui, Add, Listbox, x136 y40 w200 h110 gLB_Solution vSolution Choose1 +Wrap, Solution
Gui, Add, DropDownList, x16 y150 w110 h200 , Memory Size||128|256|512|768|1024|1280|1536|2048|Other
Gui, Add, DropDownList, x16 y180 w110 h200 , CPU Size||1.0|1.2|1.4|1.8|2.0|2.4|2.6|2.8|3.0|Other
Gui, Add, Edit, x16 y210 w300 h160 vEdit +Wrap,
Gui, Add, Button, x16 y400 w300 h30 gLog ,Create Notes
Gui, Show, x144 y306 h450 w343, Notes System
Return
;file read
Account:
Keywait Enter, D
FormatTime, var2,, MMMM dd yyyy hh:mm:ss
ControlSend,Edit2,%var2%`n,Notes System,
FileRead, content,C:\%Account%.txt
Gui, 2:Add, Text, x6 y7 w270 h350 , %content%
Gui, 2:Show, x131 y91 h366 w281, Account Info
return
;end file read
|
Not sure what the problem is any help is appreciated maybe I just need another way of looking at it
Entire Code
| Code: |
#NoEnv
Gui, Add, DateTime, x206 y7 w100 h30,
;Edit box for Account number
Gui, Add, Edit,vAccount x16 y40 w110 h25 gAccount,
;end edit box
Gui, Add, DropDownList, x16 y70 w110 h400 Choose1 gDDL_Application vLabel, Application||WinXP|Vista|MacOs|I.E|Firefox|Other
Gui, Add, DropDownList, x16 y100 w110 h400 gDDL_Problem vProblem Choose1, Problem,
Gui, Add, Listbox, x136 y40 w200 h110 gLB_Solution vSolution Choose1 +Wrap, Solution
Gui, Add, DropDownList, x16 y150 w110 h200 , Memory Size||128|256|512|768|1024|1280|1536|2048|Other
Gui, Add, DropDownList, x16 y180 w110 h200 , CPU Size||1.0|1.2|1.4|1.8|2.0|2.4|2.6|2.8|3.0|Other
Gui, Add, Edit, x16 y210 w300 h160 vEdit +Wrap,
Gui, Add, Button, x16 y400 w300 h30 gLog ,Create Notes
Gui, Show, x144 y306 h450 w343, Notes System
Return
;file read
Account:
Keywait Enter, D
FormatTime, var2,, MMMM dd yyyy hh:mm:ss
ControlSend,Edit2,%var2%`n,Notes System,
FileRead, content,C:\%Account%.txt
Gui, 2:Add, Text, x6 y7 w270 h350 , %content%
Gui, 2:Show, x131 y91 h366 w281, Account Info
return
;end file read
DDL_Application:
Gui, Submit, NoHide
If IsLabel(Label)
GoSub, %Label%
Return
Vista:
Control, EditPaste, Edit2,Windows Vista`n, Notes System,
GuiControl, , Problem, |Problem||Problem1||Problem2|Problem3|Problem4|Problem5|Problem6|Vista
Return
WinXP:
ControlSend, Edit2,Windows XP`n, Notes System,
GuiControl, , Problem, |Problem||Problem1|Problem2|Problem3|Problem4|Problem5|Problem6|XP
Return
MacOs:
ControlSetText, Edit2, Macintosh`n, Notes System,
GuiControl, , Problem, |Problem||Problem1|Problem2|Problem3|Problem4|Problem5|Problem6|Mac Os
Return
I.E:
ControlSend, Edit2,Inernet Explorer 7/6`n, Notes System,
GuiControl, , Problem, |Problem||Problem1|Problem2|Problem3|Problem4|Problem5|Problem6|I.E
Return
Firefox:
ControlSend, Edit2,Firefox`n, Notes System,
GuiControl, , Problem, |Problem||Problem1|Problem2|Problem3|Problem4|Problem5|Problem6|Firefox
Return
Other:
ControlSend, Edit2,Other`n, Notes System,
GuiControl, ,Other,|Other||Other
Return
DDL_Problem:
Gui, Submit, NoHide
If IsLabel(Label)
GoSub, %Problem%
Return
Problem1:
ControlSend, Edit2,Problem1`n, Notes System,
GuiControl, , Solution, |Solution||Solution1:the quick fox jumped over the lazy dog|Solution2|Solution3|Solution4|Solution5|Solution6|Solution7|Solution8|
return
Problem2:
ControlSend, Edit2,Problem2`n, Notes System,
GuiControl, , Solution, |Solution||Solution1|Solution2|Solution3|Solution4|Solution5|Solution6|Solution7|Solution8|
return
Problem3:
ControlSend, Edit2,Problem3`n, Notes System,
GuiControl, , Solution, |Solution||Solution1|Solution2|Solution3|Solution4|Solution5|Solution6|Solution7|Solution8|
return
Problem4:
ControlSend, Edit2,Problem4`n, Notes System,
GuiControl, , Solution, |Solution||Solution1|Solution2|Solution3|Solution4|Solution5|Solution6|Solution7|Solution8|
return
Problem5:
ControlSend, Edit2,Problem5`n, Notes System,
GuiControl, , Solution, |Solution||Solution1|Solution2|Solution3|Solution4|Solution5|Solution6|Solution7|Solution8|
return
Problem6:
ControlSend, Edit2,Problem6`n, Notes System,
GuiControl, , Solution, |Solution||Solution1|Solution2|Solution3|Solution4|Solution5|Solution6|Solution7|Solution8|
return
LB_Solution:
Gui, Submit, NoHide
If IsLabel(Label)
GuiControlGet, Solution
ControlSend, Edit2,%Solution%`n, Notes System,
return
Log:
ControlGetText, Notes, Edit2, Notes System, ,
FileAppend, %Notes%`n, C:\%Account%.txt
reload
^1::
msgbox, %Account%
return
F11:
reload
GuiClose:
ExitApp | [/u] |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Thu Jul 17, 2008 7:44 pm Post subject: |
|
|
I'm guessing your error message says you can't add the same thing twice? You didn't specify how it was breaking.
| Code: |
;file read
Account:
Keywait Enter, D
FormatTime, var2,, MMMM dd yyyy hh:mm:ss
ControlSend,Edit2,%var2%`n,Notes System,
FileRead, content,C:\%Account%.txt
Gui, 2:Destroy
Gui, 2:Add, Text, x6 y7 w270 h350 , %content%
Gui, 2:Show, x131 y91 h366 w281, Account Info
return
;end file read
|
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
Mkbailey755
Joined: 20 Aug 2007 Posts: 178
|
Posted: Thu Jul 17, 2008 8:12 pm Post subject: |
|
|
thanks for the reply sorry I didn't specify the results. the variable vAccount isn't recognizing what I put in the edit box. I have files on my hard drive IE. 023243.txt. it should use the file read command and read %account%.txt pulling this into a popup window with the account information as well as notes I put in there about the account. I have a test setup
| Code: | ^1::
msgbox, %Account% |
this shows the varible %account% blank. I need what I type in the Edit box "Accounts" to pull the account file up and append what I put in the notes section to %Account%.txt
as of now it recognize the Variable account but doesn't recognize it as the information I type in the Edit box.
I tried using
| Code: | Account:
GuiControlGettext, Account
Keywait Enter, D
FormatTime, var2,, MMMM dd yyyy hh:mm:ss
ControlSend,Edit2,%var2%`n,Notes System,
FileRead, content,C:\%Account%.txt
Gui, 2:Add, Text, x6 y7 w270 h350 , %content%
Gui, 2:Show, x131 y91 h366 w281, Account Info
return
;end file read |
this only read the first Number IE. 003454 became just 0. I hope this explains better Im at my ends with this battle. This is also the first time using a GUI with AHK Thank you for the reply |
|
| Back to top |
|
 |
Mkbailey755
Joined: 20 Aug 2007 Posts: 178
|
Posted: Fri Jul 18, 2008 3:43 am Post subject: (Solved) |
|
|
| Ive solved my dilemma with a Underscore I changed gAccount to g_Account lol couldn't believe five hours wasted on a underscore |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|