AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Why are my variables not excepting my input? <SOLVED>

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Procyan



Joined: 03 Sep 2008
Posts: 4
Location: Germany

PostPosted: Thu Sep 04, 2008 12:27 pm    Post subject: Why are my variables not excepting my input? <SOLVED> Reply with quote

This should be an easy question for the experienced here.

Code:
SetTitleMatchMode, 2
#4::

Gui, Add, Text,, Please enter the line you want to start at:
Gui, Add, Text,, What is the ship to DODAAC?
Gui, Add, Text,, What are the disposition instructions?
Gui, Add, Edit, w50 vstart ym
Gui, Add, Edit, w50 vdodaac
Gui, Add, Edit, w200 vdispo r5
Gui, Add, Button, default ym, OK
Gui, Show,, Automatic Disposition Provider
return

GuiClose:
ButtonOK:
Gui, Submit

SendInput !d javascript:document.fldForm.select%vstart%.focus(){Enter}
Sleep 150
Send U
Sleep 50
SendInput !d javascript:document.fldForm.ship_to_DODAAC_%vstart%.focus(){Enter}
Sleep 150
Send %vdodaac%
Sleep 50
SendInput !d javascript:document.fldForm.PROV_REMARKS_%vstart%.focus(){Enter}
Sleep 150
Send %vdispo%


Yesterday I made my first GUI and I though I had the coding correct but my variables are not working.


Last edited by Procyan on Thu Sep 04, 2008 1:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Thu Sep 04, 2008 12:44 pm    Post subject: Re: Why are my variables not excepting my input? Reply with quote

Code:
Gui, Add, Edit, w50 vdodaac

The above is correct, but you have to remove the v in the following line

Code:
Send %vdodaac%


Do correct rest of the similar errors.

Smile
_________________
URLGet - Internet Explorer based Downloader
Back to top
View user's profile Send private message Send e-mail
Procyan



Joined: 03 Sep 2008
Posts: 4
Location: Germany

PostPosted: Thu Sep 04, 2008 1:01 pm    Post subject: Reply with quote

I deleted the V from the variables and it still does not work. I wanted to try a different method so I wipped up some Input boxes and tried them and they work. I wonder why?

Code:
SetTitleMatchMode, 2
#4::

;Gui, Add, Text,, Please enter the line you want to start at:
;Gui, Add, Text,, Please enter the line you want to end at:
;Gui, Add, Text,, What is the ship to DODAAC?
;Gui, Add, Text,, What are the disposition instructions?
;Gui, Add, Edit, w50 start ym
;Gui, Add, Edit, w50 end
;Gui, Add, Edit, w50 dodaac
;Gui, Add, Edit, w200 dispo r5
;Gui, Add, Button, default ym, OK
;Gui, Show,, Automatic Disposition Provider
;return

;GuiClose:
;ButtonOK:
;Gui, Submit

InputBox, start, Lines, How many lines?

InputBox, dodaac, DODAAC, What is the ship to DODAAC?

InputBox, dispo, Disposition, What are the Disposition Instructions for this piece of equipment?

SendInput !d javascript:document.fldForm.select%start%.focus(){Enter}
Sleep 150
Send U
Sleep 50
SendInput !d javascript:document.fldForm.ship_to_DODAAC_%start%.focus(){Enter}
Sleep 150
Send %dodaac%
Sleep 50
SendInput !d javascript:document.fldForm.PROV_REMARKS_%start%.focus(){Enter}
Sleep 150
Send %dispo%


It must be something in the GUI command that I got wrong. I guess I can work with the Input Boxes but the GUI interface is much nicer.
Back to top
View user's profile Send private message
Razlin



Joined: 05 Nov 2007
Posts: 454
Location: canada

PostPosted: Thu Sep 04, 2008 1:11 pm    Post subject: Reply with quote

As SKAN mentionned you have it upside down.. variables in gui keep V variables outside gui loose the V as in

Code:
SetTitleMatchMode, 2
#4::
;;;;;;;;V is REQUIRED in GUI
Gui, Add, Text,, Please enter the line you want to start at:
Gui, Add, Text,, What is the ship to DODAAC?
Gui, Add, Text,, What are the disposition instructions?
Gui, Add, Edit, w50 vstart ym
Gui, Add, Edit, w50 vdodaac
Gui, Add, Edit, w200 vdispo r5
Gui, Add, Button, default ym, OK
Gui, Show,, Automatic Disposition Provider
return

GuiClose:
ButtonOK:
Gui, Submit

;;;;;;;;V is REMOVED here
SendInput !d javascript:document.fldForm.select%start%.focus(){Enter}
Sleep 150
Send U
Sleep 50
SendInput !d javascript:document.fldForm.ship_to_DODAAC_%start%.focus(){Enter}
Sleep 150
Send %dodaac%
Sleep 50
SendInput !d javascript:document.fldForm.PROV_REMARKS_%start%.focus(){Enter}
Sleep 150
Send %dispo%

_________________
-=Raz=-
Back to top
View user's profile Send private message
BoBo²
Guest





PostPosted: Thu Sep 04, 2008 1:15 pm    Post subject: Reply with quote

You've to assign the variable to its Gui-Control adding 'v' to the variables name (you 'flag' it). Outside any 'Gui'-settings use the variables name without the 'v'.

Quote:
Gui, Add, Edit, vMeineVariable, Testeingabe
Gui, Show,, Test
Return

!y:: ; press ALT+y
GuiControl,, MeineVariable, Ich bin die Textersetzung
Return
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group