Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

GUI, add, Edit window clear?


  • Please log in to reply
1 reply to this topic
byrdman75
  • Members
  • 1 posts
  • Last active: Nov 01 2015 05:59 PM
  • Joined: 30 Oct 2015

Hello,

i need some help. i have built a simple GUI window and within a couple Edit panes i want the user input text to go into a If, Else statement. so far if i put anything into my Edit window the if statement always shows true. here is my code so far.


Gui, Add, Picture, w285 h100, C:\Users\Austin\Downloads\GFI.jpg
Gui, add, Text,, Transfer Description:
GUI, add, Edit, w285 vTransferDescription
Gui, add, Text,, Model:
Gui, add, Edit, W115  vScannerInput
Gui, add, Text,, Amount:
Gui, add, Edit, w60 vLoopAmount, 1
Gui, Add, Button, w150, OK
Gui, Show, w300 h300, Transfer Orders
Gui,+Alwaysontop

return


ButtonOK:
gui, submit, NoHide
sleep 500

if (%Scannerinput% := 123)
{
msgbox 123
}
else if (%Scannerinput% := 465)
{
msgbox 465
}

any help?



JMeneses
  • Members
  • 161 posts
  • Last active: Oct 30 2015 02:10 PM
  • Joined: 17 Feb 2011

Your have a wrong if statement  spare de % in the name var and :  

Msgbox % (%Scannerinput% := 123) ; <<-- This assigns the "123" value to the variable
Msgbox % (Scannerinput := 465)   ; <<-- This assigns the "465" value to the variable

Try this

if (Scannerinput = 123) {
    msgbox % "VALUE(123) Scannerinput: " Scannerinput
    }
else 
  if (Scannerinput = 465){
     msgbox % "VALUE(465) Scannerinput: " Scannerinput
   }
else
     msgbox % "VALUE(..?) Scannerinput: " Scannerinput


http://ahkscript.org...fExpression.htm